From: Ferruccio Guidi Date: Sun, 22 Jan 2017 19:56:34 +0000 (+0000) Subject: - degree-based equivalene for terms X-Git-Tag: make_still_working~513 X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=commitdiff_plain;h=09b4420070d6a71990e16211e499b51dbb0742cb - degree-based equivalene for terms - improved matitadep allows to find more top files in the reference graph - refactoring and bug fix --- diff --git a/matita/components/binaries/matitadep/matitadep.ml b/matita/components/binaries/matitadep/matitadep.ml index 00a2f9268..054f90f4a 100644 --- a/matita/components/binaries/matitadep/matitadep.ml +++ b/matita/components/binaries/matitadep/matitadep.ml @@ -14,10 +14,12 @@ let rec purge dname vdeps = match vdeps with | hd :: tl -> if hd = dname then tl else hd :: purge dname tl let add fname = + if fname = "" then () else if Hashtbl.mem graph fname then () else Hashtbl.add graph fname {ddeps = []; rdeps = None} let add_ddep fname dname = + if dname = "" then () else let file = Hashtbl.find graph fname in Hashtbl.replace graph fname {file with ddeps = dname :: file.ddeps} @@ -104,7 +106,7 @@ let _ = if !show_top then top (); if !show_leaf then leaf () in - let help = "" in + let help = "matitadep [-clt | -d ] < " in let help_c = " Print the redundant and looping arcs of the dependences graph" in let help_d = " Set these debug options" in let help_l = " Print the leaf nodes of the dependences graph" in diff --git a/matita/matita/contribs/lambdadelta/Makefile b/matita/matita/contribs/lambdadelta/Makefile index 9de41db0c..cd6bcea17 100644 --- a/matita/matita/contribs/lambdadelta/Makefile +++ b/matita/matita/contribs/lambdadelta/Makefile @@ -91,9 +91,12 @@ orig: $(ORIGS) # dep input ################################################################## -$(DEP_INPUT): $(MAS) +$(DEP_INPUT): LINE = $(MAS:%=%:include \"\".) + +$(DEP_INPUT): $(MAS) Makefile @echo " GREP include" $(H)grep "include \"" $^ > $(DEP_INPUT) + $(H)echo "$(LINE)" | sed -e 's/\"\. /\"\.\n/g' >> $(DEP_INPUT) # dep ######################################################################## diff --git a/matita/matita/contribs/lambdadelta/alpha_1/grammar/item.ma b/matita/matita/contribs/lambdadelta/alpha_1/grammar/item.ma deleted file mode 100644 index 01a767223..000000000 --- a/matita/matita/contribs/lambdadelta/alpha_1/grammar/item.ma +++ /dev/null @@ -1,38 +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 *) -(* *) -(**************************************************************************) - -(* THE FORMAL SYSTEM α: MATITA SOURCE FILES - * Initial invocation : - Patience on me to gain peace and perfection! - - * Developed since : 2014 July 25 - *) - -include "ground_2/lib/bool.ma". -include "ground_2/lib/arith.ma". - -(* ITEMS ********************************************************************) - -(* unary items *) -inductive item1: Type[0] ≝ - | Char: nat → item1 (* character: starting at 0 *) - | LRef: nat → item1 (* reference by index: starting at 0 *) - | GRef: nat → item1 (* reference by position: starting at 0 *) - | Decl: item1 (* global abstraction *) -. - -(* binary items *) -inductive item2: Type[0] ≝ - | Abst: item2 (* local abstraction *) - | Abbr: bool → item2 (* local (Ⓣ) or global (Ⓕ) abbreviation *) - | Proj: bool → item2 (* local (Ⓣ) or global (Ⓕ) projection *) -. diff --git a/matita/matita/contribs/lambdadelta/alpha_1/grammar/term.ma b/matita/matita/contribs/lambdadelta/alpha_1/grammar/term.ma deleted file mode 100644 index 9562d4c40..000000000 --- a/matita/matita/contribs/lambdadelta/alpha_1/grammar/term.ma +++ /dev/null @@ -1,80 +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/notation/constructors/snitem2_3.ma". -include "basic_2/notation/constructors/star_0.ma". -include "basic_2/notation/constructors/snabstpos_2.ma". -include "basic_2/notation/constructors/snabbr_3.ma". -include "basic_2/notation/constructors/snabbrpos_2.ma". -include "basic_2/notation/constructors/snabbrneg_2.ma". -include "alpha_1/notation/constructors/snitem1_2.ma". -include "alpha_1/notation/constructors/snstar_2.ma". -include "alpha_1/notation/constructors/snlref_2.ma". -include "alpha_1/notation/constructors/sngref_2.ma". -include "alpha_1/notation/constructors/snabstneg_1.ma". -include "alpha_1/notation/constructors/snproj_3.ma". -include "alpha_1/notation/constructors/snprojpos_2.ma". -include "alpha_1/notation/constructors/snprojneg_2.ma". -include "alpha_1/grammar/item.ma". - -(* TERMS ********************************************************************) - -(* terms *) -inductive term: Type[0] ≝ - | TAtom: term (* atomic item construction *) - | TUnit: item1 → term → term (* unary item construction *) - | TPair: item2 → term → term → term (* binary item construction *) -. - -interpretation "top (term)" - 'Star = TAtom. - -interpretation "term construction (unary)" - 'SnItem1 I T = (TUnit I T). - -interpretation "term construction (binary)" - 'SnItem2 I T1 T2 = (TPair I T1 T2). - -interpretation "character (term)" - 'SnStar k T = (TUnit (Char k) T). - -interpretation "local reference (term)" - 'SnLRef i T = (TUnit (LRef i) T). - -interpretation "global reference (term)" - 'SnGRef p T = (TUnit (GRef p) T). - -interpretation "negative abbreviation (term)" - 'SnAbbrNeg T = (TUnit Decl T). - -interpretation "positive abstraction (term)" - 'SnAbstPos T1 T2 = (TPair Abst T1 T2). - -interpretation "abbreviation (term)" - 'SnAbbr a T1 T2 = (TPair (Abbr a) T1 T2). - -interpretation "positive abbreviation (term)" - 'SnAbbrPos T1 T2 = (TPair (Abbr true) T1 T2). - -interpretation "negative abbreviation (term)" - 'SnAbbrNeg T1 T2 = (TPair (Abbr false) T1 T2). - -interpretation "projection (term)" - 'SnProj a T1 T2 = (TPair (Proj a) T1 T2). - -interpretation "positive projection (term)" - 'SnProjPos T1 T2 = (TPair (Proj true) T1 T2). - -interpretation "negative projection (term)" - 'SnProjNeg T1 T2 = (TPair (Proj false) T1 T2). diff --git a/matita/matita/contribs/lambdadelta/alpha_1/grammar/term_append.ma b/matita/matita/contribs/lambdadelta/alpha_1/grammar/term_append.ma deleted file mode 100644 index 98ce3bafd..000000000 --- a/matita/matita/contribs/lambdadelta/alpha_1/grammar/term_append.ma +++ /dev/null @@ -1,25 +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 "alpha_1/grammar/term.ma". - -(* TERMS ********************************************************************) - -let rec tappend T U on T ≝ match T with -[ TAtom ⇒ U -| TUnit I T ⇒ ①{I}.(tappend T U) -| TPair I V T ⇒ ②{I}V.(tappend T U) -]. - -interpretation "append (term)" 'Append T U = (tappend T U). diff --git a/matita/matita/contribs/lambdadelta/alpha_1/syntax/item.ma b/matita/matita/contribs/lambdadelta/alpha_1/syntax/item.ma new file mode 100644 index 000000000..01a767223 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/alpha_1/syntax/item.ma @@ -0,0 +1,38 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* THE FORMAL SYSTEM α: MATITA SOURCE FILES + * Initial invocation : - Patience on me to gain peace and perfection! - + * Developed since : 2014 July 25 + *) + +include "ground_2/lib/bool.ma". +include "ground_2/lib/arith.ma". + +(* ITEMS ********************************************************************) + +(* unary items *) +inductive item1: Type[0] ≝ + | Char: nat → item1 (* character: starting at 0 *) + | LRef: nat → item1 (* reference by index: starting at 0 *) + | GRef: nat → item1 (* reference by position: starting at 0 *) + | Decl: item1 (* global abstraction *) +. + +(* binary items *) +inductive item2: Type[0] ≝ + | Abst: item2 (* local abstraction *) + | Abbr: bool → item2 (* local (Ⓣ) or global (Ⓕ) abbreviation *) + | Proj: bool → item2 (* local (Ⓣ) or global (Ⓕ) projection *) +. diff --git a/matita/matita/contribs/lambdadelta/alpha_1/syntax/term.ma b/matita/matita/contribs/lambdadelta/alpha_1/syntax/term.ma new file mode 100644 index 000000000..674e618a8 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/alpha_1/syntax/term.ma @@ -0,0 +1,80 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/constructors/snitem2_3.ma". +include "basic_2/notation/constructors/star_0.ma". +include "basic_2/notation/constructors/snabstpos_2.ma". +include "basic_2/notation/constructors/snabbr_3.ma". +include "basic_2/notation/constructors/snabbrpos_2.ma". +include "basic_2/notation/constructors/snabbrneg_2.ma". +include "alpha_1/notation/constructors/snitem1_2.ma". +include "alpha_1/notation/constructors/snstar_2.ma". +include "alpha_1/notation/constructors/snlref_2.ma". +include "alpha_1/notation/constructors/sngref_2.ma". +include "alpha_1/notation/constructors/snabstneg_1.ma". +include "alpha_1/notation/constructors/snproj_3.ma". +include "alpha_1/notation/constructors/snprojpos_2.ma". +include "alpha_1/notation/constructors/snprojneg_2.ma". +include "alpha_1/syntax/item.ma". + +(* TERMS ********************************************************************) + +(* terms *) +inductive term: Type[0] ≝ + | TAtom: term (* atomic item construction *) + | TUnit: item1 → term → term (* unary item construction *) + | TPair: item2 → term → term → term (* binary item construction *) +. + +interpretation "top (term)" + 'Star = TAtom. + +interpretation "term construction (unary)" + 'SnItem1 I T = (TUnit I T). + +interpretation "term construction (binary)" + 'SnItem2 I T1 T2 = (TPair I T1 T2). + +interpretation "character (term)" + 'SnStar k T = (TUnit (Char k) T). + +interpretation "local reference (term)" + 'SnLRef i T = (TUnit (LRef i) T). + +interpretation "global reference (term)" + 'SnGRef p T = (TUnit (GRef p) T). + +interpretation "negative abbreviation (term)" + 'SnAbbrNeg T = (TUnit Decl T). + +interpretation "positive abstraction (term)" + 'SnAbstPos T1 T2 = (TPair Abst T1 T2). + +interpretation "abbreviation (term)" + 'SnAbbr a T1 T2 = (TPair (Abbr a) T1 T2). + +interpretation "positive abbreviation (term)" + 'SnAbbrPos T1 T2 = (TPair (Abbr true) T1 T2). + +interpretation "negative abbreviation (term)" + 'SnAbbrNeg T1 T2 = (TPair (Abbr false) T1 T2). + +interpretation "projection (term)" + 'SnProj a T1 T2 = (TPair (Proj a) T1 T2). + +interpretation "positive projection (term)" + 'SnProjPos T1 T2 = (TPair (Proj true) T1 T2). + +interpretation "negative projection (term)" + 'SnProjNeg T1 T2 = (TPair (Proj false) T1 T2). diff --git a/matita/matita/contribs/lambdadelta/alpha_1/syntax/term_append.ma b/matita/matita/contribs/lambdadelta/alpha_1/syntax/term_append.ma new file mode 100644 index 000000000..4ea795a68 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/alpha_1/syntax/term_append.ma @@ -0,0 +1,25 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "alpha_1/syntax/term.ma". + +(* TERMS ********************************************************************) + +let rec tappend T U on T ≝ match T with +[ TAtom ⇒ U +| TUnit I T ⇒ ①{I}.(tappend T U) +| TPair I V T ⇒ ②{I}V.(tappend T U) +]. + +interpretation "append (term)" 'Append T U = (tappend T U). diff --git a/matita/matita/contribs/lambdadelta/apps_2/functional/rtm.ma b/matita/matita/contribs/lambdadelta/apps_2/functional/rtm.ma index 2e92ea0cc..66b481290 100644 --- a/matita/matita/contribs/lambdadelta/apps_2/functional/rtm.ma +++ b/matita/matita/contribs/lambdadelta/apps_2/functional/rtm.ma @@ -12,8 +12,8 @@ (* *) (**************************************************************************) -include "basic_2/grammar/term_vector.ma". -include "basic_2/grammar/genv.ma". +include "basic_2/syntax/term_vector.ma". +include "basic_2/syntax/genv.ma". include "apps_2/functional/notation.ma". (* REDUCTION AND TYPE MACHINE ***********************************************) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/append/cir_append.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/append/cir_append.etc deleted file mode 100644 index efd097f84..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/append/cir_append.etc +++ /dev/null @@ -1,34 +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/reduction/crr_append.ma". -include "basic_2/reduction/cir.ma". - -(* IRREDUCIBLE TERMS FOR CONTEXT-SENSITIVE REDUCTION ************************) - -(* Advanved properties ******************************************************) - -lemma cir_labst_last: ∀G,L,T,W. ⦃G, L⦄ ⊢ ➡ 𝐈⦃T⦄ → ⦃G, ⋆.ⓛW @@ L⦄ ⊢ ➡ 𝐈⦃T⦄. -/3 width=2 by crr_inv_labst_last/ qed. - -lemma cir_tif: ∀G,T,W. ⦃G, ⋆⦄ ⊢ ➡ 𝐈⦃T⦄ → ⦃G, ⋆.ⓛW⦄ ⊢ ➡ 𝐈⦃T⦄. -/3 width=2 by crr_inv_trr/ qed. - -(* Advanced inversion lemmas ************************************************) - -lemma cir_inv_append_sn: ∀G,L,K,T. ⦃G, K @@ L⦄ ⊢ ➡ 𝐈⦃T⦄ → ⦃G, L⦄ ⊢ ➡ 𝐈⦃T⦄. -/3 width=1/ qed-. - -lemma cir_inv_tir: ∀G,T,W. ⦃G, ⋆.ⓛW⦄ ⊢ ➡ 𝐈⦃T⦄ → ⦃G, ⋆⦄ ⊢ ➡ 𝐈⦃T⦄. -/3 width=1/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/append/cix_append.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/append/cix_append.etc deleted file mode 100644 index 7b5522ebd..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/append/cix_append.etc +++ /dev/null @@ -1,26 +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/reduction/crx_append.ma". -include "basic_2/reduction/cix.ma". - -(* IRREDUCIBLE TERMS FOR CONTEXT-SENSITIVE EXTENDED REDUCTION ***************) - -(* Advanced inversion lemmas ************************************************) - -lemma cix_inv_append_sn: ∀h,g,G,L,K,T. ⦃G, K @@ L⦄ ⊢ ➡[h, g] 𝐈⦃T⦄ → ⦃G, L⦄ ⊢ ➡[h, g] 𝐈⦃T⦄. -/3 width=1 by crx_append_sn/ qed-. - -lemma cix_inv_tix: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ ➡[h, g] 𝐈⦃T⦄ → ⦃G, ⋆⦄ ⊢ ➡[h, g] 𝐈⦃T⦄. -/3 width=1 by trx_crx/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/append/cl_shift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/append/cl_shift.etc deleted file mode 100644 index 5fdab7148..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/append/cl_shift.etc +++ /dev/null @@ -1,45 +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/grammar/lenv_append.ma". - -(* SHIFT OF A CLOSURE *******************************************************) - -let rec shift L T on L ≝ match L with -[ LAtom ⇒ T -| LPair L I V ⇒ shift L (-ⓑ{I} V. T) -]. - -interpretation "shift (closure)" 'Append L T = (shift L T). - -(* Basic properties *********************************************************) - -lemma shift_append_assoc: ∀L,K. ∀T:term. (L @@ K) @@ T = L @@ K @@ T. -#L #K elim K -K // normalize // -qed. - -(* Basic inversion lemmas ***************************************************) - -lemma shift_inj: ∀L1,L2. ∀T1,T2:term. L1 @@ T1 = L2 @@ T2 → |L1| = |L2| → - L1 = L2 ∧ T1 = T2. -#L1 elim L1 -L1 -[ * normalize /2 width=1/ - #L2 #I2 #V2 #T1 #T2 #_ shift_append_assoc normalize #H - elim (cpr_inv_bind1 … H) -H * - [ #V0 #T0 #_ #HT10 #H destruct - elim (IH … HT10) -IH -HT10 #L2 #T2 #HL12 #H destruct - >append_length >HL12 -HL12 - @(ex2_2_intro … (⋆.ⓑ{I}V0@@L2) T2) [ >append_length ] /2 width=3 by trans_eq/ (**) (* explicit constructor *) - | #T #_ #_ #H destruct - ] -] -qed-. - diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/append/cpx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/append/cpx.etc deleted file mode 100644 index 5f8bf520c..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/append/cpx.etc +++ /dev/null @@ -1,25 +0,0 @@ -lemma cpx_append: ∀h,g,G. l_appendable_sn … (cpx h g G). -#h #g #G #K #T1 #T2 #H elim H -G -K -T1 -T2 -/2 width=3 by cpx_sort, cpx_bind, cpx_flat, cpx_zeta, cpx_tau, cpx_ti, cpx_beta, cpx_theta/ -#I #G #K #K0 #V1 #V2 #W2 #i #HK0 #_ #HVW2 #IHV12 #L -lapply (ldrop_fwd_length_lt2 … HK0) #H -@(cpx_delta … I … (L@@K0) V1 … HVW2) // -@(ldrop_O1_append_sn_le … HK0) /2 width=2 by lt_to_le/ (**) (* /3/ does not work *) -qed. - -lemma cpx_fwd_shift1: ∀h,g,G,L1,L,T1,T. ⦃G, L⦄ ⊢ L1 @@ T1 ➡[h, g] T → - ∃∃L2,T2. |L1| = |L2| & T = L2 @@ T2. -#h #g #G #L1 @(lenv_ind_dx … L1) -L1 normalize -[ #L #T1 #T #HT1 - @(ex2_2_intro … (⋆)) // (**) (* explicit constructor *) -| #I #L1 #V1 #IH #L #T1 #X - >shift_append_assoc normalize #H - elim (cpx_inv_bind1 … H) -H * - [ #V0 #T0 #_ #HT10 #H destruct - elim (IH … HT10) -IH -HT10 #L2 #T2 #HL12 #H destruct - >append_length >HL12 -HL12 - @(ex2_2_intro … (⋆.ⓑ{I}V0@@L2) T2) [ >append_length ] /2 width=3 by refl, trans_eq/ (**) (* explicit constructor *) - | #T #_ #_ #H destruct - ] -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/append/cpy2.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/append/cpy2.etc deleted file mode 100644 index e941c9653..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/append/cpy2.etc +++ /dev/null @@ -1,27 +0,0 @@ -include "basic_2/grammar/cl_shift.ma". -include "basic_2/relocation/ldrop_append.ma". - -lemma cpy_append: ∀G,d,e. l_appendable_sn … (cpy d e G). -#G #d #e #K #T1 #T2 #H elim H -G -K -T1 -T2 -d -e -/2 width=1 by cpy_atom, cpy_bind, cpy_flat/ -#I #G #K #K0 #V #W #i #d #e #Hdi #Hide #HK0 #HVW #L -lapply (ldrop_fwd_length_lt2 … HK0) #H -@(cpy_subst I … (L@@K0) … HVW) // (**) (* /4/ does not work *) -@(ldrop_O1_append_sn_le … HK0) /2 width=2 by lt_to_le/ -qed-. - -lemma cpy_fwd_shift1: ∀G,L1,L,T1,T,d,e. ⦃G, L⦄ ⊢ L1 @@ T1 ▶[d, e] T → - ∃∃L2,T2. |L1| = |L2| & T = L2 @@ T2. -#G #L1 @(lenv_ind_dx … L1) -L1 normalize -[ #L #T1 #T #d #e #HT1 - @(ex2_2_intro … (⋆)) // (**) (* explicit constructor *) -| #I #L1 #V1 #IH #L #T1 #X #d #e - >shift_append_assoc normalize #H - elim (cpy_inv_bind1 … H) -H - #V0 #T0 #_ #HT10 #H destruct - elim (IH … HT10) -IH -HT10 #L2 #T2 #HL12 #H destruct - >append_length >HL12 -HL12 - @(ex2_2_intro … (⋆.ⓑ{I}V0@@L2) T2) [ >append_length ] (**) (* explicit constructor *) - /2 width=3 by trans_eq/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/append/cpys0.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/append/cpys0.etc deleted file mode 100644 index fa9bcf6de..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/append/cpys0.etc +++ /dev/null @@ -1,24 +0,0 @@ -include "basic_2/grammar/cl_shift.ma". -include "basic_2/relocation/ldrop_append.ma". - -lemma cpys_append: ∀G. l_appendable_sn … (cpys G). -#G #K #T1 #T2 #H elim H -G -K -T1 -T2 -/2 width=3 by cpys_bind, cpys_flat/ -#I #G #K #K0 #V1 #V2 #W2 #i #HK0 #_ #HVW2 #IHV12 #L -lapply (ldrop_fwd_length_lt2 … HK0) #H -@(cpys_delta … I … (L@@K0) V1 … HVW2) // -@(ldrop_O1_append_sn_le … HK0) /2 width=2 by lt_to_le/ (**) (* /3/ does not work *) -qed. - -lemma cpys_fwd_shift1: ∀G,L1,L,T1,T. ⦃G, L⦄ ⊢ L1 @@ T1 ▶*× T → - ∃∃L2,T2. |L1| = |L2| & T = L2 @@ T2. -#G #L1 @(lenv_ind_dx … L1) -L1 normalize -[ #L #T1 #T #HT1 @(ex2_2_intro … (⋆)) // (**) (* explicit constructor *) -| #I #L1 #V1 #IH #L #T1 #X >shift_append_assoc normalize - #H elim (cpys_inv_bind1 … H) -H - #V0 #T0 #_ #HT10 #H destruct - elim (IH … HT10) -IH -HT10 #L2 #T2 #HL12 #H destruct - >append_length >HL12 -HL12 - @(ex2_2_intro … (⋆.ⓑ{I}V0@@L2) T2) [ >append_length ] /2 width=3 by trans_eq/ (**) (* explicit constructor *) -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/append/cpys2.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/append/cpys2.etc deleted file mode 100644 index 22f74d0a8..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/append/cpys2.etc +++ /dev/null @@ -1,14 +0,0 @@ -lemma cpys_append: ∀G,d,e. l_appendable_sn … (cpys d e G). -#G #d #e #K #T1 #T2 #H @(cpys_ind … H) -T2 -/3 width=3 by cpys_strap1, cpy_append/ -qed-. - -lemma cpys_fwd_shift1: ∀G,L,L1,T1,T,d,e. ⦃G, L⦄ ⊢ L1 @@ T1 ▶*[d, e] T → - ∃∃L2,T2. |L1| = |L2| & T = L2 @@ T2. -#G #L #L1 #T1 #T #d #e #H @(cpys_ind … H) -T -[ /2 width=4 by ex2_2_intro/ -| #T #X #_ #HX * #L0 #T0 #HL10 #H destruct - elim (cpy_fwd_shift1 … HX) -HX #L2 #T2 #HL02 #H destruct - /2 width=4 by ex2_2_intro/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/append/crr_append.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/append/crr_append.etc deleted file mode 100644 index dbf794d99..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/append/crr_append.etc +++ /dev/null @@ -1,56 +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/relocation/ldrop_append.ma". -include "basic_2/reduction/crr.ma". - -(* REDUCIBLE TERMS FOR CONTEXT-SENSITIVE REDUCTION **************************) - -(* Advanved properties ******************************************************) - -lemma crr_append_sn: ∀G,L,K,T. ⦃G, L⦄ ⊢ ➡ 𝐑⦃T⦄ → ⦃G, K @@ L⦄ ⊢ ➡ 𝐑⦃T⦄. -#G #L #K0 #T #H elim H -L -T /2 width=1/ -#L #K #V #i #HLK -lapply (ldrop_fwd_length_lt2 … HLK) #Hi -lapply (ldrop_O1_append_sn_le … HLK … K0) -HLK /2 width=2/ -Hi /2 width=3/ -qed. - -lemma trr_crr: ∀G,L,T. ⦃G, ⋆⦄ ⊢ ➡ 𝐑⦃T⦄ → ⦃G, L⦄ ⊢ ➡ 𝐑⦃T⦄. -#G #L #T #H lapply (crr_append_sn … H) // -qed. - -(* Advanced inversion lemmas ************************************************) - -fact crr_inv_labst_last_aux: ∀G,L1,T,W. ⦃G, L1⦄ ⊢ ➡ 𝐑⦃T⦄ → - ∀L2. L1 = ⋆.ⓛW @@ L2 → ⦃G, L2⦄ ⊢ ➡ 𝐑⦃T⦄. -#G #L1 #T #W #H elim H -L1 -T /2 width=1/ /3 width=1/ -[ #L1 #K1 #V1 #i #HLK1 #L2 #H destruct - lapply (ldrop_fwd_length_lt2 … HLK1) - >append_length >commutative_plus normalize in ⊢ (??% → ?); #H - elim (le_to_or_lt_eq i (|L2|)) /2 width=1/ -H #Hi destruct - [ elim (ldrop_O1_lt … Hi) #I2 #K2 #V2 #HLK2 - lapply (ldrop_O1_inv_append1_le … HLK1 … HLK2) -HLK1 /2 width=2/ -Hi - normalize #H destruct /2 width=3/ - | lapply (ldrop_O1_inv_append1_ge … HLK1 ?) -HLK1 // shift_append_assoc #H (ldrop_fwd_length … HL) -HL // -qed. - -lemma cny_lref_top: ∀G,L,d,e,i. d+e ≤ yinj i → ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃#i⦄. -#G #L #d #e #i #Hdei #X #H elim (cpy_inv_lref1 … H) -H // * -#I #K #V #_ #H elim (ylt_yle_false … H) // -qed. - -lemma cny_lref_skip: ∀G,L,d,e,i. yinj i < d → ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃#i⦄. -#G #L #d #e #i #Hid #X #H elim (cpy_inv_lref1 … H) -H // * -#I #K #V #H elim (ylt_yle_false … H) // -qed. - -lemma cny_gref: ∀G,L,d,e,p. ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃§p⦄. -#G #L #d #e #p #X #H elim (cpy_inv_gref1 … H) -H // -qed. - -lemma cny_bind: ∀G,L,V,d,e. ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃V⦄ → - ∀I,T. ⦃G, L.ⓑ{I}V⦄ ⊢ ▶[⫯d, e] 𝐍⦃T⦄ → - ∀a. ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃ⓑ{a,I}V.T⦄. -#G #L #V1 #d #e #HV1 #I #T1 #HT1 #a #X #H -elim (cpy_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct ->(HV1 … HV12) -V2 >(HT1 … HT12) -T2 // -qed. - -lemma cny_flat: ∀G,L,V,d,e. ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃V⦄ → - ∀T. ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃T⦄ → - ∀I. ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃ⓕ{I}V.T⦄. -#G #L #V1 #d #e #HV1 #T1 #HT1 #I #X #H -elim (cpy_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct ->(HV1 … HV12) -V2 >(HT1 … HT12) -T2 // -qed. - -lemma cny_narrow: ∀G,L,T,d1,e1. ⦃G, L⦄ ⊢ ▶[d1, e1] 𝐍⦃T⦄ → - ∀d2,e2. d1 ≤ d2 → d2 + e2 ≤ d1 + e1 → ⦃G, L⦄ ⊢ ▶[d2, e2] 𝐍⦃T⦄. -#G #L #T1 #d1 #e1 #HT1 #d2 #e2 #Hd12 #Hde21 #T2 #HT12 -@HT1 /2 width=5 by cpy_weak/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cny_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cny_lift.etc deleted file mode 100644 index 213fa6abb..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cny_lift.etc +++ /dev/null @@ -1,118 +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/relocation/cpy_lift.ma". -include "basic_2/relocation/cny.ma". - -(* NORMAL TERMS FOR CONTEXT-SENSITIVE EXTENDED SUBSTITUTION *****************) - -(* Properties on relocation *************************************************) - -lemma cny_lift_le: ∀G,L,K,T,U,s,d,dt,e,et. ⦃G, K⦄ ⊢ ▶[dt, et] 𝐍⦃T⦄ → ⇩[s, d, e] L ≡ K → - ⇧[d, e] T ≡ U → dt + et ≤ d → ⦃G, L⦄ ⊢ ▶[dt, et] 𝐍⦃U⦄. -#G #L #K #T1 #U1 #s #d #dt #e #et #HT1 #HLK #HTU1 #Hdetd #U2 #HU12 -elim (cpy_inv_lift1_le … HU12 … HLK … HTU1) // -L -Hdetd #T2 #HT12 ->(HT1 … HT12) -K /2 width=5 by lift_mono/ -qed-. - -lemma cny_lift_be: ∀G,L,K,T,U,s,d,dt,e,et. ⦃G, K⦄ ⊢ ▶[dt, et] 𝐍⦃T⦄ → ⇩[s, d, e] L ≡ K → - ⇧[d, e] T ≡ U → dt ≤ d → yinj d ≤ dt + et → ⦃G, L⦄ ⊢ ▶[dt, et+e] 𝐍⦃U⦄. -#G #L #K #T1 #U1 #s #d #dt #e #et #HT1 #HLK #HTU1 #Hdtd #Hddet #U2 #HU12 -elim (cpy_inv_lift1_be … HU12 … HLK … HTU1) /2 width=1 by monotonic_yle_plus_dx/ -L -Hdtd -Hddet #T2 ->yplus_minus_inj #HT12 >(HT1 … HT12) -K /2 width=5 by lift_mono/ -qed-. - -lemma cny_lift_ge: ∀G,L,K,T,U,s,d,dt,e,et. ⦃G, K⦄ ⊢ ▶[dt, et] 𝐍⦃T⦄ → ⇩[s, d, e] L ≡ K → - ⇧[d, e] T ≡ U → d ≤ dt → ⦃G, L⦄ ⊢ ▶[dt+e, et] 𝐍⦃U⦄. -#G #L #K #T1 #U1 #s #d #dt #e #et #HT1 #HLK #HTU1 #Hddt #U2 #HU12 -elim (cpy_inv_lift1_ge … HU12 … HLK … HTU1) /2 width=1 by monotonic_yle_plus_dx/ -L -Hddt #T2 ->yplus_minus_inj #HT12 >(HT1 … HT12) -K /2 width=5 by lift_mono/ -qed-. - -(* Inversion lemmas on relocation *******************************************) - -lemma cny_inv_lift_le: ∀G,L,K,T,U,s,d,dt,e,et. ⦃G, L⦄ ⊢ ▶[dt, et] 𝐍⦃U⦄ → ⇩[s, d, e] L ≡ K → - ⇧[d, e] T ≡ U → dt + et ≤ d → ⦃G, K⦄ ⊢ ▶[dt, et] 𝐍⦃T⦄. -#G #L #K #T1 #U1 #s #d #dt #e #et #HU1 #HLK #HTU1 #Hdetd #T2 #HT12 -elim (lift_total T2 d e) #U2 #HTU2 -lapply (cpy_lift_le … HT12 … HLK … HTU1 … HTU2 ?) // -K -Hdetd #HU12 -lapply (HU1 … HU12) -L /2 width=5 by lift_inj/ -qed-. - -lemma cny_inv_lift_be: ∀G,L,K,T,U,s,d,dt,e,et. ⦃G, L⦄ ⊢ ▶[dt, et] 𝐍⦃U⦄ → ⇩[s, d, e] L ≡ K → - ⇧[d, e] T ≡ U → dt ≤ d → yinj d + e ≤ dt + et → ⦃G, K⦄ ⊢ ▶[dt, et-e] 𝐍⦃T⦄. -#G #L #K #T1 #U1 #s #d #dt #e #et #HU1 #HLK #HTU1 #Hdtd #Hdedet #T2 #HT12 -lapply (yle_fwd_plus_ge_inj … Hdedet) // #Heet -elim (yle_inv_plus_inj2 … Hdedet) -Hdedet #Hddete #Hedet -elim (lift_total T2 d e) #U2 #HTU2 -lapply (cpy_lift_be … HT12 … HLK … HTU1 … HTU2 ? ?) // [ >yplus_minus_assoc_inj // ] -K -Hdtd -Hddete ->ymax_pre_sn // -Heet #HU12 -lapply (HU1 … HU12) -L /2 width=5 by lift_inj/ -qed-. - -lemma cny_inv_lift_ge: ∀G,L,K,T,U,s,d,dt,e,et. ⦃G, L⦄ ⊢ ▶[dt, et] 𝐍⦃U⦄ → ⇩[s, d, e] L ≡ K → - ⇧[d, e] T ≡ U → yinj d + e ≤ dt → ⦃G, K⦄ ⊢ ▶[dt-e, et] 𝐍⦃T⦄. -#G #L #K #T1 #U1 #s #d #dt #e #et #HU1 #HLK #HTU1 #Hdedt #T2 #HT12 -elim (yle_inv_plus_inj2 … Hdedt) -Hdedt #Hddte #Hedt -elim (lift_total T2 d e) #U2 #HTU2 -lapply (cpy_lift_ge … HT12 … HLK … HTU1 … HTU2 ?) // -K -Hddte ->ymax_pre_sn // -Hedt #HU12 -lapply (HU1 … HU12) -L /2 width=5 by lift_inj/ -qed-. - -(* Advanced inversion lemmas on relocation **********************************) - -lemma cny_inv_lift_ge_up: ∀G,L,K,T,U,s,d,dt,e,et. ⦃G, L⦄ ⊢ ▶[dt, et] 𝐍⦃U⦄ → ⇩[s, d, e] L ≡ K → - ⇧[d, e] T ≡ U → d ≤ dt → dt ≤ yinj d + e → yinj d + e ≤ dt + et → - ⦃G, K⦄ ⊢ ▶[d, dt + et - (yinj d + e)] 𝐍⦃T⦄. -#G #L #K #T1 #U1 #s #d #dt #e #et #HU1 #HLK #HTU1 #Hddt #Hdtde #Hdedet -lapply (cny_narrow … HU1 (d+e) (dt+et-(d+e)) ? ?) -HU1 [ >ymax_pre_sn_comm ] // #HU1 -lapply (cny_inv_lift_ge … HU1 … HLK … HTU1 ?) // -L -U1 ->yplus_minus_inj // -qed-. - -lemma cny_inv_lift_subst: ∀G,L,K,V,W,i,d,e. d ≤ yinj i → i < d + e → - ⇩[i+1] L ≡ K → ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃W⦄ → - ⇧[O, i+1] V ≡ W → ⦃G, K⦄ ⊢ ▶[O, ⫰(d+e-i)] 𝐍⦃V⦄. -#G #L #K #V #W #i #d #e #Hdi #Hide #HLK #HW #HVW -lapply (cny_inv_lift_ge_up … HW … HLK … HVW ? ? ?) // ->yplus_O1 yplus_SO2 -[ /2 width=1 by ylt_fwd_le_succ1/ -| /2 width=3 by yle_trans/ -| >yminus_succ2 // -] -qed-. - -(* Advanced properties ******************************************************) - -(* Note: this should be applicable in a forward manner *) -lemma cny_lift_ge_up: ∀G,L,K,T,U,s,d,dt,e,et. ⦃G, K⦄ ⊢ ▶[yinj d, dt + et - (yinj d + yinj e)] 𝐍⦃T⦄ → - ⇩[s, d, e] L ≡ K → ⇧[d, e] T ≡ U → - yinj d ≤ dt → dt ≤ yinj d + yinj e → yinj d + yinj e ≤ dt + et → - ⦃G, L⦄ ⊢ ▶[dt, et] 𝐍⦃U⦄. -#G #L #K #T1 #U1 #s #d #dt #e #et #HT1 #HLK #HTU1 #Hddt #Hdtde #Hdedet -lapply (cny_lift_be … HT1 … HLK … HTU1 ? ?) // -K -T1 -#HU1 @(cny_narrow … HU1) -HU1 // (**) (* auto fails *) -qed-. - -lemma cny_lift_subst: ∀G,L,K,V,W,i,d,e. d ≤ yinj i → i < d + e → - ⇩[i+1] L ≡ K → ⦃G, K⦄ ⊢ ▶[O, ⫰(d+e-i)] 𝐍⦃V⦄ → - ⇧[O, i+1] V ≡ W → ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃W⦄. -#G #L #K #V #W #i #d #e #Hdi #Hide #HLK #HV #HVW -@(cny_lift_ge_up … HLK … HVW) // >yplus_O1 yplus_SO2 -[ >yminus_succ2 // -| /2 width=3 by yle_trans/ -| /2 width=1 by ylt_fwd_le_succ1/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpx_cpzs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpx_cpzs.etc deleted file mode 100644 index 6c208d51b..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpx_cpzs.etc +++ /dev/null @@ -1,73 +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/delta_equivalence/cpzs.ma". -include "basic_2/reduction/cpx.ma". - -fact destruct_tsort_tsort: ∀k1,k2. ⋆k1 = ⋆k2 → k1 = k2. -#k1 #k2 #H destruct // -qed-. - -axiom cpzs_inv_subst: ∀I,G,L,K,V1,V2,W2,i. - ⇩[i] L ≡ K.ⓑ{I}V1 → ⇧[O, i+1] V2 ≡ W2 → - ⦃G, L⦄ ⊢ #i ◆*[O, ∞] W2 → ⦃G, K⦄⊢ V1 ◆*[O, ∞] V2. - -axiom cpzs_subst: ∀I,G,L,K,V1,V2,W2,i. - ⇩[i] L ≡ K.ⓑ{I}V1 → ⇧[O, i+1] V2 ≡ W2 → - ⦃G, K⦄⊢ V1 ◆*[O, ∞] V2 → ⦃G, L⦄ ⊢ #i ◆*[O, ∞] W2. - -(* CONTEXT-SENSITIVE EXTENDED PARALLEL REDUCTION FOR TERMS ******************) - -(* Forward lemmas on delta-equivalence for terms ****************************) - -lemma cpx_fwd_cpys_cpzs: ∀h,g,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 → - ∀d,e. ⦃G, L⦄ ⊢ T1 ◆*[d, e] T2 ↔ ⦃G, L⦄ ⊢ T1 ▶*[d, e] T2. -#h #g #G #L #T1 #T2 #H elim H -G -L -T1 -T2 -[ /2 width=1 by conj/ -| #G #L #k #l #_ #d #e @conj #H lapply (next_lt h k) - [ <(cpzs_inv_sort … H) - | lapply (cpys_inv_sort1 … H) -H #H >(destruct_tsort_tsort … H) - ] -H #H elim (lt_refl_false … H) -| #I #G #L #K #V1 #V2 #W2 #i #HLK #_ #HVW2 #IHV12 #d #e @conj #H -(* - [ @(cpys_subst … HLK … HVW2) // >yminus_Y_inj /3 width=7 by cpzs_inv_subst/ - | elim (cpys_inv_lref1_ldrop … H … HLK … HVW2) -H /3 width=7 by cpzs_subst/ - ] -*) -| #a #I #G #L #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #d #e - elim (IHV12 d e) -IHV12 elim (IHT12 (⫯d) e) -IHT12 - #IHTdx #IHTsn #IHVdx #IHVsn @conj #H - [ elim (cpzs_inv_bind … H) -H /3 width=1 by cpys_bind/ - | elim (cpys_inv_bind1 … H) -H #X1 #X2 #H1 #H2 #H destruct /3 width=1 by cpzs_bind/ - ] -| #I #G #L #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #d #e - elim (IHV12 d e) -IHV12 elim (IHT12 (d) e) -IHT12 - #IHTdx #IHTsn #IHVdx #IHVsn @conj #H - [ elim (cpzs_inv_flat … H) -H /3 width=1 by cpys_flat/ - | elim (cpys_inv_flat1 … H) -H #X1 #X2 #H1 #H2 #H destruct /3 width=1 by cpzs_flat/ - ] -| #G #L #V #U1 #U2 #T2 #_ #HTU2 #_ #d #e @conj #H -| #G #L #V1 #T1 #T2 #_ #_ #d #e @conj #H -| #G #L #V1 #V2 #T1 #HV12 #_ #d #e @conj #H -| #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #d #e @conj #H - [ elim (cpzs_inv_flat_bind … H) - | elim (cpys_inv_flat1 … H) -H #X1 #X2 #H1 #H2 #H destruct - ] -| #a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #_ #d #e @conj #H - [ elim (cpzs_inv_flat_bind … H) - | elim (cpys_inv_flat1 … H) -H #X1 #X2 #H1 #H2 #H destruct - ] -] - - \ No newline at end of file diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpye.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpye.etc deleted file mode 100644 index 71e06ea72..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpye.etc +++ /dev/null @@ -1,89 +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/notation/relations/psubsteval_6.ma". -include "basic_2/relocation/cny.ma". -include "basic_2/substitution/cpys.ma". - -(* EVALUATION FOR CONTEXT-SENSITIVE EXTENDED SUBSTITUTION ON TERMS **********) - -definition cpye: ynat → ynat → relation4 genv lenv term term ≝ - λd,e,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ▶*[d, e] T2 ∧ ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃T2⦄. - -interpretation "evaluation for context-sensitive extended substitution (term)" - 'PSubstEval G L T1 T2 d e = (cpye d e G L T1 T2). - -(* Basic_properties *********************************************************) - -(* Note: this should go in subconversion *) -lemma leqy_cpye_trans: ∀G,L2,T1,T2,d,e. ⦃G, L2⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T2⦄ → - ∀L1. L1 ⊑×[d, e] L2 → L2 ⊑×[d, e] L1 → ⦃G, L1⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T2⦄. -#G #L2 #T1 #T2 #d #e * -/4 width=8 by lsuby_cpys_trans, lsuby_cny_conf, conj/ -qed-. - -lemma cpye_sort: ∀G,L,d,e,k. ⦃G, L⦄ ⊢ ⋆k ▶*[d, e] 𝐍⦃⋆k⦄. -/3 width=5 by cny_sort, conj/ qed. - -lemma cpye_free: ∀G,L,d,e,i. |L| ≤ i → ⦃G, L⦄ ⊢ #i ▶*[d, e] 𝐍⦃#i⦄. -/3 width=6 by cny_lref_free, conj/ qed. - -lemma cpye_top: ∀G,L,d,e,i. d + e ≤ yinj i → ⦃G, L⦄ ⊢ #i ▶*[d, e] 𝐍⦃#i⦄. -/3 width=6 by cny_lref_top, conj/ qed. - -lemma cpye_skip: ∀G,L,d,e,i. yinj i < d → ⦃G, L⦄ ⊢ #i ▶*[d, e] 𝐍⦃#i⦄. -/3 width=6 by cny_lref_skip, conj/ qed. - -lemma cpye_gref: ∀G,L,d,e,p. ⦃G, L⦄ ⊢ §p ▶*[d, e] 𝐍⦃§p⦄. -/3 width=5 by cny_gref, conj/ qed. - -lemma cpye_bind: ∀G,L,V1,V2,d,e. ⦃G, L⦄ ⊢ V1 ▶*[d, e] 𝐍⦃V2⦄ → - ∀I,T1,T2. ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ▶*[⫯d, e] 𝐍⦃T2⦄ → - ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ▶*[d, e] 𝐍⦃ⓑ{a,I}V2.T2⦄. -#G #L #V1 #V2 #d #e * #HV12 #HV2 #I #T1 #T2 * -/5 width=8 by cpys_bind, cny_bind, lsuby_cny_conf, lsuby_succ, conj/ -qed. - -lemma cpye_flat: ∀G,L,V1,V2,d,e. ⦃G, L⦄ ⊢ V1 ▶*[d, e] 𝐍⦃V2⦄ → - ∀T1,T2. ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T2⦄ → - ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ▶*[d, e] 𝐍⦃ⓕ{I}V2.T2⦄. -#G #L #V1 #V2 #d #e * #HV12 #HV2 #T1 #T2 * -/3 width=7 by cpys_flat, cny_flat, conj/ -qed. - -(* Basic inversion lemmas ***************************************************) - -lemma cpye_inv_sort1: ∀G,L,X,d,e,k. ⦃G, L⦄ ⊢ ⋆k ▶*[d, e] 𝐍⦃X⦄ → X = ⋆k. -#G #L #X #d #e #k * /2 width=5 by cpys_inv_sort1/ -qed-. - -lemma cpye_inv_gref1: ∀G,L,X,d,e,p. ⦃G, L⦄ ⊢ §p ▶*[d, e] 𝐍⦃X⦄ → X = §p. -#G #L #X #d #e #p * /2 width=5 by cpys_inv_gref1/ -qed-. - -lemma cpye_inv_bind1: ∀a,I,G,L,V1,T1,X,d,e. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ▶*[d, e] 𝐍⦃X⦄ → - ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ▶*[d, e] 𝐍⦃V2⦄ & ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ▶*[⫯d, e] 𝐍⦃T2⦄ & - X = ⓑ{a,I}V2.T2. -#a #I #G #L #V1 #T1 #X #d #e * #H1 #H2 elim (cpys_inv_bind1 … H1) -H1 -#V2 #T2 #HV12 #HT12 #H destruct elim (cny_inv_bind … H2) -H2 -/5 width=8 by lsuby_cny_conf, lsuby_succ, ex3_2_intro, conj/ -qed-. - -lemma cpye_inv_flat1: ∀I,G,L,V1,T1,X,d,e. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ▶*[d, e] 𝐍⦃X⦄ → - ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ▶*[d, e] 𝐍⦃V2⦄ & ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T2⦄ & - X = ⓕ{I}V2.T2. -#I #G #L #V1 #T1 #X #d #e * #H1 #H2 elim (cpys_inv_flat1 … H1) -H1 -#V2 #T2 #HV12 #HT12 #H destruct elim (cny_inv_flat … H2) -H2 -/3 width=5 by ex3_2_intro, conj/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpye_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpye_alt.etc deleted file mode 100644 index a9dc53cf5..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpye_alt.etc +++ /dev/null @@ -1,89 +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/notation/relations/psubstevalalt_6.ma". -include "basic_2/substitution/cpye_lift.ma". - -(* EVALUATION FOR CONTEXT-SENSITIVE EXTENDED SUBSTITUTION ON TERMS **********) - -(* Note: alternative definition of cpye *) -inductive cpyea: ynat → ynat → relation4 genv lenv term term ≝ -| cpyea_sort : ∀G,L,d,e,k. cpyea d e G L (⋆k) (⋆k) -| cpyea_free : ∀G,L,d,e,i. |L| ≤ i → cpyea d e G L (#i) (#i) -| cpyea_top : ∀G,L,d,e,i. d + e ≤ yinj i → cpyea d e G L (#i) (#i) -| cpyea_skip : ∀G,L,d,e,i. yinj i < d → cpyea d e G L (#i) (#i) -| cpyea_subst: ∀I,G,L,K,V1,V2,W2,i,d,e. d ≤ yinj i → yinj i < d+e → - ⇩[i] L ≡ K.ⓑ{I}V1 → cpyea (yinj 0) (⫰(d+e-yinj i)) G K V1 V2 → - ⇧[0, i+1] V2 ≡ W2 → cpyea d e G L (#i) W2 -| cpyea_gref : ∀G,L,d,e,p. cpyea d e G L (§p) (§p) -| cpyea_bind : ∀a,I,G,L,V1,V2,T1,T2,d,e. - cpyea d e G L V1 V2 → cpyea (⫯d) e G (L.ⓑ{I}V1) T1 T2 → - cpyea d e G L (ⓑ{a,I}V1.T1) (ⓑ{a,I}V2.T2) -| cpyea_flat : ∀I,G,L,V1,V2,T1,T2,d,e. - cpyea d e G L V1 V2 → cpyea d e G L T1 T2 → - cpyea d e G L (ⓕ{I}V1.T1) (ⓕ{I}V2.T2) -. - -interpretation - "evaluation for context-sensitive extended substitution (term) alternative" - 'PSubstEvalAlt G L T1 T2 d e = (cpyea d e G L T1 T2). - -(* Main properties **********************************************************) - -theorem cpye_cpyea: ∀G,L,T1,T2,d,e. ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T2⦄ → ⦃G, L⦄ ⊢ T1 ▶▶*[d, e] 𝐍⦃T2⦄. -#G #L #T1 @(fqup_wf_ind_eq … G L T1) -G -L -T1 -#Z #Y #X #IH #G #L * * -[ #k #_ #_ #_ #T2 #d #e #H -X -Y -Z >(cpye_inv_sort1 … H) -H // -| #i #HG #HL #HT #T2 #d #e #H destruct - elim (cpye_inv_lref1 … H) -H * - /4 width=7 by cpyea_subst, cpyea_free, cpyea_top, cpyea_skip, fqup_lref/ -| #p #_ #_ #_ #T2 #d #e #H -X -Y -Z >(cpye_inv_gref1 … H) -H // -| #a #I #V1 #T1 #HG #HL #HT #T #d #e #H destruct - elim (cpye_inv_bind1 … H) -H /3 width=1 by cpyea_bind/ -| #I #V1 #T1 #HG #HL #HT #T #d #e #H destruct - elim (cpye_inv_flat1 … H) -H /3 width=1 by cpyea_flat/ -] -qed. - -(* Main inversion properties ************************************************) - -theorem cpyea_inv_cpye: ∀G,L,T1,T2,d,e. ⦃G, L⦄ ⊢ T1 ▶▶*[d, e] 𝐍⦃T2⦄ → ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T2⦄. -#G #L #T1 #T2 #d #e #H elim H -G -L -T1 -T2 -d -e -/2 width=7 by cpye_subst, cpye_flat, cpye_bind, cpye_skip, cpye_top, cpye_free/ -qed-. - -(* Advanced eliminators *****************************************************) - -lemma cpye_ind_alt: ∀R:ynat→ynat→relation4 genv lenv term term. - (∀G,L,d,e,k. R d e G L (⋆k) (⋆k)) → - (∀G,L,d,e,i. |L| ≤ i → R d e G L (#i) (#i)) → - (∀G,L,d,e,i. d + e ≤ yinj i → R d e G L (#i) (#i)) → - (∀G,L,d,e,i. yinj i < d → R d e G L (#i) (#i)) → - (∀I,G,L,K,V1,V2,W2,i,d,e. d ≤ yinj i → yinj i < d + e → - ⇩[i] L ≡ K.ⓑ{I}V1 → ⦃G, K⦄ ⊢ V1 ▶*[yinj O, ⫰(d+e-yinj i)] 𝐍⦃V2⦄ → - ⇧[O, i+1] V2 ≡ W2 → R (yinj O) (⫰(d+e-yinj i)) G K V1 V2 → R d e G L (#i) W2 - ) → - (∀G,L,d,e,p. R d e G L (§p) (§p)) → - (∀a,I,G,L,V1,V2,T1,T2,d,e. ⦃G, L⦄ ⊢ V1 ▶*[d, e] 𝐍⦃V2⦄ → - ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ▶*[⫯d, e] 𝐍⦃T2⦄ → R d e G L V1 V2 → - R (⫯d) e G (L.ⓑ{I}V1) T1 T2 → R d e G L (ⓑ{a,I}V1.T1) (ⓑ{a,I}V2.T2) - ) → - (∀I,G,L,V1,V2,T1,T2,d,e. ⦃G, L⦄ ⊢ V1 ▶*[d, e] 𝐍⦃V2⦄ → - ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T2⦄ → R d e G L V1 V2 → - R d e G L T1 T2 → R d e G L (ⓕ{I}V1.T1) (ⓕ{I}V2.T2) - ) → - ∀d,e,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T2⦄ → R d e G L T1 T2. -#R #H1 #H2 #H3 #H4 #H5 #H6 #H7 #H8 #d #e #G #L #T1 #T2 #H elim (cpye_cpyea … H) -G -L -T1 -T2 -d -e -/3 width=8 by cpyea_inv_cpye/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpye_cpye.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpye_cpye.etc deleted file mode 100644 index 42bd19b8e..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpye_cpye.etc +++ /dev/null @@ -1,28 +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/substitution/cpys_cny.ma". -include "basic_2/substitution/cpys_cpys.ma". -include "basic_2/substitution/cpye.ma". - -(* EVALUATION FOR CONTEXT-SENSITIVE EXTENDED SUBSTITUTION ON TERMS **********) - -(* Advanced properties ******************************************************) - -lemma cpye_cpys_conf: ∀G,L,T,T2,d,e. ⦃G, L⦄ ⊢ T ▶*[d, e] 𝐍⦃T2⦄ → - ∀T1. ⦃G, L⦄ ⊢ T ▶*[d, e] T1 → ⦃G, L⦄ ⊢ T1 ▶*[d, e] T2. -#G #L #T #T2 #d #e * #H2 #HT2 #T1 #H1 elim (cpys_conf_eq … H1 … H2) -T -#T0 #HT10 #HT20 >(cpys_inv_cny1 … HT2 … HT20) -T2 // -qed-. - \ No newline at end of file diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpye_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpye_lift.etc deleted file mode 100644 index 3c0abe617..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpye_lift.etc +++ /dev/null @@ -1,169 +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/relocation/cny_lift.ma". -include "basic_2/substitution/fqup.ma". -include "basic_2/substitution/cpys_lift.ma". -include "basic_2/substitution/cpye.ma". - -(* EVALUATION FOR CONTEXT-SENSITIVE EXTENDED SUBSTITUTION ON TERMS **********) - -(* Advanced properties ******************************************************) - -lemma cpye_subst: ∀I,G,L,K,V1,V2,W2,i,d,e. d ≤ yinj i → i < d + e → - ⇩[i] L ≡ K.ⓑ{I}V1 → ⦃G, K⦄ ⊢ V1 ▶*[O, ⫰(d+e-i)] 𝐍⦃V2⦄ → - ⇧[O, i+1] V2 ≡ W2 → ⦃G, L⦄ ⊢ #i ▶*[d, e] 𝐍⦃W2⦄. -#I #G #L #K #V1 #V2 #W2 #i #d #e #Hdi #Hide #HLK * -/4 width=13 by cpys_subst, cny_lift_subst, ldrop_fwd_drop2, conj/ -qed. - -lemma cpye_total: ∀G,L,T1,d,e. ∃T2. ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T2⦄. -#G #L #T1 @(fqup_wf_ind_eq … G L T1) -G -L -T1 -#Z #Y #X #IH #G #L * * -[ #k #HG #HL #HT #d #e destruct -IH /2 width=2 by ex_intro/ -| #i #HG #HL #HT #d #e destruct - elim (ylt_split i d) /3 width=2 by cpye_skip, ex_intro/ - elim (ylt_split i (d+e)) /3 width=2 by cpye_top, ex_intro/ - elim (lt_or_ge i (|L|)) /3 width=2 by cpye_free, ex_intro/ - #Hi #Hide #Hdi elim (ldrop_O1_lt L i) // -Hi - #I #K #V1 #HLK elim (IH G K V1 … 0 (⫰(d+e-i))) -IH /2 width=2 by fqup_lref/ - #V2 elim (lift_total V2 0 (i+1)) /3 width=8 by ex_intro, cpye_subst/ -| #p #HG #HL #HT #d #e destruct -IH /2 width=2 by ex_intro/ -| #a #I #V1 #T1 #HG #HL #HT #d #e destruct - elim (IH G L V1 … d e) // elim (IH G (L.ⓑ{I}V1) T1 … (⫯d) e) // - /3 width=2 by cpye_bind, ex_intro/ -| #I #V1 #T1 #HG #HL #HT #d #e destruct - elim (IH G L V1 … d e) // elim (IH G L T1 … d e) // - /3 width=2 by cpye_flat, ex_intro/ -] -qed-. - -(* Advanced inversion lemmas ************************************************) - -lemma cpye_inv_lref1: ∀G,L,T2,d,e,i. ⦃G, L⦄ ⊢ #i ▶*[d, e] 𝐍⦃T2⦄ → - ∨∨ |L| ≤ i ∧ T2 = #i - | d + e ≤ yinj i ∧ T2 = #i - | yinj i < d ∧ T2 = #i - | ∃∃I,K,V1,V2. d ≤ yinj i & yinj i < d + e & - ⇩[i] L ≡ K.ⓑ{I}V1 & - ⦃G, K⦄ ⊢ V1 ▶*[yinj 0, ⫰(d+e-yinj i)] 𝐍⦃V2⦄ & - ⇧[O, i+1] V2 ≡ T2. -#G #L #T2 #i #d #e * #H1 #H2 elim (cpys_inv_lref1 … H1) -H1 -[ #H destruct elim (cny_inv_lref … H2) -H2 - /3 width=1 by or4_intro0, or4_intro1, or4_intro2, conj/ -| * #I #K #V1 #V2 #Hdi #Hide #HLK #HV12 #HVT2 - @or4_intro3 @(ex5_4_intro … HLK … HVT2) (**) (* explicit constructor *) - /4 width=13 by cny_inv_lift_subst, ldrop_fwd_drop2, conj/ -] -qed-. - -lemma cpye_inv_lref1_free: ∀G,L,T2,d,e,i. ⦃G, L⦄ ⊢ #i ▶*[d, e] 𝐍⦃T2⦄ → - (∨∨ |L| ≤ i | d + e ≤ yinj i | yinj i < d) → T2 = #i. -#G #L #T2 #d #e #i #H * elim (cpye_inv_lref1 … H) -H * // -#I #K #V1 #V2 #Hdi #Hide #HLK #_ #_ #H -[ elim (lt_refl_false i) -d - @(lt_to_le_to_lt … H) -H /2 width=5 by ldrop_fwd_length_lt2/ (**) (* full auto slow: 19s *) -] -elim (ylt_yle_false … H) // -qed-. - -lemma cpye_inv_lref1_lget: ∀G,L,T2,d,e,i. ⦃G, L⦄ ⊢ #i ▶*[d, e] 𝐍⦃T2⦄ → - ∀I,K,V1. ⇩[i] L ≡ K.ⓑ{I}V1 → - ∨∨ d + e ≤ yinj i ∧ T2 = #i - | yinj i < d ∧ T2 = #i - | ∃∃V2. d ≤ yinj i & yinj i < d + e & - ⦃G, K⦄ ⊢ V1 ▶*[yinj 0, ⫰(d+e-yinj i)] 𝐍⦃V2⦄ & - ⇧[O, i+1] V2 ≡ T2. -#G #L #T2 #d #e #i #H #I #K #V1 #HLK elim (cpye_inv_lref1 … H) -H * -[ #H elim (lt_refl_false i) -T2 -d - @(lt_to_le_to_lt … H) -H /2 width=5 by ldrop_fwd_length_lt2/ -| /3 width=1 by or3_intro0, conj/ -| /3 width=1 by or3_intro1, conj/ -| #Z #Y #X1 #X2 #Hdi #Hide #HLY #HX12 #HXT2 - lapply (ldrop_mono … HLY … HLK) -HLY -HLK #H destruct - /3 width=3 by or3_intro2, ex4_intro/ -] -qed-. - -lemma cpye_inv_lref1_subst_ex: ∀G,L,T2,d,e,i. ⦃G, L⦄ ⊢ #i ▶*[d, e] 𝐍⦃T2⦄ → - ∀I,K,V1. d ≤ yinj i → yinj i < d + e → - ⇩[i] L ≡ K.ⓑ{I}V1 → - ∃∃V2. ⦃G, K⦄ ⊢ V1 ▶*[yinj 0, ⫰(d+e-yinj i)] 𝐍⦃V2⦄ & - ⇧[O, i+1] V2 ≡ T2. -#G #L #T2 #d #e #i #H #I #K #V1 #Hdi #Hide #HLK -elim (cpye_inv_lref1_lget … H … HLK) -H * /2 width=3 by ex2_intro/ -#H elim (ylt_yle_false … H) // -qed-. - -lemma cpye_inv_lref1_subst: ∀G,L,T2,d,e,i. ⦃G, L⦄ ⊢ #i ▶*[d, e] 𝐍⦃T2⦄ → - ∀I,K,V1,V2. d ≤ yinj i → yinj i < d + e → - ⇩[i] L ≡ K.ⓑ{I}V1 → ⇧[O, i+1] V2 ≡ T2 → - ⦃G, K⦄ ⊢ V1 ▶*[yinj 0, ⫰(d+e-yinj i)] 𝐍⦃V2⦄. -#G #L #T2 #d #e #i #H #I #K #V1 #V2 #Hdi #Hide #HLK #HVT2 -elim (cpye_inv_lref1_subst_ex … H … HLK) -H -HLK // -#X2 #H0 #HXT2 lapply (lift_inj … HXT2 … HVT2) -HXT2 -HVT2 #H destruct // -qed-. - -(* Inversion lemmas on relocation *******************************************) - -lemma cpye_inv_lift1_le: ∀G,L,U1,U2,dt,et. ⦃G, L⦄ ⊢ U1 ▶*[dt, et] 𝐍⦃U2⦄ → - ∀K,s,d,e. ⇩[s, d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → - dt + et ≤ d → - ∃∃T2. ⦃G, K⦄ ⊢ T1 ▶*[dt, et] 𝐍⦃T2⦄ & ⇧[d, e] T2 ≡ U2. -#G #L #U1 #U2 #dt #et * #HU12 #HU2 #K #s #d #e #HLK #T1 #HTU1 #Hdetd -elim (cpys_inv_lift1_le … HU12 … HLK … HTU1) -U1 // #T2 #HT12 #HTU2 -lapply (cny_inv_lift_le … HU2 … HLK … HTU2 ?) -L -/3 width=3 by ex2_intro, conj/ -qed-. - -lemma cpye_inv_lift1_be: ∀G,L,U1,U2,dt,et. ⦃G, L⦄ ⊢ U1 ▶*[dt, et] 𝐍⦃U2⦄ → - ∀K,s,d,e. ⇩[s, d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → - dt ≤ d → yinj d + e ≤ dt + et → - ∃∃T2. ⦃G, K⦄ ⊢ T1 ▶*[dt, et - e] 𝐍⦃T2⦄ & ⇧[d, e] T2 ≡ U2. -#G #L #U1 #U2 #dt #et * #HU12 #HU2 #K #s #d #e #HLK #T1 #HTU1 #Hdtd #Hdedet -elim (cpys_inv_lift1_be … HU12 … HLK … HTU1) -U1 // #T2 #HT12 #HTU2 -lapply (cny_inv_lift_be … HU2 … HLK … HTU2 ? ?) -L -/3 width=3 by ex2_intro, conj/ -qed-. - -lemma cpye_inv_lift1_ge: ∀G,L,U1,U2,dt,et. ⦃G, L⦄ ⊢ U1 ▶*[dt, et] 𝐍⦃U2⦄ → - ∀K,s,d,e. ⇩[s, d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → - yinj d + e ≤ dt → - ∃∃T2. ⦃G, K⦄ ⊢ T1 ▶*[dt - e, et] 𝐍⦃T2⦄ & ⇧[d, e] T2 ≡ U2. -#G #L #U1 #U2 #dt #et * #HU12 #HU2 #K #s #d #e #HLK #T1 #HTU1 #Hdedt -elim (cpys_inv_lift1_ge … HU12 … HLK … HTU1) -U1 // #T2 #HT12 #HTU2 -lapply (cny_inv_lift_ge … HU2 … HLK … HTU2 ?) -L -/3 width=3 by ex2_intro, conj/ -qed-. - -lemma cpye_inv_lift1_ge_up: ∀G,L,U1,U2,dt,et. ⦃G, L⦄ ⊢ U1 ▶*[dt, et] 𝐍⦃U2⦄ → - ∀K,s,d,e. ⇩[s, d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → - d ≤ dt → dt ≤ yinj d + e → yinj d + e ≤ dt + et → - ∃∃T2. ⦃G, K⦄ ⊢ T1 ▶*[d, dt + et - (yinj d + e)] 𝐍⦃T2⦄ & - ⇧[d, e] T2 ≡ U2. -#G #L #U1 #U2 #dt #et * #HU12 #HU2 #K #s #d #e #HLK #T1 #HTU1 #Hddt #Hdtde #Hdedet -elim (cpys_inv_lift1_ge_up … HU12 … HLK … HTU1) -U1 // #T2 #HT12 #HTU2 -lapply (cny_inv_lift_ge_up … HU2 … HLK … HTU2 ? ? ?) -L -/3 width=3 by ex2_intro, conj/ -qed-. - -lemma cpye_inv_lift1_subst: ∀G,L,W1,W2,d,e. ⦃G, L⦄ ⊢ W1 ▶*[d, e] 𝐍⦃W2⦄ → - ∀K,V1,i. ⇩[i+1] L ≡ K → ⇧[O, i+1] V1 ≡ W1 → - d ≤ yinj i → i < d + e → - ∃∃V2. ⦃G, K⦄ ⊢ V1 ▶*[O, ⫰(d+e-i)] 𝐍⦃V2⦄ & ⇧[O, i+1] V2 ≡ W2. -#G #L #W1 #W2 #d #e * #HW12 #HW2 #K #V1 #i #HLK #HVW1 #Hdi #Hide -elim (cpys_inv_lift1_subst … HW12 … HLK … HVW1) -W1 // #V2 #HV12 #HVW2 -lapply (cny_inv_lift_subst … HLK HW2 HVW2) -L -/3 width=3 by ex2_intro, conj/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpys_cny.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpys_cny.etc deleted file mode 100644 index 1499ceea5..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpys_cny.etc +++ /dev/null @@ -1,26 +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/relocation/cny.ma". -include "basic_2/substitution/cpys.ma". - -(* CONTEXT-SENSITIVE EXTENDED MULTIPLE SUBSTITUTION FOR TERMS ***************) - -(* Inversion lemmas on normality for extended substitution ******************) - -lemma cpys_inv_cny1: ∀G,L,T1,d,e. ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃T1⦄ → - ∀T2. ⦃G, L⦄ ⊢ T1 ▶*[d, e] T2 → T1 = T2. -#G #L #T1 #d #e #HT1 #T2 #H @(cpys_ind … H) -T2 // -#T #T2 #_ #HT2 #IHT1 destruct <(HT1 … HT2) -T // -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpzs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpzs.etc deleted file mode 100644 index 0fada97a0..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/cpzs.etc +++ /dev/null @@ -1,83 +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/notation/relations/pdeltaconvstar_6.ma". -include "basic_2/substitution/cpye_lift.ma". - -(* CONTEXT-SENSITIVE EXTENDED DELTA-EQUIVALENCE FOR TERMS *******************) - -definition cpzs: ynat → ynat → relation4 genv lenv term term ≝ - λd,e,G,L,T1,T2. - ∃∃T. ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T⦄ & ⦃G, L⦄ ⊢ T2 ▶*[d, e] 𝐍⦃T⦄. - -interpretation "context-sensitive extended delta-equivalence (term)" - 'PDeltaConvStar G L T1 d e T2 = (cpzs d e G L T1 T2). - -(* Basic properties **********************************************************) - -lemma cpye_div: ∀G,L,T1,T,d,e. ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T⦄ → - ∀T2. ⦃G, L⦄ ⊢ T2 ▶*[d, e] 𝐍⦃T⦄ → ⦃G, L⦄ ⊢ T1 ◆*[d, e] T2. -/2 width=3 by ex2_intro/ qed. - -lemma cpzs_refl: ∀G,L,d,e. reflexive … (cpzs d e G L). -#G #L #d #e #T elim (cpye_total G L T d e) /2 width=3 by cpye_div/ -qed. - -lemma cpzs_bind: ∀G,L,V1,V2,d,e. ⦃G, L⦄ ⊢ V1 ◆*[d, e] V2 → - ∀I,T1,T2. ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ◆*[⫯d, e] T2 → - ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ◆*[d, e] ⓑ{a,I}V2.T2. -#G #L #V1 #V2 #d #e * #V #HV1 #HV2 #I #T1 #T2 * -/5 width=10 by cpye_div, cpye_bind, leqy_cpye_trans, cny_bind, lsuby_succ/ -qed. - -lemma cpzs_flat: ∀G,L,V1,V2,d,e. ⦃G, L⦄ ⊢ V1 ◆*[d, e] V2 → - ∀T1,T2. ⦃G, L⦄ ⊢ T1 ◆*[d, e] T2 → - ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ◆*[d, e] ⓕ{I}V2.T2. -#G #L #V1 #V2 #d #e * #V #HV1 #HV2 #T1 #T2 * -/3 width=5 by cpye_div, cpye_flat, cny_flat/ -qed. - -(* Basic inversion lemmas ***************************************************) - -lemma cpzs_inv_sort: ∀G,L,d,e,k1,k2. ⦃G, L⦄ ⊢ ⋆k1 ◆*[d, e] ⋆k2 → k1 = k2. -#G #L #d #e #k1 #k2 * #X #H1 #H2 -lapply (cpye_inv_sort1 … H1) -H1 #H1 -lapply (cpye_inv_sort1 … H2) -H2 #H2 -destruct // -qed-. - -lemma cpzs_inv_bind: ∀a1,a2,I1,I2,G,L,V1,V2,T1,T2,d,e. ⦃G, L⦄ ⊢ ⓑ{a1,I1}V1.T1 ◆*[d, e] ⓑ{a2,I2}V2.T2 → - ∧∧ a1 = a2 & I1 = I2 - & ⦃G, L⦄ ⊢ V1 ◆*[d, e] V2 & ⦃G, L.ⓑ{I1}V1⦄ ⊢ T1 ◆*[⫯d, e] T2. -#a1 #a2 #I1 #I2 #G #L #V1 #V2 #T1 #T2 #d #e * #X #H1 #H2 -elim (cpye_inv_bind1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H1 -elim (cpye_inv_bind1 … H2) -H2 #W2 #U2 #HW12 #HU12 #H2 -destruct /5 width=8 by cpye_div, leqy_cpye_trans, lsuby_succ, and4_intro/ -qed-. - -lemma cpzs_inv_flat: ∀I1,I2,G,L,V1,V2,T1,T2,d,e. ⦃G, L⦄ ⊢ ⓕ{I1}V1.T1 ◆*[d, e] ⓕ{I2}V2.T2 → - ∧∧ I1 = I2 - & ⦃G, L⦄ ⊢ V1 ◆*[d, e] V2 & ⦃G, L⦄ ⊢ T1 ◆*[d, e] T2. -#I1 #I2 #G #L #V1 #V2 #T1 #T2 #d #e * #X #H1 #H2 -elim (cpye_inv_flat1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H1 -elim (cpye_inv_flat1 … H2) -H2 #W2 #U2 #HW12 #HU12 #H2 -destruct /3 width=3 by cpye_div, and3_intro/ -qed-. - -lemma cpzs_inv_flat_bind: ∀a2,I1,I2,G,L,V1,V2,T1,T2,d,e. ⦃G, L⦄ ⊢ ⓕ{I1}V1.T1 ◆*[d, e] ⓑ{a2,I2}V2.T2 → ⊥. -#a2 #I1 #I2 #G #L #V1 #V2 #T1 #T2 #d #e * #X #H1 #H2 -elim (cpye_inv_flat1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H1 -elim (cpye_inv_bind1 … H2) -H2 #W2 #U2 #HW12 #HU12 #H2 -destruct -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/lleq_cpye.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cny/lleq_cpye.etc deleted file mode 100644 index e6890e637..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/lleq_cpye.etc +++ /dev/null @@ -1,49 +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/substitution/cpye_lift.ma". -include "basic_2/substitution/lleq_alt.ma". - -(* LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **********************************) - -(* Forward lemmas on evaluation for extended substitution *******************) - -lemma lleq_fwd_cpye: ∀L1,L2,T,d. L1 ⋕[T, d] L2 → ∀G,T1. ⦃G, L1⦄ ⊢ T ▶*[d, ∞] 𝐍⦃T1⦄ → - ∀T2. ⦃G, L2⦄ ⊢ T ▶*[d, ∞] 𝐍⦃T2⦄ → T1 = T2. -#L1 #L2 #T #d #H @(lleq_ind_alt … H) -L1 -L2 -T -d -[ #L1 #L2 #d #k #_ #G #T1 #H1 #T2 #H2 - >(cpye_inv_sort1 … H1) -H1 >(cpye_inv_sort1 … H2) -H2 // -| #L1 #L2 #d #i #_ #Hid #G #T1 #H1 #T2 #H2 - >(cpye_inv_lref1_free … H1) -H1 [ >(cpye_inv_lref1_free … H2) -H2 ] - /2 width=1 by or3_intro2/ -| #I1 #I2 #L1 #L2 #K1 #K2 #V #d #i #Hdi #HLK1 #HLK2 #_ #IHV #G #T1 #H1 #T2 #H2 - elim (cpye_inv_lref1_subst_ex … H1 … HLK1) -H1 -HLK1 // - elim (cpye_inv_lref1_subst_ex … H2 … HLK2) -H2 -HLK2 // - >yminus_Y_inj #V2 #HV2 #HVT2 #V1 #HV1 #HVT1 - lapply (IHV … HV1 … HV2) -IHV -HV1 -HV2 #H destruct /2 width=5 by lift_mono/ -| #L1 #L2 #d #i #_ #HL1 #HL2 #G #T1 #H1 #T2 #H2 - >(cpye_inv_lref1_free … H1) -H1 [ >(cpye_inv_lref1_free … H2) -H2 ] - /2 width=1 by or3_intro0/ -| #L1 #L2 #d #p #_ #G #T1 #H1 #T2 #H2 - >(cpye_inv_gref1 … H1) -H1 >(cpye_inv_gref1 … H2) -H2 // -| #a #I #L1 #L2 #V #T #d #_ #_ #IHV #IHT #G #X1 #H1 #X2 #H2 - elim (cpye_inv_bind1 … H1) -H1 #V1 #T1 #HV1 #HT1 #H destruct - elim (cpye_inv_bind1 … H2) -H2 #V2 #T2 #HV2 #HT2 #H destruct - /3 width=3 by eq_f2/ -| #I #L1 #L2 #V #T #d #_ #_ #IHV #IHT #G #X1 #H1 #X2 #H2 - elim (cpye_inv_flat1 … H1) -H1 #V1 #T1 #HV1 #HT1 #H destruct - elim (cpye_inv_flat1 … H2) -H2 #V2 #T2 #HV2 #HT2 #H destruct - /3 width=3 by eq_f2/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/lpx_cpye.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cny/lpx_cpye.etc deleted file mode 100644 index 48816c85d..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/lpx_cpye.etc +++ /dev/null @@ -1,44 +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/substitution/cpye_cpye.ma". -include "basic_2/reduction/lpx_cpys.ma". - -axiom cpx_cpys_conf_lpx: ∀h,g,G,d,e. - ∀L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡[h, g] T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡[h, g] L1 → - ∀T2. ⦃G, L0⦄ ⊢ T0 ▶*[d, e] T2 → - ∃∃T. ⦃G, L1⦄ ⊢ T1 ▶*[d, e] T & ⦃G, L0⦄ ⊢ T2 ➡[h, g] T. - -(* SN EXTENDED PARALLEL REDUCTION ON LOCAL ENVIRONMENTS *********************) - -(* Forward lemmas on evaluation for extended substitution *******************) - -lemma cpx_cpys_cpye_fwd_lpx: ∀h,g,G,L1,T1,T2. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2 → - ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → - ∀U1,d,e. ⦃G, L1⦄ ⊢ T1 ▶*[d, e] U1 → - ∀U2. ⦃G, L2⦄ ⊢ T2 ▶*[d, e] 𝐍⦃U2⦄ → - ⦃G, L1⦄ ⊢ U1 ➡[h, g] U2. -#h #g #G #L1 #T1 #T2 #HT12 #L2 #HL12 #U1 #d #e #HTU1 -elim (cpx_cpys_conf_lpx … HT12 … HL12 … HTU1) -T1 -/3 width=9 by cpx_cpys_trans_lpx, cpye_cpys_conf/ -qed-. - -lemma cpx_cpye_fwd_lpx: ∀h,g,G,L1,T1,T2. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2 → - ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → - ∀U1,d,e. ⦃G, L1⦄ ⊢ T1 ▶*[d, e] 𝐍⦃U1⦄ → - ∀U2. ⦃G, L2⦄ ⊢ T2 ▶*[d, e] 𝐍⦃U2⦄ → - ⦃G, L1⦄ ⊢ U1 ➡[h, g] U2. -#h #g #G #L1 #T1 #T2 #HT12 #L2 #HL12 #U1 #d #e * -/2 width=9 by cpx_cpys_cpye_fwd_lpx/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/lpxs_cpye.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cny/lpxs_cpye.etc deleted file mode 100644 index a6f0f86bd..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/lpxs_cpye.etc +++ /dev/null @@ -1,36 +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/substitution/cpye_lift.ma". -include "basic_2/reduction/lpx_cpye.ma". -include "basic_2/computation/cpxs_cpxs.ma". -include "basic_2/computation/lpxs.ma". - -(* SN EXTENDED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS *******************) - -(* Forward lemmas on evaluation for extended substitution *******************) - -lemma cpx_cpye_fwd_lpxs: ∀h,g,G,L1,L2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → - ∀T1,T2. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2 → - ∀U1,d,e. ⦃G, L1⦄ ⊢ T1 ▶*[d, e] 𝐍⦃U1⦄ → - ∀U2. ⦃G, L2⦄ ⊢ T2 ▶*[d, e] 𝐍⦃U2⦄ → - ⦃G, L1⦄ ⊢ U1 ➡*[h, g] U2. -#h #g #G #L1 #L2 #H @(lpxs_ind_dx … H) -L1 -[ /3 width=9 by cpx_cpxs, cpx_cpye_fwd_lpx/ -| #L1 #L #HL1 #_ #IHL2 #T1 #T2 #HT12 #U1 #d #e #HTU1 #U2 #HTU2 - elim (cpye_total G L T2 d e) #X2 #HTX2 - lapply (cpx_cpye_fwd_lpx … HT12 … HL1 … HTU1 … HTX2) -T1 - /4 width=9 by lpx_cpxs_trans, cpxs_strap2/ (**) (* full auto too long: 41s *) -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/pdeltaconvstar_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cny/pdeltaconvstar_6.etc deleted file mode 100644 index b7de5f543..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/pdeltaconvstar_6.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 break ◆ * [ term 46 d , break term 46 e ] break term 46 T2 )" - non associative with precedence 45 - for @{ 'PDeltaConvStar $G $L $T1 $d $e $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/psubsteval_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cny/psubsteval_6.etc deleted file mode 100644 index 360f43d29..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/psubsteval_6.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ break term 46 T1 ▶ * break [ term 46 d , break term 46 e ] break 𝐍 ⦃ term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'PSubstEval $G $L $T1 $T2 $d $e }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/psubstevalalt_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cny/psubstevalalt_6.etc deleted file mode 100644 index 18cdf608f..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/psubstevalalt_6.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ break term 46 T1 ▶ ▶ * break [ term 46 d , break term 46 e ] break 𝐍 ⦃ term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'PSubstEvalAlt $G $L $T1 $T2 $d $e }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/psubstnormal_5.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cny/psubstnormal_5.etc deleted file mode 100644 index 4a7a78afc..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cny/psubstnormal_5.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ ▶ break [ term 46 d , break term 46 e ] 𝐍 break ⦃ term 46 T ⦄ )" - non associative with precedence 45 - for @{ 'PSubstNormal $G $L $T $d $e }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cofrees/cofrees.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cofrees/cofrees.etc deleted file mode 100644 index e1b9b06b2..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cofrees/cofrees.etc +++ /dev/null @@ -1,130 +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/notation/relations/cofreestar_4.ma". -include "basic_2/relocation/lift_neg.ma". -include "basic_2/substitution/cpys.ma". - -(* CONTEXT-SENSITIVE EXCLUSION FROM FREE VARIABLES **************************) - -definition cofrees: relation4 ynat nat lenv term ≝ - λd,i,L,U1. ∀U2. ⦃⋆, L⦄ ⊢ U1 ▶*[d, ∞] U2 → ∃T2. ⇧[i, 1] T2 ≡ U2. - -interpretation - "context-sensitive exclusion from free variables (term)" - 'CoFreeStar L i d T = (cofrees d i L T). - -(* Basic forward lemmas *****************************************************) - -lemma cofrees_fwd_lift: ∀L,U,d,i. L ⊢ i ~ϵ 𝐅*[d]⦃U⦄ → ∃T. ⇧[i, 1] T ≡ U. -/2 width=1 by/ qed-. - -lemma cofrees_fwd_bind_sn: ∀a,I,L,W,U,i,d. L ⊢ i ~ϵ 𝐅*[d]⦃ⓑ{a,I}W.U⦄ → - L ⊢ i ~ϵ 𝐅*[d]⦃W⦄. -#a #I #L #W1 #U #i #d #H #W2 #HW12 elim (H (ⓑ{a,I}W2.U)) /2 width=1 by cpys_bind/ -W1 -#X #H elim (lift_inv_bind2 … H) -H /2 width=2 by ex_intro/ -qed-. - -lemma cofrees_fwd_bind_dx: ∀a,I,L,W,U,i,d. L ⊢ i ~ϵ 𝐅*[d]⦃ⓑ{a,I}W.U⦄ → - L.ⓑ{I}W ⊢ i+1 ~ϵ 𝐅*[⫯d]⦃U⦄. -#a #I #L #W #U1 #i #d #H #U2 #HU12 elim (H (ⓑ{a,I}W.U2)) /2 width=1 by cpys_bind/ -U1 -#X #H elim (lift_inv_bind2 … H) -H /2 width=2 by ex_intro/ -qed-. - -lemma cofrees_fwd_flat_sn: ∀I,L,W,U,i,d. L ⊢ i ~ϵ 𝐅*[d]⦃ⓕ{I}W.U⦄ → - L ⊢ i ~ϵ 𝐅*[d]⦃W⦄. -#I #L #W1 #U #i #d #H #W2 #HW12 elim (H (ⓕ{I}W2.U)) /2 width=1 by cpys_flat/ -W1 -#X #H elim (lift_inv_flat2 … H) -H /2 width=2 by ex_intro/ -qed-. - -lemma cofrees_fwd_flat_dx: ∀I,L,W,U,i,d. L ⊢ i ~ϵ 𝐅*[d]⦃ⓕ{I}W.U⦄ → - L ⊢ i ~ϵ 𝐅*[d]⦃U⦄. -#I #L #W #U1 #i #d #H #U2 #HU12 elim (H (ⓕ{I}W.U2)) /2 width=1 by cpys_flat/ -U1 -#X #H elim (lift_inv_flat2 … H) -H /2 width=2 by ex_intro/ -qed-. - -(* Basic inversion lemmas ***************************************************) - -lemma cofrees_inv_gen: ∀L,U,U0,d,i. ⦃⋆, L⦄ ⊢ U ▶*[d, ∞] U0 → (∀T. ⇧[i, 1] T ≡ U0 → ⊥) → - L ⊢ i ~ϵ 𝐅*[d]⦃U⦄ → ⊥. -#L #U #U0 #d #i #HU0 #HnU0 #HU elim (HU … HU0) -L -U -d /2 width=2 by/ -qed-. - -lemma cofrees_inv_lref_eq: ∀L,d,i. L ⊢ i ~ϵ 𝐅*[d]⦃#i⦄ → ⊥. -#L #d #i #H elim (H (#i)) -H // -#X #H elim (lift_inv_lref2_be … H) -H // -qed-. - -lemma cofrees_inv_bind: ∀a,I,L,W,U,i,d. L ⊢ i ~ϵ 𝐅*[d]⦃ⓑ{a,I}W.U⦄ → - L ⊢ i ~ϵ 𝐅*[d]⦃W⦄ ∧ L.ⓑ{I}W ⊢ i+1 ~ϵ 𝐅*[⫯d]⦃U⦄. -/3 width=8 by cofrees_fwd_bind_sn, cofrees_fwd_bind_dx, conj/ qed-. - -lemma cofrees_inv_flat: ∀I,L,W,U,i,d. L ⊢ i ~ϵ 𝐅*[d]⦃ⓕ{I}W.U⦄ → - L ⊢ i ~ϵ 𝐅*[d]⦃W⦄ ∧ L ⊢ i ~ϵ 𝐅*[d]⦃U⦄. -/3 width=7 by cofrees_fwd_flat_sn, cofrees_fwd_flat_dx, conj/ qed-. - -(* Basic Properties *********************************************************) - -lemma cofrees_lsuby_conf: ∀L1,U,d,i. L1 ⊢ i ~ϵ 𝐅*[d]⦃U⦄ → - ∀L2. L1 ⊆[d, ∞] L2 → L2 ⊢ i ~ϵ 𝐅*[d]⦃U⦄. -/3 width=3 by lsuby_cpys_trans/ qed-. - -lemma cofrees_sort: ∀L,d,i,k. L ⊢ i ~ϵ 𝐅*[d]⦃⋆k⦄. -#L #d #i #k #X #H >(cpys_inv_sort1 … H) -X /2 width=2 by ex_intro/ -qed. - -lemma cofrees_gref: ∀L,d,i,p. L ⊢ i ~ϵ 𝐅*[d]⦃§p⦄. -#L #d #i #p #X #H >(cpys_inv_gref1 … H) -X /2 width=2 by ex_intro/ -qed. - -lemma cofrees_bind: ∀L,V,d,i. L ⊢ i ~ϵ 𝐅*[d] ⦃V⦄ → - ∀I,T. L.ⓑ{I}V ⊢ i+1 ~ϵ 𝐅*[⫯d]⦃T⦄ → - ∀a. L ⊢ i ~ϵ 𝐅*[d]⦃ⓑ{a,I}V.T⦄. -#L #W1 #d #i #HW1 #I #U1 #HU1 #a #X #H elim (cpys_inv_bind1 … H) -H -#W2 #U2 #HW12 #HU12 #H destruct -elim (HW1 … HW12) elim (HU1 … HU12) -W1 -U1 /3 width=2 by lift_bind, ex_intro/ -qed. - -lemma cofrees_flat: ∀L,V,d,i. L ⊢ i ~ϵ 𝐅*[d]⦃V⦄ → ∀T. L ⊢ i ~ϵ 𝐅*[d]⦃T⦄ → - ∀I. L ⊢ i ~ϵ 𝐅*[d]⦃ⓕ{I}V.T⦄. -#L #W1 #d #i #HW1 #U1 #HU1 #I #X #H elim (cpys_inv_flat1 … H) -H -#W2 #U2 #HW12 #HU12 #H destruct -elim (HW1 … HW12) elim (HU1 … HU12) -W1 -U1 /3 width=2 by lift_flat, ex_intro/ -qed. - -lemma cofrees_cpy_trans: ∀L,U1,U2,d. ⦃⋆, L⦄ ⊢ U1 ▶[d, ∞] U2 → - ∀i. L ⊢ i ~ϵ 𝐅*[d]⦃U1⦄ → L ⊢ i ~ϵ 𝐅*[d]⦃U2⦄. -/3 width=3 by cpys_strap2/ qed-. - -axiom cofrees_dec: ∀L,T,d,i. Decidable (L ⊢ i ~ϵ 𝐅*[d]⦃T⦄). - -(* Basic negated properties *************************************************) - -lemma frees_cpy_div: ∀L,U1,U2,d. ⦃⋆, L⦄ ⊢ U1 ▶[d, ∞] U2 → - ∀i. (L ⊢ i ~ϵ 𝐅*[d]⦃U2⦄ → ⊥) → (L ⊢ i ~ϵ 𝐅*[d]⦃U1⦄ → ⊥). -/3 width=7 by cofrees_cpy_trans/ qed-. - -(* Basic negated inversion lemmas *******************************************) - -lemma frees_inv_bind: ∀a,I,L,V,T,d,i. (L ⊢ i ~ϵ 𝐅*[d]⦃ⓑ{a,I}V.T⦄ → ⊥) → - (L ⊢ i ~ϵ 𝐅*[d]⦃V⦄ → ⊥) ∨ (L.ⓑ{I}V ⊢ i+1 ~ϵ 𝐅*[⫯d]⦃T⦄ → ⊥). -#a #I #L #W #U #d #i #H elim (cofrees_dec L W d i) -/4 width=9 by cofrees_bind, or_intror, or_introl/ -qed-. - -lemma frees_inv_flat: ∀I,L,V,T,d,i. (L ⊢ i ~ϵ 𝐅*[d]⦃ⓕ{I}V.T⦄ → ⊥) → - (L ⊢ i ~ϵ 𝐅*[d]⦃V⦄ → ⊥) ∨ (L ⊢ i ~ϵ 𝐅*[d]⦃T⦄ → ⊥). -#I #L #W #U #d #H elim (cofrees_dec L W d) -/4 width=8 by cofrees_flat, or_intror, or_introl/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cofrees/cofrees_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cofrees/cofrees_alt.etc deleted file mode 100644 index 7bb9c9ca7..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cofrees/cofrees_alt.etc +++ /dev/null @@ -1,54 +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/relocation/cpy_nlift.ma". -include "basic_2/substitution/cofrees_lift.ma". - -(* CONTEXT-SENSITIVE EXCLUSION FROM FREE VARIABLES **************************) - -(* Alternative definition of frees_ge ***************************************) - -lemma nlift_frees: ∀L,U,d,i. (∀T. ⇧[i, 1] T ≡ U → ⊥) → (L ⊢ i ~ϵ 𝐅*[d]⦃U⦄ → ⊥). -#L #U #d #i #HnTU #H elim (cofrees_fwd_lift … H) -H /2 width=2 by/ -qed-. - -lemma frees_inv_ge: ∀L,U,d,i. d ≤ yinj i → (L ⊢ i ~ϵ 𝐅*[d]⦃U⦄ → ⊥) → - (∀T. ⇧[i, 1] T ≡ U → ⊥) ∨ - ∃∃I,K,W,j. d ≤ yinj j & j < i & ⇩[j]L ≡ K.ⓑ{I}W & - (K ⊢ i-j-1 ~ϵ 𝐅*[yinj 0]⦃W⦄ → ⊥) & (∀T. ⇧[j, 1] T ≡ U → ⊥). -#L #U #d #i #Hdi #H @(frees_ind … H) -U /3 width=2 by or_introl/ -#U1 #U2 #HU12 #HU2 * -[ #HnU2 elim (cpy_fwd_nlift2_ge … HU12 … HnU2) -HU12 -HnU2 /3 width=2 by or_introl/ - * /5 width=9 by nlift_frees, ex5_4_intro, or_intror/ -| * #I2 #K2 #W2 #j2 #Hdj2 #Hj2i #HLK2 #HnW2 #HnU2 elim (cpy_fwd_nlift2_ge … HU12 … HnU2) -HU12 -HnU2 /4 width=9 by ex5_4_intro, or_intror/ - * #I1 #K1 #W1 #j1 #Hdj1 #Hj12 #HLK1 #HnW1 #HnU1 - lapply (ldrop_conf_ge … HLK1 … HLK2 ?) -HLK2 /2 width=1 by lt_to_le/ - #HK12 lapply (ldrop_inv_drop1_lt … HK12 ?) /2 width=1 by lt_plus_to_minus_r/ -HK12 - #HK12 - @or_intror @(ex5_4_intro … HLK1 … HnU1) -HLK1 -HnU1 /2 width=3 by transitive_lt/ - @(frees_be … HK12 … HnW1) /2 width=1 by arith_k_sn/ -HK12 -HnW1 - >minus_plus in ⊢ (??(?(?%?)?)??→?); >minus_plus in ⊢ (??(?(??%)?)??→?); >arith_b1 /2 width=1 by/ -] -qed-. - -lemma frees_ind_ge: ∀R:relation4 ynat nat lenv term. - (∀d,i,L,U. d ≤ yinj i → (∀T. ⇧[i, 1] T ≡ U → ⊥) → R d i L U) → - (∀d,i,j,I,L,K,W,U. d ≤ yinj j → j < i → ⇩[j]L ≡ K.ⓑ{I}W → (K ⊢ i-j-1 ~ϵ 𝐅*[0]⦃W⦄ → ⊥) → (∀T. ⇧[j, 1] T ≡ U → ⊥) → R 0 (i-j-1) K W → R d i L U) → - ∀d,i,L,U. d ≤ yinj i → (L ⊢ i ~ϵ 𝐅*[d]⦃U⦄ → ⊥) → R d i L U. -#R #IH1 #IH2 #d #i #L #U -generalize in match d; -d generalize in match i; -i -@(f2_ind … rfw … L U) -L -U -#n #IHn #L #U #Hn #i #d #Hdi #H elim (frees_inv_ge … H) -H /3 width=2 by/ --IH1 * #I #K #W #j #Hdj #Hji #HLK #HnW #HnU destruct /4 width=12 by ldrop_fwd_rfw/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cofrees/cofrees_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cofrees/cofrees_lift.etc deleted file mode 100644 index f93f72216..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cofrees/cofrees_lift.etc +++ /dev/null @@ -1,180 +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/substitution/cpys_lift.ma". -include "basic_2/substitution/cofrees.ma". - -(* CONTEXT-SENSITIVE EXCLUSION FROM FREE VARIABLES **************************) - -(* Advanced inversion lemmas ************************************************) - -lemma cofrees_inv_lref_be: ∀L,d,i,j. L ⊢ i ~ϵ 𝐅*[d]⦃#j⦄ → d ≤ yinj j → j < i → - ∀I,K,W. ⇩[j]L ≡ K.ⓑ{I}W → K ⊢ i-j-1 ~ϵ 𝐅*[yinj 0]⦃W⦄. -#L #d #i #j #Hj #Hdj #Hji #I #K #W1 #HLK #W2 #HW12 elim (lift_total W2 0 (j+1)) -#X2 #HWX2 elim (Hj X2) /2 width=7 by cpys_subst_Y2/ -I -L -K -W1 -d -#Z2 #HZX2 elim (lift_div_le … HWX2 (i-j-1) 1 Z2) -HWX2 /2 width=2 by ex_intro/ ->minus_plus minus_plus_plus_l // -| #J #W #U #Hn #d #i #H1 #j #H2 #I #K #V #HLK #Hdj #Hji destruct - elim (cofrees_inv_flat … H1) -H1 #HW #HU - elim (nlift_inv_flat … H2) -H2 [ /3 width=9 by/ ] - #HnU @(IH … HU … HnU … HLK) // (**) (* full auto fails *) -] -qed-. - -(* Advanced properties ******************************************************) - -lemma cofrees_lref_skip: ∀L,d,i,j. j < i → yinj j < d → L ⊢ i ~ϵ 𝐅*[d]⦃#j⦄. -#L #d #i #j #Hji #Hjd #X #H elim (cpys_inv_lref1_Y2 … H) -H -[ #H destruct /3 width=2 by lift_lref_lt, ex_intro/ -| * #I #K #W1 #W2 #Hdj elim (ylt_yle_false … Hdj) -i -I -L -K -W1 -W2 -X // -] -qed. - -lemma cofrees_lref_lt: ∀L,d,i,j. i < j → L ⊢ i ~ϵ 𝐅*[d]⦃#j⦄. -#L #d #i #j #Hij #X #H elim (cpys_inv_lref1_Y2 … H) -H -[ #H destruct /3 width=2 by lift_lref_ge_minus, ex_intro/ -| * #I #K #V1 #V2 #_ #_ #_ #H -I -L -K -V1 -d - elim (lift_split … H i j) /2 width=2 by lt_to_le, ex_intro/ -] -qed. - -lemma cofrees_lref_gt: ∀I,L,K,W,d,i,j. j < i → ⇩[j] L ≡ K.ⓑ{I}W → - K ⊢ (i-j-1) ~ϵ 𝐅*[O]⦃W⦄ → L ⊢ i ~ϵ 𝐅*[d]⦃#j⦄. -#I #L #K #W1 #d #i #j #Hji #HLK #HW1 #X #H elim (cpys_inv_lref1_Y2 … H) -H -[ #H destruct /3 width=2 by lift_lref_lt, ex_intro/ -| * #I0 #K0 #W0 #W2 #Hdj #HLK0 #HW12 #HW2 lapply (ldrop_mono … HLK0 … HLK) -L - #H destruct elim (HW1 … HW12) -I -K -W1 -d - #V2 #HVW2 elim (lift_trans_le … HVW2 … HW2) -W2 // - >minus_plus minus_plus yplus_inj >yminus_Y_inj #T2 #HT12 - lapply (cpys_weak … HT12 (d-yinj e0) (∞) ? ?) /2 width=1 by yle_plus2_to_minus_inj2/ -HT12 - | elim (cpys_inv_lift1_ge … HU12 … HLK … HTU1) // #T2 - ] -| elim (cpys_inv_lift1_be … HU12 … HLK … HTU1) // >yminus_Y_inj #T2 #HT12 - lapply (cpys_weak … HT12 (d-yinj e0) (∞) ? ?) // -HT12 -] --s -L #HT12 #HTU2 -elim (HT1 … HT12) -T1 #V2 #HVT2 -elim (lift_trans_le … HVT2 … HTU2 ?) // (tpss_inv_sort1 … H) -H // -| #I #L1 #K1 #V1 #B #i #HLK1 #_ #IHV1 #L2 #d #e #HL12 #T2 #H - elim (tpss_inv_lref1 … H) -H - [ #H destruct - elim (lt_or_ge i d) #Hdi - [ elim (ltpss_dx_ldrop_conf_le … HL12 … HLK1 ?) -L1 /2 width=2/ #X #H #HLK2 - elim (ltpss_dx_inv_tpss11 … H ?) -H /2 width=1/ -Hdi #K2 #V2 #HK12 #HV12 #H destruct - /3 width=8 by aaa_lref/ (**) (* too slow without trace *) - | elim (lt_or_ge i (d + e)) #Hide - [ elim (ltpss_dx_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HLK2 - elim (ltpss_dx_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K2 #V2 #HK12 #HV12 #H destruct - /3 width=8 by aaa_lref/ (**) (* too slow without trace *) - | -Hdi - lapply (ltpss_dx_ldrop_conf_ge … HL12 … HLK1 ?) -L1 // -Hide - /3 width=8 by aaa_lref/ (**) (* too slow without trace *) - ] - ] - | * #K2 #V2 #W2 #Hdi #Hide #HLK2 #HVW2 #HWT2 - elim (ltpss_dx_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HL2K0 - elim (ltpss_dx_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K0 #V0 #HK12 #HV12 #H destruct - lapply (ldrop_mono … HL2K0 … HLK2) -HL2K0 #H destruct - lapply (ldrop_fwd_ldrop2 … HLK2) -HLK2 #HLK2 - lapply (tpss_trans_eq … HV12 HVW2) -V2 /3 width=7/ - ] -| #a #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #L2 #d #e #HL12 #X #H - elim (tpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct /4 width=4/ -| #a #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #L2 #d #e #HL12 #X #H - elim (tpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct /4 width=4/ -| #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #L2 #d #e #HL12 #X #H - elim (tpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct /3 width=4/ -| #L1 #V1 #T1 #A #_ #_ #IHV1 #IHT1 #L2 #d #e #HL12 #X #H - elim (tpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct /3 width=4/ -] -qed. - -lemma aaa_ltpss_dx_tps_conf: ∀L1,T1,A. L1 ⊢ T1 ⁝ A → - ∀L2,d,e. L1 ▶* [d, e] L2 → - ∀T2. L2 ⊢ T1 ▶ [d, e] T2 → L2 ⊢ T2 ⁝ A. -/3 width=7/ qed. - -lemma aaa_ltpss_dx_conf: ∀L1,T,A. L1 ⊢ T ⁝ A → - ∀L2,d,e. L1 ▶* [d, e] L2 → L2 ⊢ T ⁝ A. -/2 width=7/ qed. - -lemma aaa_tpss_conf: ∀L,T1,A. L ⊢ T1 ⁝ A → - ∀T2,d,e. L ⊢ T1 ▶* [d, e] T2 → L ⊢ T2 ⁝ A. -/2 width=7/ qed. - -lemma aaa_tps_conf: ∀L,T1,A. L ⊢ T1 ⁝ A → - ∀T2,d,e. L ⊢ T1 ▶ [d, e] T2 → L ⊢ T2 ⁝ A. -/2 width=7/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/aaa_ltpss_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/aaa_ltpss_sn.etc deleted file mode 100644 index 4f2a44827..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/aaa_ltpss_sn.etc +++ /dev/null @@ -1,37 +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/unfold/ltpss_sn_alt.ma". -include "basic_2/static/aaa_ltpss_dx.ma". - -(* ATONIC ARITY ASSIGNMENT ON TERMS *****************************************) - -(* Properties about sn parallel unfold **************************************) - -lemma aaa_ltpss_sn_conf: ∀L1,T,A. L1 ⊢ T ⁝ A → - ∀L2,d,e. L1 ⊢ ▶* [d, e] L2 → L2 ⊢ T ⁝ A. -#L1 #T #A #HT #L2 #d #e #HL12 -lapply (ltpss_sn_ltpssa … HL12) -HL12 #HL12 -@(TC_Conf3 … (λL,A. L ⊢ T ⁝ A) … HT ? HL12) /2 width=5/ -qed. - -lemma aaa_ltpss_sn_tpss_conf: ∀L1,T1,A. L1 ⊢ T1 ⁝ A → - ∀L2,d,e. L1 ⊢ ▶* [d, e] L2 → - ∀T2. L2 ⊢ T1 ▶* [d, e] T2 → L2 ⊢ T2 ⁝ A. -/3 width=5/ qed. - -lemma aaa_ltpss_sn_tps_conf: ∀L1,T1,A. L1 ⊢ T1 ⁝ A → - ∀L2,d,e. L1 ⊢ ▶* [d, e] L2 → - ∀T2. L2 ⊢ T1 ▶ [d, e] T2 → L2 ⊢ T2 ⁝ A. -/3 width=5/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cnf_cif.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cnf_cif.etc deleted file mode 100644 index 5a1ae5a5b..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cnf_cif.etc +++ /dev/null @@ -1,106 +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/reducibility/cif.ma". -include "basic_2/reducibility/cnf_lift.ma". - -(* CONTEXT-SENSITIVE NORMAL TERMS *******************************************) - -(* Main properties **********************************************************) - -lemma tps_cif_eq: ∀L,T1,T2,d,e. L ⊢ T1 ▶[d, e] T2 → L ⊢ 𝐈⦃T1⦄ → T1 = T2. -#L #T1 #T2 #d #e #H elim H -L -T1 -T2 -d -e -[ // -| #L #K #V #W #i #d #e #_ #_ #HLK #_ #H -d -e - elim (cif_inv_delta … HLK ?) // -| #L #a #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #H - elim (cif_inv_bind … H) -H #HV1 #HT1 * #H destruct - lapply (IHV12 … HV1) -IHV12 -HV1 #H destruct /3 width=1/ -| #L #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #H - elim (cif_inv_flat … H) -H #HV1 #HT1 #_ #_ /3 width=1/ -] -qed. - -lemma tpss_cif_eq: ∀L,T1,T2,d,e. L ⊢ T1 ▶*[d, e] T2 → L ⊢ 𝐈⦃T1⦄ → T1 = T2. -#L #T1 #T2 #d #e #H @(tpss_ind … H) -T2 // -#T #T2 #_ #HT2 #IHT1 #HT1 -lapply (IHT1 HT1) -IHT1 #H destruct /2 width=5/ -qed. - -lemma tpr_cif_eq: ∀T1,T2. T1 ➡ T2 → ∀L. L ⊢ 𝐈⦃T1⦄ → T1 = T2. -#T1 #T2 #H elim H -T1 -T2 -[ // -| * #V1 #V2 #T1 #T2 #_ #_ #IHV1 #IHT1 #L #H - [ elim (cif_inv_appl … H) -H #HV1 #HT1 #_ - >IHV1 -IHV1 // -HV1 >IHT1 -IHT1 // - | elim (cif_inv_ri2 … H) /2 width=1/ - ] -| #a #V1 #V2 #W #T1 #T2 #_ #_ #_ #_ #L #H - elim (cif_inv_appl … H) -H #_ #_ #H - elim (simple_inv_bind … H) -| #a * #V1 #V2 #T1 #T #T2 #_ #_ #HT2 #IHV1 #IHT1 #L #H - [ lapply (tps_lsubr_trans … HT2 (L.ⓓV2) ?) -HT2 /2 width=1/ #HT2 - elim (cif_inv_bind … H) -H #HV1 #HT1 * #H destruct - lapply (IHV1 … HV1) -IHV1 -HV1 #H destruct - lapply (IHT1 … HT1) -IHT1 #H destruct - lapply (tps_cif_eq … HT2 ?) -HT2 // - | <(tps_inv_refl_SO2 … HT2 ?) -HT2 // - elim (cif_inv_ib2 … H) -H /2 width=1/ /3 width=2/ - ] -| #a #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #_ #L #H - elim (cif_inv_appl … H) -H #_ #_ #H - elim (simple_inv_bind … H) -| #V1 #T1 #T #T2 #_ #_ #_ #L #H - elim (cif_inv_ri2 … H) /2 width=1/ -| #V1 #T1 #T2 #_ #_ #L #H - elim (cif_inv_ri2 … H) /2 width=1/ -] -qed. - -lemma cpr_cif_eq: ∀L,T1,T2. L ⊢ T1 ➡ T2 → L ⊢ 𝐈⦃T1⦄ → T1 = T2. -#L #T1 #T2 * #T0 #HT10 #HT02 #HT1 -lapply (tpr_cif_eq … HT10 … HT1) -HT10 #H destruct /2 width=5/ -qed. - -theorem cif_cnf: ∀L,T. L ⊢ 𝐈⦃T⦄ → L ⊢ 𝐍⦃T⦄. -/3 width=3/ qed. - -(* Note: this property is unusual *) -lemma cnf_crf_false: ∀L,T. L ⊢ 𝐑⦃T⦄ → L ⊢ 𝐍⦃T⦄ → ⊥. -#L #T #H elim H -L -T -[ #L #K #V #i #HLK #H - elim (cnf_inv_delta … HLK H) -| #L #V #T #_ #IHV #H - elim (cnf_inv_appl … H) -H /2 width=1/ -| #L #V #T #_ #IHT #H - elim (cnf_inv_appl … H) -H /2 width=1/ -| #I #L #V #T * #H1 #H2 destruct - [ elim (cnf_inv_zeta … H2) - | elim (cnf_inv_tau … H2) - ] -|5,6: #a * [ elim a ] #L #V #T * #H1 #_ #IH #H2 destruct - [1,3: elim (cnf_inv_abbr … H2) -H2 /2 width=1/ - |*: elim (cnf_inv_abst … H2) -H2 /2 width=1/ - ] -| #a #L #V #W #T #H - elim (cnf_inv_appl … H) -H #_ #_ #H - elim (simple_inv_bind … H) -| #a #L #V #W #T #H - elim (cnf_inv_appl … H) -H #_ #_ #H - elim (simple_inv_bind … H) -] -qed. - -theorem cnf_cif: ∀L,T. L ⊢ 𝐍⦃T⦄ → L ⊢ 𝐈⦃T⦄. -/2 width=4/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpcs_ltpss_dx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpcs_ltpss_dx.etc deleted file mode 100644 index 80f418b08..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpcs_ltpss_dx.etc +++ /dev/null @@ -1,50 +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/computation/cprs_ltpss_dx.ma". -include "basic_2/equivalence/cpcs_cpcs.ma". - -(* CONTEXT-SENSITIVE PARALLEL EQUIVALENCE ON TERMS **************************) - -(* Properties concerning dx partial unfold on local environments ************) - -lemma cpcs_ltpss_dx_conf: ∀L1,L2,d,e. L1 ▶* [d, e] L2 → - ∀T1,T2. L1 ⊢ T1 ⬌* T2 → L2 ⊢ T1 ⬌* T2. -#L1 #L2 #d #e #HL12 #T1 #T2 #H -elim (cpcs_inv_cprs … H) -H #T #HT1 #HT2 -elim (cprs_ltpss_dx_conf … HT1 … HL12) -HT1 #U1 #HTU1 #H1 -elim (cprs_ltpss_dx_conf … HT2 … HL12) -L1 #U2 #HTU2 #H2 -elim (tpss_conf_eq … H1 … H2) -T #U #HU1 #HU2 -lapply (cprs_tpss_trans … HTU1 … HU1) -U1 -lapply (cprs_tpss_trans … HTU2 … HU2) -U2 /2 width=3/ -qed-. - -lemma cpcs_ltpss_dx_tpss_conf: ∀L1,L2,d,e. L1 ▶* [d, e] L2 → - ∀T,T2. L1 ⊢ T ⬌* T2 → - ∀T1. L2 ⊢ T ▶* [d, e] T1 → - L2 ⊢ T1 ⬌* T2. -#L1 #L2 #d #e #HL12 #T #T2 #HT2 #T1 #HT1 -lapply (cpcs_ltpss_dx_conf … HL12 … HT2) -L1 #HT2 -lapply (cpcs_tpss_conf … HT1 … HT2) -T // -qed-. - -lemma cpcs_ltpss_dx_tpss2_conf: ∀L1,L2,d,e. L1 ▶* [d, e] L2 → - ∀T1,T2. L1 ⊢ T1 ⬌* T2 → - ∀T3. L2 ⊢ T1 ▶* [d, e] T3 → - ∀T4. L2 ⊢ T2 ▶* [d, e] T4 → - L2 ⊢ T3 ⬌* T4. -#L1 #L2 #d #e #HL12 #T1 #T2 #HT12 #T3 #HT13 #T4 #HT24 -lapply (cpcs_ltpss_dx_tpss_conf … HL12 … HT12 … HT13) -L1 -T1 #HT32 -lapply (cpcs_tpss_strap1 … HT32 … HT24) -T2 // -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpcs_ltpss_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpcs_ltpss_sn.etc deleted file mode 100644 index 5bf1ed57f..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpcs_ltpss_sn.etc +++ /dev/null @@ -1,28 +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/equivalence/cpcs_ltpss_dx.ma". - -(* CONTEXT-SENSITIVE PARALLEL EQUIVALENCE ON TERMS **************************) - -(* Properties concerning sn partial unfold on local environments ************) - -lemma cpcs_ltpss_sn_conf: ∀L1,L2,d,e. L1 ⊢ ▶* [d, e] L2 → - ∀T1,T2. L1 ⊢ T1 ⬌* T2 → L2 ⊢ T1 ⬌* T2. -#L1 #L2 #d #e #H -lapply (ltpss_sn_ltpssa … H) -H #H @(ltpssa_ind … H) -L2 // -#L #L2 #_ #HL2 #IHL1 #T1 #U1 #HTU1 -lapply (IHL1 … HTU1) -IHL1 -HTU1 #HTU1 -lapply (cpcs_ltpss_dx_conf … HL2 … HTU1) -HTU1 -HL2 // -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpr.etc deleted file mode 100644 index d82299c38..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpr.etc +++ /dev/null @@ -1,111 +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/unfold/tpss.ma". -include "basic_2/reducibility/tpr.ma". - -(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS ****************************) - -(* Basic_1: includes: pr2_delta1 *) -definition cpr: lenv → relation term ≝ - λL,T1,T2. ∃∃T. T1 ➡ T & L ⊢ T ▶* [0, |L|] T2. - -interpretation - "context-sensitive parallel reduction (term)" - 'PRed L T1 T2 = (cpr L T1 T2). - -(* Basic properties *********************************************************) - -lemma cpr_intro: ∀L,T1,T,T2,d,e. T1 ➡ T → L ⊢ T ▶* [d, e] T2 → L ⊢ T1 ➡ T2. -/3 width=5/ qed-. - -(* Basic_1: was by definition: pr2_free *) -lemma cpr_tpr: ∀T1,T2. T1 ➡ T2 → ∀L. L ⊢ T1 ➡ T2. -/2 width=3/ qed. - -lemma cpr_tpss: ∀L,T1,T2,d,e. L ⊢ T1 ▶* [d, e] T2 → L ⊢ T1 ➡ T2. -/3 width=5/ qed. - -lemma cpr_refl: ∀L,T. L ⊢ T ➡ T. -/2 width=1/ qed. - -(* Note: new property *) -(* Basic_1: was only: pr2_thin_dx *) -lemma cpr_flat: ∀I,L,V1,V2,T1,T2. - L ⊢ V1 ➡ V2 → L ⊢ T1 ➡ T2 → L ⊢ ⓕ{I} V1. T1 ➡ ⓕ{I} V2. T2. -#I #L #V1 #V2 #T1 #T2 * #V #HV1 #HV2 * /3 width=5/ -qed. - -lemma cpr_cast: ∀L,V,T1,T2. - L ⊢ T1 ➡ T2 → L ⊢ ⓝV. T1 ➡ T2. -#L #V #T1 #T2 * /3 width=3/ -qed. - -(* Note: it does not hold replacing |L1| with |L2| *) -(* Basic_1: was only: pr2_change *) -lemma cpr_lsubr_trans: ∀L1,T1,T2. L1 ⊢ T1 ➡ T2 → - ∀L2. L2 ⊑ [0, |L1|] L1 → L2 ⊢ T1 ➡ T2. -#L1 #T1 #T2 * #T #HT1 #HT2 #L2 #HL12 -lapply (tpss_lsubr_trans … HT2 … HL12) -HT2 -HL12 /3 width=4/ -qed. - -(* Basic inversion lemmas ***************************************************) - -(* Basic_1: was: pr2_gen_csort *) -lemma cpr_inv_atom: ∀T1,T2. ⋆ ⊢ T1 ➡ T2 → T1 ➡ T2. -#T1 #T2 * #T #HT normalize #HT2 -<(tpss_inv_refl_O2 … HT2) -HT2 // -qed-. - -(* Basic_1: was: pr2_gen_sort *) -lemma cpr_inv_sort1: ∀L,T2,k. L ⊢ ⋆k ➡ T2 → T2 = ⋆k. -#L #T2 #k * #X #H ->(tpr_inv_atom1 … H) -H #H ->(tpss_inv_sort1 … H) -H // -qed-. - -(* Basic_1: was: pr2_gen_cast *) -lemma cpr_inv_cast1: ∀L,V1,T1,U2. L ⊢ ⓝV1. T1 ➡ U2 → ( - ∃∃V2,T2. L ⊢ V1 ➡ V2 & L ⊢ T1 ➡ T2 & - U2 = ⓝV2. T2 - ) ∨ L ⊢ T1 ➡ U2. -#L #V1 #T1 #U2 * #X #H #HU2 -elim (tpr_inv_cast1 … H) -H /3 width=3/ -* #V #T #HV1 #HT1 #H destruct -elim (tpss_inv_flat1 … HU2) -HU2 #V2 #T2 #HV2 #HT2 #H destruct /4 width=5/ -qed-. - -(* Basic forward lemmas *****************************************************) - -lemma cpr_fwd_bind1_minus: ∀I,L,V1,T1,T. L ⊢ -ⓑ{I}V1.T1 ➡ T → ∀b. - ∃∃V2,T2. L ⊢ ⓑ{b,I}V1.T1 ➡ ⓑ{b,I}V2.T2 & - T = -ⓑ{I}V2.T2. -#I #L #V1 #T1 #T * #X #H1 #H2 #b -elim (tpr_fwd_bind1_minus … H1 b) -H1 #V0 #T0 #HT10 #H destruct -elim (tpss_inv_bind1 … H2) -H2 #V2 #T2 #HV02 #HT02 #H destruct /4 width=5/ -qed-. - -lemma cpr_fwd_shift1: ∀L,L1,T1,T. L ⊢ L1 @@ T1 ➡ T → - ∃∃L2,T2. |L1| = |L2| & T = L2 @@ T2. -#L #L1 #T1 #T * #X #H1 #H2 -elim (tpr_fwd_shift1 … H1) -H1 #L0 #T0 #HL10 #H destruct -elim (tpss_fwd_shift1 … H2) -H2 #L2 #T2 #HL02 #H destruct /2 width=4/ -qed-. - -(* Basic_1: removed theorems 6: - pr2_head_2 pr2_cflat pr2_gen_cflat clear_pr2_trans - pr2_gen_ctail pr2_ctail - Basic_1: removed local theorems 3: - pr2_free_free pr2_free_delta pr2_delta_delta -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpr_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpr_aaa.etc deleted file mode 100644 index 7c1273334..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpr_aaa.etc +++ /dev/null @@ -1,25 +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/static/aaa_ltpss_sn.ma". -include "basic_2/reducibility/ltpr_aaa.ma". -include "basic_2/reducibility/cpr.ma". - -(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS ****************************) - -(* Properties about atomic arity assignment on terms ************************) - -lemma aaa_cpr_conf: ∀L,T1,A. L ⊢ T1 ⁝ A → ∀T2. L ⊢ T1 ➡ T2 → L ⊢ T2 ⁝ A. -#L #T1 #A #HT1 #T2 * /3 width=5/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpr_cpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpr_cpr.etc deleted file mode 100644 index d231c849f..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpr_cpr.etc +++ /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/reducibility/tpr_tpr.ma". -include "basic_2/reducibility/cpr.ma". - -(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS ****************************) - -(* Advanced properties ******************************************************) - -lemma cpr_bind_sn: ∀a,I,L,V1,V2,T1,T2. L ⊢ V1 ➡ V2 → T1 ➡ T2 → - L ⊢ ⓑ{a,I} V1. T1 ➡ ⓑ{a,I} V2. T2. -#a #I #L #V1 #V2 #T1 #T2 * #V #HV1 #HV2 #HT12 -@ex2_intro [2: @(tpr_delta … HV1 HT12) | skip ] /2 width=3/ (* /3 width=5/ is too slow *) -qed. - -(* Basic_1: was only: pr2_gen_cbind *) -lemma cpr_bind_dx: ∀a,I,L,V1,V2,T1,T2. V1 ➡ V2 → L. ⓑ{I} V2 ⊢ T1 ➡ T2 → - L ⊢ ⓑ{a,I} V1. T1 ➡ ⓑ{a,I} V2. T2. -#a #I #L #V1 #V2 #T1 #T2 #HV12 * #T #HT1 normalize #HT2 -elim (tpss_split_up … HT2 1 ? ?) -HT2 // #T0 (tpr_inv_atom1 … H) -H #H -elim (tpss_inv_lref1 … H) -H /2 width=1/ -* /3 width=6/ -qed-. - -(* Basic_1: was pr2_gen_abbr *) -lemma cpr_inv_abbr1: ∀a,L,V1,T1,U2. L ⊢ ⓓ{a}V1. T1 ➡ U2 → - (∃∃V,V2,T2. V1 ➡ V & L ⊢ V ▶* [O, |L|] V2 & - L. ⓓV ⊢ T1 ➡ T2 & - U2 = ⓓ{a}V2. T2 - ) ∨ - ∃∃T2. L.ⓓV1 ⊢ T1 ➡ T2 & ⇧[0,1] U2 ≡ T2 & a = true. -#a #L #V1 #T1 #Y * #X #H1 #H2 -elim (tpr_inv_abbr1 … H1) -H1 * -[ #V #T #T0 #HV1 #HT1 #HT0 #H destruct - elim (tpss_inv_bind1 … H2) -H2 #V2 #T2 #HV2 #HT02 #H destruct - lapply (tps_lsubr_trans … HT0 (L. ⓓV) ?) -HT0 /2 width=1/ #HT0 - lapply (tps_weak_full … HT0) -HT0 #HT0 - lapply (tpss_lsubr_trans … HT02 (L. ⓓV) ?) -HT02 /2 width=1/ #HT02 - lapply (tpss_weak_full … HT02) -HT02 #HT02 - lapply (tpss_strap2 … HT0 HT02) -T0 /4 width=7/ -| #T2 #HT12 #HXT2 #H destruct - elim (lift_total Y 0 1) #Z #HYZ - lapply (tpss_lift_ge … H2 (L.ⓓV1) … HXT2 … HYZ) -X // /2 width=1/ #H - lapply (cpr_intro … HT12 … H) -T2 /3 width=3/ -] -qed-. - -(* Basic_1: was: pr2_gen_abst *) -lemma cpr_inv_abst1: ∀a,L,V1,T1,U2. L ⊢ ⓛ{a}V1. T1 ➡ U2 → ∀I,W. - ∃∃V2,T2. L ⊢ V1 ➡ V2 & L. ⓑ{I} W ⊢ T1 ➡ T2 & U2 = ⓛ{a}V2. T2. -#a #L #V1 #T1 #Y * #X #H1 #H2 #I #W -elim (tpr_inv_abst1 … H1) -H1 #V #T #HV1 #HT1 #H destruct -elim (tpss_inv_bind1 … H2) -H2 #V2 #T2 #HV2 #HT2 #H destruct -lapply (tpss_lsubr_trans … HT2 (L. ⓑ{I} W) ?) -HT2 /2 width=1/ /4 width=5/ -qed-. - -(* Basic_1: was pr2_gen_appl *) -lemma cpr_inv_appl1: ∀L,V1,U0,U2. L ⊢ ⓐV1. U0 ➡ U2 → - ∨∨ ∃∃V2,T2. L ⊢ V1 ➡ V2 & L ⊢ U0 ➡ T2 & - U2 = ⓐV2. T2 - | ∃∃a,V2,W,T1,T2. L ⊢ V1 ➡ V2 & L. ⓓV2 ⊢ T1 ➡ T2 & - U0 = ⓛ{a}W. T1 & - U2 = ⓓ{a}V2. T2 - | ∃∃a,V2,V,W1,W2,T1,T2. L ⊢ V1 ➡ V2 & L ⊢ W1 ➡ W2 & L. ⓓW2 ⊢ T1 ➡ T2 & - ⇧[0,1] V2 ≡ V & - U0 = ⓓ{a}W1. T1 & - U2 = ⓓ{a}W2. ⓐV. T2. -#L #V1 #U0 #Y * #X #H1 #H2 -elim (tpr_inv_appl1 … H1) -H1 * -[ #V #U #HV1 #HU0 #H destruct - elim (tpss_inv_flat1 … H2) -H2 #V2 #U2 #HV2 #HU2 #H destruct /4 width=5/ -| #a #V #W #T0 #T #HV1 #HT0 #H #H1 destruct - elim (tpss_inv_bind1 … H2) -H2 #V2 #T2 #HV2 #HT2 #H destruct - lapply (tpss_weak … HT2 0 (|L|+1) ? ?) -HT2 // /4 width=9/ -| #a #V0 #V #W #W0 #T #T0 #HV10 #HW0 #HT0 #HV0 #H #H1 destruct - elim (tpss_inv_bind1 … H2) -H2 #W2 #X #HW02 #HX #HY destruct - elim (tpss_inv_flat1 … HX) -HX #V2 #T2 #HV2 #HT2 #H destruct - elim (tpss_inv_lift1_ge … HV2 … HV0 ?) -V // [3: /2 width=1/ |2: skip ] #V (ltpr_fwd_length … HL12) in HT2; #HT2 -elim (ltpr_tpr_tpss_conf … HL12 … HT2) -L1 /3 width=3/ -qed. - -lemma cpr_ltpr_conf_tpss: ∀L1,L2. L1 ➡ L2 → ∀T1,T2. L1 ⊢ T1 ➡ T2 → - ∀d,e,U1. L1 ⊢ T1 ▶* [d, e] U1 → - ∃∃U2. L2 ⊢ U1 ➡ U2 & L2 ⊢ T2 ➡ U2. -#L1 #L2 #HL12 #T1 #T2 #HT12 #d #e #U1 #HTU1 -elim (cpr_ltpr_conf_eq … HT12 … HL12) -HT12 #T #HT1 #HT2 -elim (cpr_tpss_ltpr … HL12 … HT1 … HTU1) -L1 -HT1 #U2 #HU12 #HTU2 -lapply (tpss_weak_full … HTU2) -HTU2 #HTU2 /3 width=5/ (**) (* /4 width=5/ is too slow *) -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpr_ltpss_dx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpr_ltpss_dx.etc deleted file mode 100644 index 5d90e6865..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpr_ltpss_dx.etc +++ /dev/null @@ -1,28 +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/unfold/ltpss_dx_ltpss_dx.ma". -include "basic_2/reducibility/cpr.ma". - -(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS ****************************) - -(* Properties concerning dx partial unfold on local environments ************) - -lemma ltpss_dx_cpr_conf: ∀L1,T,U1. L1 ⊢ T ➡ U1 → - ∀L2,d,e. L1 ▶* [d, e] L2 → - ∃∃U2. L2 ⊢ T ➡ U2 & L2 ⊢ U1 ▶* [d, e] U2. -#L1 #T #U1 * #U #HTU #HU1 #L2 #d #e #HL12 -lapply (ltpss_dx_fwd_length … HL12) #H >H in HU1; -H #HU1 -elim (ltpss_dx_tpss_conf … HU1 … HL12) -L1 /3 width=3/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpr_ltpss_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpr_ltpss_sn.etc deleted file mode 100644 index f946e4cfb..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpr_ltpss_sn.etc +++ /dev/null @@ -1,35 +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/unfold/ltpss_sn_alt.ma". -include "basic_2/reducibility/cpr.ma". - -(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS ****************************) - -(* Properties concerning sn partial unfold on local environments ************) - -lemma ltpss_sn_cpr_trans: ∀L1,L2,d,e. L1 ⊢ ▶* [d, e] L2 → - ∀T1,T2. L2 ⊢ T1 ➡ T2 → L1 ⊢ T1 ➡ T2. -#L1 #L2 #d #e #HL12 #T1 #T2 * -lapply (ltpss_sn_weak_full … HL12) -<(ltpss_sn_fwd_length … HL12) -HL12 /3 width=5/ -qed. - -lemma ltpss_sn_cpr_conf: ∀L1,T,U1. L1 ⊢ T ➡ U1 → - ∀L2,d,e. L1 ⊢ ▶* [d, e] L2 → - ∃∃U2. L2 ⊢ T ➡ U2 & L1 ⊢ U1 ▶* [d, e] U2. -#L1 #T #U1 * #U #HTU #HU1 #L2 #d #e #HL12 -lapply (ltpss_sn_fwd_length … HL12) #H >H in HU1; -H #HU1 -elim (ltpss_sn_tpss_conf … HU1 … HL12) -HU1 -HL12 /3 width=3/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpr_tpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpr_tpss.etc deleted file mode 100644 index d8c7225d9..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cpr_tpss.etc +++ /dev/null @@ -1,39 +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/reducibility/ltpr_tpss.ma". -include "basic_2/reducibility/cpr.ma". - -(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS ****************************) - -(* Properties on partial unfold for terms ***********************************) - -lemma cpr_tpss_trans: ∀L,T1,T. L ⊢ T1 ➡ T → - ∀T2,d,e. L ⊢ T ▶* [d, e] T2 → L ⊢ T1 ➡ T2. -#L #T1 #T * #T0 #HT10 #HT0 #T2 #d #e #HT2 -lapply (tpss_weak_full … HT2) -HT2 #HT2 -lapply (tpss_trans_eq … HT0 HT2) -T /2 width=3/ -qed. - -lemma cpr_tps_trans: ∀L,T1,T. L ⊢ T1 ➡ T → - ∀T2,d,e. L ⊢ T ▶ [d, e] T2 → L ⊢ T1 ➡ T2. -/3 width=5/ qed. - -lemma cpr_tpss_conf: ∀L,T0,T1. L ⊢ T0 ➡ T1 → - ∀T2,d,e. L ⊢ T0 ▶* [d, e] T2 → - ∃∃T. L ⊢ T1 ▶* [d, e] T & L ⊢ T2 ➡ T. -#L #T0 #T1 * #U0 #HTU0 #HU0T1 #T2 #d #e #HT02 -elim (tpr_tpss_conf … HTU0 … HT02) -T0 #T0 #HT20 #HUT0 -elim (tpss_conf_eq … HU0T1 … HUT0) -U0 /3 width=5/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cprs_ltpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cprs_ltpr.etc deleted file mode 100644 index 2682a7609..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cprs_ltpr.etc +++ /dev/null @@ -1,32 +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/reducibility/cpr_ltpr.ma". -include "basic_2/computation/cprs.ma". - -(* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************) - -(* Properties concerning parallel unfold on terms ***************************) - -(* Basic_1: was only: pr3_subst1 *) -lemma cprs_tpss_ltpr: ∀L1,T1,U1,d,e. L1 ⊢ T1 ▶* [d, e] U1 → - ∀L2. L1 ➡ L2 → ∀T2. L2 ⊢ T1 ➡* T2 → - ∃∃U2. L2 ⊢ U1 ➡* U2 & L2 ⊢ T2 ▶* [d, e] U2. -#L1 #T1 #U1 #d #e #HTU1 #L2 #HL12 #T2 #HT12 elim HT12 -T2 -[ #T2 #HT12 - elim (cpr_tpss_ltpr … HL12 … HT12 … HTU1) -L1 -T1 /3 width=3/ -| #T #T2 #_ #HT2 * #U #HU1 #HTU - elim (cpr_tpss_ltpr … HT2 … HTU) -L1 -T // /3 width=3/ -] -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cprs_ltpss_dx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cprs_ltpss_dx.etc deleted file mode 100644 index 7f8618007..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cprs_ltpss_dx.etc +++ /dev/null @@ -1,52 +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/reducibility/cpr_ltpss_dx.ma". -include "basic_2/computation/cprs_tpss.ma". - -(* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************) - -(* Properties concerning dx partial unfold on local environments ************) - -lemma cprs_ltpss_dx_conf: ∀L1,T,U1. L1 ⊢ T ➡* U1 → - ∀L2,d,e. L1 ▶* [d, e] L2 → - ∃∃U2. L2 ⊢ T ➡* U2 & L2 ⊢ U1 ▶* [d, e] U2. -#L1 #T #U1 #H @(cprs_ind … H) -U1 /2 width=3/ -#T1 #U1 #_ #HTU1 #IHT1 #L2 #d #e #HL12 -elim (IHT1 … HL12) -IHT1 #U #HTU #HT1U -elim (ltpss_dx_cpr_conf … HTU1 … HL12) -L1 #U0 #HT1U0 #HU10 -elim (cpr_tpss_conf … HT1U0 … HT1U) -T1 #U2 #HU02 #HU2 -lapply (tpss_trans_eq … HU10 HU02) -U0 /3 width=3/ -qed-. - -lemma cprs_ltpss_dx_tpss_conf: ∀L1,T1,U1. L1 ⊢ T1 ➡* U1 → - ∀L2,d,e. L1 ▶* [d, e] L2 → - ∀T2. L2 ⊢ T1 ▶* [d, e] T2 → - ∃∃U2. L2 ⊢ T2 ➡* U2 & L2 ⊢ U1 ▶* [d, e] U2. -#L1 #T1 #U1 #HTU1 #L2 #d #e #HL12 #T2 #HT12 -elim (cprs_ltpss_dx_conf … HTU1 … HL12) -L1 #U #HT1U #HU1 -elim (cprs_tpss_conf … HT1U … HT12) -T1 #T #HUT #HT2 -lapply (tpss_trans_eq … HU1 HUT) -U /2 width=3/ -qed-. - -lemma cprs_ltpss_dx_tpss2_conf: ∀L1,T1,U1. L1 ⊢ T1 ➡* U1 → - ∀L2,d,e. L1 ▶* [d, e] L2 → - ∀T2. L2 ⊢ T1 ▶* [d, e] T2 → - ∀U2. L2 ⊢ U1 ▶* [d, e] U2 → - ∃∃U. L2 ⊢ T2 ➡* U & L2 ⊢ U2 ▶* [d, e] U. -#L1 #T1 #U1 #HTU1 #L2 #d #e #HL12 #T2 #HT12 #U2 #HU12 -elim (cprs_ltpss_dx_tpss_conf … HTU1 … HL12 … HT12) -L1 -T1 #U #HT2U #HU1 -elim (tpss_conf_eq … HU12 … HU1) -U1 #U0 #HU20 #HU0 -lapply (cprs_tpss_trans … HT2U … HU0) -U /2 width=3/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cprs_ltpss_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cprs_ltpss_sn.etc deleted file mode 100644 index 32009d11d..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cprs_ltpss_sn.etc +++ /dev/null @@ -1,34 +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/unfold/ltpss_sn_alt.ma". -include "basic_2/computation/cprs_ltpss_dx.ma". - -(* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************) - -(* Properties concerning sn partial unfold on local environments ************) - -lemma cprs_ltpss_sn_conf: ∀L1,L2,d,e. L1 ⊢ ▶* [d, e] L2 → - ∀T,U1. L1 ⊢ T ➡* U1 → - ∃∃U2. L2 ⊢ T ➡* U2 & L1 ⊢ U1 ▶* [d, e] U2. -#L1 #L2 #d #e #H -lapply (ltpss_sn_ltpssa … H) -H #H @(ltpssa_ind … H) -L2 /2 width=3/ -#L #L2 #HL1 #HL2 #IHL1 #T #U1 #HTU1 -lapply (ltpssa_ltpss_sn … HL1) -HL1 #HL1 -lapply (ltpss_sn_dx_trans_eq … HL1 … HL2) -HL1 #HL12 -elim (IHL1 … HTU1) -IHL1 -HTU1 #U #HTU #HU1 -elim (cprs_ltpss_dx_conf … HTU … HL2) -HTU -HL2 #U2 #HTU2 #HU2 -lapply (ltpss_sn_tpss_trans_eq … HU2 … HL12) -HU2 -HL12 #HU2 -lapply (tpss_trans_eq … HU1 HU2) -U /2 width=3/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cprs_tpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cprs_tpss.etc deleted file mode 100644 index 0c575ae02..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/cprs_tpss.etc +++ /dev/null @@ -1,38 +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/reducibility/cpr_tpss.ma". -include "basic_2/computation/cprs.ma". - -(* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************) - -(* Properties on partial unfold for terms ***********************************) - -lemma cprs_tpss_trans: ∀L,T1,T. L ⊢ T1 ➡* T → - ∀T2,d,e. L ⊢ T ▶* [d, e] T2 → L ⊢ T1 ➡* T2. -#L #T1 #T #H @(cprs_ind … H) -T /2 width=3/ /3 width=5/ -qed. - -lemma cprs_tps_trans: ∀L,T1,T. L ⊢ T1 ➡* T → - ∀T2,d,e. L ⊢ T ▶ [d, e] T2 → L ⊢ T1 ➡* T2. -/3 width=5 by inj, cprs_tpss_trans/ qed. (**) (* auto too slow without trace *) - -lemma cprs_tpss_conf: ∀L,T0,T1. L ⊢ T0 ➡* T1 → - ∀T2,d,e. L ⊢ T0 ▶* [d, e] T2 → - ∃∃T. L ⊢ T1 ▶* [d, e] T & L ⊢ T2 ➡* T. -#L #T0 #T1 #H @(cprs_ind … H) -T1 /2 width=3/ -#T #T1 #_ #HT1 #IHT0 #T2 #d #e #HT02 -elim (IHT0 … HT02) -T0 #T0 #HT0 #HT20 -elim (cpr_tpss_conf … HT1 … HT0) -T /3 width=5/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/dxprs_ltpss_dx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/dxprs_ltpss_dx.etc deleted file mode 100644 index 8e3260dd4..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/dxprs_ltpss_dx.etc +++ /dev/null @@ -1,50 +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/unwind/sstas_ltpss_dx.ma". -include "basic_2/computation/cprs_ltpss_dx.ma". -include "basic_2/computation/dxprs.ma". - -(* DECOMPOSED EXTENDED PARALLEL COMPUTATION ON TERMS ************************) - -(* Properties about dx parallel unfold **************************************) - -lemma dxprs_ltpss_dx_conf: ∀h,g,L1,T,U1. ⦃h, L1⦄ ⊢ T •*➡*[g] U1 → - ∀L2,d,e. L1 ▶* [d, e] L2 → - ∃∃U2. ⦃h, L2⦄ ⊢ T •*➡*[g] U2 & L2 ⊢ U1 ▶* [d, e] U2. -#h #g #L1 #T #U1 * #U #HTU #HU1 #L2 #d #e #HL12 -elim (sstas_ltpss_dx_conf … HTU … HL12) -HTU #U0 #HTU0 #HU0 -elim (cprs_ltpss_dx_conf … HU1 … HL12) -L1 #U2 #HU2 #HU12 -elim (cprs_tpss_conf … HU2 … HU0) -U #U #HU2 #HU0 -lapply (tpss_trans_eq … HU12 HU2) -U2 /3 width=3/ -qed-. - -lemma dxprs_tpss_conf: ∀h,g,L,T1,U1. ⦃h, L⦄ ⊢ T1 •*➡*[g] U1 → - ∀T2,d,e. L ⊢ T1 ▶* [d, e] T2 → - ∃∃U2. ⦃h, L⦄ ⊢ T2 •*➡*[g] U2 & L ⊢ U1 ▶* [d, e] U2. -#h #g #L #T1 #U1 * #W1 #HTW1 #HWU1 #T2 #d #e #HT12 -elim (sstas_tpss_conf … HTW1 … HT12) -T1 #W2 #HTW2 #HW12 -elim (cprs_tpss_conf … HWU1 … HW12) -W1 /3 width=3/ -qed-. - -lemma dxprs_ltpss_dx_tpss_conf: ∀h,g,L1,T1,U1. ⦃h, L1⦄ ⊢ T1 •*➡*[g] U1 → - ∀L2,d,e. L1 ▶* [d, e] L2 → - ∀T2. L2 ⊢ T1 ▶* [d, e] T2 → - ∃∃U2. ⦃h, L2⦄ ⊢ T2 •*➡*[g] U2 & - L2 ⊢ U1 ▶* [d, e] U2. -#h #g #L1 #T1 #U1 #HTU1 #L2 #d #e #HL12 #T2 #HT12 -elim (dxprs_ltpss_dx_conf … HTU1 … HL12) -L1 #U #HT1U #HU1 -elim (dxprs_tpss_conf … HT1U … HT12) -T1 #U2 #HTU2 #HU2 -lapply (tpss_trans_eq … HU1 HU2) -U /2 width=3/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/dxprs_ltpss_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/dxprs_ltpss_sn.etc deleted file mode 100644 index 553e4658b..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/dxprs_ltpss_sn.etc +++ /dev/null @@ -1,34 +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/unfold/ltpss_sn_alt.ma". -include "basic_2/computation/dxprs_ltpss_dx.ma". - -(* DECOMPOSED EXTENDED PARALLEL COMPUTATION ON TERMS ************************) - -(* Properties about sn parallel unfold **************************************) - -lemma dxprs_ltpss_sn_conf: ∀h,g,L1,L2,d,e. L1 ⊢ ▶* [d, e] L2 → - ∀T,U1. ⦃h, L1⦄ ⊢ T •*➡*[g] U1 → - ∃∃U2. ⦃h, L2⦄ ⊢ T •*➡*[g] U2 & L1 ⊢ U1 ▶* [d, e] U2. -#h #g #L1 #L2 #d #e #H -lapply (ltpss_sn_ltpssa … H) -H #H @(ltpssa_ind … H) -L2 [ /2 width=3/ ] -#L #L2 #HL1 #HL2 #IHL1 #T #U1 #HTU1 -lapply (ltpssa_ltpss_sn … HL1) -HL1 #HL1 -lapply (ltpss_sn_dx_trans_eq … HL1 … HL2) -HL1 #HL12 -elim (IHL1 … HTU1) -IHL1 -HTU1 #U #HTU #HU1 -elim (dxprs_ltpss_dx_conf … HTU … HL2) -HTU -HL2 #U2 #HTU2 #HU2 -lapply (ltpss_sn_tpss_trans_eq … HU2 … HL12) -HU2 -HL12 #HU2 -lapply (tpss_trans_eq … HU1 HU2) -U /2 width=3/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ldrop_lbotr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ldrop_lbotr.etc deleted file mode 100644 index df6b2c11e..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ldrop_lbotr.etc +++ /dev/null @@ -1,94 +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/relocation/lsubr_lbotr.ma". -include "basic_2/relocation/ldrop_ldrop.ma". - -(* DROPPING *****************************************************************) - -(* Inversion lemmas about local env. full refinement for substitution *******) - -(* Note: ldrop_ldrop not needed *) -lemma lbotr_inv_ldrop: ∀I,L,K,V,i. ⇩[0, i] L ≡ K. ⓑ{I}V → ∀d,e. ⊒[d, e] L → - d ≤ i → i < d + e → I = Abbr. -#I #L elim L -L -[ #K #V #i #H - lapply (ldrop_inv_atom1 … H) -H #H destruct -| #L #J #W #IHL #K #V #i #H - elim (ldrop_inv_O1 … H) -H * - [ -IHL #H1 #H2 #d #e #HL #Hdi #Hide destruct - lapply (le_n_O_to_eq … Hdi) -Hdi #H destruct - lapply (HL … (L.ⓓW) ?) -HL /2 width=1/ #H - elim (lsubr_inv_abbr2 … H ?) -H // -Hide #K #_ #H destruct // - | #Hi #HLK #d @(nat_ind_plus … d) -d - [ #e #H #_ #Hide - elim (lbotr_inv_bind … H ?) -H [2: /2 width=2/ ] #HL #H destruct - @(IHL … HLK … HL) -IHL -HLK -HL // /2 width=1/ - | #d #_ #e #H #Hdi #Hide - lapply (lbotr_inv_skip … H ?) -H // #HL - @(IHL … HLK … HL) -IHL -HLK -HL /2 width=1/ - ] - ] -] -qed-. - -(* Properties about local env. full refinement for substitution *************) - -(* Note: ldrop_ldrop not needed *) -lemma lbotr_ldrop: ∀L,d,e. - (∀I,K,V,i. d ≤ i → i < d + e → ⇩[0, i] L ≡ K. ⓑ{I}V → I = Abbr) → - ⊒[d, e] L. -#L elim L -L // -#L #I #V #IHL #d @(nat_ind_plus … d) -d -[ #e @(nat_ind_plus … e) -e // - #e #_ #H0 - >(H0 I L V 0 ? ? ?) // - /5 width=6 by lbotr_abbr, ldrop_ldrop, lt_minus_to_plus_r/ (**) (* auto now too slow without trace *) -| #d #_ #e #H0 - /5 width=6 by lbotr_skip, ldrop_ldrop, le_S_S, lt_minus_to_plus_r/ (**) (* auto now too slow without trace *) -] -qed. - -lemma lbotr_ldrop_trans_le: ∀L1,L2,d,e. ⇩[d, e] L1 ≡ L2 → ∀dd,ee. ⊒[dd, ee] L1 → - dd + ee ≤ d → ⊒[dd, ee] L2. -#L1 #L2 #d #e #HL12 #dd #ee #HL1 #Hddee -@lbotr_ldrop #I #K2 #V2 #i #Hddi #Hiddee #HLK2 -lapply (lt_to_le_to_lt … Hiddee Hddee) -Hddee #Hid -elim (ldrop_trans_le … HL12 … HLK2 ?) -L2 /2 width=2/ #X #HLK1 #H -elim (ldrop_inv_skip2 … H ?) -H /2 width=1/ -Hid #K1 #V1 #HK12 #HV21 #H destruct -@(lbotr_inv_ldrop … HLK1 … HL1) -L1 -K1 -V1 // -qed. - -lemma lbotr_ldrop_trans_be_up: ∀L1,L2,d,e. ⇩[d, e] L1 ≡ L2 → - ∀dd,ee. ⊒[dd, ee] L1 → - dd ≤ d + e → d + e ≤ dd + ee → - ⊒[d, dd + ee - d - e] L2. -#L1 #L2 #d #e #HL12 #dd #ee #HL1 #Hdde #Hddee -@lbotr_ldrop #I #K2 #V2 #i #Hdi #Hiddee #HLK2 -lapply (transitive_le ? ? (i+e)… Hdde ?) -Hdde /2 width=1/ #Hddie ->commutative_plus in Hiddee; >minus_minus_comm commutative_plus // -Hddie /2 width=1/ -qed. - -lemma lbotr_ldrop_trans_ge: ∀L1,L2,d,e. ⇩[d, e] L1 ≡ L2 → ∀dd,ee. ⊒[dd, ee] L1 → - d + e ≤ dd → ⊒[dd - e, ee] L2. -#L1 #L2 #d #e #HL12 #dd #ee #HL1 #Hddee -@lbotr_ldrop #I #K2 #V2 #i #Hddi #Hiddee #HLK2 -elim (le_inv_plus_l … Hddee) -Hddee #Hdde #Hedd ->plus_minus in Hiddee; // #Hiddee -lapply (transitive_le … Hdde Hddi) -Hdde #Hid -lapply (ldrop_trans_ge … HL12 … HLK2 ?) -L2 // -Hid #HL1K2 -@(lbotr_inv_ldrop … HL1K2 … HL1) -L1 >commutative_plus /2 width=1/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ldrop_lpx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ldrop_lpx.etc deleted file mode 100644 index d23ed28e5..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ldrop_lpx.etc +++ /dev/null @@ -1,68 +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/grammar/lenv_px.ma". -include "basic_2/relocation/ldrop.ma". - -(* DROPPING *****************************************************************) - -(* Properties on pointwise extension ****************************************) - -lemma lpx_deliftable_dropable: ∀R. t_deliftable_sn R → dropable_sn (lpx R). -#R #HR #L1 #K1 #d #e #H elim H -L1 -K1 -d -e -[ #d #e #X #H >(lpx_inv_atom1 … H) -H /2 width=3/ -| #K1 #I #V1 #X #H - elim (lpx_inv_pair1 … H) -H #L2 #V2 #HL12 #HV12 #H destruct /3 width=5/ -| #L1 #K1 #I #V1 #e #_ #IHLK1 #X #H - elim (lpx_inv_pair1 … H) -H #L2 #V2 #HL12 #HV12 #H destruct - elim (IHLK1 … HL12) -L1 /3 width=3/ -| #L1 #K1 #I #V1 #W1 #d #e #_ #HWV1 #IHLK1 #X #H - elim (lpx_inv_pair1 … H) -H #L2 #V2 #HL12 #HV12 #H destruct - elim (HR … HV12 … HWV1) -V1 - elim (IHLK1 … HL12) -L1 /3 width=5/ -] -qed. - -lemma lpx_liftable_dedropable: ∀R. reflexive ? R → - t_liftable R → dedropable_sn (lpx R). -#R #H1R #H2R #L1 #K1 #d #e #H elim H -L1 -K1 -d -e -[ #d #e #X #H >(lpx_inv_atom1 … H) -H /2 width=3/ -| #K1 #I #V1 #X #H - elim (lpx_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct /3 width=5/ -| #L1 #K1 #I #V1 #e #_ #IHLK1 #K2 #HK12 - elim (IHLK1 … HK12) -K1 /3 width=5/ -| #L1 #K1 #I #V1 #W1 #d #e #_ #HWV1 #IHLK1 #X #H - elim (lpx_inv_pair1 … H) -H #K2 #W2 #HK12 #HW12 #H destruct - elim (lift_total W2 d e) #V2 #HWV2 - lapply (H2R … HW12 … HWV1 … HWV2) -W1 - elim (IHLK1 … HK12) -K1 /3 width=5/ -] -qed. - -fact lpx_dropable_aux: ∀R,L2,K2,d,e. ⇩[d, e] L2 ≡ K2 → ∀L1. lpx R L1 L2 → - d = 0 → ∃∃K1. ⇩[0, e] L1 ≡ K1 & lpx R K1 K2. -#R #L2 #K2 #d #e #H elim H -L2 -K2 -d -e -[ #d #e #X #H >(lpx_inv_atom2 … H) -H /2 width=3/ -| #K2 #I #V2 #X #H - elim (lpx_inv_pair2 … H) -H #K1 #V1 #HK12 #HV12 #H destruct /3 width=5/ -| #L2 #K2 #I #V2 #e #_ #IHLK2 #X #H #_ - elim (lpx_inv_pair2 … H) -H #L1 #V1 #HL12 #HV12 #H destruct - elim (IHLK2 … HL12 ?) -L2 // /3 width=3/ -| #L2 #K2 #I #V2 #W2 #d #e #_ #_ #_ #L1 #_ - >commutative_plus normalize #H destruct -] -qed-. - -lemma lpx_dropable: ∀R. dropable_dx (lpx R). -/2 width=5 by lpx_dropable_aux/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lenv_px.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lenv_px.etc deleted file mode 100644 index ea916e10a..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lenv_px.etc +++ /dev/null @@ -1,166 +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/grammar/lenv_append.ma". - -(* POINTWISE EXTENSION OF A CONTEXT-FREE REALTION FOR TERMS *****************) - -inductive lpx (R:relation term): relation lenv ≝ -| lpx_stom: lpx R (⋆) (⋆) -| lpx_pair: ∀I,K1,K2,V1,V2. - lpx R K1 K2 → R V1 V2 → lpx R (K1. ⓑ{I} V1) (K2. ⓑ{I} V2) -. - -(* Basic inversion lemmas ***************************************************) - -fact lpx_inv_atom1_aux: ∀R,L1,L2. lpx R L1 L2 → L1 = ⋆ → L2 = ⋆. -#R #L1 #L2 * -L1 -L2 -[ // -| #I #K1 #K2 #V1 #V2 #_ #_ #H destruct -] -qed-. - -lemma lpx_inv_atom1: ∀R,L2. lpx R (⋆) L2 → L2 = ⋆. -/2 width=4 by lpx_inv_atom1_aux/ qed-. - -fact lpx_inv_pair1_aux: ∀R,L1,L2. lpx R L1 L2 → ∀I,K1,V1. L1 = K1. ⓑ{I} V1 → - ∃∃K2,V2. lpx R K1 K2 & R V1 V2 & L2 = K2. ⓑ{I} V2. -#R #L1 #L2 * -L1 -L2 -[ #J #K1 #V1 #H destruct -| #I #K1 #K2 #V1 #V2 #HK12 #HV12 #J #L #W #H destruct /2 width=5/ -] -qed-. - -lemma lpx_inv_pair1: ∀R,I,K1,V1,L2. lpx R (K1. ⓑ{I} V1) L2 → - ∃∃K2,V2. lpx R K1 K2 & R V1 V2 & L2 = K2. ⓑ{I} V2. -/2 width=3 by lpx_inv_pair1_aux/ qed-. - -fact lpx_inv_atom2_aux: ∀R,L1,L2. lpx R L1 L2 → L2 = ⋆ → L1 = ⋆. -#R #L1 #L2 * -L1 -L2 -[ // -| #I #K1 #K2 #V1 #V2 #_ #_ #H destruct -] -qed-. - -lemma lpx_inv_atom2: ∀R,L1. lpx R L1 (⋆) → L1 = ⋆. -/2 width=4 by lpx_inv_atom2_aux/ qed-. - -fact lpx_inv_pair2_aux: ∀R,L1,L2. lpx R L1 L2 → ∀I,K2,V2. L2 = K2. ⓑ{I} V2 → - ∃∃K1,V1. lpx R K1 K2 & R V1 V2 & L1 = K1. ⓑ{I} V1. -#R #L1 #L2 * -L1 -L2 -[ #J #K2 #V2 #H destruct -| #I #K1 #K2 #V1 #V2 #HK12 #HV12 #J #K #W #H destruct /2 width=5/ -] -qed-. - -lemma lpx_inv_pair2: ∀R,I,L1,K2,V2. lpx R L1 (K2. ⓑ{I} V2) → - ∃∃K1,V1. lpx R K1 K2 & R V1 V2 & L1 = K1. ⓑ{I} V1. -/2 width=3 by lpx_inv_pair2_aux/ qed-. - -(* Basic forward lemmas *****************************************************) - -lemma lpx_fwd_length: ∀R,L1,L2. lpx R L1 L2 → |L1| = |L2|. -#R #L1 #L2 #H elim H -L1 -L2 normalize // -qed-. - -(* Advanced inversion lemmas ************************************************) - -lemma lpx_inv_append1: ∀R,L1,K1,L. lpx R (K1 @@ L1) L → - ∃∃K2,L2. lpx R K1 K2 & lpx R L1 L2 & L = K2 @@ L2. -#R #L1 elim L1 -L1 normalize -[ #K1 #K2 #HK12 - @(ex3_2_intro … K2 (⋆)) // (**) (* explicit constructor, /2 width=5/ does not work *) -| #L1 #I #V1 #IH #K1 #X #H - elim (lpx_inv_pair1 … H) -H #L #V2 #H1 #HV12 #H destruct - elim (IH … H1) -IH -H1 #K2 #L2 #HK12 #HL12 #H destruct - @(ex3_2_intro … HK12) [2: /2 width=2/ | skip | // ] (* explicit constructor, /3 width=5/ does not work *) -] -qed-. - -lemma lpx_inv_append2: ∀R,L2,K2,L. lpx R L (K2 @@ L2) → - ∃∃K1,L1. lpx R K1 K2 & lpx R L1 L2 & L = K1 @@ L1. -#R #L2 elim L2 -L2 normalize -[ #K2 #K1 #HK12 - @(ex3_2_intro … K1 (⋆)) // (**) (* explicit constructor, /2 width=5/ does not work *) -| #L2 #I #V2 #IH #K2 #X #H - elim (lpx_inv_pair2 … H) -H #L #V1 #H1 #HV12 #H destruct - elim (IH … H1) -IH -H1 #K1 #L1 #HK12 #HL12 #H destruct - @(ex3_2_intro … HK12) [2: /2 width=2/ | skip | // ] (* explicit constructor, /3 width=5/ does not work *) -] -qed-. - -(* Basic properties *********************************************************) - -lemma lpx_refl: ∀R. reflexive ? R → reflexive … (lpx R). -#R #HR #L elim L -L // /2 width=1/ -qed. - -lemma lpx_sym: ∀R. symmetric ? R → symmetric … (lpx R). -#R #HR #L1 #L2 #H elim H -H // /3 width=1/ -qed. - -lemma lpx_trans: ∀R. Transitive ? R → Transitive … (lpx R). -#R #HR #L1 #L #H elim H -L // -#I #K1 #K #V1 #V #_ #HV1 #IHK1 #X #H -elim (lpx_inv_pair1 … H) -H #K2 #V2 #HK2 #HV2 #H destruct /3 width=3/ -qed. - -lemma lpx_conf: ∀R. confluent ? R → confluent … (lpx R). -#R #HR #L0 #L1 #H elim H -L1 -[ #X #H >(lpx_inv_atom1 … H) -X /2 width=3/ -| #I #K0 #K1 #V0 #V1 #_ #HV01 #IHK01 #X #H - elim (lpx_inv_pair1 … H) -H #K2 #V2 #HK02 #HV02 #H destruct - elim (IHK01 … HK02) -K0 #K #HK1 #HK2 - elim (HR … HV01 … HV02) -HR -V0 /3 width=5/ -] -qed. - -lemma lpx_TC_inj: ∀R,L1,L2. lpx R L1 L2 → lpx (TC … R) L1 L2. -#R #L1 #L2 #H elim H -L1 -L2 // /3 width=1/ -qed. - -lemma lpx_TC_step: ∀R,L1,L. lpx (TC … R) L1 L → - ∀L2. lpx R L L2 → lpx (TC … R) L1 L2. -#R #L1 #L #H elim H -L /2 width=1/ -#I #K1 #K #V1 #V #_ #HV1 #IHK1 #X #H -elim (lpx_inv_pair1 … H) -H #K2 #V2 #HK2 #HV2 #H destruct /3 width=3/ -qed. - -lemma TC_lpx_pair_dx: ∀R. reflexive ? R → - ∀I,K,V1,V2. TC … R V1 V2 → - TC … (lpx R) (K.ⓑ{I}V1) (K.ⓑ{I}V2). -#R #HR #I #K #V1 #V2 #H elim H -V2 -/4 width=5 by lpx_refl, lpx_pair, inj, step/ (**) (* too slow without trace *) -qed. - -lemma TC_lpx_pair_sn: ∀R. reflexive ? R → - ∀I,V,K1,K2. TC … (lpx R) K1 K2 → - TC … (lpx R) (K1.ⓑ{I}V) (K2.ⓑ{I}V). -#R #HR #I #V #K1 #K2 #H elim H -K2 -/4 width=5 by lpx_refl, lpx_pair, inj, step/ (**) (* too slow without trace *) -qed. - -lemma lpx_TC: ∀R,L1,L2. TC … (lpx R) L1 L2 → lpx (TC … R) L1 L2. -#R #L1 #L2 #H elim H -L2 /2 width=1/ /2 width=3/ -qed. - -lemma lpx_inv_TC: ∀R. reflexive ? R → - ∀L1,L2. lpx (TC … R) L1 L2 → TC … (lpx R) L1 L2. -#R #HR #L1 #L2 #H elim H -L1 -L2 /3 width=1/ /3 width=3/ -qed. - -lemma lpx_append: ∀R,K1,K2. lpx R K1 K2 → ∀L1,L2. lpx R L1 L2 → - lpx R (L1 @@ K1) (L2 @@ K2). -#R #K1 #K2 #H elim H -K1 -K2 // /3 width=1/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lenv_top.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lenv_top.etc deleted file mode 100644 index ab90cebe7..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lenv_top.etc +++ /dev/null @@ -1,68 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( T1 𝟙 break term 46 T2 )" - non associative with precedence 45 - for @{ 'RTop $T1 $T2 }. - -include "basic_2/grammar/lenv_px.ma". - -(* POINTWISE EXTENSION OF TOP RELATION FOR TERMS ****************************) - -definition ttop: relation term ≝ λT1,T2. True. - -definition ltop: relation lenv ≝ lpx ttop. - -interpretation - "top reduction (environment)" - 'RTop L1 L2 = (ltop L1 L2). - -(* Basic properties *********************************************************) - -lemma ltop_refl: reflexive … ltop. -/2 width=1/ qed. - -lemma ltop_sym: symmetric … ltop. -/2 width=1/ qed. - -lemma ltop_trans: transitive … ltop. -/2 width=3/ qed. - -lemma ltop_append: ∀K1,K2. K1 𝟙 K2 → ∀L1,L2. L1 𝟙 L2 → L1 @@ K1 𝟙 L2 @@ K2. -/2 width=1/ qed. - -(* Basic inversion lemmas ***************************************************) - -lemma ltop_inv_atom1: ∀L2. ⋆ 𝟙 L2 → L2 = ⋆. -/2 width=2 by lpx_inv_atom1/ qed-. - -lemma ltop_inv_pair1: ∀K1,I,V1,L2. K1. ⓑ{I} V1 𝟙 L2 → - ∃∃K2,V2. K1 𝟙 K2 & L2 = K2. ⓑ{I} V2. -#K1 #I #V1 #L2 #H -elim (lpx_inv_pair1 … H) -H /2 width=4/ -qed-. - -lemma ltop_inv_atom2: ∀L1. L1 𝟙 ⋆ → L1 = ⋆. -/2 width=2 by lpx_inv_atom2/ qed-. - -lemma ltop_inv_pair2: ∀L1,K2,I,V2. L1 𝟙 K2. ⓑ{I} V2 → - ∃∃K1,V1. K1 𝟙 K2 & L1 = K1. ⓑ{I} V1. -#L1 #K2 #I #V2 #H -elim (lpx_inv_pair2 … H) -H /2 width=4/ -qed-. - -(* Basic forward lemmas *****************************************************) - -lemma ltop_fwd_length: ∀L1,L2. L1 𝟙 L2 → |L1| = |L2|. -/2 width=2 by lpx_fwd_length/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lfpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lfpr.etc deleted file mode 100644 index ea9f585a6..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lfpr.etc +++ /dev/null @@ -1,48 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( ⦃ term 46 L1 ⦄ ➡ break ⦃ term 46 L2 ⦄ )" - non associative with precedence 45 - for @{ 'FocalizedPRed $L1 $L2 }. - -include "basic_2/unfold/ltpss_sn.ma". -include "basic_2/reducibility/ltpr.ma". - -(* FOCALIZED PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ***********************) - -definition lfpr: relation lenv ≝ - λL1,L2. ∃∃L. L1 ➡ L & L ⊢ ▶* [0, |L|] L2 -. - -interpretation - "focalized parallel reduction (environment)" - 'FocalizedPRed L1 L2 = (lfpr L1 L2). - -(* Basic properties *********************************************************) - -(* Note: lemma 250 *) -lemma lfpr_refl: ∀L. ⦃L⦄ ➡ ⦃L⦄. -/2 width=3/ qed. - -lemma ltpss_sn_lfpr: ∀L1,L2,d,e. L1 ⊢ ▶* [d, e] L2 → ⦃L1⦄ ➡ ⦃L2⦄. -/3 width=5/ qed. - -lemma ltpr_lfpr: ∀L1,L2. L1 ➡ L2 → ⦃L1⦄ ➡ ⦃L2⦄. -/3 width=3/ qed. - -(* Basic inversion lemmas ***************************************************) - -lemma lfpr_inv_atom1: ∀L2. ⦃⋆⦄ ➡ ⦃L2⦄ → L2 = ⋆. -#L2 * #L #HL >(ltpr_inv_atom1 … HL) -HL #HL2 >(ltpss_sn_inv_atom1 … HL2) -HL2 // -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lfpr_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lfpr_aaa.etc deleted file mode 100644 index 6f6c49df3..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lfpr_aaa.etc +++ /dev/null @@ -1,25 +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/static/aaa_ltpss_sn.ma". -include "basic_2/reducibility/ltpr_aaa.ma". -include "basic_2/reducibility/lfpr.ma". - -(* FOCALIZED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS **********************) - -(* Properties about atomic arity assignment on terms ************************) - -lemma aaa_lfpr_conf: ∀L1,T,A. L1 ⊢ T ⁝ A → ∀L2. ⦃L1⦄ ➡ ⦃L2⦄ → L2 ⊢ T ⁝ A. -#L1 #T #A #HT #L2 * /3 width=5/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lfpr_cpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lfpr_cpr.etc deleted file mode 100644 index 8a01f263a..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lfpr_cpr.etc +++ /dev/null @@ -1,52 +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/unfold/ltpss_sn_ltpss_sn.ma". -include "basic_2/reducibility/ltpr_ldrop.ma". -include "basic_2/reducibility/cpr.ma". -include "basic_2/reducibility/lfpr.ma". - -(* FOCALIZED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS **********************) - -(* Advanced properties ******************************************************) - -lemma lfpr_pair_cpr: ∀L1,L2. ⦃L1⦄ ➡ ⦃L2⦄ → ∀V1,V2. L2 ⊢ V1 ➡ V2 → - ∀I. ⦃L1. ⓑ{I} V1⦄ ➡ ⦃L2. ⓑ{I} V2⦄. -#L1 #L2 * #L #HL1 #HL2 #V1 #V2 * -<(ltpss_sn_fwd_length … HL2) #V #HV1 #HV2 #I -lapply (ltpss_sn_tpss_trans_eq … HV2 … HL2) -HV2 #V2 -@(ex2_intro … (L.ⓑ{I}V)) /2 width=1/ (**) (* explicit constructor *) -qed. - -(* Properties on supclosure *************************************************) -(* -lamma fsub_cpr_trans: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ → ∀U2. L2 ⊢ T2 ➡ U2 → - ∃∃L,U1. ⦃L1⦄ ➡ ⦃L⦄ & L ⊢ T1 ➡ U1 & ⦃L, U1⦄ ⊃ ⦃L2, U2⦄. -#L1 #L2 #T1 #T2 #HT12 #U2 * #T #H1 #H2 -elim (fsub_tpr_trans … HT12 … H1) -T2 #L #U #HL1 #HT1U #HUT -elim (fsup_tpss_trans_full … HUT … H2) -T -HUT -H2 #L #U #HL1 #HT1U #HUT - - - - - - - #H elim H -L1 -L2 -T1 -T2 [1,2,3,4,5: /3 width=5/ ] -#L1 #K1 #K2 #T1 #T2 #U1 #d #e #HLK1 #HTU1 #_ #IHT12 #U2 #HTU2 -elim (IHT12 … HTU2) -IHT12 -HTU2 #K #T #HK1 #HT1 #HK2 -elim (lift_total T d e) #U #HTU -elim (ldrop_ltpr_trans … HLK1 … HK1) -HLK1 -HK1 #L #HL1 #HLK -lapply (tpr_lift … HT1 … HTU1 … HTU) -HT1 -HTU1 /3 width=11/ -qed-. -*) \ No newline at end of file diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lfpr_lfpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lfpr_lfpr.etc deleted file mode 100644 index 7031e792b..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lfpr_lfpr.etc +++ /dev/null @@ -1,39 +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/reducibility/ltpr_ltpss_sn.ma". -include "basic_2/reducibility/ltpr_ltpr.ma". -include "basic_2/reducibility/lfpr.ma". - -(* FOCALIZED PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ***********************) - -(* Main properties **********************************************************) - -theorem lfpr_conf: ∀L0,L1,L2. ⦃L0⦄ ➡ ⦃L1⦄ → ⦃L0⦄ ➡ ⦃L2⦄ → - ∃∃L. ⦃L1⦄ ➡ ⦃L⦄ & ⦃L2⦄ ➡ ⦃L⦄. -#K0 #L1 #L2 * #K1 #HK01 #HKL1 * #K2 #HK02 #HKL2 -lapply (ltpr_fwd_length … HK01) #H ->(ltpr_fwd_length … HK02) in H; #H -elim (ltpr_conf … HK01 … HK02) -K0 #K #HK1 #HK2 -lapply (ltpss_sn_fwd_length … HKL1) #H1 -lapply (ltpss_sn_fwd_length … HKL2) #H2 ->H1 in HKL1 H; -H1 #HKL1 ->H2 in HKL2; -H2 #HKL2 #H -elim (ltpr_ltpss_sn_conf … HKL1 … HK1) -K1 #K1 #HK1 #HLK1 -elim (ltpr_ltpss_sn_conf … HKL2 … HK2) -K2 #K2 #HK2 #HLK2 -elim (ltpss_sn_conf … HK1 … HK2) -K #K #HK1 #HK2 -lapply (ltpr_fwd_length … HLK1) #H1 -lapply (ltpr_fwd_length … HLK2) #H2 -/3 width=5/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lfprs_ltprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lfprs_ltprs.etc deleted file mode 100644 index 99ae801d7..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lfprs_ltprs.etc +++ /dev/null @@ -1,23 +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/computation/ltprs.ma". -include "basic_2/computation/lfprs.ma". - -(* FOCALIZED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS *********************) - -(* Properties on context-free parallel computation for local environments ***) - -lemma ltprs_lfprs: ∀L1,L2. L1 ➡* L2 → ⦃L1⦄ ➡* ⦃L2⦄. -/3 width=3/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lift.etc deleted file mode 100644 index f0d631ebb..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lift.etc +++ /dev/null @@ -1,25 +0,0 @@ -definition t_liftable: relation term → Prop ≝ - λR. ∀T1,T2. R T1 T2 → ∀U1,d,e. ⇧[d, e] T1 ≡ U1 → - ∀U2. ⇧[d, e] T2 ≡ U2 → R U1 U2. - -definition t_deliftable_sn: relation term → Prop ≝ - λR. ∀U1,U2. R U1 U2 → ∀T1,d,e. ⇧[d, e] T1 ≡ U1 → - ∃∃T2. ⇧[d, e] T2 ≡ U2 & R T1 T2. - -lemma t_liftable_TC: ∀R. t_liftable R → t_liftable (TC … R). -#R #HR #T1 #T2 #H elim H -T2 -[ /3 width=7/ -| #T #T2 #_ #HT2 #IHT1 #U1 #d #e #HTU1 #U2 #HTU2 - elim (lift_total T d e) /3 width=9/ -] -qed. - -lemma t_deliftable_sn_TC: ∀R. t_deliftable_sn R → t_deliftable_sn (TC … R). -#R #HR #U1 #U2 #H elim H -U2 -[ #U2 #HU12 #T1 #d #e #HTU1 - elim (HR … HU12 … HTU1) -U1 /3 width=3/ -| #U #U2 #_ #HU2 #IHU1 #T1 #d #e #HTU1 - elim (IHU1 … HTU1) -U1 #T #HTU #HT1 - elim (HR … HU2 … HTU) -U /3 width=5/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lsubr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lsubr.etc deleted file mode 100644 index 8655a5e54..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lsubr.etc +++ /dev/null @@ -1,198 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( L1 break ⊑ [ term 46 d , break term 46 e ] break term 46 L2 )" - non associative with precedence 45 - for @{ 'SubEq $L1 $d $e $L2 }. - -include "basic_2/grammar/lenv_length.ma". - -(* LOCAL ENVIRONMENT REFINEMENT FOR SUBSTITUTION ****************************) - -inductive lsubr: nat → nat → relation lenv ≝ -| lsubr_sort: ∀d,e. lsubr d e (⋆) (⋆) -| lsubr_OO: ∀L1,L2. lsubr 0 0 L1 L2 -| lsubr_abbr: ∀L1,L2,V,e. lsubr 0 e L1 L2 → - lsubr 0 (e + 1) (L1. ⓓV) (L2.ⓓV) -| lsubr_abst: ∀L1,L2,I,V1,V2,e. lsubr 0 e L1 L2 → - lsubr 0 (e + 1) (L1. ⓑ{I}V1) (L2. ⓛV2) -| lsubr_skip: ∀L1,L2,I1,I2,V1,V2,d,e. - lsubr d e L1 L2 → lsubr (d + 1) e (L1. ⓑ{I1} V1) (L2. ⓑ{I2} V2) -. - -interpretation - "local environment refinement (substitution)" - 'SubEq L1 d e L2 = (lsubr d e L1 L2). - -definition lsubr_trans: ∀S. (lenv → relation S) → Prop ≝ λS,R. - ∀L2,s1,s2. R L2 s1 s2 → - ∀L1,d,e. L1 ⊑ [d, e] L2 → R L1 s1 s2. - -(* Basic properties *********************************************************) - -lemma lsubr_bind_eq: ∀L1,L2,e. L1 ⊑ [0, e] L2 → ∀I,V. - L1. ⓑ{I} V ⊑ [0, e + 1] L2.ⓑ{I} V. -#L1 #L2 #e #HL12 #I #V elim I -I /2 width=1/ -qed. - -lemma lsubr_abbr_lt: ∀L1,L2,V,e. L1 ⊑ [0, e - 1] L2 → 0 < e → - L1. ⓓV ⊑ [0, e] L2.ⓓV. -#L1 #L2 #V #e #HL12 #He >(plus_minus_m_m e 1) // /2 width=1/ -qed. - -lemma lsubr_abst_lt: ∀L1,L2,I,V1,V2,e. L1 ⊑ [0, e - 1] L2 → 0 < e → - L1. ⓑ{I}V1 ⊑ [0, e] L2. ⓛV2. -#L1 #L2 #I #V1 #V2 #e #HL12 #He >(plus_minus_m_m e 1) // /2 width=1/ -qed. - -lemma lsubr_skip_lt: ∀L1,L2,d,e. L1 ⊑ [d - 1, e] L2 → 0 < d → - ∀I1,I2,V1,V2. L1. ⓑ{I1} V1 ⊑ [d, e] L2. ⓑ{I2} V2. -#L1 #L2 #d #e #HL12 #Hd >(plus_minus_m_m d 1) // /2 width=1/ -qed. - -lemma lsubr_bind_lt: ∀I,L1,L2,V,e. L1 ⊑ [0, e - 1] L2 → 0 < e → - L1. ⓓV ⊑ [0, e] L2. ⓑ{I}V. -* /2 width=1/ qed. - -lemma lsubr_refl: ∀d,e,L. L ⊑ [d, e] L. -#d elim d -d -[ #e elim e -e // #e #IHe #L elim L -L // /2 width=1/ -| #d #IHd #e #L elim L -L // /2 width=1/ -] -qed. - -lemma TC_lsubr_trans: ∀S,R. lsubr_trans S R → lsubr_trans S (λL. (TC … (R L))). -#S #R #HR #L1 #s1 #s2 #H elim H -s2 -[ /3 width=5/ -| #s #s2 #_ #Hs2 #IHs1 #L2 #d #e #HL12 - lapply (HR … Hs2 … HL12) -HR -Hs2 -HL12 /3 width=3/ -] -qed. - -(* Basic inversion lemmas ***************************************************) - -fact lsubr_inv_atom1_aux: ∀L1,L2,d,e. L1 ⊑ [d, e] L2 → L1 = ⋆ → - L2 = ⋆ ∨ (d = 0 ∧ e = 0). -#L1 #L2 #d #e * -L1 -L2 -d -e -[ /2 width=1/ -| /3 width=1/ -| #L1 #L2 #W #e #_ #H destruct -| #L1 #L2 #I #W1 #W2 #e #_ #H destruct -| #L1 #L2 #I1 #I2 #W1 #W2 #d #e #_ #H destruct -] -qed. - -lemma lsubr_inv_atom1: ∀L2,d,e. ⋆ ⊑ [d, e] L2 → - L2 = ⋆ ∨ (d = 0 ∧ e = 0). -/2 width=3/ qed-. - -fact lsubr_inv_skip1_aux: ∀L1,L2,d,e. L1 ⊑ [d, e] L2 → - ∀I1,K1,V1. L1 = K1.ⓑ{I1}V1 → 0 < d → - ∃∃I2,K2,V2. K1 ⊑ [d - 1, e] K2 & L2 = K2.ⓑ{I2}V2. -#L1 #L2 #d #e * -L1 -L2 -d -e -[ #d #e #I1 #K1 #V1 #H destruct -| #L1 #L2 #I1 #K1 #V1 #_ #H - elim (lt_zero_false … H) -| #L1 #L2 #W #e #_ #I1 #K1 #V1 #_ #H - elim (lt_zero_false … H) -| #L1 #L2 #I #W1 #W2 #e #_ #I1 #K1 #V1 #_ #H - elim (lt_zero_false … H) -| #L1 #L2 #J1 #J2 #W1 #W2 #d #e #HL12 #I1 #K1 #V1 #H #_ destruct /2 width=5/ -] -qed. - -lemma lsubr_inv_skip1: ∀I1,K1,L2,V1,d,e. K1.ⓑ{I1}V1 ⊑ [d, e] L2 → 0 < d → - ∃∃I2,K2,V2. K1 ⊑ [d - 1, e] K2 & L2 = K2.ⓑ{I2}V2. -/2 width=5/ qed-. - -fact lsubr_inv_atom2_aux: ∀L1,L2,d,e. L1 ⊑ [d, e] L2 → L2 = ⋆ → - L1 = ⋆ ∨ (d = 0 ∧ e = 0). -#L1 #L2 #d #e * -L1 -L2 -d -e -[ /2 width=1/ -| /3 width=1/ -| #L1 #L2 #W #e #_ #H destruct -| #L1 #L2 #I #W1 #W2 #e #_ #H destruct -| #L1 #L2 #I1 #I2 #W1 #W2 #d #e #_ #H destruct -] -qed. - -lemma lsubr_inv_atom2: ∀L1,d,e. L1 ⊑ [d, e] ⋆ → - L1 = ⋆ ∨ (d = 0 ∧ e = 0). -/2 width=3/ qed-. - -fact lsubr_inv_abbr2_aux: ∀L1,L2,d,e. L1 ⊑ [d, e] L2 → - ∀K2,V. L2 = K2.ⓓV → d = 0 → 0 < e → - ∃∃K1. K1 ⊑ [0, e - 1] K2 & L1 = K1.ⓓV. -#L1 #L2 #d #e * -L1 -L2 -d -e -[ #d #e #K1 #V #H destruct -| #L1 #L2 #K1 #V #_ #_ #H - elim (lt_zero_false … H) -| #L1 #L2 #W #e #HL12 #K1 #V #H #_ #_ destruct /2 width=3/ -| #L1 #L2 #I #W1 #W2 #e #_ #K1 #V #H destruct -| #L1 #L2 #I1 #I2 #W1 #W2 #d #e #_ #K1 #V #_ >commutative_plus normalize #H destruct -] -qed. - -lemma lsubr_inv_abbr2: ∀L1,K2,V,e. L1 ⊑ [0, e] K2.ⓓV → 0 < e → - ∃∃K1. K1 ⊑ [0, e - 1] K2 & L1 = K1.ⓓV. -/2 width=5/ qed-. - -fact lsubr_inv_skip2_aux: ∀L1,L2,d,e. L1 ⊑ [d, e] L2 → - ∀I2,K2,V2. L2 = K2.ⓑ{I2}V2 → 0 < d → - ∃∃I1,K1,V1. K1 ⊑ [d - 1, e] K2 & L1 = K1.ⓑ{I1}V1. -#L1 #L2 #d #e * -L1 -L2 -d -e -[ #d #e #I1 #K1 #V1 #H destruct -| #L1 #L2 #I1 #K1 #V1 #_ #H - elim (lt_zero_false … H) -| #L1 #L2 #W #e #_ #I1 #K1 #V1 #_ #H - elim (lt_zero_false … H) -| #L1 #L2 #I #W1 #W2 #e #_ #I1 #K1 #V1 #_ #H - elim (lt_zero_false … H) -| #L1 #L2 #J1 #J2 #W1 #W2 #d #e #HL12 #I1 #K1 #V1 #H #_ destruct /2 width=5/ -] -qed. - -lemma lsubr_inv_skip2: ∀I2,L1,K2,V2,d,e. L1 ⊑ [d, e] K2.ⓑ{I2}V2 → 0 < d → - ∃∃I1,K1,V1. K1 ⊑ [d - 1, e] K2 & L1 = K1.ⓑ{I1}V1. -/2 width=5/ qed-. - -(* Basic forward lemmas *****************************************************) - -fact lsubr_fwd_length_full1_aux: ∀L1,L2,d,e. L1 ⊑ [d, e] L2 → - d = 0 → e = |L1| → |L1| ≤ |L2|. -#L1 #L2 #d #e #H elim H -L1 -L2 -d -e normalize -[ // -| /2 width=1/ -| /3 width=1/ -| /3 width=1/ -| #L1 #L2 #_ #_ #_ #_ #d #e #_ #_ >commutative_plus normalize #H destruct -] -qed. - -lemma lsubr_fwd_length_full1: ∀L1,L2. L1 ⊑ [0, |L1|] L2 → |L1| ≤ |L2|. -/2 width=5/ qed-. - -fact lsubr_fwd_length_full2_aux: ∀L1,L2,d,e. L1 ⊑ [d, e] L2 → - d = 0 → e = |L2| → |L2| ≤ |L1|. -#L1 #L2 #d #e #H elim H -L1 -L2 -d -e normalize -[ // -| /2 width=1/ -| /3 width=1/ -| /3 width=1/ -| #L1 #L2 #_ #_ #_ #_ #d #e #_ #_ >commutative_plus normalize #H destruct -] -qed. - -lemma lsubr_fwd_length_full2: ∀L1,L2. L1 ⊑ [0, |L2|] L2 → |L2| ≤ |L1|. -/2 width=5/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lsubr_lbotr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lsubr_lbotr.etc deleted file mode 100644 index b95a19b66..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/lsubr_lbotr.etc +++ /dev/null @@ -1,77 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( ⊒ [ term 46 d , break term 46 e ] break term 46 L2 )" - non associative with precedence 45 - for @{ 'SubEqBottom $d $e $L2 }. - -include "basic_2/relocation/lsubr.ma". - -(* LOCAL ENVIRONMENT REFINEMENT FOR SUBSTITUTION ****************************) - -(* bottom element of the refinement *) -definition lbotr: nat → nat → predicate lenv ≝ - λd,e. NF_sn … (lsubr d e) (lsubr d e …). - -interpretation - "local environment full refinement (substitution)" - 'SubEqBottom d e L = (lbotr d e L). - -(* Basic properties *********************************************************) - -lemma lbotr_atom: ∀d,e. ⊒[d, e] ⋆. -#d #e #L #H -elim (lsubr_inv_atom2 … H) -H -[ #H destruct // -| * #H1 #H2 destruct // -] -qed. - -lemma lbotr_OO: ∀L. ⊒[0, 0] L. -// qed. - -lemma lbotr_abbr: ∀L,V,e. ⊒[0, e] L → ⊒[0, e + 1] L.ⓓV. -#L #V #e #HL #K #H -elim (lsubr_inv_abbr2 … H ?) -H // (tpr_inv_atom1 … H2) -Y -|4,5: [ #a ] * #V1 #T1 #Hn #X #H1 #L2 #HL12 #Y #H2 destruct -] -[ >(aaa_inv_sort … H1) -X // -| elim (aaa_inv_lref … H1) #I #K1 #V1 #HLK1 #HA - lapply (ldrop_pair2_fwd_fw … HLK1 (#i)) #HKV1 - elim (ltpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #Y #H #HLK2 - elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct - lapply (IH … HKV1 … HA … HK12 … HV12) -L1 -K1 -V1 /2 width=5/ -| elim (aaa_inv_gref … H1) -| elim (aaa_inv_abbr … H1) -H1 #B #HB #HA - elim (tpr_inv_abbr1 … H2) -H2 * - [ #V2 #T #T2 #HV12 #HT1 #HT2 #H destruct - lapply (tps_lsubr_trans … HT2 (L2.ⓓV2) ?) -HT2 /2 width=1/ #HT2 - lapply (IH … HB … HL12 … HV12) -HB /width=5/ #HB - lapply (IH … HA … (L2.ⓓV2) … HT1) -IH -HA -HT1 /width=5/ -T1 /2 width=1/ -L1 -V1 /3 width=5/ - | -B #T #HT1 #HXT #H destruct - lapply (IH … HA … (L2.ⓓV1) … HT1) /width=5/ -T1 /2 width=1/ -L1 #HA - @(aaa_inv_lift … HA … HXT) /2 width=1/ - ] -| elim (aaa_inv_abst … H1) -H1 #B #A #HB #HA #H destruct - elim (tpr_inv_abst1 … H2) -H2 #V2 #T2 #HV12 #HT12 #H destruct - lapply (IH … HB … HL12 … HV12) -HB /width=5/ #HB - lapply (IH … HA … (L2.ⓛV2) … HT12) -IH -HA -HT12 /width=5/ -T1 /2 width=1/ -| elim (aaa_inv_appl … H1) -H1 #B #HB #HA - elim (tpr_inv_appl1 … H2) -H2 * - [ #V2 #T2 #HV12 #HT12 #H destruct - lapply (IH … HB … HL12 … HV12) -HB -HV12 /width=5/ #HB - lapply (IH … HA … HL12 … HT12) -IH -HA -HL12 -HT12 /width=5/ /2 width=3/ - | #b #V2 #W2 #T0 #T2 #HV12 #HT02 #H1 #H2 destruct - elim (aaa_inv_abst … HA) -HA #B0 #A0 #HB0 #HA0 #H destruct - lapply (IH … HB … HL12 … HV12) -HB -HV12 /width=5/ #HB - lapply (IH … HB0 … HL12 W2 ?) -HB0 /width=5/ #HB0 - lapply (IH … HA0 … (L2.ⓛW2) … HT02) -IH -HA0 -HT02 // /2 width=1/ -T0 -L1 -V1 /4 width=7/ - | #b #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HW02 #HT02 #HV02 #H1 #H2 destruct - elim (aaa_inv_abbr … HA) -HA #B0 #HW0 #HT0 - lapply (IH … HW0 … HL12 … HW02) -HW0 /width=5/ #HW2 - lapply (IH … HB … HL12 … HV10) -HB -HV10 /width=5/ #HV0 - lapply (IH … HT0 … (L2.ⓓW2) … HT02) -IH -HT0 -HT02 // /2 width=1/ -V1 -T0 -L1 -W0 #HT2 - @(aaa_abbr … HW2) -HW2 - @(aaa_appl … HT2) -HT2 /3 width=7/ (**) (* explict constructors, /5 width=7/ is too slow *) - ] -| elim (aaa_inv_cast … H1) -H1 #HV1 #HT1 - elim (tpr_inv_cast1 … H2) -H2 - [ * #V2 #T2 #HV12 #HT12 #H destruct - lapply (IH … HV1 … HL12 … HV12) -HV1 -HV12 /width=5/ #HV2 - lapply (IH … HT1 … HL12 … HT12) -IH -HT1 -HL12 -HT12 /width=5/ -L1 -V1 -T1 /2 width=1/ - | -HV1 #HT1X - lapply (IH … HT1 … HL12 … HT1X) -IH -HT1 -HL12 -HT1X /width=5/ - ] -] -qed. - -lemma aaa_ltpr_conf: ∀L1,T,A. L1 ⊢ T ⁝ A → ∀L2. L1 ➡ L2 → L2 ⊢ T ⁝ A. -/2 width=5/ qed. - -lemma aaa_tpr_conf: ∀L,T1,A. L ⊢ T1 ⁝ A → ∀T2. T1 ➡ T2 → L ⊢ T2 ⁝ A. -/2 width=5/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_ldrop.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_ldrop.etc deleted file mode 100644 index 02404a11d..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_ldrop.etc +++ /dev/null @@ -1,45 +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/substitution/ldrop_lpx.ma". -include "basic_2/substitution/fsup.ma". -include "basic_2/reducibility/tpr_lift.ma". -include "basic_2/reducibility/ltpr.ma". - -(* CONTEXT-FREE PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ********************) - -(* Properies on local environment slicing ***********************************) - -(* Basic_1: was: wcpr0_drop *) -lemma ltpr_ldrop_conf: dropable_sn ltpr. -/3 width=3 by lpx_deliftable_dropable, tpr_inv_lift1/ qed. - -(* Basic_1: was: wcpr0_drop_back *) -lemma ldrop_ltpr_trans: dedropable_sn ltpr. -/2 width=3/ qed. - -lemma ltpr_ldrop_trans_O1: dropable_dx ltpr. -/2 width=3/ qed. - -(* Properties on supclosure *************************************************) - -lemma fsub_tpr_trans: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ → ∀U2. T2 ➡ U2 → - ∃∃L,U1. L1 ➡ L & T1 ➡ U1 & ⦃L, U1⦄ ⊃ ⦃L2, U2⦄. -#L1 #L2 #T1 #T2 #H elim H -L1 -L2 -T1 -T2 [1,2,3,4,5: /3 width=5/ ] -#L1 #K1 #K2 #T1 #T2 #U1 #d #e #HLK1 #HTU1 #_ #IHT12 #U2 #HTU2 -elim (IHT12 … HTU2) -IHT12 -HTU2 #K #T #HK1 #HT1 #HK2 -elim (lift_total T d e) #U #HTU -elim (ldrop_ltpr_trans … HLK1 … HK1) -HLK1 -HK1 #L #HL1 #HLK -lapply (tpr_lift … HT1 … HTU1 … HTU) -HT1 -HTU1 /3 width=11/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_ltpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_ltpr.etc deleted file mode 100644 index 4a27a6e70..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_ltpr.etc +++ /dev/null @@ -1,29 +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/reducibility/tpr_tpr.ma". -include "basic_2/reducibility/ltpr.ma". - -(* CONTEXT-FREE PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ********************) - -(* Main properties **********************************************************) - -theorem ltpr_conf: ∀L0:lenv. ∀L1. L0 ➡ L1 → ∀L2. L0 ➡ L2 → - ∃∃L. L1 ➡ L & L2 ➡ L. -#L0 #L1 #H elim H -L0 -L1 /2 width=3/ -#I #K0 #K1 #V0 #V1 #_ #HV01 #IHK01 #L2 #H -elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK02 #HV02 #H destruct -elim (IHK01 … HK02) -K0 #K #HK1 #HK2 -elim (tpr_conf … HV01 HV02) -V0 /3 width=5/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_ltpss_dx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_ltpss_dx.etc deleted file mode 100644 index 00730b732..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_ltpss_dx.etc +++ /dev/null @@ -1,36 +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/reducibility/ltpr_tpss.ma". - -(* CONTEXT-FREE PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ********************) - -(* Properties concerning dx parallel unfold on local environments ***********) - -lemma ltpr_ltpss_dx_conf: ∀L1,K1,d,e. L1 ▶* [d, e] K1 → ∀L2. L1 ➡ L2 → - ∃∃K2. L2 ▶* [d, e] K2 & K1 ➡ K2. -#L1 #K1 #d #e #H elim H -L1 -K1 -d -e -[ /2 width=3/ -| #L1 #I #V1 #X #H - elim (ltpr_inv_pair1 … H) -H #L2 #V2 #HL12 #HV12 #H destruct /3 width=5/ -| #L1 #K1 #I #V1 #W1 #e #_ #HVW1 #IHLK1 #X #H - elim (ltpr_inv_pair1 … H) -H #L2 #V2 #HL12 #HV12 #H destruct - elim (IHLK1 … HL12) -L1 #K2 #HLK2 #HK12 - elim (ltpr_tpr_tpss_conf … HK12 … HV12 … HVW1) -V1 /3 width=5/ -| #L1 #K1 #I #V1 #W1 #d #e #_ #HVW1 #IHLK1 #X #H - elim (ltpr_inv_pair1 … H) -H #L2 #V2 #HL12 #HV12 #H destruct - elim (IHLK1 … HL12) -L1 #K2 #HLK2 #HK12 - elim (ltpr_tpr_tpss_conf … HK12 … HV12 … HVW1) -V1 /3 width=5/ -] -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_ltpss_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_ltpss_sn.etc deleted file mode 100644 index 79ffb7c9e..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_ltpss_sn.etc +++ /dev/null @@ -1,31 +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/unfold/ltpss_sn_alt.ma". -include "basic_2/reducibility/ltpr_ltpss_dx.ma". - -(* CONTEXT-FREE PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ********************) - -(* Properties on sn parallel unfold on local environments *******************) - -(* Note: this can also be proved like ltpr_ltpss_dx_conf *) -lemma ltpr_ltpss_sn_conf: ∀L1,K1,d,e. L1 ⊢ ▶* [d, e] K1 → ∀L2. L1 ➡ L2 → - ∃∃K2. L2 ⊢ ▶* [d, e] K2 & K1 ➡ K2. -#L1 #K1 #d #e #H -lapply (ltpss_sn_ltpssa … H) -H #H -@(ltpssa_ind … H) -K1 /2 width=3/ -#K #K1 #_ #HK1 #IHK #L2 #HL12 -elim (IHK … HL12) -L1 #K2 #HLK2 #HK2 -elim (ltpr_ltpss_dx_conf … HK1 … HK2) -K /3 width=3/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_tps.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_tps.etc deleted file mode 100644 index 7f08be62b..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_tps.etc +++ /dev/null @@ -1,57 +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/reducibility/ltpr_ldrop.ma". - -(* CONTEXT-FREE PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ********************) - -(* Properties concerning parallel substitution on terms *********************) - -(* Basic_1: was: pr0_subst1_fwd *) -lemma ltpr_tps_conf: ∀L1,T1,T2,d,e. L1 ⊢ T1 ▶ [d, e] T2 → ∀L2. L1 ➡ L2 → - ∃∃T. L2 ⊢ T1 ▶ [d, e] T & T2 ➡ T. -#L1 #T1 #T2 #d #e #H elim H -L1 -T1 -T2 -d -e -[ /2 width=3/ -| #L1 #K1 #V1 #W1 #i #d #e #Hdi #Hide #HLK1 #HVW1 #L2 #HL12 - elim (ltpr_ldrop_conf … HLK1 … HL12) -L1 #X #H #HLK2 - elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct -K1 - elim (lift_total V2 0 (i+1)) #W2 #HVW2 - lapply (tpr_lift … HV12 … HVW1 … HVW2) -V1 /3 width=4/ -| #L1 #a #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #L2 #HL12 - elim (IHV12 … HL12) -IHV12 #V #HV1 #HV2 - elim (IHT12 (L2.ⓑ{I}V) ?) /2 width=1/ -L1 /3 width=5/ -| #L1 #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #L2 #HL12 - elim (IHV12 … HL12) -IHV12 - elim (IHT12 … HL12) -L1 /3 width=5/ -] -qed-. - -(* Basic_1: was: pr0_subst1_back *) -lemma ltpr_tps_trans: ∀L2,T1,T2,d,e. L2 ⊢ T1 ▶ [d, e] T2 → ∀L1. L1 ➡ L2 → - ∃∃T. L1 ⊢ T1 ▶ [d, e] T & T ➡ T2. -#L2 #T1 #T2 #d #e #H elim H -L2 -T1 -T2 -d -e -[ /2 width=3/ -| #L2 #K2 #V2 #W2 #i #d #e #Hdi #Hide #HLK2 #HVW2 #L1 #HL12 - elim (ltpr_ldrop_trans_O1 … HL12 … HLK2) -L2 #X #HLK1 #H - elim (ltpr_inv_pair2 … H) -H #K1 #V1 #HK12 #HV12 #H destruct -K2 - elim (lift_total V1 0 (i+1)) #W1 #HVW1 - lapply (tpr_lift … HV12 … HVW1 … HVW2) -V2 /3 width=4/ -| #L2 #a #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #L1 #HL12 - elim (IHV12 … HL12) -IHV12 #V #HV1 #HV2 - elim (IHT12 (L1.ⓑ{I}V) ?) /2 width=1/ -L2 /3 width=5/ -| #L2 #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #L1 #HL12 - elim (IHV12 … HL12) -IHV12 - elim (IHT12 … HL12) -L2 /3 width=5/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_tpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_tpss.etc deleted file mode 100644 index 71586fa36..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_tpss.etc +++ /dev/null @@ -1,91 +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/unfold/ltpss_dx_ltpss_dx.ma". -include "basic_2/reducibility/ltpr_tps.ma". - -(* CONTEXT-FREE PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ********************) - -(* Properties on partial unfold for terms ***********************************) - -(* Basic_1: was: pr0_subst1 *) -lemma ltpr_tpr_tps_conf: ∀T1,T2. T1 ➡ T2 → - ∀L1,d,e,U1. L1 ⊢ T1 ▶ [d, e] U1 → - ∀L2. L1 ➡ L2 → - ∃∃U2. U1 ➡ U2 & L2 ⊢ T2 ▶* [d, e] U2. -#T1 #T2 #H elim H -T1 -T2 -[ #I #L1 #d #e #U1 #H #L2 #HL12 - elim (ltpr_tps_conf … H … HL12) -L1 /3 width=3/ -| #I #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #d #e #X #H #L2 #HL12 - elim (tps_inv_flat1 … H) -H #W1 #U1 #HVW1 #HTU1 #H destruct - elim (IHV12 … HVW1 … HL12) -V1 - elim (IHT12 … HTU1 … HL12) -T1 -HL12 /3 width=5/ -| #a #V1 #V2 #W #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #d #e #X #H #L2 #HL12 - elim (tps_inv_flat1 … H) -H #VV1 #Y #HVV1 #HY #HX destruct - elim (tps_inv_bind1 … HY) -HY #WW #TT1 #_ #HTT1 #H destruct - elim (IHV12 … HVV1 … HL12) -V1 #VV2 #HVV12 #HVV2 - elim (IHT12 … HTT1 (L2. ⓛWW) ?) -T1 /2 width=1/ -HL12 #TT2 #HTT12 #HTT2 - lapply (tpss_lsubr_trans … HTT2 (L2. ⓓVV2) ?) -HTT2 /3 width=5/ -| #a #I #V1 #V2 #T1 #T #T2 #HV12 #_ #HT2 #IHV12 #IHT1 #L1 #d #e #X #H #L2 #HL12 - elim (tps_inv_bind1 … H) -H #W1 #U1 #HVW1 #HTU1 #H destruct - elim (IHV12 … HVW1 … HL12) -V1 #W2 #HW12 #HVW2 - elim (IHT1 … HTU1 (L2. ⓑ{I} W2) ?) -T1 /2 width=1/ -HL12 #U #HU1 #HTU - elim (tpss_strip_neq … HTU … HT2 ?) -T /2 width=1/ #U2 #HU2 #HTU2 - lapply (tps_lsubr_trans … HU2 (L2. ⓑ{I} V2) ?) -HU2 /2 width=1/ #HU2 - elim (ltpss_dx_tps_conf … HU2 (L2. ⓑ{I} W2) (d + 1) e ?) -HU2 /2 width=1/ #U3 #HU3 #HU23 - lapply (tps_lsubr_trans … HU3 (⋆. ⓑ{I} W2) ?) -HU3 /2 width=1/ #HU3 - lapply (tpss_lsubr_trans … HU23 (L2. ⓑ{I} W2) ?) -HU23 /2 width=1/ #HU23 - lapply (tpss_trans_eq … HTU2 … HU23) -U2 /3 width=5/ -| #a #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV12 #IHW12 #IHT12 #L1 #d #e #X #H #L2 #HL12 - elim (tps_inv_flat1 … H) -H #VV1 #Y #HVV1 #HY #HX destruct - elim (tps_inv_bind1 … HY) -HY #WW1 #TT1 #HWW1 #HTT1 #H destruct - elim (IHV12 … HVV1 … HL12) -V1 #VV2 #HVV12 #HVV2 - elim (IHW12 … HWW1 … HL12) -W1 #WW2 #HWW12 #HWW2 - elim (IHT12 … HTT1 (L2. ⓓWW2) ?) -T1 /2 width=1/ -HL12 #TT2 #HTT12 #HTT2 - elim (lift_total VV2 0 1) #VV #H2VV - lapply (tpss_lift_ge … HVV2 (L2. ⓓWW2) … HV2 … H2VV) -V2 /2 width=1/ #HVV - @ex2_intro [2: @tpr_theta |1: skip |3: @tpss_bind [2: @tpss_flat ] ] /width=11/ (**) (* /4 width=11/ is too slow *) -| #V #T1 #T #T2 #_ #HT2 #IHT1 #L1 #d #e #X #H #L2 #HL12 - elim (tps_inv_bind1 … H) -H #W #U1 #_ #HTU1 #H destruct -V - elim (IHT1 … HTU1 (L2.ⓓW) ?) -T1 /2 width=1/ -HL12 #U #HU1 #HTU - elim (tpss_inv_lift1_ge … HTU L2 … HT2 ?) -T (ltpr_inv_atom1 … HL2) -L2 // -qed-. - -lemma ltprs_inv_pair1: ∀I,K1,L2,V1. K1. ⓑ{I} V1 ➡* L2 → - ∃∃K2,V2. K1 ➡* K2 & V1 ➡* V2 & L2 = K2. ⓑ{I} V2. -#I #K1 #L2 #V1 #H @(ltprs_ind … H) -L2 /2 width=5/ -#L #L2 #_ #HL2 * #K #V #HK1 #HV1 #H destruct -elim (ltpr_inv_pair1 … HL2) -HL2 #K2 #V2 #HK2 #HV2 #H destruct /3 width=5/ -qed-. - -lemma ltprs_inv_atom2: ∀L1. L1 ➡* ⋆ → L1 = ⋆. -#L1 #H @(ltprs_ind_dx … H) -L1 // -#L1 #L #HL1 #_ #IHL2 destruct ->(ltpr_inv_atom2 … HL1) -L1 // -qed-. - -lemma ltprs_inv_pair2: ∀I,L1,K2,V2. L1 ➡* K2. ⓑ{I} V2 → - ∃∃K1,V1. K1 ➡* K2 & V1 ➡* V2 & L1 = K1. ⓑ{I} V1. -#I #L1 #K2 #V2 #H @(ltprs_ind_dx … H) -L1 /2 width=5/ -#L1 #L #HL1 #_ * #K #V #HK2 #HV2 #H destruct -elim (ltpr_inv_pair2 … HL1) -HL1 #K1 #V1 #HK1 #HV1 #H destruct /3 width=5/ -qed-. - -(* Basic forward lemmas *****************************************************) - -lemma ltprs_fwd_length: ∀L1,L2. L1 ➡* L2 → |L1| = |L2|. -#L1 #L2 #H @(ltprs_ind … H) -L2 // -#L #L2 #_ #HL2 #IHL1 ->IHL1 -L1 >(ltpr_fwd_length … HL2) -HL2 // -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltprs_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltprs_alt.etc deleted file mode 100644 index 1d2db2daf..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltprs_alt.etc +++ /dev/null @@ -1,38 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( T1 ➡ ➡ * break term 46 T2 )" - non associative with precedence 45 - for @{ 'PRedStarAlt $T1 $T2 }. - -include "basic_2/computation/ltprs.ma". - -(* CONTEXT-FREE PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS ******************) - -(* alternative definition of ltprs *) -definition ltprsa: relation lenv ≝ lpx tprs. - -interpretation - "context-free parallel computation (environment) alternative" - 'PRedStarAlt L1 L2 = (ltprsa L1 L2). - -(* Basic properties *********************************************************) - -lemma ltprs_ltprsa: ∀L1,L2. L1 ➡* L2 → L1 ➡➡* L2. -/2 width=1/ qed. - -(* Basic inversion lemmas ***************************************************) - -lemma ltprsa_ltprs: ∀L1,L2. L1 ➡➡* L2 → L1 ➡* L2. -/2 width=1/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltprs_ldrop.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltprs_ldrop.etc deleted file mode 100644 index a7c320089..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltprs_ldrop.etc +++ /dev/null @@ -1,27 +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/reducibility/ltpr_ldrop.ma". -include "basic_2/computation/ltprs.ma". - -(* CONTEXT-FREE PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS ******************) - -lemma ltprs_ldrop_conf: dropable_sn ltprs. -/2 width=3/ qed. - -lemma ldrop_ltprs_trans: dedropable_sn ltprs. -/2 width=3/ qed. - -lemma ltprs_ldrop_trans_O1: dropable_dx ltprs. -/2 width=3/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltprs_ltprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltprs_ltprs.etc deleted file mode 100644 index 7ededf2af..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltprs_ltprs.etc +++ /dev/null @@ -1,32 +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/reducibility/ltpr_ltpr.ma". -include "basic_2/computation/ltprs.ma". - -(* CONTEXT-FREE PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS ******************) - -(* Advanced properties ******************************************************) - -lemma ltprs_strip: ∀L1. ∀L:lenv. L ➡* L1 → ∀L2. L ➡ L2 → - ∃∃L0. L1 ➡ L0 & L2 ➡* L0. -/3 width=3/ qed. - -(* Main properties **********************************************************) - -theorem ltprs_conf: confluent … ltprs. -/3 width=3/ qed. - -theorem ltprs_trans: Transitive … ltprs. -/2 width=3/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpss_dx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpss_dx.etc deleted file mode 100644 index 753c948cc..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpss_dx.etc +++ /dev/null @@ -1,278 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( T1 break ▶ * [ term 46 d , break term 46 e ] break term 46 T2 )" - non associative with precedence 45 - for @{ 'PSubstStar $T1 $d $e $T2 }. - -include "basic_2/unfold/tpss.ma". - -(* DX PARALLEL UNFOLD ON LOCAL ENVIRONMENTS *********************************) - -(* Basic_1: includes: csubst1_bind *) -inductive ltpss_dx: nat → nat → relation lenv ≝ -| ltpss_dx_atom : ∀d,e. ltpss_dx d e (⋆) (⋆) -| ltpss_dx_pair : ∀L,I,V. ltpss_dx 0 0 (L. ⓑ{I} V) (L. ⓑ{I} V) -| ltpss_dx_tpss2: ∀L1,L2,I,V1,V2,e. - ltpss_dx 0 e L1 L2 → L2 ⊢ V1 ▶* [0, e] V2 → - ltpss_dx 0 (e + 1) (L1. ⓑ{I} V1) (L2. ⓑ{I} V2) -| ltpss_dx_tpss1: ∀L1,L2,I,V1,V2,d,e. - ltpss_dx d e L1 L2 → L2 ⊢ V1 ▶* [d, e] V2 → - ltpss_dx (d + 1) e (L1. ⓑ{I} V1) (L2. ⓑ{I} V2) -. - -interpretation "parallel unfold (local environment, dx variant)" - 'PSubstStar L1 d e L2 = (ltpss_dx d e L1 L2). - -(* Basic inversion lemmas ***************************************************) - -fact ltpss_dx_inv_refl_O2_aux: ∀d,e,L1,L2. L1 ▶* [d, e] L2 → e = 0 → L1 = L2. -#d #e #L1 #L2 #H elim H -d -e -L1 -L2 // -[ #L1 #L2 #I #V1 #V2 #e #_ #_ #_ >commutative_plus normalize #H destruct -| #L1 #L2 #I #V1 #V2 #d #e #_ #HV12 #IHL12 #He destruct - >(IHL12 ?) -IHL12 // >(tpss_inv_refl_O2 … HV12) // -] -qed. - -lemma ltpss_dx_inv_refl_O2: ∀d,L1,L2. L1 ▶* [d, 0] L2 → L1 = L2. -/2 width=4/ qed-. - -fact ltpss_dx_inv_atom1_aux: ∀d,e,L1,L2. - L1 ▶* [d, e] L2 → L1 = ⋆ → L2 = ⋆. -#d #e #L1 #L2 * -d -e -L1 -L2 -[ // -| #L #I #V #H destruct -| #L1 #L2 #I #V1 #V2 #e #_ #_ #H destruct -| #L1 #L2 #I #V1 #V2 #d #e #_ #_ #H destruct -] -qed. - -lemma ltpss_dx_inv_atom1: ∀d,e,L2. ⋆ ▶* [d, e] L2 → L2 = ⋆. -/2 width=5/ qed-. - -fact ltpss_dx_inv_tpss21_aux: ∀d,e,L1,L2. L1 ▶* [d, e] L2 → d = 0 → 0 < e → - ∀K1,I,V1. L1 = K1. ⓑ{I} V1 → - ∃∃K2,V2. K1 ▶* [0, e - 1] K2 & - K2 ⊢ V1 ▶* [0, e - 1] V2 & - L2 = K2. ⓑ{I} V2. -#d #e #L1 #L2 * -d -e -L1 -L2 -[ #d #e #_ #_ #K1 #I #V1 #H destruct -| #L1 #I #V #_ #H elim (lt_refl_false … H) -| #L1 #L2 #I #V1 #V2 #e #HL12 #HV12 #_ #_ #K1 #J #W1 #H destruct /2 width=5/ -| #L1 #L2 #I #V1 #V2 #d #e #_ #_ >commutative_plus normalize #H destruct -] -qed. - -lemma ltpss_dx_inv_tpss21: ∀e,K1,I,V1,L2. K1. ⓑ{I} V1 ▶* [0, e] L2 → 0 < e → - ∃∃K2,V2. K1 ▶* [0, e - 1] K2 & - K2 ⊢ V1 ▶* [0, e - 1] V2 & - L2 = K2. ⓑ{I} V2. -/2 width=5/ qed-. - -fact ltpss_dx_inv_tpss11_aux: ∀d,e,L1,L2. L1 ▶* [d, e] L2 → 0 < d → - ∀I,K1,V1. L1 = K1. ⓑ{I} V1 → - ∃∃K2,V2. K1 ▶* [d - 1, e] K2 & - K2 ⊢ V1 ▶* [d - 1, e] V2 & - L2 = K2. ⓑ{I} V2. -#d #e #L1 #L2 * -d -e -L1 -L2 -[ #d #e #_ #I #K1 #V1 #H destruct -| #L #I #V #H elim (lt_refl_false … H) -| #L1 #L2 #I #V1 #V2 #e #_ #_ #H elim (lt_refl_false … H) -| #L1 #L2 #I #V1 #V2 #d #e #HL12 #HV12 #_ #J #K1 #W1 #H destruct /2 width=5/ -] -qed. - -lemma ltpss_dx_inv_tpss11: ∀d,e,I,K1,V1,L2. K1. ⓑ{I} V1 ▶* [d, e] L2 → 0 < d → - ∃∃K2,V2. K1 ▶* [d - 1, e] K2 & - K2 ⊢ V1 ▶* [d - 1, e] V2 & - L2 = K2. ⓑ{I} V2. -/2 width=3/ qed-. - -fact ltpss_dx_inv_atom2_aux: ∀d,e,L1,L2. - L1 ▶* [d, e] L2 → L2 = ⋆ → L1 = ⋆. -#d #e #L1 #L2 * -d -e -L1 -L2 -[ // -| #L #I #V #H destruct -| #L1 #L2 #I #V1 #V2 #e #_ #_ #H destruct -| #L1 #L2 #I #V1 #V2 #d #e #_ #_ #H destruct -] -qed. - -lemma ltpss_dx_inv_atom2: ∀d,e,L1. L1 ▶* [d, e] ⋆ → L1 = ⋆. -/2 width=5/ qed-. - -fact ltpss_dx_inv_tpss22_aux: ∀d,e,L1,L2. L1 ▶* [d, e] L2 → d = 0 → 0 < e → - ∀K2,I,V2. L2 = K2. ⓑ{I} V2 → - ∃∃K1,V1. K1 ▶* [0, e - 1] K2 & - K2 ⊢ V1 ▶* [0, e - 1] V2 & - L1 = K1. ⓑ{I} V1. -#d #e #L1 #L2 * -d -e -L1 -L2 -[ #d #e #_ #_ #K1 #I #V1 #H destruct -| #L1 #I #V #_ #H elim (lt_refl_false … H) -| #L1 #L2 #I #V1 #V2 #e #HL12 #HV12 #_ #_ #K2 #J #W2 #H destruct /2 width=5/ -| #L1 #L2 #I #V1 #V2 #d #e #_ #_ >commutative_plus normalize #H destruct -] -qed. - -lemma ltpss_dx_inv_tpss22: ∀e,L1,K2,I,V2. L1 ▶* [0, e] K2. ⓑ{I} V2 → 0 < e → - ∃∃K1,V1. K1 ▶* [0, e - 1] K2 & - K2 ⊢ V1 ▶* [0, e - 1] V2 & - L1 = K1. ⓑ{I} V1. -/2 width=5/ qed-. - -fact ltpss_dx_inv_tpss12_aux: ∀d,e,L1,L2. L1 ▶* [d, e] L2 → 0 < d → - ∀I,K2,V2. L2 = K2. ⓑ{I} V2 → - ∃∃K1,V1. K1 ▶* [d - 1, e] K2 & - K2 ⊢ V1 ▶* [d - 1, e] V2 & - L1 = K1. ⓑ{I} V1. -#d #e #L1 #L2 * -d -e -L1 -L2 -[ #d #e #_ #I #K2 #V2 #H destruct -| #L #I #V #H elim (lt_refl_false … H) -| #L1 #L2 #I #V1 #V2 #e #_ #_ #H elim (lt_refl_false … H) -| #L1 #L2 #I #V1 #V2 #d #e #HL12 #HV12 #_ #J #K2 #W2 #H destruct /2 width=5/ -] -qed. - -lemma ltpss_dx_inv_tpss12: ∀L1,K2,I,V2,d,e. L1 ▶* [d, e] K2. ⓑ{I} V2 → 0 < d → - ∃∃K1,V1. K1 ▶* [d - 1, e] K2 & - K2 ⊢ V1 ▶* [d - 1, e] V2 & - L1 = K1. ⓑ{I} V1. -/2 width=3/ qed-. - -(* Basic properties *********************************************************) - -lemma ltpss_dx_tps2: ∀L1,L2,I,V1,V2,e. - L1 ▶* [0, e] L2 → L2 ⊢ V1 ▶ [0, e] V2 → - L1. ⓑ{I} V1 ▶* [0, e + 1] L2. ⓑ{I} V2. -/3 width=1/ qed. - -lemma ltpss_dx_tps1: ∀L1,L2,I,V1,V2,d,e. - L1 ▶* [d, e] L2 → L2 ⊢ V1 ▶ [d, e] V2 → - L1. ⓑ{I} V1 ▶* [d + 1, e] L2. ⓑ{I} V2. -/3 width=1/ qed. - -lemma ltpss_dx_tpss2_lt: ∀L1,L2,I,V1,V2,e. - L1 ▶* [0, e - 1] L2 → L2 ⊢ V1 ▶* [0, e - 1] V2 → - 0 < e → L1. ⓑ{I} V1 ▶* [0, e] L2. ⓑ{I} V2. -#L1 #L2 #I #V1 #V2 #e #HL12 #HV12 #He ->(plus_minus_m_m e 1) /2 width=1/ -qed. - -lemma ltpss_dx_tpss1_lt: ∀L1,L2,I,V1,V2,d,e. - L1 ▶* [d - 1, e] L2 → L2 ⊢ V1 ▶* [d - 1, e] V2 → - 0 < d → L1. ⓑ{I} V1 ▶* [d, e] L2. ⓑ{I} V2. -#L1 #L2 #I #V1 #V2 #d #e #HL12 #HV12 #Hd ->(plus_minus_m_m d 1) /2 width=1/ -qed. - -lemma ltpss_dx_tps2_lt: ∀L1,L2,I,V1,V2,e. - L1 ▶* [0, e - 1] L2 → L2 ⊢ V1 ▶ [0, e - 1] V2 → - 0 < e → L1. ⓑ{I} V1 ▶* [0, e] L2. ⓑ{I} V2. -/3 width=1/ qed. - -lemma ltpss_dx_tps1_lt: ∀L1,L2,I,V1,V2,d,e. - L1 ▶* [d - 1, e] L2 → L2 ⊢ V1 ▶ [d - 1, e] V2 → - 0 < d → L1. ⓑ{I} V1 ▶* [d, e] L2. ⓑ{I} V2. -/3 width=1/ qed. - -(* Basic_1: was by definition: csubst1_refl *) -lemma ltpss_dx_refl: ∀L,d,e. L ▶* [d, e] L. -#L elim L -L // -#L #I #V #IHL * /2 width=1/ * /2 width=1/ -qed. - -lemma ltpss_dx_weak: ∀L1,L2,d1,e1. L1 ▶* [d1, e1] L2 → - ∀d2,e2. d2 ≤ d1 → d1 + e1 ≤ d2 + e2 → L1 ▶* [d2, e2] L2. -#L1 #L2 #d1 #e1 #H elim H -L1 -L2 -d1 -e1 // -[ #L1 #L2 #I #V1 #V2 #e1 #_ #HV12 #IHL12 #d2 #e2 #Hd2 #Hde2 - lapply (le_n_O_to_eq … Hd2) #H destruct normalize in Hde2; - lapply (lt_to_le_to_lt 0 … Hde2) // #He2 - lapply (le_plus_to_minus_r … Hde2) -Hde2 /3 width=5/ -| #L1 #L2 #I #V1 #V2 #d1 #e1 #_ #HV12 #IHL12 #d2 #e2 #Hd21 #Hde12 - >plus_plus_comm_23 in Hde12; #Hde12 - elim (le_to_or_lt_eq 0 d2 ?) // #H destruct - [ lapply (le_plus_to_minus_r … Hde12) -Hde12 plus_plus_comm_23 - /4 width=5 by ltpss_dx_tpss2, tpss_append, tpss_weak, monotonic_le_plus_r/ (**) (* too slow without trace *) -| #K1 #K2 #I #V1 #V2 #d #x #_ #HV12 #IHK12 normalize (ldrop_inv_atom1 … H) -H // -| // -| normalize #K0 #K1 #I #V0 #V1 #e1 #_ #_ #IHK01 #L2 #e2 #H #He12 - elim (le_inv_plus_l … He12) #_ #He2 - lapply (ldrop_inv_ldrop1 … H ?) -H // #HK0L2 - lapply (IHK01 … HK0L2 ?) -K0 /2 width=1/ -| #K0 #K1 #I #V0 #V1 #d1 #e1 >plus_plus_comm_23 #_ #_ #IHK01 #L2 #e2 #H #Hd1e2 - elim (le_inv_plus_l … Hd1e2) #_ #He2 - lapply (ldrop_inv_ldrop1 … H ?) -H // #HK0L2 - lapply (IHK01 … HK0L2 ?) -K0 /2 width=1/ -] -qed. - -lemma ltpss_dx_ldrop_trans_ge: ∀L1,L0,d1,e1. L1 ▶* [d1, e1] L0 → - ∀L2,e2. ⇩[0, e2] L0 ≡ L2 → - d1 + e1 ≤ e2 → ⇩[0, e2] L1 ≡ L2. -#L1 #L0 #d1 #e1 #H elim H -L1 -L0 -d1 -e1 -[ #d1 #e1 #L2 #e2 #H >(ldrop_inv_atom1 … H) -H // -| // -| normalize #K1 #K0 #I #V1 #V0 #e1 #_ #_ #IHK10 #L2 #e2 #H #He12 - elim (le_inv_plus_l … He12) #_ #He2 - lapply (ldrop_inv_ldrop1 … H ?) -H // #HK0L2 - lapply (IHK10 … HK0L2 ?) -K0 /2 width=1/ -| #K0 #K1 #I #V1 #V0 #d1 #e1 >plus_plus_comm_23 #_ #_ #IHK10 #L2 #e2 #H #Hd1e2 - elim (le_inv_plus_l … Hd1e2) #_ #He2 - lapply (ldrop_inv_ldrop1 … H ?) -H // #HK0L2 - lapply (IHK10 … HK0L2 ?) -IHK10 -HK0L2 /2 width=1/ -] -qed. - -lemma ltpss_dx_ldrop_conf_be: ∀L0,L1,d1,e1. L0 ▶* [d1, e1] L1 → - ∀L2,e2. ⇩[0, e2] L0 ≡ L2 → d1 ≤ e2 → e2 ≤ d1 + e1 → - ∃∃L. L2 ▶* [0, d1 + e1 - e2] L & ⇩[0, e2] L1 ≡ L. -#L0 #L1 #d1 #e1 #H elim H -L0 -L1 -d1 -e1 -[ #d1 #e1 #L2 #e2 #H >(ldrop_inv_atom1 … H) -H /2 width=3/ -| normalize #L #I #V #L2 #e2 #HL2 #_ #He2 - lapply (le_n_O_to_eq … He2) -He2 #H destruct - lapply (ldrop_inv_refl … HL2) -HL2 #H destruct /2 width=3/ -| normalize #K0 #K1 #I #V0 #V1 #e1 #HK01 #HV01 #IHK01 #L2 #e2 #H #_ #He21 - lapply (ldrop_inv_O1 … H) -H * * #He2 #HK0L2 - [ -IHK01 -He21 destruct plus_plus_comm_23 #_ #_ #IHK01 #L2 #e2 #H #Hd1e2 #He2de1 - elim (le_inv_plus_l … Hd1e2) #_ #He2 - (ldrop_inv_atom1 … H) -H /2 width=3/ -| normalize #L #I #V #L2 #e2 #HL2 #_ #He2 - lapply (le_n_O_to_eq … He2) -He2 #H destruct - lapply (ldrop_inv_refl … HL2) -HL2 #H destruct /2 width=3/ -| normalize #K1 #K0 #I #V1 #V0 #e1 #HK10 #HV10 #IHK10 #L2 #e2 #H #_ #He21 - lapply (ldrop_inv_O1 … H) -H * * #He2 #HK0L2 - [ -IHK10 -He21 destruct plus_plus_comm_23 #_ #_ #IHK10 #L2 #e2 #H #Hd1e2 #He2de1 - elim (le_inv_plus_l … Hd1e2) #_ #He2 - (ldrop_inv_atom1 … H) -H /2 width=3/ -| /2 width=3/ -| normalize #K0 #K1 #I #V0 #V1 #e1 #HK01 #HV01 #_ #L2 #e2 #H #He2 - lapply (le_n_O_to_eq … He2) -He2 #He2 destruct - lapply (ldrop_inv_refl … H) -H #H destruct /3 width=3/ -| #K0 #K1 #I #V0 #V1 #d1 #e1 #HK01 #HV01 #IHK01 #L2 #e2 #H #He2d1 - lapply (ldrop_inv_O1 … H) -H * * #He2 #HK0L2 - [ -IHK01 -He2d1 destruct (ldrop_inv_atom1 … H) -H /2 width=3/ -| /2 width=3/ -| normalize #K1 #K0 #I #V1 #V0 #e1 #HK10 #HV10 #_ #L2 #e2 #H #He2 - lapply (le_n_O_to_eq … He2) -He2 #He2 destruct - lapply (ldrop_inv_refl … H) -H #H destruct /3 width=3/ -| #K1 #K0 #I #V1 #V0 #d1 #e1 #HK10 #HV10 #IHK10 #L2 #e2 #H #He2d1 - lapply (ldrop_inv_O1 … H) -H * * #He2 #HK0L2 - [ -IHK10 -He2d1 destruct (ltpss_dx_inv_atom1 … H) -H /2 width=3/ -| /2 width=3/ -| #L1 #K1 #I #V #e1 #_ #IHLK1 #K2 #d2 #e2 #HK12 #Hd - elim (IHLK1 … HK12 Hd) -K1 -Hd /3 width=5/ -| #L1 #K1 #I #V1 #W1 #d1 #e1 #_ #HWV1 #IHLK1 #X #d2 #e2 #H #Hd12 - elim (le_inv_plus_l … Hd12) -Hd12 #Hd12 #Hd2 - elim (ltpss_dx_inv_tpss11 … H Hd2) -H #K2 #W2 #HK12 #HW12 #H destruct - elim (IHLK1 … HK12 … Hd12) -IHLK1 -HK12 (ltpss_dx_inv_atom1 … H) -H /2 width=3/ -| #K1 #I #V1 #K2 #d2 #e2 #HK12 #H #_ - lapply (le_n_O_to_eq … H) -H #H destruct /2 width=3/ -| #L1 #K1 #I #V #e1 #_ #IHLK1 #K2 #d2 #e2 #HK12 #H1 #H2 - elim (IHLK1 … HK12 H1 H2) -K1 -H2 - lapply (le_n_O_to_eq … H1) -H1 #H destruct /3 width=5/ -| #L1 #K1 #I #V1 #W1 #d1 #e1 #_ #HWV1 #IHLK1 #X #d2 #e2 #H #Hd21 #Hd12 - elim (eq_or_gt d2) #Hd2 [ -Hd21 elim (eq_or_gt e2) #He2 ] destruct - [ lapply (le_n_O_to_eq … Hd12) -Hd12 plus_minus_commutative // #L2 #HL12 #HLK2 - elim (lift_total W2 d1 e1) #V2 #HWV2 - lapply (tpss_lift_be … HW12 … HLK2 HWV1 … HWV2) -W1 // /2 width=1/ - >plus_minus // >commutative_plus /4 width=5/ - | elim (ltpss_dx_inv_tpss11 … H Hd2) -H #K2 #W2 #HK12 #HW12 #H destruct - elim (IHLK1 … HK12 …) -IHLK1 [2: >plus_minus // ] /2 width=1/ #L2 #HL12 #HLK2 - elim (lift_total W2 d1 e1) #V2 #HWV2 - lapply (tpss_lift_be … HW12 … HLK2 HWV1 … HWV2) -W1 [ >plus_minus // ] /2 width=1/ - >commutative_plus /3 width=5/ - ] -] -qed-. - -lemma ldrop_ltpss_dx_trans_ge: ∀L1,K1,d1,e1. ⇩[d1, e1] L1 ≡ K1 → - ∀K2,d2,e2. K1 ▶* [d2, e2] K2 → d2 + e2 ≤ d1 → - ∃∃L2. L1 ▶* [d2, e2] L2 & ⇩[d1, e1] L2 ≡ K2. -#L1 #K1 #d1 #e1 #H elim H -L1 -K1 -d1 -e1 -[ #d1 #e1 #K2 #d2 #e2 #H #_ - >(ltpss_dx_inv_atom1 … H) -H /2 width=3/ -| #K1 #I #V1 #K2 #d2 #e2 #HK12 #H - elim (plus_le_0 … H) -H #H1 #H2 destruct /2 width=3/ -| #L1 #K1 #I #V #e1 #_ #IHLK1 #K2 #d2 #e2 #HK12 #H - elim (IHLK1 … HK12 H) -K1 - elim (plus_le_0 … H) -H #H1 #H2 destruct #L2 #HL12 - >(ltpss_dx_inv_refl_O2 … HL12) -L1 /3 width=5/ -| #L1 #K1 #I #V1 #W1 #d1 #e1 #HLK1 #HWV1 #IHLK1 #X #d2 #e2 #H #Hd21 - elim (eq_or_gt d2) #Hd2 [ elim (eq_or_gt e2) #He2 ] destruct - [ -IHLK1 -Hd21 <(ltpss_dx_inv_refl_O2 … H) -X /3 width=5/ - | elim (ltpss_dx_inv_tpss21 … H He2) -H #K2 #W2 #HK12 #HW12 #H destruct - elim (IHLK1 … HK12 …) -IHLK1 /2 width=1/ #L2 #HL12 #HLK2 - elim (lift_total W2 d1 e1) #V2 #HWV2 - lapply (tpss_lift_le … HW12 … HLK2 HWV1 … HWV2) -W1 /2 width=1/ /3 width=5/ - | elim (ltpss_dx_inv_tpss11 … H Hd2) -H #K2 #W2 #HK12 #HW12 #H destruct - elim (IHLK1 … HK12 …) -IHLK1 [2: >plus_minus // /2 width=1/ ] #L2 #HL12 #HLK2 - elim (lift_total W2 d1 e1) #V2 #HWV2 - lapply (tpss_lift_le … HW12 … HLK2 HWV1 … HWV2) -W1 [ >plus_minus // /2 width=1/ ] /3 width=5/ - ] -] -qed-. - -(* Properties on supclosure *************************************************) - -lemma fsup_tps_trans_full: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ → ∀U2. L2 ⊢ T2 ▶[0,|L2|] U2 → - ∃∃L,U1. L1 ▶*[0,|L|] L & L ⊢ T1 ▶[0,|L|] U1 & ⦃L, U1⦄ ⊃ ⦃L2, T2⦄. -#L1 #L2 #T1 #T2 #H elim H -L1 -L2 -T1 -T2 [1,2,3,4,5: /3 width=5/ ] -#L1 #K1 #K2 #T1 #T2 #U1 #d #e #HLK1 #HTU1 #_ #IHT12 #U2 #HTU2 -elim (IHT12 … HTU2) -IHT12 -HTU2 #K #T #HK1 #HT1 #HT2 -elim (lift_total T d e) #U #HTU -elim (le_or_ge d (|K|)) #Hd -[ elim (ldrop_ltpss_dx_trans_be … HLK1 … HK1 … Hd) // -HLK1 -HK1 #L2 #HL12 #HL2K - lapply (tps_lift_be … HT1 … HL2K … HTU1 HTU … Hd) // -HT1 -HTU1 #HU1 -| elim (ldrop_ltpss_dx_trans_ge … HLK1 … HK1 Hd) -HLK1 -HK1 #L2 #HL12 #HL2K - lapply (tps_lift_le … HT1 … HL2K … HTU1 HTU Hd) -HT1 -HTU1 #HU1 -] -lapply (ltpss_dx_weak_full … HL12) -HL12 #HL12 -lapply (tps_weak_full … HU1) -HU1 #HU1 -@(ex3_2_intro … L2 U) // /2 width=7/ (**) (* explicit constructor: auto /3 width=14/ too slow *) -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpss_dx_ltpss_dx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpss_dx_ltpss_dx.etc deleted file mode 100644 index 74b898d69..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpss_dx_ltpss_dx.etc +++ /dev/null @@ -1,106 +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/unfold/tpss_tpss.ma". -include "basic_2/unfold/ltpss_dx_tpss.ma". - -(* DX PARTIAL UNFOLD ON LOCAL ENVIRONMENTS **********************************) - -(* Advanced properties ******************************************************) - -lemma ltpss_dx_tpss_conf: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 ▶* [d2, e2] U2 → - ∀L1,d1,e1. L0 ▶* [d1, e1] L1 → - ∃∃T. L1 ⊢ T2 ▶* [d2, e2] T & - L1 ⊢ U2 ▶* [d1, e1] T. -#L0 #T2 #U2 #d2 #e2 #H #L1 #d1 #e1 #HL01 @(tpss_ind … H) -U2 /2 width=3/ -#U #U2 #_ #HU2 * #X2 #HTX2 #HUX2 -elim (ltpss_dx_tps_conf … HU2 … HL01) -L0 #X1 #HUX1 #HU2X1 -elim (tpss_strip_eq … HUX2 … HUX1) -U #X #HX2 #HX1 -lapply (tpss_trans_eq … HU2X1 … HX1) -X1 /3 width=3/ -qed. - -lemma ltpss_dx_tpss_trans_down: ∀L0,L1,T2,U2,d1,e1,d2,e2. d2 + e2 ≤ d1 → - L1 ▶* [d1, e1] L0 → L0 ⊢ T2 ▶* [d2, e2] U2 → - ∃∃T. L1 ⊢ T2 ▶* [d2, e2] T & L0 ⊢ T ▶* [d1, e1] U2. -#L0 #L1 #T2 #U2 #d1 #e1 #d2 #e2 #Hde2d1 #HL10 #H @(tpss_ind … H) -U2 -[ /2 width=3/ -| #U #U2 #_ #HU2 * #T #HT2 #HTU - elim (tpss_strap1_down … HTU … HU2 ?) -U // #U #HTU #HU2 - elim (ltpss_dx_tps_trans … HTU … HL10) -HTU -HL10 #X #HTX #HXU - lapply (tpss_trans_eq … HXU HU2) -U /3 width=3/ -] -qed. - -lemma ltpss_dx_tpss_trans_eq: ∀L1,T2,U2,d,e. L1 ⊢ T2 ▶* [d, e] U2 → - ∀L0. L0 ▶* [d, e] L1 → L0 ⊢ T2 ▶* [d, e] U2. -#L1 #T2 @(f2_ind … fw … L1 T2) -L1 -T2 #n #IH #L1 * -[ #I #Hn #W2 #d #e #H #L0 #HL01 destruct - elim (tpss_inv_atom1 … H) -H // * - #K1 #V1 #V2 #i #Hdi #Hide #HLK1 #HV12 #HVW2 #H destruct - lapply (ldrop_fwd_lw … HLK1) #H1 normalize in H1; - elim (ltpss_dx_ldrop_trans_be … HL01 … HLK1 ? ?) -HL01 -HLK1 // /2 width=2/ #X #H #HLK0 - elim (ltpss_dx_inv_tpss22 … H ?) -H /2 width=1/ #K0 #V0 #HK01 #HV01 #H destruct - lapply (tpss_fwd_tw … HV01) #H2 - lapply (transitive_le (♯{K1} + ♯{V0}) … H1) -H1 /2 width=1/ -H2 #H - lapply (tpss_trans_eq … HV01 HV12) -V1 #HV02 - lapply (IH … HV02 … HK01) -IH -HV02 -HK01 - [ normalize /2 width=1/ | /2 width=6/ ] -| * [ #a ] #I #V2 #T2 #Hn #X #d #e #H #L0 #HL0 destruct - [ elim (tpss_inv_bind1 … H) -H #W2 #U2 #HVW2 #HTU2 #H destruct - lapply (tpss_lsubr_trans … HTU2 (L1. ⓑ{I} V2) ?) -HTU2 /2 width=1/ #HTU2 - lapply (IH … HVW2 … HL0) -HVW2 [ /2 width=2/ ] #HVW2 - lapply (IH … HTU2 (L0. ⓑ{I} V2) ?) -IH -HTU2 // /2 width=2/ -HL0 #HTU2 - lapply (tpss_lsubr_trans … HTU2 (L0. ⓑ{I} W2) ?) -HTU2 /2 width=1/ - | elim (tpss_inv_flat1 … H) -H #W2 #U2 #HVW2 #HTU2 #H destruct - lapply (IH … HVW2 … HL0) -HVW2 // - lapply (IH … HTU2 … HL0) -IH -HTU2 // -HL0 /2 width=1/ -] -qed. - -lemma ltpss_dx_tps_trans_eq: ∀L0,L1,T2,U2,d,e. L0 ▶* [d, e] L1 → - L1 ⊢ T2 ▶ [d, e] U2 → L0 ⊢ T2 ▶* [d, e] U2. -/3 width=3/ qed. - -(* Main properties **********************************************************) - -theorem ltpss_dx_conf: ∀L0,L1,d1,e1. L0 ▶* [d1, e1] L1 → - ∀L2,d2,e2. L0 ▶* [d2, e2] L2 → - ∃∃L. L1 ▶* [d2, e2] L & L2 ▶* [d1, e1] L. -#L0 @(f_ind … lw … L0) -L0 #n #IH * -[ #_ #L1 #d1 #e1 #H1 #L2 #d2 #e2 #H2 -n - >(ltpss_dx_inv_atom1 … H1) -L1 - >(ltpss_dx_inv_atom1 … H2) -L2 /2 width=3/ -| #K0 #I0 #V0 #Hn #L1 #d1 #e1 #H1 #L2 #d2 #e2 #H2 destruct - elim (eq_or_gt d1) #Hd1 [ elim (eq_or_gt e1) #He1 ] destruct - [ lapply (ltpss_dx_inv_refl_O2 … H1) -H1 #H1 - | elim (ltpss_dx_inv_tpss21 … H1 … He1) -H1 #K1 #V1 #HK01 #HV01 #H1 - | elim (ltpss_dx_inv_tpss11 … H1 … Hd1) -H1 #K1 #V1 #HK01 #HV01 #H1 - ] destruct - elim (eq_or_gt d2) #Hd2 [1,3,5: elim (eq_or_gt e2) #He2 ] destruct - [1,3,5: lapply (ltpss_dx_inv_refl_O2 … H2) -H2 #H2 - |2,4,6: elim (ltpss_dx_inv_tpss21 … H2 … He2) -H2 #K2 #V2 #HK02 #HV02 #H2 - |7,8,9: elim (ltpss_dx_inv_tpss11 … H2 … Hd2) -H2 #K2 #V2 #HK02 #HV02 #H2 - ] destruct - [1: -IH /2 width=3/ - |2,3,4,7: -IH /3 width=5/ - |5,6,8,9: - elim (IH … HK01 … HK02) // -K0 #K #HK1 #HK2 - elim (ltpss_dx_tpss_conf … HV01 … HK1) -HV01 #W1 #HW1 #HVW1 - elim (ltpss_dx_tpss_conf … HV02 … HK2) -HV02 #W2 #HW2 #HVW2 - elim (tpss_conf_eq … HW1 … HW2) -V0 #V #HW1 #HW2 - lapply (tpss_trans_eq … HVW1 HW1) -W1 - lapply (tpss_trans_eq … HVW2 HW2) -W2 /3 width=5/ - ] -] -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpss_dx_tps.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpss_dx_tps.etc deleted file mode 100644 index b10306677..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpss_dx_tps.etc +++ /dev/null @@ -1,47 +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/unfold/ltpss_dx_ldrop.ma". - -(* DX PARALLEL UNFOLD ON LOCAL ENVIRONMENTS *********************************) - -(* Properties concerning partial substitution on terms **********************) - -lemma ltpss_dx_tps_conf_ge: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 ▶ [d2, e2] U2 → - ∀L1,d1,e1. L0 ▶* [d1, e1] L1 → d1 + e1 ≤ d2 → - L1 ⊢ T2 ▶ [d2, e2] U2. -#L0 #T2 #U2 #d2 #e2 #H elim H -L0 -T2 -U2 -d2 -e2 -[ // -| #L0 #K0 #V0 #W0 #i2 #d2 #e2 #Hdi2 #Hide2 #HLK0 #HVW0 #L1 #d1 #e1 #HL01 #Hde1d2 - lapply (transitive_le … Hde1d2 Hdi2) -Hde1d2 #Hde1i2 - lapply (ltpss_dx_ldrop_conf_ge … HL01 … HLK0 ?) -L0 // /2 width=4/ -| #L0 #a #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL01 #Hde1d2 - @tps_bind [ /2 width=4/ | @IHTU2 -IHTU2 -IHVW2 [3: /2 by ltpss_dx_tpss1/ |1,2: skip | /2 width=1/ ] ] (**) (* explicit constructor *) -| /3 width=4/ -] -qed. - -lemma ltpss_dx_tps_trans_ge: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 ▶ [d2, e2] U2 → - ∀L1,d1,e1. L1 ▶* [d1, e1] L0 → d1 + e1 ≤ d2 → - L1 ⊢ T2 ▶ [d2, e2] U2. -#L0 #T2 #U2 #d2 #e2 #H elim H -L0 -T2 -U2 -d2 -e2 -[ // -| #L0 #K0 #V0 #W0 #i2 #d2 #e2 #Hdi2 #Hide2 #HLK0 #HVW0 #L1 #d1 #e1 #HL10 #Hde1d2 - lapply (transitive_le … Hde1d2 Hdi2) -Hde1d2 #Hde1i2 - lapply (ltpss_dx_ldrop_trans_ge … HL10 … HLK0 ?) -L0 // /2 width=4/ -| #L0 #a #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL10 #Hde1d2 - @tps_bind [ /2 width=4/ | @IHTU2 -IHTU2 -IHVW2 [3: /2 by ltpss_dx_tpss1/ |1,2: skip | /2 width=1/ ] ] (**) (* explicit constructor *) -| /3 width=4/ -] -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpss_dx_tpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpss_dx_tpss.etc deleted file mode 100644 index 9c7875927..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpss_dx_tpss.etc +++ /dev/null @@ -1,101 +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/unfold/ltpss_dx_tps.ma". - -(* DX PARALLEL UNFOLD ON LOCAL ENVIRONMENTS *********************************) - -(* Properties concerning partial unfold on terms ****************************) - -lemma ltpss_dx_tpss_conf_ge: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 ▶* [d2, e2] U2 → - ∀L1,d1,e1. L0 ▶* [d1, e1] L1 → d1 + e1 ≤ d2 → - L1 ⊢ T2 ▶* [d2, e2] U2. -#L0 #T2 #U2 #d2 #e2 #H #L1 #d1 #e1 #HL01 #Hde1d2 @(tpss_ind … H) -U2 // -#U #U2 #_ #HU2 #IHU -lapply (ltpss_dx_tps_conf_ge … HU2 … HL01 ?) -L0 // -Hde1d2 /2 width=3/ -qed. - -(* Basic_1: was: subst1_subst1_back *) -lemma ltpss_dx_tps_conf: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 ▶ [d2, e2] U2 → - ∀L1,d1,e1. L0 ▶* [d1, e1] L1 → - ∃∃T. L1 ⊢ T2 ▶ [d2, e2] T & - L1 ⊢ U2 ▶* [d1, e1] T. -#L0 #T2 #U2 #d2 #e2 #H elim H -L0 -T2 -U2 -d2 -e2 -[ /2 width=3/ -| #L0 #K0 #V0 #W0 #i2 #d2 #e2 #Hdi2 #Hide2 #HLK0 #HVW0 #L1 #d1 #e1 #HL01 - elim (lt_or_ge i2 d1) #Hi2d1 - [ elim (ltpss_dx_ldrop_conf_le … HL01 … HLK0 ?) -L0 /2 width=2/ #X #H #HLK1 - elim (ltpss_dx_inv_tpss11 … H ?) -H /2 width=1/ #K1 #V1 #_ #HV01 #H destruct - lapply (ldrop_fwd_ldrop2 … HLK1) #H - elim (lift_total V1 0 (i2 + 1)) #W1 #HVW1 - lapply (tpss_lift_ge … HV01 … H HVW0 … HVW1) -V0 -H // >minus_plus minus_plus >commutative_plus /2 width=1/ - | lapply (ltpss_dx_ldrop_conf_ge … HL01 … HLK0 ?) -L0 // /3 width=4/ - ] - ] -| #L0 #a #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL01 - elim (IHVW2 … HL01) -IHVW2 #V #HV2 #HVW2 - elim (IHTU2 (L1. ⓑ{I} V) (d1 + 1) e1 ?) -IHTU2 /2 width=1/ -HL01 /3 width=5/ -| #L0 #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL01 - elim (IHVW2 … HL01) -IHVW2 - elim (IHTU2 … HL01) -IHTU2 -HL01 /3 width=5/ -] -qed. - -lemma ltpss_dx_tpss_trans_ge: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 ▶* [d2, e2] U2 → - ∀L1,d1,e1. L1 ▶* [d1, e1] L0 → d1 + e1 ≤ d2 → - L1 ⊢ T2 ▶* [d2, e2] U2. -#L0 #T2 #U2 #d2 #e2 #H #L1 #d1 #e1 #HL01 #Hde1d2 @(tpss_ind … H) -U2 // -#U #U2 #_ #HU2 #IHU -lapply (ltpss_dx_tps_trans_ge … HU2 … HL01 ?) -L0 // -Hde1d2 /2 width=3/ -qed. - -(* Basic_1: was: subst1_subst1 *) -lemma ltpss_dx_tps_trans: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 ▶ [d2, e2] U2 → - ∀L1,d1,e1. L1 ▶* [d1, e1] L0 → - ∃∃T. L1 ⊢ T2 ▶ [d2, e2] T & - L0 ⊢ T ▶* [d1, e1] U2. -#L0 #T2 #U2 #d2 #e2 #H elim H -L0 -T2 -U2 -d2 -e2 -[ /2 width=3/ -| #L0 #K0 #V0 #W0 #i2 #d2 #e2 #Hdi2 #Hide2 #HLK0 #HVW0 #L1 #d1 #e1 #HL10 - elim (lt_or_ge i2 d1) #Hi2d1 - [ elim (ltpss_dx_ldrop_trans_le … HL10 … HLK0 ?) -HL10 /2 width=2/ #X #H #HLK1 - elim (ltpss_dx_inv_tpss12 … H ?) -H /2 width=1/ #K1 #V1 #_ #HV01 #H destruct - lapply (ldrop_fwd_ldrop2 … HLK0) -HLK0 #H - elim (lift_total V1 0 (i2 + 1)) #W1 #HVW1 - lapply (tpss_lift_ge … HV01 … H HVW1 … HVW0) -V0 -H // >minus_plus minus_plus >commutative_plus /2 width=1/ - | lapply (ltpss_dx_ldrop_trans_ge … HL10 … HLK0 ?) -HL10 -HLK0 // /3 width=4/ - ] - ] -| #L0 #a #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL10 - elim (IHVW2 … HL10) -IHVW2 #V #HV2 #HVW2 - elim (IHTU2 (L1. ⓑ{I} V) (d1 + 1) e1 ?) -IHTU2 /2 width=1/ -HL10 /3 width=5/ -| #L0 #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL10 - elim (IHVW2 … HL10) -IHVW2 - elim (IHTU2 … HL10) -IHTU2 -HL10 /3 width=5/ -] -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpss_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpss_sn.etc deleted file mode 100644 index 577c1506d..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpss_sn.etc +++ /dev/null @@ -1,259 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( T1 break ⊢ ▶ * [ term 46 d , break term 46 e ] break term 46 T2 )" - non associative with precedence 45 - for @{ 'PSubstStarSn $T1 $d $e $T2 }. - -include "basic_2/unfold/tpss.ma". - -(* SN PARALLEL UNFOLD ON LOCAL ENVIRONMENTS *********************************) - -inductive ltpss_sn: nat → nat → relation lenv ≝ -| ltpss_sn_atom : ∀d,e. ltpss_sn d e (⋆) (⋆) -| ltpss_sn_pair : ∀L,I,V. ltpss_sn 0 0 (L. ⓑ{I} V) (L. ⓑ{I} V) -| ltpss_sn_tpss2: ∀L1,L2,I,V1,V2,e. - ltpss_sn 0 e L1 L2 → L1 ⊢ V1 ▶* [0, e] V2 → - ltpss_sn 0 (e + 1) (L1. ⓑ{I} V1) (L2. ⓑ{I} V2) -| ltpss_sn_tpss1: ∀L1,L2,I,V1,V2,d,e. - ltpss_sn d e L1 L2 → L1 ⊢ V1 ▶* [d, e] V2 → - ltpss_sn (d + 1) e (L1. ⓑ{I} V1) (L2. ⓑ{I} V2) -. - -interpretation "parallel unfold (local environment, sn variant)" - 'PSubstStarSn L1 d e L2 = (ltpss_sn d e L1 L2). - -(* Basic inversion lemmas ***************************************************) - -fact ltpss_sn_inv_refl_O2_aux: ∀d,e,L1,L2. L1 ⊢ ▶* [d, e] L2 → e = 0 → L1 = L2. -#d #e #L1 #L2 #H elim H -d -e -L1 -L2 // -[ #L1 #L2 #I #V1 #V2 #e #_ #_ #_ >commutative_plus normalize #H destruct -| #L1 #L2 #I #V1 #V2 #d #e #_ #HV12 #IHL12 #He destruct - >(IHL12 ?) -IHL12 // >(tpss_inv_refl_O2 … HV12) // -] -qed. - -lemma ltpss_sn_inv_refl_O2: ∀d,L1,L2. L1 ⊢ ▶* [d, 0] L2 → L1 = L2. -/2 width=4/ qed-. - -fact ltpss_sn_inv_atom1_aux: ∀d,e,L1,L2. - L1 ⊢ ▶* [d, e] L2 → L1 = ⋆ → L2 = ⋆. -#d #e #L1 #L2 * -d -e -L1 -L2 -[ // -| #L #I #V #H destruct -| #L1 #L2 #I #V1 #V2 #e #_ #_ #H destruct -| #L1 #L2 #I #V1 #V2 #d #e #_ #_ #H destruct -] -qed. - -lemma ltpss_sn_inv_atom1: ∀d,e,L2. ⋆ ⊢ ▶* [d, e] L2 → L2 = ⋆. -/2 width=5/ qed-. - -fact ltpss_sn_inv_tpss21_aux: ∀d,e,L1,L2. L1 ⊢ ▶* [d, e] L2 → d = 0 → 0 < e → - ∀K1,I,V1. L1 = K1. ⓑ{I} V1 → - ∃∃K2,V2. K1 ⊢ ▶* [0, e - 1] K2 & - K1 ⊢ V1 ▶* [0, e - 1] V2 & - L2 = K2. ⓑ{I} V2. -#d #e #L1 #L2 * -d -e -L1 -L2 -[ #d #e #_ #_ #K1 #I #V1 #H destruct -| #L1 #I #V #_ #H elim (lt_refl_false … H) -| #L1 #L2 #I #V1 #V2 #e #HL12 #HV12 #_ #_ #K1 #J #W1 #H destruct /2 width=5/ -| #L1 #L2 #I #V1 #V2 #d #e #_ #_ >commutative_plus normalize #H destruct -] -qed. - -lemma ltpss_sn_inv_tpss21: ∀e,K1,I,V1,L2. K1. ⓑ{I} V1 ⊢ ▶* [0, e] L2 → 0 < e → - ∃∃K2,V2. K1 ⊢ ▶* [0, e - 1] K2 & - K1 ⊢ V1 ▶* [0, e - 1] V2 & - L2 = K2. ⓑ{I} V2. -/2 width=5/ qed-. - -fact ltpss_sn_inv_tpss11_aux: ∀d,e,L1,L2. L1 ⊢ ▶* [d, e] L2 → 0 < d → - ∀I,K1,V1. L1 = K1. ⓑ{I} V1 → - ∃∃K2,V2. K1 ⊢ ▶* [d - 1, e] K2 & - K1 ⊢ V1 ▶* [d - 1, e] V2 & - L2 = K2. ⓑ{I} V2. -#d #e #L1 #L2 * -d -e -L1 -L2 -[ #d #e #_ #I #K1 #V1 #H destruct -| #L #I #V #H elim (lt_refl_false … H) -| #L1 #L2 #I #V1 #V2 #e #_ #_ #H elim (lt_refl_false … H) -| #L1 #L2 #I #V1 #V2 #d #e #HL12 #HV12 #_ #J #K1 #W1 #H destruct /2 width=5/ -] -qed. - -lemma ltpss_sn_inv_tpss11: ∀d,e,I,K1,V1,L2. K1. ⓑ{I} V1 ⊢ ▶* [d, e] L2 → 0 < d → - ∃∃K2,V2. K1 ⊢ ▶* [d - 1, e] K2 & - K1 ⊢ V1 ▶* [d - 1, e] V2 & - L2 = K2. ⓑ{I} V2. -/2 width=3/ qed-. - -fact ltpss_sn_inv_atom2_aux: ∀d,e,L1,L2. - L1 ⊢ ▶* [d, e] L2 → L2 = ⋆ → L1 = ⋆. -#d #e #L1 #L2 * -d -e -L1 -L2 -[ // -| #L #I #V #H destruct -| #L1 #L2 #I #V1 #V2 #e #_ #_ #H destruct -| #L1 #L2 #I #V1 #V2 #d #e #_ #_ #H destruct -] -qed. - -lemma ltpss_sn_inv_atom2: ∀d,e,L1. L1 ⊢ ▶* [d, e] ⋆ → L1 = ⋆. -/2 width=5/ qed-. - -fact ltpss_sn_inv_tpss22_aux: ∀d,e,L1,L2. L1 ⊢ ▶* [d, e] L2 → d = 0 → 0 < e → - ∀K2,I,V2. L2 = K2. ⓑ{I} V2 → - ∃∃K1,V1. K1 ⊢ ▶* [0, e - 1] K2 & - K1 ⊢ V1 ▶* [0, e - 1] V2 & - L1 = K1. ⓑ{I} V1. -#d #e #L1 #L2 * -d -e -L1 -L2 -[ #d #e #_ #_ #K1 #I #V1 #H destruct -| #L1 #I #V #_ #H elim (lt_refl_false … H) -| #L1 #L2 #I #V1 #V2 #e #HL12 #HV12 #_ #_ #K2 #J #W2 #H destruct /2 width=5/ -| #L1 #L2 #I #V1 #V2 #d #e #_ #_ >commutative_plus normalize #H destruct -] -qed. - -lemma ltpss_sn_inv_tpss22: ∀e,L1,K2,I,V2. L1 ⊢ ▶* [0, e] K2. ⓑ{I} V2 → 0 < e → - ∃∃K1,V1. K1 ⊢ ▶* [0, e - 1] K2 & - K1 ⊢ V1 ▶* [0, e - 1] V2 & - L1 = K1. ⓑ{I} V1. -/2 width=5/ qed-. - -fact ltpss_sn_inv_tpss12_aux: ∀d,e,L1,L2. L1 ⊢ ▶* [d, e] L2 → 0 < d → - ∀I,K2,V2. L2 = K2. ⓑ{I} V2 → - ∃∃K1,V1. K1 ⊢ ▶* [d - 1, e] K2 & - K1 ⊢ V1 ▶* [d - 1, e] V2 & - L1 = K1. ⓑ{I} V1. -#d #e #L1 #L2 * -d -e -L1 -L2 -[ #d #e #_ #I #K2 #V2 #H destruct -| #L #I #V #H elim (lt_refl_false … H) -| #L1 #L2 #I #V1 #V2 #e #_ #_ #H elim (lt_refl_false … H) -| #L1 #L2 #I #V1 #V2 #d #e #HL12 #HV12 #_ #J #K2 #W2 #H destruct /2 width=5/ -] -qed. - -lemma ltpss_sn_inv_tpss12: ∀L1,K2,I,V2,d,e. L1 ⊢ ▶* [d, e] K2. ⓑ{I} V2 → 0 < d → - ∃∃K1,V1. K1 ⊢ ▶* [d - 1, e] K2 & - K1 ⊢ V1 ▶* [d - 1, e] V2 & - L1 = K1. ⓑ{I} V1. -/2 width=3/ qed-. - -(* Basic properties *********************************************************) - -lemma ltpss_sn_tps2: ∀L1,L2,I,V1,V2,e. - L1 ⊢ ▶* [0, e] L2 → L1 ⊢ V1 ▶ [0, e] V2 → - L1. ⓑ{I} V1 ⊢ ▶* [0, e + 1] L2. ⓑ{I} V2. -/3 width=1/ qed. - -lemma ltpss_sn_tps1: ∀L1,L2,I,V1,V2,d,e. - L1 ⊢ ▶* [d, e] L2 → L1 ⊢ V1 ▶ [d, e] V2 → - L1. ⓑ{I} V1 ⊢ ▶* [d + 1, e] L2. ⓑ{I} V2. -/3 width=1/ qed. - -lemma ltpss_sn_tpss2_lt: ∀L1,L2,I,V1,V2,e. - L1 ⊢ ▶* [0, e - 1] L2 → L1 ⊢ V1 ▶* [0, e - 1] V2 → - 0 < e → L1. ⓑ{I} V1 ⊢ ▶* [0, e] L2. ⓑ{I} V2. -#L1 #L2 #I #V1 #V2 #e #HL12 #HV12 #He ->(plus_minus_m_m e 1) /2 width=1/ -qed. - -lemma ltpss_sn_tpss1_lt: ∀L1,L2,I,V1,V2,d,e. - L1 ⊢ ▶* [d - 1, e] L2 → L1 ⊢ V1 ▶* [d - 1, e] V2 → - 0 < d → L1. ⓑ{I} V1 ⊢ ▶* [d, e] L2. ⓑ{I} V2. -#L1 #L2 #I #V1 #V2 #d #e #HL12 #HV12 #Hd ->(plus_minus_m_m d 1) /2 width=1/ -qed. - -lemma ltpss_sn_tps2_lt: ∀L1,L2,I,V1,V2,e. - L1 ⊢ ▶* [0, e - 1] L2 → L1 ⊢ V1 ▶ [0, e - 1] V2 → - 0 < e → L1. ⓑ{I} V1 ⊢ ▶* [0, e] L2. ⓑ{I} V2. -/3 width=1/ qed. - -lemma ltpss_sn_tps1_lt: ∀L1,L2,I,V1,V2,d,e. - L1 ⊢ ▶* [d - 1, e] L2 → L1 ⊢ V1 ▶ [d - 1, e] V2 → - 0 < d → L1. ⓑ{I} V1 ⊢ ▶* [d, e] L2. ⓑ{I} V2. -/3 width=1/ qed. - -lemma ltpss_sn_refl: ∀L,d,e. L ⊢ ▶* [d, e] L. -#L elim L -L // -#L #I #V #IHL * /2 width=1/ * /2 width=1/ -qed. - -lemma ltpss_sn_weak: ∀L1,L2,d1,e1. L1 ⊢ ▶* [d1, e1] L2 → - ∀d2,e2. d2 ≤ d1 → d1 + e1 ≤ d2 + e2 → L1 ⊢ ▶* [d2, e2] L2. -#L1 #L2 #d1 #e1 #H elim H -L1 -L2 -d1 -e1 // -[ #L1 #L2 #I #V1 #V2 #e1 #_ #HV12 #IHL12 #d2 #e2 #Hd2 #Hde2 - lapply (le_n_O_to_eq … Hd2) #H destruct normalize in Hde2; - lapply (lt_to_le_to_lt 0 … Hde2) // #He2 - lapply (le_plus_to_minus_r … Hde2) -Hde2 /3 width=5/ -| #L1 #L2 #I #V1 #V2 #d1 #e1 #_ #HV12 #IHL12 #d2 #e2 #Hd21 #Hde12 - >plus_plus_comm_23 in Hde12; #Hde12 - elim (le_to_or_lt_eq 0 d2 ?) // #H destruct - [ lapply (le_plus_to_minus_r … Hde12) -Hde12 plus_plus_comm_23 - /4 width=5 by ltpss_sn_tpss2, tpss_append, tpss_weak, monotonic_le_plus_r/ (**) (* too slow without trace *) -| #K1 #K2 #I #V1 #V2 #d #x #_ #HV12 #IHK12 normalize (ldrop_inv_atom1 … H) -H // -| // -| normalize #K0 #K1 #I #V0 #V1 #e1 #_ #_ #IHK01 #L2 #e2 #H #He12 - elim (le_inv_plus_l … He12) #_ #He2 - lapply (ldrop_inv_ldrop1 … H ?) -H // #HK0L2 - lapply (IHK01 … HK0L2 ?) -K0 /2 width=1/ -| #K0 #K1 #I #V0 #V1 #d1 #e1 >plus_plus_comm_23 #_ #_ #IHK01 #L2 #e2 #H #Hd1e2 - elim (le_inv_plus_l … Hd1e2) #_ #He2 - lapply (ldrop_inv_ldrop1 … H ?) -H // #HK0L2 - lapply (IHK01 … HK0L2 ?) -K0 /2 width=1/ -] -qed. - -lemma ltpss_sn_ldrop_trans_ge: ∀L1,L0,d1,e1. L1 ⊢ ▶* [d1, e1] L0 → - ∀L2,e2. ⇩[0, e2] L0 ≡ L2 → - d1 + e1 ≤ e2 → ⇩[0, e2] L1 ≡ L2. -#L1 #L0 #d1 #e1 #H elim H -L1 -L0 -d1 -e1 -[ #d1 #e1 #L2 #e2 #H >(ldrop_inv_atom1 … H) -H // -| // -| normalize #K1 #K0 #I #V1 #V0 #e1 #_ #_ #IHK10 #L2 #e2 #H #He12 - elim (le_inv_plus_l … He12) #_ #He2 - lapply (ldrop_inv_ldrop1 … H ?) -H // #HK0L2 - lapply (IHK10 … HK0L2 ?) -K0 /2 width=1/ -| #K0 #K1 #I #V1 #V0 #d1 #e1 >plus_plus_comm_23 #_ #_ #IHK10 #L2 #e2 #H #Hd1e2 - elim (le_inv_plus_l … Hd1e2) #_ #He2 - lapply (ldrop_inv_ldrop1 … H ?) -H // #HK0L2 - lapply (IHK10 … HK0L2 ?) -IHK10 -HK0L2 /2 width=1/ -] -qed. - -lemma ltpss_sn_ldrop_conf_be: ∀L0,L1,d1,e1. L0 ⊢ ▶* [d1, e1] L1 → - ∀L2,e2. ⇩[0, e2] L0 ≡ L2 → d1 ≤ e2 → e2 ≤ d1 + e1 → - ∃∃L. L2 ⊢ ▶* [0, d1 + e1 - e2] L & ⇩[0, e2] L1 ≡ L. -#L0 #L1 #d1 #e1 #H elim H -L0 -L1 -d1 -e1 -[ #d1 #e1 #L2 #e2 #H >(ldrop_inv_atom1 … H) -H /2 width=3/ -| normalize #L #I #V #L2 #e2 #HL2 #_ #He2 - lapply (le_n_O_to_eq … He2) -He2 #H destruct - lapply (ldrop_inv_refl … HL2) -HL2 #H destruct /2 width=3/ -| normalize #K0 #K1 #I #V0 #V1 #e1 #HK01 #HV01 #IHK01 #L2 #e2 #H #_ #He21 - lapply (ldrop_inv_O1 … H) -H * * #He2 #HK0L2 - [ -IHK01 -He21 destruct plus_plus_comm_23 #_ #_ #IHK01 #L2 #e2 #H #Hd1e2 #He2de1 - elim (le_inv_plus_l … Hd1e2) #_ #He2 - (ldrop_inv_atom1 … H) -H /2 width=3/ -| normalize #L #I #V #L2 #e2 #HL2 #_ #He2 - lapply (le_n_O_to_eq … He2) -He2 #H destruct - lapply (ldrop_inv_refl … HL2) -HL2 #H destruct /2 width=3/ -| normalize #K1 #K0 #I #V1 #V0 #e1 #HK10 #HV10 #IHK10 #L2 #e2 #H #_ #He21 - lapply (ldrop_inv_O1 … H) -H * * #He2 #HK0L2 - [ -IHK10 -He21 destruct plus_plus_comm_23 #_ #_ #IHK10 #L2 #e2 #H #Hd1e2 #He2de1 - elim (le_inv_plus_l … Hd1e2) #_ #He2 - (ldrop_inv_atom1 … H) -H /2 width=3/ -| /2 width=3/ -| normalize #K0 #K1 #I #V0 #V1 #e1 #HK01 #HV01 #_ #L2 #e2 #H #He2 - lapply (le_n_O_to_eq … He2) -He2 #He2 destruct - lapply (ldrop_inv_refl … H) -H #H destruct /3 width=3/ -| #K0 #K1 #I #V0 #V1 #d1 #e1 #HK01 #HV01 #IHK01 #L2 #e2 #H #He2d1 - lapply (ldrop_inv_O1 … H) -H * * #He2 #HK0L2 - [ -IHK01 -He2d1 destruct (ldrop_inv_atom1 … H) -H /2 width=3/ -| /2 width=3/ -| normalize #K1 #K0 #I #V1 #V0 #e1 #HK10 #HV10 #_ #L2 #e2 #H #He2 - lapply (le_n_O_to_eq … He2) -He2 #He2 destruct - lapply (ldrop_inv_refl … H) -H #H destruct /3 width=3/ -| #K1 #K0 #I #V1 #V0 #d1 #e1 #HK10 #HV10 #IHK10 #L2 #e2 #H #He2d1 - lapply (ldrop_inv_O1 … H) -H * * #He2 #HK0L2 - [ -IHK10 -He2d1 destruct (ltpss_sn_inv_atom1 … H) -H /2 width=3/ -| /2 width=3/ -| #L1 #K1 #I #V #e1 #_ #IHLK1 #K2 #d2 #e2 #HK12 #Hd - elim (IHLK1 … HK12 Hd) -K1 -Hd /3 width=5/ -| #L1 #K1 #I #V1 #W1 #d1 #e1 #HLK1 #HWV1 #IHLK1 #X #d2 #e2 #H #Hd12 - elim (le_inv_plus_l … Hd12) -Hd12 #Hd12 #Hd2 - elim (ltpss_sn_inv_tpss11 … H Hd2) -H #K2 #W2 #HK12 #HW12 #H destruct - elim (IHLK1 … HK12 … Hd12) -IHLK1 -HK12 (ltpss_sn_inv_atom1 … H) -H /2 width=3/ -| #K1 #I #V1 #K2 #d2 #e2 #HK12 #H #_ - lapply (le_n_O_to_eq … H) -H #H destruct /2 width=3/ -| #L1 #K1 #I #V #e1 #_ #IHLK1 #K2 #d2 #e2 #HK12 #H1 #H2 - elim (IHLK1 … HK12 H1 H2) -K1 -H2 - lapply (le_n_O_to_eq … H1) -H1 #H destruct /3 width=5/ -| #L1 #K1 #I #V1 #W1 #d1 #e1 #HLK1 #HWV1 #IHLK1 #X #d2 #e2 #H #Hd21 #Hd12 - elim (eq_or_gt d2) #Hd2 [ -Hd21 elim (eq_or_gt e2) #He2 ] destruct - [ lapply (le_n_O_to_eq … Hd12) -Hd12 plus_minus_commutative // #L2 #HL12 #HLK2 - elim (lift_total W2 d1 e1) #V2 #HWV2 - lapply (tpss_lift_be … HW12 … HLK1 HWV1 … HWV2) -HLK1 -W1 // /2 width=1/ - >plus_minus // >commutative_plus /4 width=5/ - | elim (ltpss_sn_inv_tpss11 … H Hd2) -H #K2 #W2 #HK12 #HW12 #H destruct - elim (IHLK1 … HK12 …) -IHLK1 [2: >plus_minus // ] /2 width=1/ #L2 #HL12 #HLK2 - elim (lift_total W2 d1 e1) #V2 #HWV2 - lapply (tpss_lift_be … HW12 … HLK1 HWV1 … HWV2) -HLK1 -W1 [ >plus_minus // ] /2 width=1/ - >commutative_plus /3 width=5/ - ] -] -qed-. - -lemma ldrop_ltpss_sn_trans_ge: ∀L1,K1,d1,e1. ⇩[d1, e1] L1 ≡ K1 → - ∀K2,d2,e2. K1 ⊢ ▶* [d2, e2] K2 → d2 + e2 ≤ d1 → - ∃∃L2. L1 ⊢ ▶* [d2, e2] L2 & ⇩[d1, e1] L2 ≡ K2. -#L1 #K1 #d1 #e1 #H elim H -L1 -K1 -d1 -e1 -[ #d1 #e1 #K2 #d2 #e2 #H #_ - >(ltpss_sn_inv_atom1 … H) -H /2 width=3/ -| #K1 #I #V1 #K2 #d2 #e2 #HK12 #H - elim (plus_le_0 … H) -H #H1 #H2 destruct /2 width=3/ -| #L1 #K1 #I #V #e1 #_ #IHLK1 #K2 #d2 #e2 #HK12 #H - elim (IHLK1 … HK12 H) -K1 - elim (plus_le_0 … H) -H #H1 #H2 destruct #L2 #HL12 - >(ltpss_sn_inv_refl_O2 … HL12) -L1 /3 width=5/ -| #L1 #K1 #I #V1 #W1 #d1 #e1 #HLK1 #HWV1 #IHLK1 #X #d2 #e2 #H #Hd21 - elim (eq_or_gt d2) #Hd2 [ elim (eq_or_gt e2) #He2 ] destruct - [ -IHLK1 -Hd21 <(ltpss_sn_inv_refl_O2 … H) -X /3 width=5/ - | elim (ltpss_sn_inv_tpss21 … H He2) -H #K2 #W2 #HK12 #HW12 #H destruct - elim (IHLK1 … HK12 …) -IHLK1 /2 width=1/ #L2 #HL12 #HLK2 - elim (lift_total W2 d1 e1) #V2 #HWV2 - lapply (tpss_lift_le … HW12 … HLK1 HWV1 … HWV2) -HLK1 -W1 /2 width=1/ /3 width=5/ - | elim (ltpss_sn_inv_tpss11 … H Hd2) -H #K2 #W2 #HK12 #HW12 #H destruct - elim (IHLK1 … HK12 …) -IHLK1 [2: >plus_minus // /2 width=1/ ] #L2 #HL12 #HLK2 - elim (lift_total W2 d1 e1) #V2 #HWV2 - lapply (tpss_lift_le … HW12 … HLK1 HWV1 … HWV2) -HLK1 -W1 [ >plus_minus // /2 width=1/ ] /3 width=5/ - ] -] -qed-. - -(* Properties on supclosure *************************************************) - -lemma fsup_tpss_trans_full: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ → ∀U2. L2 ⊢ T2 ▶*[0,|L2|] U2 → - ∃∃L,U1. L1 ⊢ ▶*[0,|L1|] L & L ⊢ T1 ▶*[0,|L|] U1 & ⦃L, U1⦄ ⊃ ⦃L2, T2⦄. -#L1 #L2 #T1 #T2 #H elim H -L1 -L2 -T1 -T2 [1,2,3,4,5: /3 width=5/ ] -#L1 #K1 #K2 #T1 #T2 #U1 #d #e #HLK1 #HTU1 #_ #IHT12 #U2 #HTU2 -elim (IHT12 … HTU2) -IHT12 -HTU2 #K #T #HK1 #HT1 #HT2 -elim (lift_total T d e) #U #HTU -lapply (ltpss_sn_fwd_length … HK1) #H >H in HK1; -H #HK1 -elim (le_or_ge d (|K|)) #Hd -[ elim (ldrop_ltpss_sn_trans_be … HLK1 … HK1 … Hd) // -HLK1 -HK1 #L2 #HL12 #HL2K - lapply (tpss_lift_be … HT1 … Hd HL2K HTU1 … HTU) // -HT1 -HTU1 #HU1 -| elim (ldrop_ltpss_sn_trans_ge … HLK1 … HK1 Hd) -HLK1 -HK1 #L2 #HL12 #HL2K - lapply (tpss_lift_le … HT1 … Hd HL2K HTU1 … HTU) -HT1 -HTU1 #HU1 -] -lapply (ltpss_sn_weak_full … HL12) -HL12 #HL12 -lapply (tpss_weak_full … HU1) -HU1 #HU1 -@(ex3_2_intro … L2 U) // /2 width=7/ (**) (* explicit constructor: auto /3 width=14/ too slow *) -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpss_sn_ltpss_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpss_sn_ltpss_sn.etc deleted file mode 100644 index 67c287e2b..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpss_sn_ltpss_sn.etc +++ /dev/null @@ -1,81 +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/unfold/tpss_tpss.ma". -include "basic_2/unfold/ltpss_sn_tpss.ma". - -(* PARTIAL UNFOLD ON LOCAL ENVIRONMENTS *************************************) - -(* Advanced properties ******************************************************) - -lemma ltpss_sn_tpss_trans_eq: ∀L1,T2,U2,d,e. L1 ⊢ T2 ▶* [d, e] U2 → - ∀L0. L0 ⊢ ▶* [d, e] L1 → L0 ⊢ T2 ▶* [d, e] U2. -#L1 #T2 @(f2_ind … fw … L1 T2) -L1 -T2 #n #IH #L1 * -[ #I #Hn #W2 #d #e #H #L0 #HL01 destruct - elim (tpss_inv_atom1 … H) -H // * - #K1 #V1 #V2 #i #Hdi #Hide #HLK1 #HV12 #HVW2 #H destruct - lapply (ldrop_fwd_lw … HLK1) #H1 normalize in H1; - elim (ltpss_sn_ldrop_trans_be … HL01 … HLK1 ? ?) -HL01 -HLK1 // /2 width=2/ #X #H #HLK0 - elim (ltpss_sn_inv_tpss22 … H ?) -H /2 width=1/ #K0 #V0 #HK01 #HV01 #H destruct - lapply (IH … HV12 … HK01) -IH -HV12 -HK01 [ normalize /2 width=1/ ] #HV12 - lapply (tpss_trans_eq … HV01 HV12) -V1 /2 width=6/ -| * [ #a ] #I #V2 #T2 #Hn #X #d #e #H #L0 #HL0 destruct - [ elim (tpss_inv_bind1 … H) -H #W2 #U2 #HVW2 #HTU2 #H destruct - lapply (tpss_lsubr_trans … HTU2 (L1. ⓑ{I} V2) ?) -HTU2 /2 width=1/ #HTU2 - lapply (IH … HVW2 … HL0) -HVW2 [ /2 width=2/ ] #HVW2 - lapply (IH … HTU2 (L0. ⓑ{I} V2) ?) -IH -HTU2 // /2 width=2/ -HL0 #HTU2 - lapply (tpss_lsubr_trans … HTU2 (L0. ⓑ{I} W2) ?) -HTU2 /2 width=1/ - | elim (tpss_inv_flat1 … H) -H #W2 #U2 #HVW2 #HTU2 #H destruct - lapply (IH … HVW2 … HL0) -HVW2 // - lapply (IH … HTU2 … HL0) -IH -HTU2 // -HL0 /2 width=1/ -] -qed. - -lemma ltpss_sn_tps_trans_eq: ∀L0,L1,T2,U2,d,e. L0 ⊢ ▶* [d, e] L1 → - L1 ⊢ T2 ▶ [d, e] U2 → L0 ⊢ T2 ▶* [d, e] U2. -/3 width=3/ qed. - -(* Main properties **********************************************************) - -theorem ltpss_sn_trans_eq: ∀L1,L,d,e. L1 ⊢ ▶* [d, e] L → - ∀L2. L ⊢ ▶* [d, e] L2 → L1 ⊢ ▶* [d, e] L2. -#L1 #L #d #e #H elim H -L1 -L -d -e // -[ #L1 #L #I #V1 #V #e #HL1 #HV1 #IHL1 #X #H - elim (ltpss_sn_inv_tpss21 … H ?) -H // shift_append_assoc #H - elim (tps_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct - elim (IH … HT12) -IH -HT12 #L2 #T #HL12 #HT1 #H destruct - append_length minus_plus minus_plus >commutative_plus /2 width=1/ - | lapply (ltpss_sn_ldrop_conf_ge … HL01 … HLK0 ?) -HL01 -HLK0 // /3 width=4/ - ] - ] -| #L0 #a #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL01 - elim (IHVW2 … HL01) -IHVW2 #V #HV2 #HVW2 - elim (IHTU2 (L1. ⓑ{I} V) (d1 + 1) e1 ?) -IHTU2 /2 width=1/ -HL01 #T #HT2 #H - lapply (tpss_lsubr_trans … H (L0.ⓑ{I}V) ?) -H /2 width=1/ /3 width=5/ -| #L0 #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL01 - elim (IHVW2 … HL01) -IHVW2 - elim (IHTU2 … HL01) -IHTU2 -HL01 /3 width=5/ -] -qed. - -lemma ltpss_sn_tpss_trans_ge: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 ▶* [d2, e2] U2 → - ∀L1,d1,e1. L1 ⊢ ▶* [d1, e1] L0 → d1 + e1 ≤ d2 → - L1 ⊢ T2 ▶* [d2, e2] U2. -#L0 #T2 #U2 #d2 #e2 #H #L1 #d1 #e1 #HL01 #Hde1d2 @(tpss_ind … H) -U2 // -#U #U2 #_ #HU2 #IHU -lapply (ltpss_sn_tps_trans_ge … HU2 … HL01 ?) -L0 // -Hde1d2 /2 width=3/ -qed. - -lemma ltpss_sn_tps_trans: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 ▶ [d2, e2] U2 → - ∀L1,d1,e1. L1 ⊢ ▶* [d1, e1] L0 → - ∃∃T. L1 ⊢ T2 ▶ [d2, e2] T & - L1 ⊢ T ▶* [d1, e1] U2. -#L0 #T2 #U2 #d2 #e2 #H elim H -L0 -T2 -U2 -d2 -e2 -[ /2 width=3/ -| #L0 #K0 #V0 #W0 #i2 #d2 #e2 #Hdi2 #Hide2 #HLK0 #HVW0 #L1 #d1 #e1 #HL10 - elim (lt_or_ge i2 d1) #Hi2d1 - [ elim (ltpss_sn_ldrop_trans_le … HL10 … HLK0 ?) -L0 /2 width=2/ #X #H #HLK1 - elim (ltpss_sn_inv_tpss12 … H ?) -H /2 width=1/ #K1 #V1 #_ #HV01 #H destruct - lapply (ldrop_fwd_ldrop2 … HLK1) #H - elim (lift_total V1 0 (i2 + 1)) #W1 #HVW1 - lapply (tpss_lift_ge … HV01 … H HVW1 … HVW0) -V0 -H // >minus_plus minus_plus >commutative_plus /2 width=1/ - | lapply (ltpss_sn_ldrop_trans_ge … HL10 … HLK0 ?) -HL10 -HLK0 // /3 width=4/ - ] - ] -| #L0 #a #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL10 - elim (IHVW2 … HL10) -IHVW2 #V #HV2 #HVW2 - elim (IHTU2 (L1. ⓑ{I} V) (d1 + 1) e1 ?) -IHTU2 /2 width=1/ -HL10 #T #HT2 #H - lapply (tpss_lsubr_trans … H (L1.ⓑ{I}W2) ?) -H /2 width=1/ /3 width=5/ -| #L0 #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL10 - elim (IHVW2 … HL10) -IHVW2 - elim (IHTU2 … HL10) -IHTU2 -HL10 /3 width=5/ -] -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/snv_ltpss_dx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/snv_ltpss_dx.etc deleted file mode 100644 index ca55239f0..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/snv_ltpss_dx.etc +++ /dev/null @@ -1,87 +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/computation/dxprs_ltpss_dx.ma". -include "basic_2/equivalence/cpcs_ltpss_dx.ma". -include "basic_2/dynamic/snv_lift.ma". - -(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************) - -(* Properties about dx parallel unfold **************************************) - -lemma snv_ltpss_dx_tpss_conf: ∀h,g,L1,T1. ⦃h, L1⦄ ⊢ T1 ¡[g] → - ∀L2,d,e. L1 ▶* [d, e] L2 → - ∀T2. L2 ⊢ T1 ▶* [d, e] T2 → ⦃h, L2⦄ ⊢ T2 ¡[g]. -#h #g #L1 #T1 #H elim H -L1 -T1 -[ #L1 #k #L2 #d #e #_ #X #H - >(tpss_inv_sort1 … H) -X // -| #I #L1 #K1 #V1 #i #HLK1 #HV1 #IHV1 #L2 #d #e #HL12 #X #H - elim (tpss_inv_lref1 … H) -H - [ #H destruct - elim (lt_or_ge i d) #Hdi [ | elim (lt_or_ge i (d + e)) #Hide ] - [ elim (ltpss_dx_ldrop_conf_le … HL12 … HLK1 …) -L1 /2 width=2/ #X #H #HLK2 - elim (ltpss_dx_inv_tpss11 … H …) -H /2 width=1/ #K2 #V2 #HK12 #HV12 #H destruct - lapply (IHV1 … HK12 … HV12) -IHV1 -HK12 -HV12 /2 width=5/ - | elim (ltpss_dx_ldrop_conf_be … HL12 … HLK1 …) -L1 // /2 width=2/ #X #H #HLK2 - elim (ltpss_dx_inv_tpss21 … H …) -H /2 width=1/ #K2 #V2 #HK12 #HV12 #H destruct - lapply (IHV1 … HK12 … HV12) -IHV1 -HK12 -HV12 /2 width=5/ - | lapply (ltpss_dx_ldrop_conf_ge … HL12 … HLK1 ?) -L1 // -Hide /2 width=5/ - ] - | * #K2 #V2 #W2 #Hdi #Hide #HLK2 #HVW2 #HWT2 - elim (ltpss_dx_ldrop_conf_be … HL12 … HLK1 …) -L1 // /2 width=2/ #X #H1 #H2 - elim (ltpss_dx_inv_tpss21 … H1 …) -H1 /2 width=1/ #K0 #V0 #HK12 #HV12 #H destruct - lapply (ldrop_mono … H2 … HLK2) -H2 #H destruct - lapply (ldrop_fwd_ldrop2 … HLK2) -HLK2 #HLK2 - lapply (tpss_trans_eq … HV12 HVW2) -V2 #HV1W2 - lapply (IHV1 … HK12 … HV1W2) -IHV1 -HK12 -HV1W2 /2 width=7/ - ] -| #a #I #L1 #V1 #T1 #_ #_ #IHV1 #IHT1 #L2 #d #e #HL12 #X #H - elim (tpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct - lapply (IHV1 … HL12 … HV12) -IHV1 #HV2 - lapply (IHT1 … HT12) -IHT1 -HT12 /2 width=1/ -| #a #L1 #V1 #W1 #W0 #T1 #U1 #l #_ #_ #HVW1 #HW10 #HTU1 #IHV1 #IHT1 #L2 #d #e #HL12 #X #H - elim (tpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct - lapply (IHV1 … HL12 … HV12) -IHV1 #HV2 - lapply (IHT1 … HT12) -IHT1 /2 width=1/ #HT2 - elim (ssta_ltpss_dx_tpss_conf … HVW1 … HL12 … HV12) -V1 #W2 #HVW2 #HW12 - elim (dxprs_ltpss_dx_tpss_conf … HTU1 … HL12 … HT12) -T1 #X #HTU2 #H - elim (tpss_inv_bind1 … H) -H #W #U2 #HW0 #_ #H -U1 destruct - elim (cprs_ltpss_dx_tpss2_conf … HW10 … HL12 … HW12 … HW0) -L1 -W1 -W0 #W0 #HW20 #HW0 - lapply (dxprs_strap1 … (ⓛ{a}W0.U2) HTU2 ?) -HTU2 /3 width=3/ -HW0 /2 width=8/ -| #L1 #W1 #T1 #U1 #l #_ #_ #HTU1 #HUW1 #IHW1 #IHT1 #L2 #d #e #HL12 #X #H - elim (tpss_inv_flat1 … H) -H #W2 #T2 #HW12 #HT12 #H destruct - lapply (IHW1 … HL12 … HW12) -IHW1 #HW2 - lapply (IHT1 … HL12 … HT12) -IHT1 #HT2 - elim (ssta_ltpss_dx_tpss_conf … HTU1 … HL12 … HT12) -T1 #U2 #HTU2 #HU12 - lapply (cpcs_ltpss_dx_tpss2_conf … HL12 … HUW1 … HU12 … HW12) -L1 -W1 -U1 /2 width=4/ -] -qed-. - -lemma snv_ltpss_dx_conf: ∀h,g,L1,T. ⦃h, L1⦄ ⊢ T ¡[g] → - ∀L2,d,e. L1 ▶* [d, e] L2 → ⦃h, L2⦄ ⊢ T ¡[g]. -#h #g #L1 #T #HT #L2 #d #e #HL12 -@(snv_ltpss_dx_tpss_conf … HT … HL12) // -qed-. - -lemma snv_tpss_conf: ∀h,g,L,T1. ⦃h, L⦄ ⊢ T1 ¡[g] → - ∀T2,d,e. L ⊢ T1 ▶* [d, e] T2 → ⦃h, L⦄ ⊢ T2 ¡[g]. -#h #g #L #T1 #HT1 #T2 #d #e #HT12 -@(snv_ltpss_dx_tpss_conf … HT1 … HT12) // -qed-. - -lemma snv_tps_conf: ∀h,g,L,T1. ⦃h, L⦄ ⊢ T1 ¡[g] → - ∀T2,d,e. L ⊢ T1 ▶ [d, e] T2 → ⦃h, L⦄ ⊢ T2 ¡[g]. -#h #g #L #T1 #HT1 #T2 #d #e #HT12 -@(snv_tpss_conf … HT1 T2) /2 width=3/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/snv_ltpss_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/snv_ltpss_sn.etc deleted file mode 100644 index 3c8070249..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/snv_ltpss_sn.etc +++ /dev/null @@ -1,28 +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/dynamic/snv_ltpss_dx.ma". - -(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************) - -(* Properties about sn parallel unfold **************************************) - -lemma snv_ltpss_sn_conf: ∀h,g,L1,L2,d,e. L1 ⊢ ▶* [d, e] L2 → - ∀T. ⦃h, L1⦄ ⊢ T ¡[g] → ⦃h, L2⦄ ⊢ T ¡[g]. -#h #g #L1 #L2 #d #e #H -lapply (ltpss_sn_ltpssa … H) -H #H @(ltpssa_ind … H) -L2 // -#L #L2 #_ #HL2 #IHL1 #T1 #HT1 -lapply (IHL1 … HT1) -IHL1 -HT1 #HT1 -lapply (snv_ltpss_dx_conf … HT1 … HL2) -HT1 -HL2 // -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ssta_ltpss_dx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ssta_ltpss_dx.etc deleted file mode 100644 index 72eff7850..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ssta_ltpss_dx.etc +++ /dev/null @@ -1,125 +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/unfold/tpss_tpss.ma". -include "basic_2/unfold/ltpss_dx_tpss.ma". -include "basic_2/static/ssta_lift.ma". - -(* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************) - -(* Properties about dx parallel unfold **************************************) - -(* Note: apparently this was missing in basic_1 *) -lemma ssta_ltpss_dx_tpss_conf: ∀h,g,L1,T1,U1,l. ⦃h, L1⦄ ⊢ T1 •[g] ⦃l, U1⦄ → - ∀L2,d,e. L1 ▶* [d, e] L2 → - ∀T2. L2 ⊢ T1 ▶* [d, e] T2 → - ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g] ⦃l, U2⦄ & - L2 ⊢ U1 ▶* [d, e] U2. -#h #g #L1 #T1 #U #l #H elim H -L1 -T1 -U -l -[ #L1 #k1 #l1 #Hkl1 #L2 #d #e #_ #T2 #H - >(tpss_inv_sort1 … H) -H /3 width=3/ -| #L1 #K1 #V1 #W1 #U1 #i #l #HLK1 #HVW1 #HWU1 #IHVW1 #L2 #d #e #HL12 #T2 #H - elim (tpss_inv_lref1 … H) -H [ | -HVW1 ] - [ #H destruct - elim (lt_or_ge i d) #Hdi [ -HVW1 | ] - [ elim (ltpss_dx_ldrop_conf_le … HL12 … HLK1 ?) -L1 /2 width=2/ #X #H #HLK2 - elim (ltpss_dx_inv_tpss11 … H ?) -H /2 width=1/ #K2 #V2 #HK12 #HV12 #H destruct - elim (IHVW1 … HK12 … HV12) -IHVW1 -HK12 -HV12 #W2 #HVW2 #HW12 - lapply (ldrop_fwd_ldrop2 … HLK2) #H - elim (lift_total W2 0 (i+1)) #U2 #HWU2 - lapply (tpss_lift_ge … HW12 … H … HWU1 … HWU2) // -HW12 -H -HWU1 - >minus_plus minus_plus #H - lapply (tpss_weak … H d e ? ?) [1,2: normalize [ >commutative_plus minus_plus #H - lapply (tpss_weak … H d e ? ?) [1,2: normalize [ >commutative_plus minus_plus minus_plus #H - lapply (tpss_weak … H d e ? ?) [1,2: normalize [ >commutative_plus (tpss_inv_sort1 … H) -H /2 width=3/ -| #L1 #K1 #V1 #W1 #U1 #i #HLK1 #HVW1 #HWU1 #IHVW1 #L2 #d #e #HL12 #T2 #H - elim (tpss_inv_lref1 … H) -H [ | -HVW1 ] - [ #H destruct - elim (lt_or_ge i d) #Hdi [ -HVW1 | ] - [ elim (ltpss_ldrop_conf_le … HL12 … HLK1 ?) -L1 /2 width=2/ #X #H #HLK2 - elim (ltpss_inv_tpss11 … H ?) -H /2 width=1/ #K2 #V2 #HK12 #HV12 #H destruct - elim (IHVW1 … HK12 … HV12) -IHVW1 -HK12 -HV12 #W2 #HVW2 #HW12 - lapply (ldrop_fwd_ldrop2 … HLK2) #H - elim (lift_total W2 0 (i+1)) #U2 #HWU2 - lapply (tpss_lift_ge … HW12 … H … HWU1 … HWU2) // -HW12 -H -HWU1 - >minus_plus minus_plus #H - lapply (tpss_weak … H d e ? ?) [1,2: normalize [ >commutative_plus minus_plus #H - lapply (tpss_weak … H d e ? ?) [1,2: normalize [ >commutative_plus minus_plus minus_plus #H - lapply (tpss_weak … H d e ? ?) [1,2: normalize [ >commutative_plus shift_append_assoc normalize #H - elim (tpr_inv_bind1 … H) -H * - [ #V0 #T0 #X0 #_ #HT10 #H0 #H destruct - elim (IH … HT10) -IH -T1 #L #T #HL1 #H destruct - elim (tps_fwd_shift1 … H0) -T #L2 #T2 #HL2 #H destruct - >append_length >HL1 >HL2 -L1 -L - @(ex2_2_intro … (⋆.ⓑ{I}V0@@L2) T2) [ >append_length ] // /2 width=3/ (**) (* explicit constructor *) - | #T #_ #_ #H destruct - ] -] -qed-. - -(* Basic_1: removed theorems 3: - pr0_subst0_back pr0_subst0_fwd pr0_subst0 -*) -(* Basic_1: removed local theorems: 1: pr0_delta_tau *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpr_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpr_lift.etc deleted file mode 100644 index 8d6b0363a..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpr_lift.etc +++ /dev/null @@ -1,121 +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/substitution/tps_lift.ma". -include "basic_2/reducibility/tpr.ma". - -(* CONTEXT-FREE PARALLEL REDUCTION ON TERMS *********************************) - -(* Relocation properties ****************************************************) - -(* Basic_1: was: pr0_lift *) -lemma tpr_lift: t_liftable tpr. -#T1 #T2 #H elim H -T1 -T2 -[ * #i #U1 #d #e #HU1 #U2 #HU2 - lapply (lift_mono … HU1 … HU2) -HU1 #H destruct - [ lapply (lift_inv_sort1 … HU2) -HU2 #H destruct // - | lapply (lift_inv_lref1 … HU2) * * #Hid #H destruct // - | lapply (lift_inv_gref1 … HU2) -HU2 #H destruct // - ] -| #I #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #X1 #d #e #HX1 #X2 #HX2 - elim (lift_inv_flat1 … HX1) -HX1 #W1 #U1 #HVW1 #HTU1 #HX1 destruct - elim (lift_inv_flat1 … HX2) -HX2 #W2 #U2 #HVW2 #HTU2 #HX2 destruct /3 width=4/ -| #a #V1 #V2 #W #T1 #T2 #_ #_ #IHV12 #IHT12 #X1 #d #e #HX1 #X2 #HX2 - elim (lift_inv_flat1 … HX1) -HX1 #V0 #X #HV10 #HX #HX1 destruct - elim (lift_inv_bind1 … HX) -HX #W0 #T0 #HW0 #HT10 #HX destruct - elim (lift_inv_bind1 … HX2) -HX2 #V3 #T3 #HV23 #HT23 #HX2 destruct /3 width=4/ -| #a #I #V1 #V2 #T1 #T #T2 #_ #_ #HT2 #IHV12 #IHT1 #X1 #d #e #HX1 #X2 #HX2 - elim (lift_inv_bind1 … HX1) -HX1 #W1 #U1 #HVW1 #HTU1 #HX1 destruct - elim (lift_inv_bind1 … HX2) -HX2 #W2 #U0 #HVW2 #HTU0 #HX2 destruct - elim (lift_total T (d + 1) e) #U #HTU - @tpr_delta - [4: @(tps_lift_le … HT2 … HTU HTU0 ?) /2 width=1/ |1: skip |2: /2 width=4/ |3: /2 width=4/ ] (**) (*/3. is too slow *) -| #a #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV12 #IHW12 #IHT12 #X1 #d #e #HX1 #X2 #HX2 - elim (lift_inv_flat1 … HX1) -HX1 #V0 #X #HV10 #HX #HX1 destruct - elim (lift_inv_bind1 … HX) -HX #W0 #T0 #HW0 #HT10 #HX destruct - elim (lift_inv_bind1 … HX2) -HX2 #W3 #X #HW23 #HX #HX2 destruct - elim (lift_inv_flat1 … HX) -HX #V3 #T3 #HV3 #HT23 #HX destruct - elim (lift_trans_ge … HV2 … HV3 ?) -V // /3 width=4/ -| #V #T1 #T #T2 #_ #HT2 #IHT1 #X #d #e #H #U2 #HTU2 - elim (lift_inv_bind1 … H) -H #V3 #T3 #_ #HT13 #H destruct -V - elim (lift_conf_O1 … HTU2 … HT2) -T2 /3 width=4/ -| #V #T1 #T2 #_ #IHT12 #X #d #e #HX #T #HT2 - elim (lift_inv_flat1 … HX) -HX #V0 #T0 #_ #HT0 #HX destruct /3 width=4/ -] -qed. - -(* Basic_1: was: pr0_gen_lift *) -lemma tpr_inv_lift1: t_deliftable_sn tpr. -#T1 #T2 #H elim H -T1 -T2 -[ * #i #X #d #e #HX - [ lapply (lift_inv_sort2 … HX) -HX #H destruct /2 width=3/ - | lapply (lift_inv_lref2 … HX) -HX * * #Hid #H destruct /3 width=3/ - | lapply (lift_inv_gref2 … HX) -HX #H destruct /2 width=3/ - ] -| #I #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #X #d #e #HX - elim (lift_inv_flat2 … HX) -HX #V0 #T0 #HV01 #HT01 #HX destruct - elim (IHV12 … HV01) -V1 - elim (IHT12 … HT01) -T1 /3 width=5/ -| #a #V1 #V2 #W1 #T1 #T2 #_ #_ #IHV12 #IHT12 #X #d #e #HX - elim (lift_inv_flat2 … HX) -HX #V0 #Y #HV01 #HY #HX destruct - elim (lift_inv_bind2 … HY) -HY #W0 #T0 #HW01 #HT01 #HY destruct - elim (IHV12 … HV01) -V1 - elim (IHT12 … HT01) -T1 /3 width=5/ -| #a #I #V1 #V2 #T1 #T #T2 #_ #_ #HT2 #IHV12 #IHT1 #X #d #e #HX - elim (lift_inv_bind2 … HX) -HX #W1 #U1 #HWV1 #HUT1 #HX destruct - elim (IHV12 … HWV1) -V1 #W2 #HWV2 #HW12 - elim (IHT1 … HUT1) -T1 #U #HUT #HU1 - elim (tps_inv_lift1_le … HT2 … HUT ?) -T // [3: /2 width=5/ |2: skip ] #U2 #HU2 #HUT2 - @ex2_intro [2: /2 width=2/ |1: skip |3: /2 width=3/ ] (**) (* /3 width=5/ is slow *) -| #a #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV12 #IHW12 #IHT12 #X #d #e #HX - elim (lift_inv_flat2 … HX) -HX #V0 #Y #HV01 #HY #HX destruct - elim (lift_inv_bind2 … HY) -HY #W0 #T0 #HW01 #HT01 #HY destruct - elim (IHV12 … HV01) -V1 #V3 #HV32 #HV03 - elim (IHW12 … HW01) -W1 #W3 #HW32 #HW03 - elim (IHT12 … HT01) -T1 #T3 #HT32 #HT03 - elim (lift_trans_le … HV32 … HV2 ?) -V2 // #V2 #HV32 #HV2 - @ex2_intro [2: /3 width=2/ |1: skip |3: /2 width=3/ ] (**) (* /4 width=5/ is slow *) -| #V #T1 #T #T2 #_ #HT2 #IHT1 #X #d #e #HX - elim (lift_inv_bind2 … HX) -HX #V3 #T3 #_ #HT31 #H destruct - elim (IHT1 … HT31) -T1 #T1 #HT1 #HT31 - elim (lift_div_le … HT2 … HT1 ?) -T // /3 width=5/ -| #V #T1 #T2 #_ #IHT12 #X #d #e #HX - elim (lift_inv_flat2 … HX) -HX #V0 #T0 #_ #HT01 #H destruct - elim (IHT12 … HT01) -T1 /3 width=3/ -] -qed-. - -(* Advanced inversion lemmas ************************************************) - -(* Basic_1: was pr0_gen_abst *) -lemma tpr_inv_abst1: ∀a,V1,T1,U2. ⓛ{a}V1. T1 ➡ U2 → - ∃∃V2,T2. V1 ➡ V2 & T1 ➡ T2 & U2 = ⓛ{a}V2. T2. -#a #V1 #T1 #U2 #H elim (tpr_inv_bind1 … H) -H * -[ #V2 #T #T2 #HV12 #HT1 #HT2 - lapply (tps_inv_refl_SO2 … HT2 ???) -HT2 // /2 width=5/ -| #T2 #_ #_ #_ #H destruct -] -qed-. - -(* Advanced forward lemmas **************************************************) - -lemma tpr_fwd_abst1: ∀a,V1,T1,U2. ⓛ{a}V1.T1 ➡ U2 → ∀b,I,W. - ∃∃V2,T2. ⓑ{b,I}W.T1 ➡ ⓑ{b,I}W.T2 & - U2 = ⓛ{a}V2.T2. -#a #V1 #T1 #U2 #H #b #I #W elim (tpr_inv_bind1 … H) -H * -[ #V2 #T #T2 #HV12 #HT1 #HT2 - lapply (tps_inv_refl_SO2 … HT2 ???) -HT2 // /3 width=4/ -| #T2 #_ #_ #_ #H destruct -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpr_tpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpr_tpr.etc deleted file mode 100644 index a733345bf..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpr_tpr.etc +++ /dev/null @@ -1,261 +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/reducibility/ltpr_tpss.ma". - -(* CONTEXT-FREE PARALLEL REDUCTION ON TERMS *********************************) - -(* Confluence lemmas ********************************************************) - -fact tpr_conf_atom_atom: ∀I. ∃∃X. ⓪{I} ➡ X & ⓪{I} ➡ X. -/2 width=3/ qed. - -fact tpr_conf_flat_flat: - ∀I,V0,V1,T0,T1,V2,T2. ( - ∀X0:term. ♯{X0} < ♯{V0} + ♯{T0} + 1 → - ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → - ∃∃X. X1 ➡ X & X2 ➡ X - ) → - V0 ➡ V1 → V0 ➡ V2 → T0 ➡ T1 → T0 ➡ T2 → - ∃∃T0. ⓕ{I} V1. T1 ➡ T0 & ⓕ{I} V2. T2 ➡ T0. -#I #V0 #V1 #T0 #T1 #V2 #T2 #IH #HV01 #HV02 #HT01 #HT02 -elim (IH … HV01 … HV02) -HV01 -HV02 // #V #HV1 #HV2 -elim (IH … HT01 … HT02) -HT01 -HT02 -IH // /3 width=5/ -qed. - -fact tpr_conf_flat_beta: - ∀a,V0,V1,T1,V2,W0,U0,T2. ( - ∀X0:term. ♯{X0} < ♯{V0} + (♯{W0} + ♯{U0} + 1) + 1 → - ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → - ∃∃X. X1 ➡ X & X2 ➡ X - ) → - V0 ➡ V1 → V0 ➡ V2 → - U0 ➡ T2 → ⓛ{a}W0. U0 ➡ T1 → - ∃∃X. ⓐV1. T1 ➡ X & ⓓ{a}V2. T2 ➡ X. -#a #V0 #V1 #T1 #V2 #W0 #U0 #T2 #IH #HV01 #HV02 #HT02 #H -elim (tpr_inv_abst1 … H) -H #W1 #U1 #HW01 #HU01 #H destruct -elim (IH … HV01 … HV02) -HV01 -HV02 /2 width=1/ #V #HV1 #HV2 -elim (IH … HT02 … HU01) -HT02 -HU01 -IH /2 width=1/ /3 width=5/ -qed. - -(* Basic-1: was: - pr0_cong_upsilon_refl pr0_cong_upsilon_zeta - pr0_cong_upsilon_cong pr0_cong_upsilon_delta -*) -fact tpr_conf_flat_theta: - ∀a,V0,V1,T1,V2,V,W0,W2,U0,U2. ( - ∀X0:term. ♯{X0} < ♯{V0} + (♯{W0} + ♯{U0} + 1) + 1 → - ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → - ∃∃X. X1 ➡ X & X2 ➡ X - ) → - V0 ➡ V1 → V0 ➡ V2 → ⇧[O,1] V2 ≡ V → - W0 ➡ W2 → U0 ➡ U2 → ⓓ{a}W0. U0 ➡ T1 → - ∃∃X. ⓐV1. T1 ➡ X & ⓓ{a}W2. ⓐV. U2 ➡ X. -#a #V0 #V1 #T1 #V2 #V #W0 #W2 #U0 #U2 #IH #HV01 #HV02 #HV2 #HW02 #HU02 #H -elim (IH … HV01 … HV02) -HV01 -HV02 /2 width=1/ #VV #HVV1 #HVV2 -elim (lift_total VV 0 1) #VVV #HVV -lapply (tpr_lift … HVV2 … HV2 … HVV) #HVVV -elim (tpr_inv_abbr1 … H) -H * -(* case 1: delta *) -[ -HV2 -HVV2 #WW2 #UU2 #UU #HWW2 #HUU02 #HUU2 #H destruct - elim (IH … HW02 … HWW2) -HW02 -HWW2 /2 width=1/ #W #HW02 #HWW2 - elim (IH … HU02 … HUU02) -HU02 -HUU02 -IH /2 width=1/ #U #HU2 #HUUU2 - elim (tpr_tps_conf_bind … HWW2 HUUU2 … HUU2) -UU2 #UUU #HUUU2 #HUUU1 - @ex2_intro - [2: @tpr_theta [6: @HVV |7: @HWW2 |8: @HUUU2 |1,2,3,4: skip | // ] - |1:skip - |3: @tpr_delta [3: @tpr_flat |1: skip ] /2 width=5/ - ] (**) (* /5 width=14/ is too slow *) -(* case 3: zeta *) -| -HV2 -HW02 -HVV2 #U1 #HU01 #HTU1 - elim (IH … HU01 … HU02) -HU01 -HU02 -IH // -U0 #U #HU1 #HU2 - elim (tpr_inv_lift1 … HU1 … HTU1) -U1 #UU #HUU #HT1UU #H destruct - @(ex2_intro … (ⓐVV.UU)) /2 width=1/ /3 width=5/ (**) (* /4 width=9/ is too slow *) -] -qed. - -fact tpr_conf_flat_cast: - ∀X2,V0,V1,T0,T1. ( - ∀X0:term. ♯{X0} < ♯{V0} + ♯{T0} + 1 → - ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → - ∃∃X. X1 ➡ X & X2 ➡ X - ) → - V0 ➡ V1 → T0 ➡ T1 → T0 ➡ X2 → - ∃∃X. ⓝV1. T1 ➡ X & X2 ➡ X. -#X2 #V0 #V1 #T0 #T1 #IH #_ #HT01 #HT02 -elim (IH … HT01 … HT02) -HT01 -HT02 -IH // /3 width=3/ -qed. - -fact tpr_conf_beta_beta: - ∀a. ∀W0:term. ∀V0,V1,T0,T1,V2,T2. ( - ∀X0:term. ♯{X0} < ♯{V0} + (♯{W0} + ♯{T0} + 1) + 1 → - ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → - ∃∃X. X1 ➡ X & X2 ➡ X - ) → - V0 ➡ V1 → V0 ➡ V2 → T0 ➡ T1 → T0 ➡ T2 → - ∃∃X. ⓓ{a}V1. T1 ➡X & ⓓ{a}V2. T2 ➡ X. -#a #W0 #V0 #V1 #T0 #T1 #V2 #T2 #IH #HV01 #HV02 #HT01 #HT02 -elim (IH … HV01 … HV02) -HV01 -HV02 /2 width=1/ -elim (IH … HT01 … HT02) -HT01 -HT02 -IH /2 width=1/ /3 width=5/ -qed. - -(* Basic_1: was: pr0_cong_delta pr0_delta_delta *) -fact tpr_conf_delta_delta: - ∀a,I1,V0,V1,T0,T1,TT1,V2,T2,TT2. ( - ∀X0:term. ♯{X0} < ♯{V0} + ♯{T0} + 1 → - ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → - ∃∃X. X1 ➡ X & X2 ➡ X - ) → - V0 ➡ V1 → V0 ➡ V2 → T0 ➡ T1 → T0 ➡ T2 → - ⋆. ⓑ{I1} V1 ⊢ T1 ▶ [O, 1] TT1 → - ⋆. ⓑ{I1} V2 ⊢ T2 ▶ [O, 1] TT2 → - ∃∃X. ⓑ{a,I1} V1. TT1 ➡ X & ⓑ{a,I1} V2. TT2 ➡ X. -#a #I1 #V0 #V1 #T0 #T1 #TT1 #V2 #T2 #TT2 #IH #HV01 #HV02 #HT01 #HT02 #HTT1 #HTT2 -elim (IH … HV01 … HV02) -HV01 -HV02 // #V #HV1 #HV2 -elim (IH … HT01 … HT02) -HT01 -HT02 -IH // #T #HT1 #HT2 -elim (tpr_tps_conf_bind … HV1 HT1 … HTT1) -T1 #U1 #TTU1 #HTU1 -elim (tpr_tps_conf_bind … HV2 HT2 … HTT2) -T2 #U2 #TTU2 #HTU2 -elim (tps_conf_eq … HTU1 … HTU2) -T #U #HU1 #HU2 -@ex2_intro [2,3: @tpr_delta |1: skip ] /width=10/ (**) (* /3 width=10/ is too slow *) -qed. - -fact tpr_conf_delta_zeta: - ∀X2,V0,V1,T0,T1,TT1,T2. ( - ∀X0:term. ♯{X0} < ♯{V0} + ♯{T0} + 1 → - ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → - ∃∃X. X1 ➡ X & X2 ➡ X - ) → - V0 ➡ V1 → T0 ➡ T1 → ⋆. ⓓV1 ⊢ T1 ▶ [O,1] TT1 → - T0 ➡ T2 → ⇧[O, 1] X2 ≡ T2 → - ∃∃X. +ⓓV1. TT1 ➡ X & X2 ➡ X. -#X2 #V0 #V1 #T0 #T1 #TT1 #T2 #IH #_ #HT01 #HTT1 #HT02 #HXT2 -elim (IH … HT01 … HT02) -IH -HT01 -HT02 // -V0 -T0 #T #HT1 #HT2 -elim (tpr_tps_conf_bind ? ? V1 … HT1 HTT1) -T1 // #TT #HTT1 #HTT -elim (tpr_inv_lift1 … HT2 … HXT2) -T2 #X #HXT #HX2 -lapply (tps_inv_lift1_eq … HTT … HXT) -HTT #H destruct /3 width=3/ -qed. - -(* Basic_1: was: pr0_upsilon_upsilon *) -fact tpr_conf_theta_theta: - ∀a,VV1,V0,V1,W0,W1,T0,T1,V2,VV2,W2,T2. ( - ∀X0:term. ♯{X0} < ♯{V0} + (♯{W0} + ♯{T0} + 1) + 1 → - ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → - ∃∃X. X1 ➡ X & X2 ➡ X - ) → - V0 ➡ V1 → V0 ➡ V2 → W0 ➡ W1 → W0 ➡ W2 → T0 ➡ T1 → T0 ➡ T2 → - ⇧[O, 1] V1 ≡ VV1 → ⇧[O, 1] V2 ≡ VV2 → - ∃∃X. ⓓ{a}W1. ⓐVV1. T1 ➡ X & ⓓ{a}W2. ⓐVV2. T2 ➡ X. -#a #VV1 #V0 #V1 #W0 #W1 #T0 #T1 #V2 #VV2 #W2 #T2 #IH #HV01 #HV02 #HW01 #HW02 #HT01 #HT02 #HVV1 #HVV2 -elim (IH … HV01 … HV02) -HV01 -HV02 /2 width=1/ #V #HV1 #HV2 -elim (IH … HW01 … HW02) -HW01 -HW02 /2 width=1/ #W #HW1 #HW2 -elim (IH … HT01 … HT02) -HT01 -HT02 -IH /2 width=1/ #T #HT1 #HT2 -elim (lift_total V 0 1) #VV #HVV -lapply (tpr_lift … HV1 … HVV1 … HVV) -V1 #HVV1 -lapply (tpr_lift … HV2 … HVV2 … HVV) -V2 -HVV #HVV2 -@ex2_intro [2,3: @tpr_bind |1:skip ] /2 width=5/ (**) (* /4 width=5/ is too slow *) -qed. - -fact tpr_conf_zeta_zeta: - ∀V0:term. ∀X2,TT0,T0,T1,TT2. ( - ∀X0:term. ♯{X0} < ♯{V0} + ♯{TT0} + 1 → - ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → - ∃∃X. X1 ➡ X & X2 ➡ X - ) → - TT0 ➡ T0 → ⇧[O, 1] T1 ≡ T0 → - TT0 ➡ TT2 → ⇧[O, 1] X2 ≡ TT2 → - ∃∃X. T1 ➡ X & X2 ➡ X. -#V0 #X2 #TT0 #T0 #T1 #TT2 #IH #HTT0 #HT10 #HTT02 #HXTT2 -elim (IH … HTT0 … HTT02) -IH -HTT0 -HTT02 // -V0 -TT0 #T #HT0 #HTT2 -elim (tpr_inv_lift1 … HT0 … HT10) -T0 #T0 #HT0 #HT10 -elim (tpr_inv_lift1 … HTT2 … HXTT2) -TT2 #TT2 #HTT2 #HXTT2 -lapply (lift_inj … HTT2 … HT0) -HTT2 #H destruct /2 width=3/ -qed. - -fact tpr_conf_tau_tau: - ∀V0,T0:term. ∀X2,T1. ( - ∀X0:term. ♯{X0} < ♯{V0} + ♯{T0} + 1 → - ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → - ∃∃X. X1 ➡ X & X2 ➡ X - ) → - T0 ➡ T1 → T0 ➡ X2 → - ∃∃X. T1 ➡ X & X2 ➡ X. -#V0 #T0 #X2 #T1 #IH #HT01 #HT02 -elim (IH … HT01 … HT02) -HT01 -HT02 -IH // /2 width=3/ -qed. - -(* Confluence ***************************************************************) - -(* Basic_1: was: pr0_confluence *) -theorem tpr_conf: ∀T0:term. ∀T1,T2. T0 ➡ T1 → T0 ➡ T2 → - ∃∃T. T1 ➡ T & T2 ➡ T. -#T0 @(f_ind … tw … T0) -T0 #n #IH * -[ #I #_ #X1 #X2 #H1 #H2 -n - >(tpr_inv_atom1 … H1) -X1 - >(tpr_inv_atom1 … H2) -X2 -(* case 1: atom, atom *) - // -| * [ #a ] #I #V0 #T0 #Hn #X1 #X2 #H1 #H2 - [ elim (tpr_inv_bind1 … H1) -H1 * - [ #V1 #T1 #U1 #HV01 #HT01 #HTU1 #H1 - | #T1 #HT01 #HXT1 #H11 #H12 - ] - elim (tpr_inv_bind1 … H2) -H2 * - [1,3: #V2 #T2 #U2 #HV02 #HT02 #HTU2 #H2 - |2,4: #T2 #HT02 #HXT2 #H21 #H22 - ] destruct -(* case 2: delta, delta *) - [ /3 width=11 by tpr_conf_delta_delta/ (**) (* /3 width=11/ is too slow *) -(* case 3: zeta, delta (repeated) *) - | @ex2_commute /3 width=10 by tpr_conf_delta_zeta/ -(* case 4: delta, zeta *) - | /3 width=10 by tpr_conf_delta_zeta/ (**) (* /3 width=10/ is too slow *) -(* case 5: zeta, zeta *) - | /3 width=9 by tpr_conf_zeta_zeta/ (**) (* /3 width=9/ is too slow *) - ] - | elim (tpr_inv_flat1 … H1) -H1 * - [ #V1 #T1 #HV01 #HT01 #H1 - | #b1 #V1 #W1 #U1 #T1 #HV01 #HUT1 #H11 #H12 #H13 - | #b1 #V1 #Y1 #W1 #Z1 #U1 #T1 #HV01 #HWZ1 #HUT1 #HVY1 #H11 #H12 #H13 - | #HX1 #H1 - ] - elim (tpr_inv_flat1 … H2) -H2 * - [1,5,9,13: #V2 #T2 #HV02 #HT02 #H2 - |2,6,10,14: #b2 #V2 #W2 #U2 #T2 #HV02 #HUT2 #H21 #H22 #H23 - |3,7,11,15: #b2 #V2 #Y2 #W2 #Z2 #U2 #T2 #HV02 #HWZ2 #HUT2 #HVY2 #H21 #H22 #H23 - |4,8,12,16: #HX2 #H2 - ] destruct -(* case 6: flat, flat *) - [ /3 width=7 by tpr_conf_flat_flat/ (**) (* /3 width=7/ is too slow *) -(* case 7: beta, flat (repeated) *) - | @ex2_commute /3 width=8 by tpr_conf_flat_beta/ -(* case 8: theta, flat (repeated) *) - | @ex2_commute /3 width=11 by tpr_conf_flat_theta/ -(* case 9: tau, flat (repeated) *) - | @ex2_commute /3 width=6 by tpr_conf_flat_cast/ -(* case 10: flat, beta *) - | /3 width=8 by tpr_conf_flat_beta/ (**) (* /3 width=8/ is too slow *) -(* case 11: beta, beta *) - | /3 width=8 by tpr_conf_beta_beta/ (**) (* /3 width=8/ is too slow *) -(* case 12: flat, theta *) - | /3 width=11 by tpr_conf_flat_theta/ (**) (* /3 width=11/ is too slow *) -(* case 13: theta, theta *) - | /3 width=14 by tpr_conf_theta_theta/ (**) (* /3 width=14/ is too slow *) -(* case 14: flat, tau *) - | /3 width=6 by tpr_conf_flat_cast/ (**) (* /3 width=6/ is too slow *) -(* case 15: tau, tau *) - | /3 width=5 by tpr_conf_tau_tau/ - ] - ] -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tprs.etc deleted file mode 100644 index 492b39041..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tprs.etc +++ /dev/null @@ -1,94 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( T1 ➡ * break term 46 T2 )" - non associative with precedence 45 - for @{ 'PRedStar $T1 $T2 }. - -include "basic_2/reducibility/tpr.ma". - -(* CONTEXT-FREE PARALLEL COMPUTATION ON TERMS *******************************) - -(* Basic_1: includes: pr1_pr0 *) -definition tprs: relation term ≝ TC … tpr. - -interpretation "context-free parallel computation (term)" - 'PRedStar T1 T2 = (tprs T1 T2). - -(* Basic eliminators ********************************************************) - -lemma tprs_ind: ∀T1. ∀R:predicate term. R T1 → - (∀T,T2. T1 ➡* T → T ➡ T2 → R T → R T2) → - ∀T2. T1 ➡* T2 → R T2. -#T1 #R #HT1 #IHT1 #T2 #HT12 -@(TC_star_ind … HT1 IHT1 … HT12) // -qed-. - -lemma tprs_ind_dx: ∀T2. ∀R:predicate term. R T2 → - (∀T1,T. T1 ➡ T → T ➡* T2 → R T → R T1) → - ∀T1. T1 ➡* T2 → R T1. -#T2 #R #HT2 #IHT2 #T1 #HT12 -@(TC_star_ind_dx … HT2 IHT2 … HT12) // -qed-. - -(* Basic properties *********************************************************) - -lemma tprs_refl: reflexive … tprs. -/2 width=1/ qed. - -lemma tpr_tprs: ∀T1,T2. T1 ➡ T2 → T2 ➡* T2. -/2 width=1/ qed. - -lemma tprs_strap1: ∀T1,T,T2. T1 ➡* T → T ➡ T2 → T1 ➡* T2. -/2 width=3/ qed. - -lemma tprs_strap2: ∀T1,T,T2. T1 ➡ T → T ➡* T2 → T1 ➡* T2. -/2 width=3/ qed. - -(* Basic_1: was only: pr1_head_1 *) -lemma tprs_pair_sn: ∀I,T1,T2. T1 ➡ T2 → ∀V1,V2. V1 ➡* V2 → - ②{I} V1. T1 ➡* ②{I} V2. T2. -* [ #a ] #I #T1 #T2 #HT12 #V1 #V2 #H @(tprs_ind … H) -V2 -[1,3: /3 width=1/ -|2,4: #V #V2 #_ #HV2 #IHV1 - @(tprs_strap1 … IHV1) -IHV1 /2 width=1/ -] -qed. - -(* Basic_1: was only: pr1_head_2 *) -lemma tprs_pair_dx: ∀I,V1,V2. V1 ➡ V2 → ∀T1,T2. T1 ➡* T2 → - ②{I} V1. T1 ➡* ②{I} V2. T2. -* [ #a ] #I #V1 #V2 #HV12 #T1 #T2 #H @(tprs_ind … H) -T2 -[1,3: /3 width=1/ -|2,4: #T #T2 #_ #HT2 #IHT1 - @(tprs_strap1 … IHT1) -IHT1 /2 width=1/ -] -qed. - -(* Basic inversion lemmas ***************************************************) - -lemma tprs_inv_atom1: ∀U2,k. ⋆k ➡* U2 → U2 = ⋆k. -#U2 #k #H @(tprs_ind … H) -U2 // -#U #U2 #_ #HU2 #IHU1 destruct ->(tpr_inv_atom1 … HU2) -HU2 // -qed-. - -lemma tprs_inv_cast1: ∀W1,T1,U2. ⓝW1.T1 ➡* U2 → T1 ➡* U2 ∨ - ∃∃W2,T2. W1 ➡* W2 & T1 ➡* T2 & U2 = ⓝW2.T2. -#W1 #T1 #U2 #H @(tprs_ind … H) -U2 /3 width=5/ -#U #U2 #_ #HU2 * /3 width=3/ * -#W #T #HW1 #HT1 #H destruct -elim (tpr_inv_cast1 … HU2) -HU2 /3 width=3/ * -#W2 #T2 #HW2 #HT2 #H destruct /4 width=5/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tprs_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tprs_lift.etc deleted file mode 100644 index d0d173470..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tprs_lift.etc +++ /dev/null @@ -1,43 +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/reducibility/tpr_lift.ma". -include "basic_2/computation/tprs.ma". - -(* CONTEXT-FREE PARALLEL COMPUTATION ON TERMS *******************************) - -(* Advanced inversion lemmas ************************************************) - -lemma tprs_inv_abst1: ∀a,V1,T1,U2. ⓛ{a}V1. T1 ➡* U2 → - ∃∃V2,T2. V1 ➡* V2 & T1 ➡* T2 & U2 = ⓛ{a}V2. T2. -#a #V1 #T1 #U2 #H @(tprs_ind … H) -U2 /2 width=5/ -#U #U2 #_ #HU2 * #V #T #HV1 #HT1 #H destruct -elim (tpr_inv_abst1 … HU2) -HU2 #V2 #T2 #HV2 #HT2 #H destruct /3 width=5/ -qed-. - -lemma tprs_inv_abst: ∀a,V1,V2,T1,T2. ⓛ{a}V1. T1 ➡* ⓛ{a}V2. T2 → - V1 ➡* V2 ∧ T1 ➡* T2. -#a #V1 #V2 #T1 #T2 #H -elim (tprs_inv_abst1 … H) -H #V #T #HV1 #HT1 #H destruct /2 width=1/ -qed-. - -(* Relocation properties ****************************************************) - -(* Note: this was missing in basic_1 *) -lemma tprs_lift: t_liftable tprs. -/3 width=7/ qed. - -(* Note: this was missing in basic_1 *) -lemma tprs_inv_lift1: t_deliftable_sn tprs. -/3 width=3 by tpr_inv_lift1, t_deliftable_sn_TC/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tprs_tprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tprs_tprs.etc deleted file mode 100644 index 87a4a71ab..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tprs_tprs.etc +++ /dev/null @@ -1,43 +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/reducibility/tpr_tpr.ma". -include "basic_2/computation/tprs.ma". - -(* CONTEXT-FREE PARALLEL COMPUTATION ON TERMS *******************************) - -(* Advanced properties ******************************************************) - -(* Basic_1: was: pr1_strip *) -lemma tprs_strip: ∀T1,T. T ➡* T1 → ∀T2. T ➡ T2 → - ∃∃T0. T1 ➡ T0 & T2 ➡* T0. -/3 width=3 by TC_strip1, tpr_conf/ qed. - -(* Main propertis ***********************************************************) - -(* Basic_1: was: pr1_confluence *) -theorem tprs_conf: confluent … tprs. -/3 width=3/ qed. - -(* Basic_1: was: pr1_t *) -theorem tprs_trans: Transitive … tprs. -/2 width=3/ qed. - -(* Basic_1: was: pr1_comp *) -lemma tprs_pair: ∀I,V1,V2. V1 ➡* V2 → ∀T1,T2. T1 ➡* T2 → - ②{I} V1. T1 ➡* ②{I} V2. T2. -#I #V1 #V2 #H @(tprs_ind … H) -V2 /2 width=1/ -#V #V2 #_ #HV2 #IHV1 #T1 #T2 #HT12 -@(tprs_trans … (②{I}V.T2)) /2 width=1/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tps.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tps.etc deleted file mode 100644 index 7d89243d5..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tps.etc +++ /dev/null @@ -1,288 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( L ⊢ break term 46 T1 break ▶ [ term 46 d , break term 46 e ] break term 46 T2 )" - non associative with precedence 45 - for @{ 'PSubst $L $T1 $d $e $T2 }. - -include "basic_2/substitution/ldrop_append.ma". - -(* PARALLEL SUBSTITUTION ON TERMS *******************************************) - -inductive tps: nat → nat → lenv → relation term ≝ -| tps_atom : ∀L,I,d,e. tps d e L (⓪{I}) (⓪{I}) -| tps_subst: ∀L,K,V,W,i,d,e. d ≤ i → i < d + e → - ⇩[0, i] L ≡ K. ⓓV → ⇧[0, i + 1] V ≡ W → tps d e L (#i) W -| tps_bind : ∀L,a,I,V1,V2,T1,T2,d,e. - tps d e L V1 V2 → tps (d + 1) e (L. ⓑ{I} V2) T1 T2 → - tps d e L (ⓑ{a,I} V1. T1) (ⓑ{a,I} V2. T2) -| tps_flat : ∀L,I,V1,V2,T1,T2,d,e. - tps d e L V1 V2 → tps d e L T1 T2 → - tps d e L (ⓕ{I} V1. T1) (ⓕ{I} V2. T2) -. - -interpretation "parallel substritution (term)" - 'PSubst L T1 d e T2 = (tps d e L T1 T2). - -(* Basic properties *********************************************************) - -lemma tps_lsubr_trans: ∀L1,T1,T2,d,e. L1 ⊢ T1 ▶ [d, e] T2 → - ∀L2. L2 ⊑ [d, e] L1 → L2 ⊢ T1 ▶ [d, e] T2. -#L1 #T1 #T2 #d #e #H elim H -L1 -T1 -T2 -d -e -[ // -| #L1 #K1 #V #W #i #d #e #Hdi #Hide #HLK1 #HVW #L2 #HL12 - elim (ldrop_lsubr_ldrop2_abbr … HL12 … HLK1 ? ?) -HL12 -HLK1 // /2 width=4/ -| /4 width=1/ -| /3 width=1/ -] -qed. - -lemma tps_refl: ∀T,L,d,e. L ⊢ T ▶ [d, e] T. -#T elim T -T // -#I elim I -I /2 width=1/ -qed. - -(* Basic_1: was: subst1_ex *) -lemma tps_full: ∀K,V,T1,L,d. ⇩[0, d] L ≡ (K. ⓓV) → - ∃∃T2,T. L ⊢ T1 ▶ [d, 1] T2 & ⇧[d, 1] T ≡ T2. -#K #V #T1 elim T1 -T1 -[ * #i #L #d #HLK /2 width=4/ - elim (lt_or_eq_or_gt i d) #Hid /3 width=4/ - destruct - elim (lift_total V 0 (i+1)) #W #HVW - elim (lift_split … HVW i i ? ? ?) // /3 width=4/ -| * [ #a ] #I #W1 #U1 #IHW1 #IHU1 #L #d #HLK - elim (IHW1 … HLK) -IHW1 #W2 #W #HW12 #HW2 - [ elim (IHU1 (L. ⓑ{I} W2) (d+1) ?) -IHU1 /2 width=1/ -HLK /3 width=9/ - | elim (IHU1 … HLK) -IHU1 -HLK /3 width=8/ - ] -] -qed. - -lemma tps_weak: ∀L,T1,T2,d1,e1. L ⊢ T1 ▶ [d1, e1] T2 → - ∀d2,e2. d2 ≤ d1 → d1 + e1 ≤ d2 + e2 → - L ⊢ T1 ▶ [d2, e2] T2. -#L #T1 #T2 #d1 #e1 #H elim H -L -T1 -T2 -d1 -e1 -[ // -| #L #K #V #W #i #d1 #e1 #Hid1 #Hide1 #HLK #HVW #d2 #e2 #Hd12 #Hde12 - lapply (transitive_le … Hd12 … Hid1) -Hd12 -Hid1 #Hid2 - lapply (lt_to_le_to_lt … Hide1 … Hde12) -Hide1 /2 width=4/ -| /4 width=3/ -| /4 width=1/ -] -qed. - -lemma tps_weak_top: ∀L,T1,T2,d,e. - L ⊢ T1 ▶ [d, e] T2 → L ⊢ T1 ▶ [d, |L| - d] T2. -#L #T1 #T2 #d #e #H elim H -L -T1 -T2 -d -e -[ // -| #L #K #V #W #i #d #e #Hdi #_ #HLK #HVW - lapply (ldrop_fwd_ldrop2_length … HLK) #Hi - lapply (le_to_lt_to_lt … Hdi Hi) /3 width=4/ -| normalize /2 width=1/ -| /2 width=1/ -] -qed. - -lemma tps_weak_full: ∀L,T1,T2,d,e. - L ⊢ T1 ▶ [d, e] T2 → L ⊢ T1 ▶ [0, |L|] T2. -#L #T1 #T2 #d #e #HT12 -lapply (tps_weak … HT12 0 (d + e) ? ?) -HT12 // #HT12 -lapply (tps_weak_top … HT12) // -qed. - -lemma tps_split_up: ∀L,T1,T2,d,e. L ⊢ T1 ▶ [d, e] T2 → ∀i. d ≤ i → i ≤ d + e → - ∃∃T. L ⊢ T1 ▶ [d, i - d] T & L ⊢ T ▶ [i, d + e - i] T2. -#L #T1 #T2 #d #e #H elim H -L -T1 -T2 -d -e -[ /2 width=3/ -| #L #K #V #W #i #d #e #Hdi #Hide #HLK #HVW #j #Hdj #Hjde - elim (lt_or_ge i j) - [ -Hide -Hjde - >(plus_minus_m_m j d) in ⊢ (% → ?); // -Hdj /3 width=4/ - | -Hdi -Hdj #Hij - lapply (plus_minus_m_m … Hjde) -Hjde /3 width=8/ - ] -| #L #a #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #i #Hdi #Hide - elim (IHV12 i ? ?) -IHV12 // #V #HV1 #HV2 - elim (IHT12 (i + 1) ? ?) -IHT12 /2 width=1/ - -Hdi -Hide >arith_c1x #T #HT1 #HT2 - lapply (tps_lsubr_trans … HT1 (L. ⓑ{I} V) ?) -HT1 /3 width=5/ -| #L #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #i #Hdi #Hide - elim (IHV12 i ? ?) -IHV12 // elim (IHT12 i ? ?) -IHT12 // - -Hdi -Hide /3 width=5/ -] -qed. - -lemma tps_split_down: ∀L,T1,T2,d,e. L ⊢ T1 ▶ [d, e] T2 → - ∀i. d ≤ i → i ≤ d + e → - ∃∃T. L ⊢ T1 ▶ [i, d + e - i] T & - L ⊢ T ▶ [d, i - d] T2. -#L #T1 #T2 #d #e #H elim H -L -T1 -T2 -d -e -[ /2 width=3/ -| #L #K #V #W #i #d #e #Hdi #Hide #HLK #HVW #j #Hdj #Hjde - elim (lt_or_ge i j) - [ -Hide -Hjde >(plus_minus_m_m j d) in ⊢ (% → ?); // -Hdj /3 width=8/ - | -Hdi -Hdj - >(plus_minus_m_m (d+e) j) in Hide; // -Hjde /3 width=4/ - ] -| #L #a #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #i #Hdi #Hide - elim (IHV12 i ? ?) -IHV12 // #V #HV1 #HV2 - elim (IHT12 (i + 1) ? ?) -IHT12 /2 width=1/ - -Hdi -Hide >arith_c1x #T #HT1 #HT2 - lapply (tps_lsubr_trans … HT1 (L. ⓑ{I} V) ?) -HT1 /3 width=5/ -| #L #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #i #Hdi #Hide - elim (IHV12 i ? ?) -IHV12 // elim (IHT12 i ? ?) -IHT12 // - -Hdi -Hide /3 width=5/ -] -qed. - -lemma tps_append: ∀K,T1,T2,d,e. K ⊢ T1 ▶ [d, e] T2 → - ∀L. L @@ K ⊢ T1 ▶ [d, e] T2. -#K #T1 #T2 #d #e #H elim H -K -T1 -T2 -d -e // /2 width=1/ -#K #K0 #V #W #i #d #e #Hdi #Hide #HK0 #HVW #L -lapply (ldrop_fwd_ldrop2_length … HK0) #H -@(tps_subst … (L@@K0) … HVW) // (**) (* /3/ does not work *) -@(ldrop_O1_append_sn_le … HK0) /2 width=2/ -qed. - -(* Basic inversion lemmas ***************************************************) - -fact tps_inv_atom1_aux: ∀L,T1,T2,d,e. L ⊢ T1 ▶ [d, e] T2 → ∀I. T1 = ⓪{I} → - T2 = ⓪{I} ∨ - ∃∃K,V,i. d ≤ i & i < d + e & - ⇩[O, i] L ≡ K. ⓓV & - ⇧[O, i + 1] V ≡ T2 & - I = LRef i. -#L #T1 #T2 #d #e * -L -T1 -T2 -d -e -[ #L #I #d #e #J #H destruct /2 width=1/ -| #L #K #V #T2 #i #d #e #Hdi #Hide #HLK #HVT2 #I #H destruct /3 width=8/ -| #L #a #I #V1 #V2 #T1 #T2 #d #e #_ #_ #J #H destruct -| #L #I #V1 #V2 #T1 #T2 #d #e #_ #_ #J #H destruct -] -qed. - -lemma tps_inv_atom1: ∀L,T2,I,d,e. L ⊢ ⓪{I} ▶ [d, e] T2 → - T2 = ⓪{I} ∨ - ∃∃K,V,i. d ≤ i & i < d + e & - ⇩[O, i] L ≡ K. ⓓV & - ⇧[O, i + 1] V ≡ T2 & - I = LRef i. -/2 width=3/ qed-. - - -(* Basic_1: was: subst1_gen_sort *) -lemma tps_inv_sort1: ∀L,T2,k,d,e. L ⊢ ⋆k ▶ [d, e] T2 → T2 = ⋆k. -#L #T2 #k #d #e #H -elim (tps_inv_atom1 … H) -H // -* #K #V #i #_ #_ #_ #_ #H destruct -qed-. - -(* Basic_1: was: subst1_gen_lref *) -lemma tps_inv_lref1: ∀L,T2,i,d,e. L ⊢ #i ▶ [d, e] T2 → - T2 = #i ∨ - ∃∃K,V. d ≤ i & i < d + e & - ⇩[O, i] L ≡ K. ⓓV & - ⇧[O, i + 1] V ≡ T2. -#L #T2 #i #d #e #H -elim (tps_inv_atom1 … H) -H /2 width=1/ -* #K #V #j #Hdj #Hjde #HLK #HVT2 #H destruct /3 width=4/ -qed-. - -lemma tps_inv_gref1: ∀L,T2,p,d,e. L ⊢ §p ▶ [d, e] T2 → T2 = §p. -#L #T2 #p #d #e #H -elim (tps_inv_atom1 … H) -H // -* #K #V #i #_ #_ #_ #_ #H destruct -qed-. - -fact tps_inv_bind1_aux: ∀d,e,L,U1,U2. L ⊢ U1 ▶ [d, e] U2 → - ∀a,I,V1,T1. U1 = ⓑ{a,I} V1. T1 → - ∃∃V2,T2. L ⊢ V1 ▶ [d, e] V2 & - L. ⓑ{I} V2 ⊢ T1 ▶ [d + 1, e] T2 & - U2 = ⓑ{a,I} V2. T2. -#d #e #L #U1 #U2 * -d -e -L -U1 -U2 -[ #L #k #d #e #a #I #V1 #T1 #H destruct -| #L #K #V #W #i #d #e #_ #_ #_ #_ #a #I #V1 #T1 #H destruct -| #L #b #J #V1 #V2 #T1 #T2 #d #e #HV12 #HT12 #a #I #V #T #H destruct /2 width=5/ -| #L #J #V1 #V2 #T1 #T2 #d #e #_ #_ #a #I #V #T #H destruct -] -qed. - -lemma tps_inv_bind1: ∀d,e,L,a,I,V1,T1,U2. L ⊢ ⓑ{a,I} V1. T1 ▶ [d, e] U2 → - ∃∃V2,T2. L ⊢ V1 ▶ [d, e] V2 & - L. ⓑ{I} V2 ⊢ T1 ▶ [d + 1, e] T2 & - U2 = ⓑ{a,I} V2. T2. -/2 width=3/ qed-. - -fact tps_inv_flat1_aux: ∀d,e,L,U1,U2. L ⊢ U1 ▶ [d, e] U2 → - ∀I,V1,T1. U1 = ⓕ{I} V1. T1 → - ∃∃V2,T2. L ⊢ V1 ▶ [d, e] V2 & L ⊢ T1 ▶ [d, e] T2 & - U2 = ⓕ{I} V2. T2. -#d #e #L #U1 #U2 * -d -e -L -U1 -U2 -[ #L #k #d #e #I #V1 #T1 #H destruct -| #L #K #V #W #i #d #e #_ #_ #_ #_ #I #V1 #T1 #H destruct -| #L #a #J #V1 #V2 #T1 #T2 #d #e #_ #_ #I #V #T #H destruct -| #L #J #V1 #V2 #T1 #T2 #d #e #HV12 #HT12 #I #V #T #H destruct /2 width=5/ -] -qed. - -lemma tps_inv_flat1: ∀d,e,L,I,V1,T1,U2. L ⊢ ⓕ{I} V1. T1 ▶ [d, e] U2 → - ∃∃V2,T2. L ⊢ V1 ▶ [d, e] V2 & L ⊢ T1 ▶ [d, e] T2 & - U2 = ⓕ{I} V2. T2. -/2 width=3/ qed-. - -fact tps_inv_refl_O2_aux: ∀L,T1,T2,d,e. L ⊢ T1 ▶ [d, e] T2 → e = 0 → T1 = T2. -#L #T1 #T2 #d #e #H elim H -L -T1 -T2 -d -e -[ // -| #L #K #V #W #i #d #e #Hdi #Hide #_ #_ #H destruct - lapply (le_to_lt_to_lt … Hdi … Hide) -Hdi -Hide shift_append_assoc normalize #H - elim (tps_inv_bind1 … H) -H - #V0 #T0 #_ #HT10 #H destruct - elim (IH … HT10) -IH -HT10 #L2 #T2 #HL12 #H destruct - >append_length >HL12 -HL12 - @(ex2_2_intro … (⋆.ⓑ{I}V0@@L2) T2) [ >append_length ] // /2 width=3/ (**) (* explicit constructor *) -] -qed-. - -(* Basic_1: removed theorems 25: - subst0_gen_sort subst0_gen_lref subst0_gen_head subst0_gen_lift_lt - subst0_gen_lift_false subst0_gen_lift_ge subst0_refl subst0_trans - subst0_lift_lt subst0_lift_ge subst0_lift_ge_S subst0_lift_ge_s - subst0_subst0 subst0_subst0_back subst0_weight_le subst0_weight_lt - subst0_confluence_neq subst0_confluence_eq subst0_tlt_head - subst0_confluence_lift subst0_tlt - subst1_head subst1_gen_head subst1_lift_S subst1_confluence_lift -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tps_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tps_lift.etc deleted file mode 100644 index 1d65d8d63..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tps_lift.etc +++ /dev/null @@ -1,294 +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/substitution/ldrop_ldrop.ma". -include "basic_2/substitution/tps.ma". - -(* PARTIAL SUBSTITUTION ON TERMS ********************************************) - -(* Advanced inversion lemmas ************************************************) - -fact tps_inv_S2_aux: ∀L,T1,T2,d,e1. L ⊢ T1 ▶ [d, e1] T2 → ∀e2. e1 = e2 + 1 → - ∀K,V. ⇩[0, d] L ≡ K. ⓛV → L ⊢ T1 ▶ [d + 1, e2] T2. -#L #T1 #T2 #d #e1 #H elim H -L -T1 -T2 -d -e1 -[ // -| #L #K0 #V0 #W #i #d #e1 #Hdi #Hide1 #HLK0 #HV0 #e2 #He12 #K #V #HLK destruct - elim (lt_or_ge i (d+1)) #HiSd - [ -Hide1 -HV0 - lapply (le_to_le_to_eq … Hdi ?) /2 width=1/ #H destruct - lapply (ldrop_mono … HLK0 … HLK) #H destruct - | -V -Hdi /2 width=4/ - ] -| /4 width=3/ -| /3 width=3/ -] -qed. - -lemma tps_inv_S2: ∀L,T1,T2,d,e. L ⊢ T1 ▶ [d, e + 1] T2 → - ∀K,V. ⇩[0, d] L ≡ K. ⓛV → L ⊢ T1 ▶ [d + 1, e] T2. -/2 width=3/ qed-. - -lemma tps_inv_refl_SO2: ∀L,T1,T2,d. L ⊢ T1 ▶ [d, 1] T2 → - ∀K,V. ⇩[0, d] L ≡ K. ⓛV → T1 = T2. -#L #T1 #T2 #d #HT12 #K #V #HLK -lapply (tps_inv_S2 … T1 T2 … 0 … HLK) -K // -HT12 #HT12 -lapply (tps_inv_refl_O2 … HT12) -HT12 // -qed-. - -(* Relocation properties ****************************************************) - -(* Basic_1: was: subst1_lift_lt *) -lemma tps_lift_le: ∀K,T1,T2,dt,et. K ⊢ T1 ▶ [dt, et] T2 → - ∀L,U1,U2,d,e. ⇩[d, e] L ≡ K → - ⇧[d, e] T1 ≡ U1 → ⇧[d, e] T2 ≡ U2 → - dt + et ≤ d → - L ⊢ U1 ▶ [dt, et] U2. -#K #T1 #T2 #dt #et #H elim H -K -T1 -T2 -dt -et -[ #K #I #dt #et #L #U1 #U2 #d #e #_ #H1 #H2 #_ - >(lift_mono … H1 … H2) -H1 -H2 // -| #K #KV #V #W #i #dt #et #Hdti #Hidet #HKV #HVW #L #U1 #U2 #d #e #HLK #H #HWU2 #Hdetd - lapply (lt_to_le_to_lt … Hidet … Hdetd) -Hdetd #Hid - lapply (lift_inv_lref1_lt … H … Hid) -H #H destruct - elim (lift_trans_ge … HVW … HWU2 ?) -W // (lift_mono … HVY … HVW) -Y -HVW #H destruct /2 width=4/ -| #K #a #I #V1 #V2 #T1 #T2 #dt #et #_ #_ #IHV12 #IHT12 #L #U1 #U2 #d #e #HLK #H1 #H2 #Hdetd - elim (lift_inv_bind1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 - elim (lift_inv_bind1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct - @tps_bind [ /2 width=6/ | @IHT12 /2 width=6/ ] (**) (* /3 width=6/ is too slow, arith3 needed to avoid crash *) -| #K #I #V1 #V2 #T1 #T2 #dt #et #_ #_ #IHV12 #IHT12 #L #U1 #U2 #d #e #HLK #H1 #H2 #Hdetd - elim (lift_inv_flat1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 - elim (lift_inv_flat1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /3 width=6/ -] -qed. - -lemma tps_lift_be: ∀K,T1,T2,dt,et. K ⊢ T1 ▶ [dt, et] T2 → - ∀L,U1,U2,d,e. ⇩[d, e] L ≡ K → - ⇧[d, e] T1 ≡ U1 → ⇧[d, e] T2 ≡ U2 → - dt ≤ d → d ≤ dt + et → - L ⊢ U1 ▶ [dt, et + e] U2. -#K #T1 #T2 #dt #et #H elim H -K -T1 -T2 -dt -et -[ #K #I #dt #et #L #U1 #U2 #d #e #_ #H1 #H2 #_ #_ - >(lift_mono … H1 … H2) -H1 -H2 // -| #K #KV #V #W #i #dt #et #Hdti #Hidet #HKV #HVW #L #U1 #U2 #d #e #HLK #H #HWU2 #Hdtd #_ - elim (lift_inv_lref1 … H) -H * #Hid #H destruct - [ -Hdtd - lapply (lt_to_le_to_lt … (dt+et+e) Hidet ?) // -Hidet #Hidete - elim (lift_trans_ge … HVW … HWU2 ?) -W // (lift_mono … HVY … HVW) -V #H destruct /2 width=4/ - | -Hdti - lapply (transitive_le … Hdtd Hid) -Hdtd #Hdti - lapply (lift_trans_be … HVW … HWU2 ? ?) -W // /2 width=1/ >plus_plus_comm_23 #HVU2 - lapply (ldrop_trans_ge_comm … HLK … HKV ?) -K // -Hid /3 width=4/ - ] -| #K #a #I #V1 #V2 #T1 #T2 #dt #et #_ #_ #IHV12 #IHT12 #L #U1 #U2 #d #e #HLK #H1 #H2 #Hdtd #Hddet - elim (lift_inv_bind1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 - elim (lift_inv_bind1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct - @tps_bind [ /2 width=6/ | @IHT12 [3,4: // | skip |5,6: /2 width=1/ | /2 width=1/ ] - ] (**) (* /3 width=6/ is too slow, simplification like tps_lift_le is too slow *) -| #K #I #V1 #V2 #T1 #T2 #dt #et #_ #_ #IHV12 #IHT12 #L #U1 #U2 #d #e #HLK #H1 #H2 #Hdetd - elim (lift_inv_flat1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 - elim (lift_inv_flat1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /3 width=6/ -] -qed. - -(* Basic_1: was: subst1_lift_ge *) -lemma tps_lift_ge: ∀K,T1,T2,dt,et. K ⊢ T1 ▶ [dt, et] T2 → - ∀L,U1,U2,d,e. ⇩[d, e] L ≡ K → - ⇧[d, e] T1 ≡ U1 → ⇧[d, e] T2 ≡ U2 → - d ≤ dt → - L ⊢ U1 ▶ [dt + e, et] U2. -#K #T1 #T2 #dt #et #H elim H -K -T1 -T2 -dt -et -[ #K #I #dt #et #L #U1 #U2 #d #e #_ #H1 #H2 #_ - >(lift_mono … H1 … H2) -H1 -H2 // -| #K #KV #V #W #i #dt #et #Hdti #Hidet #HKV #HVW #L #U1 #U2 #d #e #HLK #H #HWU2 #Hddt - lapply (transitive_le … Hddt … Hdti) -Hddt #Hid - lapply (lift_inv_lref1_ge … H … Hid) -H #H destruct - lapply (lift_trans_be … HVW … HWU2 ? ?) -W // /2 width=1/ >plus_plus_comm_23 #HVU2 - lapply (ldrop_trans_ge_comm … HLK … HKV ?) -K // -Hid /3 width=4/ -| #K #a #I #V1 #V2 #T1 #T2 #dt #et #_ #_ #IHV12 #IHT12 #L #U1 #U2 #d #e #HLK #H1 #H2 #Hddt - elim (lift_inv_bind1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 - elim (lift_inv_bind1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct - @tps_bind [ /2 width=5/ | /3 width=5/ ] (**) (* explicit constructor *) -| #K #I #V1 #V2 #T1 #T2 #dt #et #_ #_ #IHV12 #IHT12 #L #U1 #U2 #d #e #HLK #H1 #H2 #Hddt - elim (lift_inv_flat1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 - elim (lift_inv_flat1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /3 width=5/ -] -qed. - -(* Basic_1: was: subst1_gen_lift_lt *) -lemma tps_inv_lift1_le: ∀L,U1,U2,dt,et. L ⊢ U1 ▶ [dt, et] U2 → - ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → - dt + et ≤ d → - ∃∃T2. K ⊢ T1 ▶ [dt, et] T2 & ⇧[d, e] T2 ≡ U2. -#L #U1 #U2 #dt #et #H elim H -L -U1 -U2 -dt -et -[ #L * #i #dt #et #K #d #e #_ #T1 #H #_ - [ lapply (lift_inv_sort2 … H) -H #H destruct /2 width=3/ - | elim (lift_inv_lref2 … H) -H * #Hid #H destruct /3 width=3/ - | lapply (lift_inv_gref2 … H) -H #H destruct /2 width=3/ - ] -| #L #KV #V #W #i #dt #et #Hdti #Hidet #HLKV #HVW #K #d #e #HLK #T1 #H #Hdetd - lapply (lt_to_le_to_lt … Hidet … Hdetd) -Hdetd #Hid - lapply (lift_inv_lref2_lt … H … Hid) -H #H destruct - elim (ldrop_conf_lt … HLK … HLKV ?) -L // #L #U #HKL #_ #HUV - elim (lift_trans_le … HUV … HVW ?) -V // >minus_plus minus_plus plus_minus // commutative_plus >plus_minus // /2 width=1/ ] ] (**) (* explicit constructor, uses monotonic_lt_minus_l *) - ] -| #L #a #I #V1 #V2 #U1 #U2 #dt #et #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H #Hdtd #Hdedet - elim (lift_inv_bind2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct - elim (IHV12 … HLK … HWV1 ? ?) -V1 // #W2 #HW12 #HWV2 - elim (IHU12 … HTU1 ? ?) -U1 [5: @ldrop_skip // |2: skip |3: >plus_plus_comm_23 >(plus_plus_comm_23 dt) /2 width=1/ |4: /2 width=1/ ] (**) (* 29s without the rewrites *) - /3 width=5/ -| #L #I #V1 #V2 #U1 #U2 #dt #et #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H #Hdtd #Hdedet - elim (lift_inv_flat2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct - elim (IHV12 … HLK … HWV1 ? ?) -V1 // - elim (IHU12 … HLK … HTU1 ? ?) -U1 -HLK // /3 width=5/ -] -qed. - -(* Basic_1: was: subst1_gen_lift_ge *) -lemma tps_inv_lift1_ge: ∀L,U1,U2,dt,et. L ⊢ U1 ▶ [dt, et] U2 → - ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → - d + e ≤ dt → - ∃∃T2. K ⊢ T1 ▶ [dt - e, et] T2 & ⇧[d, e] T2 ≡ U2. -#L #U1 #U2 #dt #et #H elim H -L -U1 -U2 -dt -et -[ #L * #i #dt #et #K #d #e #_ #T1 #H #_ - [ lapply (lift_inv_sort2 … H) -H #H destruct /2 width=3/ - | elim (lift_inv_lref2 … H) -H * #Hid #H destruct /3 width=3/ - | lapply (lift_inv_gref2 … H) -H #H destruct /2 width=3/ - ] -| #L #KV #V #W #i #dt #et #Hdti #Hidet #HLKV #HVW #K #d #e #HLK #T1 #H #Hdedt - lapply (transitive_le … Hdedt … Hdti) #Hdei - elim (le_inv_plus_l … Hdedt) -Hdedt #_ #Hedt - elim (le_inv_plus_l … Hdei) #Hdie #Hei - lapply (lift_inv_lref2_ge … H … Hdei) -H #H destruct - lapply (ldrop_conf_ge … HLK … HLKV ?) -L // #HKV - elim (lift_split … HVW d (i - e + 1) ? ? ?) -HVW [4: // |3: /2 width=1/ |2: /3 width=1/ ] -Hdei -Hdie - #V0 #HV10 >plus_minus // plus_minus // /2 width=1/ ] ] (**) (* explicit constructor, uses monotonic_lt_minus_l *) -| #L #a #I #V1 #V2 #U1 #U2 #dt #et #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H #Hdetd - elim (lift_inv_bind2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct - elim (le_inv_plus_l … Hdetd) #_ #Hedt - elim (IHV12 … HLK … HWV1 ?) -V1 // #W2 #HW12 #HWV2 - elim (IHU12 … HTU1 ?) -U1 [4: @ldrop_skip // |2: skip |3: /2 width=1/ ] - IHV12 // >IHT12 // -| #L #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #X #HX - elim (lift_inv_flat2 … HX) -HX #V #T #HV1 #HT1 #H destruct - >IHV12 // >IHT12 // -] -qed. -(* - Theorem subst0_gen_lift_rev_ge: (t1,v,u2,i,h,d:?) - (subst0 i v t1 (lift h d u2)) -> - (le (plus d h) i) -> - (EX u1 | (subst0 (minus i h) v u1 u2) & - t1 = (lift h d u1) - ). - - - Theorem subst0_gen_lift_rev_lelt: (t1,v,u2,i,h,d:?) - (subst0 i v t1 (lift h d u2)) -> - (le d i) -> (lt i (plus d h)) -> - (EX u1 | t1 = (lift (minus (plus d h) (S i)) (S i) u1)). -*) -lemma tps_inv_lift1_ge_up: ∀L,U1,U2,dt,et. L ⊢ U1 ▶ [dt, et] U2 → - ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → - d ≤ dt → dt ≤ d + e → d + e ≤ dt + et → - ∃∃T2. K ⊢ T1 ▶ [d, dt + et - (d + e)] T2 & ⇧[d, e] T2 ≡ U2. -#L #U1 #U2 #dt #et #HU12 #K #d #e #HLK #T1 #HTU1 #Hddt #Hdtde #Hdedet -elim (tps_split_up … HU12 (d + e) ? ?) -HU12 // -Hdedet #U #HU1 #HU2 -lapply (tps_weak … HU1 d e ? ?) -HU1 // [ >commutative_plus /2 width=1/ ] -Hddt -Hdtde #HU1 -lapply (tps_inv_lift1_eq … HU1 … HTU1) -HU1 #HU1 destruct -elim (tps_inv_lift1_ge … HU2 … HLK … HTU1 ?) -U -L // commutative_plus /2 width=1/ ] -Hdtd #T #HT1 #HTU -lapply (tps_weak … HU2 d e ? ?) -HU2 // [ >commutative_plus (lift_mono … HVT1 … HVT2) -HVT1 -HVT2 /2 width=3/ - ] -| #L #a #I #V0 #V1 #T0 #T1 #d1 #e1 #_ #_ #IHV01 #IHT01 #X #d2 #e2 #HX - elim (tps_inv_bind1 … HX) -HX #V2 #T2 #HV02 #HT02 #HX destruct - lapply (tps_lsubr_trans … HT02 (L. ⓑ{I} V1) ?) -HT02 /2 width=1/ #HT02 - elim (IHV01 … HV02) -V0 #V #HV1 #HV2 - elim (IHT01 … HT02) -T0 #T #HT1 #HT2 - lapply (tps_lsubr_trans … HT1 (L. ⓑ{I} V) ?) -HT1 /2 width=1/ - lapply (tps_lsubr_trans … HT2 (L. ⓑ{I} V) ?) -HT2 /3 width=5/ -| #L #I #V0 #V1 #T0 #T1 #d1 #e1 #_ #_ #IHV01 #IHT01 #X #d2 #e2 #HX - elim (tps_inv_flat1 … HX) -HX #V2 #T2 #HV02 #HT02 #HX destruct - elim (IHV01 … HV02) -V0 - elim (IHT01 … HT02) -T0 /3 width=5/ -] -qed. - -(* Basic_1: was: subst1_confluence_neq *) -theorem tps_conf_neq: ∀L1,T0,T1,d1,e1. L1 ⊢ T0 ▶ [d1, e1] T1 → - ∀L2,T2,d2,e2. L2 ⊢ T0 ▶ [d2, e2] T2 → - (d1 + e1 ≤ d2 ∨ d2 + e2 ≤ d1) → - ∃∃T. L2 ⊢ T1 ▶ [d2, e2] T & L1 ⊢ T2 ▶ [d1, e1] T. -#L1 #T0 #T1 #d1 #e1 #H elim H -L1 -T0 -T1 -d1 -e1 -[ /2 width=3/ -| #L1 #K1 #V1 #T1 #i0 #d1 #e1 #Hd1 #Hde1 #HLK1 #HVT1 #L2 #T2 #d2 #e2 #H1 #H2 - elim (tps_inv_lref1 … H1) -H1 - [ #H destruct /3 width=6/ - | -HLK1 -HVT1 * #K2 #V2 #Hd2 #Hde2 #_ #_ elim H2 -H2 #Hded - [ -Hd1 -Hde2 - lapply (transitive_le … Hded Hd2) -Hded -Hd2 #H - lapply (lt_to_le_to_lt … Hde1 H) -Hde1 -H #H - elim (lt_refl_false … H) - | -Hd2 -Hde1 - lapply (transitive_le … Hded Hd1) -Hded -Hd1 #H - lapply (lt_to_le_to_lt … Hde2 H) -Hde2 -H #H - elim (lt_refl_false … H) - ] - ] -| #L1 #a #I #V0 #V1 #T0 #T1 #d1 #e1 #_ #_ #IHV01 #IHT01 #L2 #X #d2 #e2 #HX #H - elim (tps_inv_bind1 … HX) -HX #V2 #T2 #HV02 #HT02 #HX destruct - elim (IHV01 … HV02 H) -V0 #V #HV1 #HV2 - elim (IHT01 … HT02 ?) -T0 - [ -H #T #HT1 #HT2 - lapply (tps_lsubr_trans … HT1 (L2. ⓑ{I} V) ?) -HT1 /2 width=1/ - lapply (tps_lsubr_trans … HT2 (L1. ⓑ{I} V) ?) -HT2 /2 width=1/ /3 width=5/ - | -HV1 -HV2 >plus_plus_comm_23 >plus_plus_comm_23 in ⊢ (? ? %); elim H -H #H - [ @or_introl | @or_intror ] /2 by monotonic_le_plus_l/ (**) (* /3 / is too slow *) - ] -| #L1 #I #V0 #V1 #T0 #T1 #d1 #e1 #_ #_ #IHV01 #IHT01 #L2 #X #d2 #e2 #HX #H - elim (tps_inv_flat1 … HX) -HX #V2 #T2 #HV02 #HT02 #HX destruct - elim (IHV01 … HV02 H) -V0 - elim (IHT01 … HT02 H) -T0 -H /3 width=5/ -] -qed. - -(* Note: the constant 1 comes from tps_subst *) -(* Basic_1: was: subst1_trans *) -theorem tps_trans_ge: ∀L,T1,T0,d,e. L ⊢ T1 ▶ [d, e] T0 → - ∀T2. L ⊢ T0 ▶ [d, 1] T2 → 1 ≤ e → - L ⊢ T1 ▶ [d, e] T2. -#L #T1 #T0 #d #e #H elim H -L -T1 -T0 -d -e -[ #L #I #d #e #T2 #H #He - elim (tps_inv_atom1 … H) -H - [ #H destruct // - | * #K #V #i #Hd2i #Hide2 #HLK #HVT2 #H destruct - lapply (lt_to_le_to_lt … (d + e) Hide2 ?) /2 width=4/ - ] -| #L #K #V #V2 #i #d #e #Hdi #Hide #HLK #HVW #T2 #HVT2 #He - lapply (tps_weak … HVT2 0 (i +1) ? ?) -HVT2 /2 width=1/ #HVT2 - <(tps_inv_lift1_eq … HVT2 … HVW) -HVT2 /2 width=4/ -| #L #a #I #V1 #V0 #T1 #T0 #d #e #_ #_ #IHV10 #IHT10 #X #H #He - elim (tps_inv_bind1 … H) -H #V2 #T2 #HV02 #HT02 #H destruct - lapply (tps_lsubr_trans … HT02 (L. ⓑ{I} V0) ?) -HT02 /2 width=1/ #HT02 - lapply (IHT10 … HT02 He) -T0 #HT12 - lapply (tps_lsubr_trans … HT12 (L. ⓑ{I} V2) ?) -HT12 /2 width=1/ /3 width=1/ -| #L #I #V1 #V0 #T1 #T0 #d #e #_ #_ #IHV10 #IHT10 #X #H #He - elim (tps_inv_flat1 … H) -H #V2 #T2 #HV02 #HT02 #H destruct /3 width=1/ -] -qed. - -theorem tps_trans_down: ∀L,T1,T0,d1,e1. L ⊢ T1 ▶ [d1, e1] T0 → - ∀T2,d2,e2. L ⊢ T0 ▶ [d2, e2] T2 → d2 + e2 ≤ d1 → - ∃∃T. L ⊢ T1 ▶ [d2, e2] T & L ⊢ T ▶ [d1, e1] T2. -#L #T1 #T0 #d1 #e1 #H elim H -L -T1 -T0 -d1 -e1 -[ /2 width=3/ -| #L #K #V #W #i1 #d1 #e1 #Hdi1 #Hide1 #HLK #HVW #T2 #d2 #e2 #HWT2 #Hde2d1 - lapply (transitive_le … Hde2d1 Hdi1) -Hde2d1 #Hde2i1 - lapply (tps_weak … HWT2 0 (i1 + 1) ? ?) -HWT2 normalize /2 width=1/ -Hde2i1 #HWT2 - <(tps_inv_lift1_eq … HWT2 … HVW) -HWT2 /3 width=8/ -| #L #a #I #V1 #V0 #T1 #T0 #d1 #e1 #_ #_ #IHV10 #IHT10 #X #d2 #e2 #HX #de2d1 - elim (tps_inv_bind1 … HX) -HX #V2 #T2 #HV02 #HT02 #HX destruct - lapply (tps_lsubr_trans … HT02 (L. ⓑ{I} V0) ?) -HT02 /2 width=1/ #HT02 - elim (IHV10 … HV02 ?) -IHV10 -HV02 // #V - elim (IHT10 … HT02 ?) -T0 /2 width=1/ #T #HT1 #HT2 - lapply (tps_lsubr_trans … HT1 (L. ⓑ{I} V) ?) -HT1 /2 width=1/ - lapply (tps_lsubr_trans … HT2 (L. ⓑ{I} V2) ?) -HT2 /2 width=1/ /3 width=6/ -| #L #I #V1 #V0 #T1 #T0 #d1 #e1 #_ #_ #IHV10 #IHT10 #X #d2 #e2 #HX #de2d1 - elim (tps_inv_flat1 … HX) -HX #V2 #T2 #HV02 #HT02 #HX destruct - elim (IHV10 … HV02 ?) -V0 // - elim (IHT10 … HT02 ?) -T0 // /3 width=6/ -] -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpss.etc deleted file mode 100644 index 433718803..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpss.etc +++ /dev/null @@ -1,188 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( L ⊢ break term 46 T1 break ▶ * [ term 46 d , break term 46 e ] break term 46 T2 )" - non associative with precedence 45 - for @{ 'PSubstStar $L $T1 $d $e $T2 }. - -include "basic_2/substitution/tps.ma". - -(* PARTIAL UNFOLD ON TERMS **************************************************) - -definition tpss: nat → nat → lenv → relation term ≝ - λd,e,L. TC … (tps d e L). - -interpretation "partial unfold (term)" - 'PSubstStar L T1 d e T2 = (tpss d e L T1 T2). - -(* Basic eliminators ********************************************************) - -lemma tpss_ind: ∀d,e,L,T1. ∀R:predicate term. R T1 → - (∀T,T2. L ⊢ T1 ▶* [d, e] T → L ⊢ T ▶ [d, e] T2 → R T → R T2) → - ∀T2. L ⊢ T1 ▶* [d, e] T2 → R T2. -#d #e #L #T1 #R #HT1 #IHT1 #T2 #HT12 -@(TC_star_ind … HT1 IHT1 … HT12) // -qed-. - -lemma tpss_ind_dx: ∀d,e,L,T2. ∀R:predicate term. R T2 → - (∀T1,T. L ⊢ T1 ▶ [d, e] T → L ⊢ T ▶* [d, e] T2 → R T → R T1) → - ∀T1. L ⊢ T1 ▶* [d, e] T2 → R T1. -#d #e #L #T2 #R #HT2 #IHT2 #T1 #HT12 -@(TC_star_ind_dx … HT2 IHT2 … HT12) // -qed-. - -(* Basic properties *********************************************************) - -lemma tps_tpss: ∀L,T1,T2,d,e. L ⊢ T1 ▶ [d, e] T2 → L ⊢ T1 ▶* [d, e] T2. -/2 width=1/ qed. - -lemma tpss_strap1: ∀L,T1,T,T2,d,e. - L ⊢ T1 ▶* [d, e] T → L ⊢ T ▶ [d, e] T2 → L ⊢ T1 ▶* [d, e] T2. -/2 width=3/ qed. - -lemma tpss_strap2: ∀L,T1,T,T2,d,e. - L ⊢ T1 ▶ [d, e] T → L ⊢ T ▶* [d, e] T2 → L ⊢ T1 ▶* [d, e] T2. -/2 width=3/ qed. - -lemma tpss_lsubr_trans: ∀L1,T1,T2,d,e. L1 ⊢ T1 ▶* [d, e] T2 → - ∀L2. L2 ⊑ [d, e] L1 → L2 ⊢ T1 ▶* [d, e] T2. -/3 width=3/ qed. - -lemma tpss_refl: ∀d,e,L,T. L ⊢ T ▶* [d, e] T. -/2 width=1/ qed. - -lemma tpss_bind: ∀L,V1,V2,d,e. L ⊢ V1 ▶* [d, e] V2 → - ∀a,I,T1,T2. L. ⓑ{I} V2 ⊢ T1 ▶* [d + 1, e] T2 → - L ⊢ ⓑ{a,I} V1. T1 ▶* [d, e] ⓑ{a,I} V2. T2. -#L #V1 #V2 #d #e #HV12 elim HV12 -V2 -[ #V2 #HV12 #a #I #T1 #T2 #HT12 elim HT12 -T2 - [ /3 width=5/ - | #T #T2 #_ #HT2 #IHT @step /2 width=5/ (**) (* /3 width=5/ is too slow *) - ] -| #V #V2 #_ #HV12 #IHV #a #I #T1 #T2 #HT12 - lapply (tpss_lsubr_trans … HT12 (L. ⓑ{I} V) ?) -HT12 /2 width=1/ #HT12 - lapply (IHV a … HT12) -IHV -HT12 #HT12 @step /2 width=5/ (**) (* /3 width=5/ is too slow *) -] -qed. - -lemma tpss_flat: ∀L,I,V1,V2,T1,T2,d,e. - L ⊢ V1 ▶* [d, e] V2 → L ⊢ T1 ▶* [d, e] T2 → - L ⊢ ⓕ{I} V1. T1 ▶* [d, e] ⓕ{I} V2. T2. -#L #I #V1 #V2 #T1 #T2 #d #e #HV12 elim HV12 -V2 -[ #V2 #HV12 #HT12 elim HT12 -T2 - [ /3 width=1/ - | #T #T2 #_ #HT2 #IHT @step /2 width=5/ (**) (* /3 width=5/ is too slow *) - ] -| #V #V2 #_ #HV12 #IHV #HT12 - lapply (IHV … HT12) -IHV -HT12 #HT12 @step /2 width=5/ (**) (* /3 width=5/ is too slow *) -] -qed. - -lemma tpss_weak: ∀L,T1,T2,d1,e1. L ⊢ T1 ▶* [d1, e1] T2 → - ∀d2,e2. d2 ≤ d1 → d1 + e1 ≤ d2 + e2 → - L ⊢ T1 ▶* [d2, e2] T2. -#L #T1 #T2 #d1 #e1 #H #d1 #d2 #Hd21 #Hde12 @(tpss_ind … H) -T2 -[ // -| #T #T2 #_ #HT12 #IHT - lapply (tps_weak … HT12 … Hd21 Hde12) -HT12 -Hd21 -Hde12 /2 width=3/ -] -qed. - -lemma tpss_weak_top: ∀L,T1,T2,d,e. - L ⊢ T1 ▶* [d, e] T2 → L ⊢ T1 ▶* [d, |L| - d] T2. -#L #T1 #T2 #d #e #H @(tpss_ind … H) -T2 -[ // -| #T #T2 #_ #HT12 #IHT - lapply (tps_weak_top … HT12) -HT12 /2 width=3/ -] -qed. - -lemma tpss_weak_full: ∀L,T1,T2,d,e. - L ⊢ T1 ▶* [d, e] T2 → L ⊢ T1 ▶* [0, |L|] T2. -#L #T1 #T2 #d #e #HT12 -lapply (tpss_weak … HT12 0 (d + e) ? ?) -HT12 // #HT12 -lapply (tpss_weak_top … HT12) // -qed. - -lemma tpss_append: ∀K,T1,T2,d,e. K ⊢ T1 ▶* [d, e] T2 → - ∀L. L @@ K ⊢ T1 ▶* [d, e] T2. -#K #T1 #T2 #d #e #H @(tpss_ind … H) -T2 // /3 width=3/ -qed. - -(* Basic inversion lemmas ***************************************************) - -(* Note: this can be derived from tpss_inv_atom1 *) -lemma tpss_inv_sort1: ∀L,T2,k,d,e. L ⊢ ⋆k ▶* [d, e] T2 → T2 = ⋆k. -#L #T2 #k #d #e #H @(tpss_ind … H) -T2 -[ // -| #T #T2 #_ #HT2 #IHT destruct - >(tps_inv_sort1 … HT2) -HT2 // -] -qed-. - -(* Note: this can be derived from tpss_inv_atom1 *) -lemma tpss_inv_gref1: ∀L,T2,p,d,e. L ⊢ §p ▶* [d, e] T2 → T2 = §p. -#L #T2 #p #d #e #H @(tpss_ind … H) -T2 -[ // -| #T #T2 #_ #HT2 #IHT destruct - >(tps_inv_gref1 … HT2) -HT2 // -] -qed-. - -lemma tpss_inv_bind1: ∀d,e,L,a,I,V1,T1,U2. L ⊢ ⓑ{a,I} V1. T1 ▶* [d, e] U2 → - ∃∃V2,T2. L ⊢ V1 ▶* [d, e] V2 & - L. ⓑ{I} V2 ⊢ T1 ▶* [d + 1, e] T2 & - U2 = ⓑ{a,I} V2. T2. -#d #e #L #a #I #V1 #T1 #U2 #H @(tpss_ind … H) -U2 -[ /2 width=5/ -| #U #U2 #_ #HU2 * #V #T #HV1 #HT1 #H destruct - elim (tps_inv_bind1 … HU2) -HU2 #V2 #T2 #HV2 #HT2 #H - lapply (tpss_lsubr_trans … HT1 (L. ⓑ{I} V2) ?) -HT1 /2 width=1/ /3 width=5/ -] -qed-. - -lemma tpss_inv_flat1: ∀d,e,L,I,V1,T1,U2. L ⊢ ⓕ{I} V1. T1 ▶* [d, e] U2 → - ∃∃V2,T2. L ⊢ V1 ▶* [d, e] V2 & L ⊢ T1 ▶* [d, e] T2 & - U2 = ⓕ{I} V2. T2. -#d #e #L #I #V1 #T1 #U2 #H @(tpss_ind … H) -U2 -[ /2 width=5/ -| #U #U2 #_ #HU2 * #V #T #HV1 #HT1 #H destruct - elim (tps_inv_flat1 … HU2) -HU2 /3 width=5/ -] -qed-. - -lemma tpss_inv_refl_O2: ∀L,T1,T2,d. L ⊢ T1 ▶* [d, 0] T2 → T1 = T2. -#L #T1 #T2 #d #H @(tpss_ind … H) -T2 -[ // -| #T #T2 #_ #HT2 #IHT <(tps_inv_refl_O2 … HT2) -HT2 // -] -qed-. - -(* Basic forward lemmas *****************************************************) - -lemma tpss_fwd_tw: ∀L,T1,T2,d,e. L ⊢ T1 ▶* [d, e] T2 → ♯{T1} ≤ ♯{T2}. -#L #T1 #T2 #d #e #H @(tpss_ind … H) -T2 // -#T #T2 #_ #HT2 #IHT1 -lapply (tps_fwd_tw … HT2) -HT2 #HT2 -@(transitive_le … IHT1) // -qed-. - -lemma tpss_fwd_shift1: ∀L,L1,T1,T,d,e. L ⊢ L1 @@ T1 ▶*[d, e] T → - ∃∃L2,T2. |L1| = |L2| & T = L2 @@ T2. -#L #L1 #T1 #T #d #e #H @(tpss_ind … H) -T -[ /2 width=4/ -| #T #X #_ #H0 * #L0 #T0 #HL10 #H destruct - elim (tps_fwd_shift1 … H0) -H0 #L2 #T2 #HL02 #H destruct /2 width=4/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpss_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpss_alt.etc deleted file mode 100644 index f7670eaa8..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpss_alt.etc +++ /dev/null @@ -1,105 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( L ⊢ break term 46 T1 break ▶ ▶ * [ term 46 d , break term 46 e ] break term 46 T2 )" - non associative with precedence 45 - for @{ 'PSubstStarAlt $L $T1 $d $e $T2 }. - -include "basic_2/unfold/tpss_lift.ma". - -(* PARALLEL UNFOLD ON TERMS *************************************************) - -(* alternative definition of tpss *) -inductive tpssa: nat → nat → lenv → relation term ≝ -| tpssa_atom : ∀L,I,d,e. tpssa d e L (⓪{I}) (⓪{I}) -| tpssa_subst: ∀L,K,V1,V2,W2,i,d,e. d ≤ i → i < d + e → - ⇩[0, i] L ≡ K. ⓓV1 → tpssa 0 (d + e - i - 1) K V1 V2 → - ⇧[0, i + 1] V2 ≡ W2 → tpssa d e L (#i) W2 -| tpssa_bind : ∀L,a,I,V1,V2,T1,T2,d,e. - tpssa d e L V1 V2 → tpssa (d + 1) e (L. ⓑ{I} V2) T1 T2 → - tpssa d e L (ⓑ{a,I} V1. T1) (ⓑ{a,I} V2. T2) -| tpssa_flat : ∀L,I,V1,V2,T1,T2,d,e. - tpssa d e L V1 V2 → tpssa d e L T1 T2 → - tpssa d e L (ⓕ{I} V1. T1) (ⓕ{I} V2. T2) -. - -interpretation "parallel unfold (term) alternative" - 'PSubstStarAlt L T1 d e T2 = (tpssa d e L T1 T2). - -(* Basic properties *********************************************************) - -lemma tpssa_lsubr_trans: ∀L1,T1,T2,d,e. L1 ⊢ T1 ▶▶* [d, e] T2 → - ∀L2. L2 ⊑ [d, e] L1 → L2 ⊢ T1 ▶▶* [d, e] T2. -#L1 #T1 #T2 #d #e #H elim H -L1 -T1 -T2 -d -e -[ // -| #L1 #K1 #V1 #V2 #W2 #i #d #e #Hdi #Hide #HLK1 #_ #HVW2 #IHV12 #L2 #HL12 - elim (ldrop_lsubr_ldrop2_abbr … HL12 … HLK1 ? ?) -HL12 -HLK1 // /3 width=6/ -| /4 width=1/ -| /3 width=1/ -] -qed. - -lemma tpssa_refl: ∀T,L,d,e. L ⊢ T ▶▶* [d, e] T. -#T elim T -T // -#I elim I -I /2 width=1/ -qed. - -lemma tpssa_tps_trans: ∀L,T1,T,d,e. L ⊢ T1 ▶▶* [d, e] T → - ∀T2. L ⊢ T ▶ [d, e] T2 → L ⊢ T1 ▶▶* [d, e] T2. -#L #T1 #T #d #e #H elim H -L -T1 -T -d -e -[ #L #I #d #e #X #H - elim (tps_inv_atom1 … H) -H // * /2 width=6/ -| #L #K #V1 #V2 #W2 #i #d #e #Hdi #Hide #HLK #_ #HVW2 #IHV12 #T2 #H - lapply (ldrop_fwd_ldrop2 … HLK) #H0LK - lapply (tps_weak … H 0 (d+e) ? ?) -H // #H - elim (tps_inv_lift1_be … H … H0LK … HVW2 ? ?) -H -H0LK -HVW2 // /3 width=6/ -| #L #a #I #V1 #V #T1 #T #d #e #_ #_ #IHV1 #IHT1 #X #H - elim (tps_inv_bind1 … H) -H #V2 #T2 #HV2 #HT2 #H destruct - lapply (tps_lsubr_trans … HT2 (L.ⓑ{I}V) ?) -HT2 /2 width=1/ #HT2 - lapply (IHV1 … HV2) -IHV1 -HV2 #HV12 - lapply (IHT1 … HT2) -IHT1 -HT2 #HT12 - lapply (tpssa_lsubr_trans … HT12 (L.ⓑ{I}V2) ?) -HT12 /2 width=1/ -| #L #I #V1 #V #T1 #T #d #e #_ #_ #IHV1 #IHT1 #X #H - elim (tps_inv_flat1 … H) -H #V2 #T2 #HV2 #HT2 #H destruct /3 width=1/ -] -qed. - -lemma tpss_tpssa: ∀L,T1,T2,d,e. L ⊢ T1 ▶* [d, e] T2 → L ⊢ T1 ▶▶* [d, e] T2. -#L #T1 #T2 #d #e #H @(tpss_ind … H) -T2 // /2 width=3/ -qed. - -(* Basic inversion lemmas ***************************************************) - -lemma tpssa_tpss: ∀L,T1,T2,d,e. L ⊢ T1 ▶▶* [d, e] T2 → L ⊢ T1 ▶* [d, e] T2. -#L #T1 #T2 #d #e #H elim H -L -T1 -T2 -d -e // /2 width=6/ -qed-. - -lemma tpss_ind_alt: ∀R:nat→nat→lenv→relation term. - (∀L,I,d,e. R d e L (⓪{I}) (⓪{I})) → - (∀L,K,V1,V2,W2,i,d,e. d ≤ i → i < d + e → - ⇩[O, i] L ≡ K.ⓓV1 → K ⊢ V1 ▶* [O, d + e - i - 1] V2 → - ⇧[O, i + 1] V2 ≡ W2 → R O (d+e-i-1) K V1 V2 → R d e L (#i) W2 - ) → - (∀L,a,I,V1,V2,T1,T2,d,e. L ⊢ V1 ▶* [d, e] V2 → - L.ⓑ{I}V2 ⊢ T1 ▶* [d + 1, e] T2 → R d e L V1 V2 → - R (d+1) e (L.ⓑ{I}V2) T1 T2 → R d e L (ⓑ{a,I}V1.T1) (ⓑ{a,I}V2.T2) - ) → - (∀L,I,V1,V2,T1,T2,d,e. L ⊢ V1 ▶* [d, e] V2 → - L ⊢ T1 ▶* [d, e] T2 → R d e L V1 V2 → - R d e L T1 T2 → R d e L (ⓕ{I}V1.T1) (ⓕ{I}V2.T2) - ) → - ∀d,e,L,T1,T2. L ⊢ T1 ▶* [d, e] T2 → R d e L T1 T2. -#R #H1 #H2 #H3 #H4 #d #e #L #T1 #T2 #H elim (tpss_tpssa … H) -L -T1 -T2 -d -e -// /3 width=1 by tpssa_tpss/ /3 width=7 by tpssa_tpss/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpss_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpss_lift.etc deleted file mode 100644 index a68f86e32..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpss_lift.etc +++ /dev/null @@ -1,196 +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/substitution/tps_lift.ma". -include "basic_2/unfold/tpss.ma". - -(* PARTIAL UNFOLD ON TERMS **************************************************) - -(* Advanced properties ******************************************************) - -lemma tpss_subst: ∀L,K,V,U1,i,d,e. - d ≤ i → i < d + e → - ⇩[0, i] L ≡ K. ⓓV → K ⊢ V ▶* [0, d + e - i - 1] U1 → - ∀U2. ⇧[0, i + 1] U1 ≡ U2 → L ⊢ #i ▶* [d, e] U2. -#L #K #V #U1 #i #d #e #Hdi #Hide #HLK #H @(tpss_ind … H) -U1 -[ /3 width=4/ -| #U #U1 #_ #HU1 #IHU #U2 #HU12 - elim (lift_total U 0 (i+1)) #U0 #HU0 - lapply (IHU … HU0) -IHU #H - lapply (ldrop_fwd_ldrop2 … HLK) -HLK #HLK - lapply (tps_lift_ge … HU1 … HLK HU0 HU12 ?) -HU1 -HLK -HU0 -HU12 // normalize #HU02 - lapply (tps_weak … HU02 d e ? ?) -HU02 [ >minus_plus >commutative_plus /2 width=1/ | /2 width=1/ | /2 width=3/ ] -] -qed. - -(* Advanced inverion lemmas *************************************************) - -lemma tpss_inv_atom1: ∀L,T2,I,d,e. L ⊢ ⓪{I} ▶* [d, e] T2 → - T2 = ⓪{I} ∨ - ∃∃K,V1,V2,i. d ≤ i & i < d + e & - ⇩[O, i] L ≡ K. ⓓV1 & - K ⊢ V1 ▶* [0, d + e - i - 1] V2 & - ⇧[O, i + 1] V2 ≡ T2 & - I = LRef i. -#L #T2 #I #d #e #H @(tpss_ind … H) -T2 -[ /2 width=1/ -| #T #T2 #_ #HT2 * - [ #H destruct - elim (tps_inv_atom1 … HT2) -HT2 [ /2 width=1/ | * /3 width=10/ ] - | * #K #V1 #V #i #Hdi #Hide #HLK #HV1 #HVT #HI - lapply (ldrop_fwd_ldrop2 … HLK) #H - elim (tps_inv_lift1_ge_up … HT2 … H … HVT ? ? ?) normalize -HT2 -H -HVT [2,3,4: /2 width=1/ ] #V2 (lift_mono … HTU1 … H) -H // -| -HTU1 #T #T2 #_ #HT2 #IHT #U2 #HTU2 - elim (lift_total T d e) #U #HTU - lapply (IHT … HTU) -IHT #HU1 - lapply (tps_lift_le … HT2 … HLK HTU HTU2 ?) -HT2 -HLK -HTU -HTU2 // /2 width=3/ -] -qed. - -lemma tpss_lift_be: ∀K,T1,T2,dt,et. K ⊢ T1 ▶* [dt, et] T2 → - ∀L,U1,d,e. dt ≤ d → d ≤ dt + et → - ⇩[d, e] L ≡ K → ⇧[d, e] T1 ≡ U1 → - ∀U2. ⇧[d, e] T2 ≡ U2 → L ⊢ U1 ▶* [dt, et + e] U2. -#K #T1 #T2 #dt #et #H #L #U1 #d #e #Hdtd #Hddet #HLK #HTU1 @(tpss_ind … H) -T2 -[ #U2 #H >(lift_mono … HTU1 … H) -H // -| -HTU1 #T #T2 #_ #HT2 #IHT #U2 #HTU2 - elim (lift_total T d e) #U #HTU - lapply (IHT … HTU) -IHT #HU1 - lapply (tps_lift_be … HT2 … HLK HTU HTU2 ? ?) -HT2 -HLK -HTU -HTU2 // /2 width=3/ -] -qed. - -lemma tpss_lift_ge: ∀K,T1,T2,dt,et. K ⊢ T1 ▶* [dt, et] T2 → - ∀L,U1,d,e. d ≤ dt → ⇩[d, e] L ≡ K → - ⇧[d, e] T1 ≡ U1 → ∀U2. ⇧[d, e] T2 ≡ U2 → - L ⊢ U1 ▶* [dt + e, et] U2. -#K #T1 #T2 #dt #et #H #L #U1 #d #e #Hddt #HLK #HTU1 @(tpss_ind … H) -T2 -[ #U2 #H >(lift_mono … HTU1 … H) -H // -| -HTU1 #T #T2 #_ #HT2 #IHT #U2 #HTU2 - elim (lift_total T d e) #U #HTU - lapply (IHT … HTU) -IHT #HU1 - lapply (tps_lift_ge … HT2 … HLK HTU HTU2 ?) -HT2 -HLK -HTU -HTU2 // /2 width=3/ -] -qed. - -lemma tpss_inv_lift1_le: ∀L,U1,U2,dt,et. L ⊢ U1 ▶* [dt, et] U2 → - ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → - dt + et ≤ d → - ∃∃T2. K ⊢ T1 ▶* [dt, et] T2 & ⇧[d, e] T2 ≡ U2. -#L #U1 #U2 #dt #et #H #K #d #e #HLK #T1 #HTU1 #Hdetd @(tpss_ind … H) -U2 -[ /2 width=3/ -| -HTU1 #U #U2 #_ #HU2 * #T #HT1 #HTU - elim (tps_inv_lift1_le … HU2 … HLK … HTU ?) -HU2 -HLK -HTU // /3 width=3/ -] -qed. - -lemma tpss_inv_lift1_be: ∀L,U1,U2,dt,et. L ⊢ U1 ▶* [dt, et] U2 → - ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → - dt ≤ d → d + e ≤ dt + et → - ∃∃T2. K ⊢ T1 ▶* [dt, et - e] T2 & ⇧[d, e] T2 ≡ U2. -#L #U1 #U2 #dt #et #H #K #d #e #HLK #T1 #HTU1 #Hdtd #Hdedet @(tpss_ind … H) -U2 -[ /2 width=3/ -| -HTU1 #U #U2 #_ #HU2 * #T #HT1 #HTU - elim (tps_inv_lift1_be … HU2 … HLK … HTU ? ?) -HU2 -HLK -HTU // /3 width=3/ -] -qed. - -lemma tpss_inv_lift1_ge: ∀L,U1,U2,dt,et. L ⊢ U1 ▶* [dt, et] U2 → - ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → - d + e ≤ dt → - ∃∃T2. K ⊢ T1 ▶* [dt - e, et] T2 & ⇧[d, e] T2 ≡ U2. -#L #U1 #U2 #dt #et #H #K #d #e #HLK #T1 #HTU1 #Hdedt @(tpss_ind … H) -U2 -[ /2 width=3/ -| -HTU1 #U #U2 #_ #HU2 * #T #HT1 #HTU - elim (tps_inv_lift1_ge … HU2 … HLK … HTU ?) -HU2 -HLK -HTU // /3 width=3/ -] -qed. - -lemma tpss_inv_lift1_eq: ∀L,U1,U2,d,e. - L ⊢ U1 ▶* [d, e] U2 → ∀T1. ⇧[d, e] T1 ≡ U1 → U1 = U2. -#L #U1 #U2 #d #e #H #T1 #HTU1 @(tpss_ind … H) -U2 // -#U #U2 #_ #HU2 #IHU destruct -<(tps_inv_lift1_eq … HU2 … HTU1) -HU2 -HTU1 // -qed. - -lemma tpss_inv_lift1_ge_up: ∀L,U1,U2,dt,et. L ⊢ U1 ▶* [dt, et] U2 → - ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → - d ≤ dt → dt ≤ d + e → d + e ≤ dt + et → - ∃∃T2. K ⊢ T1 ▶* [d, dt + et - (d + e)] T2 & - ⇧[d, e] T2 ≡ U2. -#L #U1 #U2 #dt #et #H #K #d #e #HLK #T1 #HTU1 #Hddt #Hdtde #Hdedet @(tpss_ind … H) -U2 -[ /2 width=3/ -| -HTU1 #U #U2 #_ #HU2 * #T #HT1 #HTU - elim (tps_inv_lift1_ge_up … HU2 … HLK … HTU ? ? ?) -HU2 -HLK -HTU // /3 width=3/ -] -qed. - -lemma tpss_inv_lift1_be_up: ∀L,U1,U2,dt,et. L ⊢ U1 ▶* [dt, et] U2 → - ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → - dt ≤ d → dt + et ≤ d + e → - ∃∃T2. K ⊢ T1 ▶* [dt, d - dt] T2 & ⇧[d, e] T2 ≡ U2. -#L #U1 #U2 #dt #et #H #K #d #e #HLK #T1 #HTU1 #Hdtd #Hdetde @(tpss_ind … H) -U2 -[ /2 width=3/ -| -HTU1 #U #U2 #_ #HU2 * #T #HT1 #HTU - elim (tps_inv_lift1_be_up … HU2 … HLK … HTU ? ?) -HU2 -HLK -HTU // /3 width=3/ -] -qed. - -lemma tpss_inv_lift1_le_up: ∀L,U1,U2,dt,et. L ⊢ U1 ▶* [dt, et] U2 → - ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → - dt ≤ d → d ≤ dt + et → dt + et ≤ d + e → - ∃∃T2. K ⊢ T1 ▶* [dt, d - dt] T2 & ⇧[d, e] T2 ≡ U2. -#L #U1 #U2 #dt #et #H #K #d #e #HLK #T1 #HTU1 #Hdtd #Hddet #Hdetde @(tpss_ind … H) -U2 -[ /2 width=3/ -| -HTU1 #U #U2 #_ #HU2 * #T #HT1 #HTU - elim (tps_inv_lift1_le_up … HU2 … HLK … HTU ? ? ?) -HU2 -HLK -HTU // /3 width=3/ -] -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpss_tpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpss_tpss.etc deleted file mode 100644 index d124bb32c..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpss_tpss.etc +++ /dev/null @@ -1,96 +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/substitution/tps_tps.ma". -include "basic_2/unfold/tpss_lift.ma". - -(* PARTIAL UNFOLD ON TERMS **************************************************) - -(* Advanced inversion lemmas ************************************************) - -lemma tpss_inv_SO2: ∀L,T1,T2,d. L ⊢ T1 ▶* [d, 1] T2 → L ⊢ T1 ▶ [d, 1] T2. -#L #T1 #T2 #d #H @(tpss_ind … H) -T2 // -#T #T2 #_ #HT2 #IHT1 -lapply (tps_trans_ge … IHT1 … HT2 ?) // -qed-. - -(* Advanced properties ******************************************************) - -lemma tpss_strip_eq: ∀L,T0,T1,d1,e1. L ⊢ T0 ▶* [d1, e1] T1 → - ∀T2,d2,e2. L ⊢ T0 ▶ [d2, e2] T2 → - ∃∃T. L ⊢ T1 ▶ [d2, e2] T & L ⊢ T2 ▶* [d1, e1] T. -/3 width=3/ qed. - -lemma tpss_strip_neq: ∀L1,T0,T1,d1,e1. L1 ⊢ T0 ▶* [d1, e1] T1 → - ∀L2,T2,d2,e2. L2 ⊢ T0 ▶ [d2, e2] T2 → - (d1 + e1 ≤ d2 ∨ d2 + e2 ≤ d1) → - ∃∃T. L2 ⊢ T1 ▶ [d2, e2] T & L1 ⊢ T2 ▶* [d1, e1] T. -/3 width=3/ qed. - -lemma tpss_strap1_down: ∀L,T1,T0,d1,e1. L ⊢ T1 ▶* [d1, e1] T0 → - ∀T2,d2,e2. L ⊢ T0 ▶ [d2, e2] T2 → d2 + e2 ≤ d1 → - ∃∃T. L ⊢ T1 ▶ [d2, e2] T & L ⊢ T ▶* [d1, e1] T2. -/3 width=3/ qed. - -lemma tpss_strap2_down: ∀L,T1,T0,d1,e1. L ⊢ T1 ▶ [d1, e1] T0 → - ∀T2,d2,e2. L ⊢ T0 ▶* [d2, e2] T2 → d2 + e2 ≤ d1 → - ∃∃T. L ⊢ T1 ▶* [d2, e2] T & L ⊢ T ▶ [d1, e1] T2. -/3 width=3/ qed. - -lemma tpss_split_up: ∀L,T1,T2,d,e. L ⊢ T1 ▶* [d, e] T2 → - ∀i. d ≤ i → i ≤ d + e → - ∃∃T. L ⊢ T1 ▶* [d, i - d] T & L ⊢ T ▶* [i, d + e - i] T2. -#L #T1 #T2 #d #e #H #i #Hdi #Hide @(tpss_ind … H) -T2 -[ /2 width=3/ -| #T #T2 #_ #HT12 * #T3 #HT13 #HT3 - elim (tps_split_up … HT12 … Hdi Hide) -HT12 -Hide #T0 #HT0 #HT02 - elim (tpss_strap1_down … HT3 … HT0 ?) -T [2: >commutative_plus /2 width=1/ ] - /3 width=7 by ex2_intro, step/ (**) (* just /3 width=7/ is too slow *) -] -qed. - -lemma tpss_inv_lift1_up: ∀L,U1,U2,dt,et. L ⊢ U1 ▶* [dt, et] U2 → - ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → - d ≤ dt → dt ≤ d + e → d + e ≤ dt + et → - ∃∃T2. K ⊢ T1 ▶* [d, dt + et - (d + e)] T2 & - ⇧[d, e] T2 ≡ U2. -#L #U1 #U2 #dt #et #HU12 #K #d #e #HLK #T1 #HTU1 #Hddt #Hdtde #Hdedet -elim (tpss_split_up … HU12 (d + e) ? ?) -HU12 // -Hdedet #U #HU1 #HU2 -lapply (tpss_weak … HU1 d e ? ?) -HU1 // [ >commutative_plus /2 width=1/ ] -Hddt -Hdtde #HU1 -lapply (tpss_inv_lift1_eq … HU1 … HTU1) -HU1 #HU1 destruct -elim (tpss_inv_lift1_ge … HU2 … HLK … HTU1 ?) -HU2 -HLK -HTU1 // (lift_mono … H1 … H2) -H1 -H2 // -| #I #G #K #KV #V #V2 #W2 #i #HKV #HV2 #HVW2 #IHV2 #L #s #d #e #HLK #U1 #H #U2 #HWU2 - elim (lift_inv_lref1 … H) * #Hid #H destruct - [ elim (lift_trans_ge … HVW2 … HWU2) -W2 // plus_plus_comm_23 #HVU2 - lapply (ldrop_trans_ge_comm … HLK … HKV ?) -K /3 width=7 by cpys_delta, ldrop_inv_gen/ - ] -| #a #I #G #K #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #s #d #e #HLK #U1 #H1 #U2 #H2 - elim (lift_inv_bind1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 destruct - elim (lift_inv_bind1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /4 width=6 by cpys_bind, ldrop_skip/ -| #I #G #K #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #s #d #e #HLK #U1 #H1 #U2 #H2 - elim (lift_inv_flat1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 destruct - elim (lift_inv_flat1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /3 width=6 by cpys_flat/ -] -qed. - -lemma cpys_inv_lift1: ∀G. l_deliftable_sn (cpys G). -#G #L #U1 #U2 #H elim H -G -L -U1 -U2 -[ * #G #L #i #K #s #d #e #_ #T1 #H - [ lapply (lift_inv_sort2 … H) -H #H destruct /2 width=3 by cpys_atom, lift_sort, ex2_intro/ - | elim (lift_inv_lref2 … H) -H * #Hid #H destruct /3 width=3 by cpys_atom, lift_lref_ge_minus, lift_lref_lt, ex2_intro/ - | lapply (lift_inv_gref2 … H) -H #H destruct /2 width=3 by cpys_atom, lift_gref, ex2_intro/ - ] -| #I #G #L #LV #V #V2 #W2 #i #HLV #HV2 #HVW2 #IHV2 #K #s #d #e #HLK #T1 #H - elim (lift_inv_lref2 … H) -H * #Hid #H destruct - [ elim (ldrop_conf_lt … HLK … HLV) -L // #L #U #HKL #HLV #HUV - elim (IHV2 … HLV … HUV) -V #U2 #HUV2 #HU2 - elim (lift_trans_le … HUV2 … HVW2) -V2 // >minus_plus plus_minus // (length_inv_zero_dx … H) -L1 // -| #I1 #I2 #L1 #L2 #V #_ #IHL12 #H lapply (injective_plus_l … H) -H - /3 width=1 by lsuby_pair/ -] -qed-. - -(* Basic inversion lemmas ***************************************************) - -fact lsuby_inv_atom1_aux: ∀L1,L2. L1 ⊆ L2 → L1 = ⋆ → L2 = ⋆. -#L1 #L2 * -L1 -L2 // -#I1 #I2 #L1 #L2 #V #_ #H destruct -qed-. - -lemma lsuby_inv_atom1: ∀L2. ⋆ ⊆ L2 → L2 = ⋆. -/2 width=3 by lsuby_inv_atom1_aux/ qed-. - -fact lsuby_inv_pair1_aux: ∀L1,L2. L1 ⊆ L2 → ∀J1,K1,W. L1 = K1.ⓑ{J1}W → - L2 = ⋆ ∨ ∃∃I2,K2. K1 ⊆ K2 & L2 = K2.ⓑ{I2}W. -#L1 #L2 * -L1 -L2 -[ #L #J1 #K1 #W #H destruct /2 width=1 by or_introl/ -| #I1 #I2 #L1 #L2 #V #HL12 #J1 #K1 #W #H destruct /3 width=4 by ex2_2_intro, or_intror/ -] -qed-. - -lemma lsuby_inv_pair1: ∀I1,K1,L2,W. K1.ⓑ{I1}W ⊆ L2 → - L2 = ⋆ ∨ ∃∃I2,K2. K1 ⊆ K2 & L2 = K2.ⓑ{I2}W. -/2 width=4 by lsuby_inv_pair1_aux/ qed-. - -fact lsuby_inv_pair2_aux: ∀L1,L2. L1 ⊆ L2 → ∀J2,K2,W. L2 = K2.ⓑ{J2}W → - ∃∃I1,K1. K1 ⊆ K2 & L1 = K1.ⓑ{I1}W. -#L1 #L2 * -L1 -L2 -[ #L #J2 #K2 #W #H destruct -| #I1 #I2 #L1 #L2 #V #HL12 #J2 #K2 #W #H destruct /2 width=4 by ex2_2_intro/ -] -qed-. - -lemma lsuby_inv_pair2: ∀I2,L1,K2,W. L1 ⊆ K2.ⓑ{I2}W → - ∃∃I1,K1. K1 ⊆ K2 & L1 = K1.ⓑ{I1}W. -/2 width=4 by lsuby_inv_pair2_aux/ qed-. - -(* Basic forward lemmas *****************************************************) - -lemma lsuby_fwd_length: ∀L1,L2. L1 ⊆ L2 → |L2| ≤ |L1|. -#L1 #L2 #H elim H -L1 -L2 /2 width=1 by monotonic_le_plus_l/ -qed-. - -lemma lsuby_ldrop_trans: ∀L1,L2. L1 ⊆ L2 → - ∀I2,K2,W,s,i. ⇩[s, 0, i] L2 ≡ K2.ⓑ{I2}W → - ∃∃I1,K1. K1 ⊆ K2 & ⇩[s, 0, i] L1 ≡ K1.ⓑ{I1}W. -#L1 #L2 #H elim H -L1 -L2 -[ #L #J2 #K2 #W #s #i #H - elim (ldrop_inv_atom1 … H) -H #H destruct -| #I1 #I2 #L1 #L2 #V #HL12 #IHL12 #J2 #K2 #W #s #i #H - elim (ldrop_inv_O1_pair1 … H) -H * #Hi #HLK2 destruct [ -IHL12 | -HL12 ] - [ /3 width=4 by ldrop_pair, ex2_2_intro/ - | elim (IHL12 … HLK2) -IHL12 -HLK2 * /3 width=4 by ldrop_drop_lt, ex2_2_intro/ - ] -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpys0/lsuby_lsuby.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpys0/lsuby_lsuby.etc deleted file mode 100644 index 254d62928..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpys0/lsuby_lsuby.etc +++ /dev/null @@ -1,27 +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/substitution/lsuby.ma". - -(* LOCAL ENVIRONMENT REFINEMENT FOR EXTENDED SUBSTITUTION *******************) - -(* Main properties **********************************************************) - -theorem lsuby_trans: Transitive … lsuby. -#L1 #L #H elim H -L1 -L -[ #L1 #X #H lapply (lsuby_inv_atom1 … H) -H // -| #I1 #I #L1 #L #V #_ #IHL1 #X #H elim (lsuby_inv_pair1 … H) -H // * - #I2 #L2 #HL2 #H destruct /3 width=1 by lsuby_pair/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpys0/psubstsnstar_3.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpys0/psubstsnstar_3.etc deleted file mode 100644 index 0d6dffee6..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpys0/psubstsnstar_3.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G , break term 46 L1 ⦄ ⊢ ▶ * break term 46 L2 )" - non associative with precedence 45 - for @{ 'PSubstSnStar $G $L1 $L2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpys0/psubststar_4.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpys0/psubststar_4.etc deleted file mode 100644 index 0e76c6f71..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpys0/psubststar_4.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 break ▶ * break term 46 T2 )" - non associative with precedence 45 - for @{ 'PSubstStar $G $L $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpys2/cpx_cpys.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpys2/cpx_cpys.etc deleted file mode 100644 index 3b38ee6ab..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpys2/cpx_cpys.etc +++ /dev/null @@ -1,42 +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/substitution/cpys_alt.ma". -include "basic_2/reduction/cpx.ma". - -(* CONTEXT-SENSITIVE EXTENDED PARALLEL REDUCTION FOR TERMS ******************) - -(* Properties on local environment refinement for extended substitution *****) - -lemma lsuby_cpx_trans: ∀h,g,G. lsub_trans … (cpx h g G) (lsuby 0 (∞)). -#h #g #G #L1 #T1 #T2 #H elim H -G -L1 -T1 -T2 -[ // -| /2 width=2 by cpx_sort/ -| #I #G #L1 #K1 #V1 #V2 #W2 #i #HLK1 #_ #HVW2 #IHV12 #L2 #HL12 - elim (lsuby_ldrop_trans_be … HL12 … HLK1) // -HL12 -HLK1 /3 width=7 by cpx_delta/ -|4,9: /4 width=1 by cpx_bind, cpx_beta, lsuby_pair_O_Y/ -|5,7,8: /3 width=1 by cpx_flat, cpx_tau, cpx_ti/ -|6,10: /4 width=3 by cpx_zeta, cpx_theta, lsuby_pair_O_Y/ -] -qed-. - -(* Properties on context-sensitive extended multiple substitution for terms *) - -lemma cpys_cpx: ∀h,g,G,L,T1,T2,d,e. ⦃G, L⦄ ⊢ T1 ▶*[d, e] T2 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2. -#h #g #G #L #T1 #T2 #d #e #H @(cpys_ind_alt … H) -G -L -T1 -T2 -d -e -/2 width=7 by cpx_delta, cpx_bind, cpx_flat/ -qed. - -lemma cpy_cpx: ∀h,g,G,L,T1,T2,d,e. ⦃G, L⦄ ⊢ T1 ▶[d, e] T2 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2. -/3 width=3 by cpy_cpys, cpys_cpx/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpys2/cpx_cpys2.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpys2/cpx_cpys2.etc deleted file mode 100644 index 46abd5464..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpys2/cpx_cpys2.etc +++ /dev/null @@ -1,70 +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/substitution/cpys_alt.ma". -include "basic_2/reduction/cpx.ma". - -(* CONTEXT-SENSITIVE EXTENDED PARALLEL REDUCTION FOR TERMS ******************) - -(* Properties on context-sensitive extended multiple substitution for terms *) - -lemma cpys_cpx: ∀h,g,G,L,T1,T2,d,e. ⦃G, L⦄ ⊢ T1 ▶*[d, e] T2 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2. -#h #g #G #L #T1 #T2 #d #e #H @(cpys_ind_alt … H) -G -L -T1 -T2 -d -e -/2 width=7 by cpx_delta, cpx_bind, cpx_flat/ -qed. - -lemma cpy_cpx: ∀h,g,G,L,T1,T2,d,e. ⦃G, L⦄ ⊢ T1 ▶[d, e] T2 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2. -/3 width=3 by cpy_cpys, cpys_cpx/ qed. - -lemma cpx_cpy_trans: ∀h,g,G,L,T1,T. ⦃G, L⦄ ⊢ T1 ➡[h, g] T → - ∀T2,d,e. ⦃G, L⦄ ⊢ T ▶[d, e] T2 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2. -#h #g #G #L #T1 #T #H elim H -G -L -T1 -T -[ #I #G #L #X #d #e #H elim (cpy_inv_atom1 … H) // - * /2 width=3 by cpy_cpx/ -| #G #L #k #l #Hkl #X #d #e #H >(cpy_inv_sort1 … H) -X /2 width=2 by cpx_sort/ -| #I #G #L #K #V1 #V #W #i #HLK #_ #HVW #IHV1 #X #d #e #H - lapply (ldrop_fwd_drop2 … HLK) #H0 - lapply (cpy_weak … H 0 (∞) ? ?) -H // #H - elim (cpy_inv_lift1_be … H … H0 … HVW) -H -H0 -HVW - /3 width=7 by cpx_delta/ -| #a #I #G #L #V1 #V #T1 #T #_ #_ #IHV1 #IHT1 #X #d #e #H elim (cpy_inv_bind1 … H) -H - #V2 #T2 #HV2 #HT2 #H destruct - /5 width=7 by cpx_bind, lsuby_cpy_trans, lsuby_succ/ -| #I #G #L #V1 #V #T1 #T #_ #_ #IHV1 #IHT1 #X #d #e #H elim (cpy_inv_flat1 … H) -H - #V2 #T2 #HV2 #HT2 #H destruct /3 width=3 by cpx_flat/ -| #G #L #V1 #U1 #U #T #_ #HTU #IHU1 #T2 #d #e #HT2 - lapply (cpy_weak … HT2 0 (∞) ? ?) -HT2 // #HT2 - elim (lift_total T2 0 1) #U2 #HTU2 - lapply (cpy_lift_be … HT2 (L.ⓓV1) … (Ⓕ) … HTU … HTU2 ? ?) -T - /3 width=3 by cpx_zeta, ldrop_drop/ -| /3 width=3 by cpx_tau/ -| /3 width=3 by cpx_ti/ -| #a #G #L #V1 #V #W1 #W #T1 #T #_ #_ #_ #IHV1 #IHW1 #IHT1 #X #d #e #HX - elim (cpy_inv_bind1 … HX) -HX #Y #T2 #HY #HT2 #H destruct - elim (cpy_inv_flat1 … HY) -HY #W2 #V2 #HW2 #HV2 #H destruct - /5 width=7 by cpx_beta, lsuby_cpy_trans, lsuby_succ/ -| #a #G #L #V1 #V #U #W1 #W #T1 #T #_ #HVU #_ #_ #IHV1 #IHW1 #IHT1 #X #d #e #HX - elim (cpy_inv_bind1 … HX) -HX #W2 #Y #HW2 #HY #H destruct - elim (cpy_inv_flat1 … HY) -HY #U2 #T2 #HU2 #HT2 #H destruct - lapply (cpy_weak … HU2 0 (∞) ? ?) -HU2 // #HU2 - elim (cpy_inv_lift1_be … HU2 L … HVU) -U - /5 width=7 by cpx_theta, lsuby_cpy_trans, lsuby_succ, ldrop_drop/ -] -qed-. - -lemma cpx_cpys_trans: ∀h,g,G,L,T1,T. ⦃G, L⦄ ⊢ T1 ➡[h, g] T → - ∀T2,d,e. ⦃G, L⦄ ⊢ T ▶*[d, e] T2 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2. -#h #g #G #L #T1 #T #HT1 #T2 #d #e #H @(cpys_ind … H) -T2 -/2 width=5 by cpx_cpy_trans/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpys2/cpxs_cpys.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpys2/cpxs_cpys.etc deleted file mode 100644 index 881030572..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpys2/cpxs_cpys.etc +++ /dev/null @@ -1,24 +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/reduction/cpx_cpys.ma". -include "basic_2/computation/cpxs.ma". - -(* CONTEXT-SENSITIVE EXTENDED PARALLEL COMPUTATION ON TERMS *****************) - -(* Properties on local environment refinement for extended substitution *****) - -lemma lsuby_cpxs_trans: ∀h,g,G. lsub_trans … (cpxs h g G) (lsuby 0 (∞)). -/3 width=5 by lsuby_cpx_trans, LTC_lsub_trans/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpys2/lpx_cpys.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpys2/lpx_cpys.etc deleted file mode 100644 index d3c490a89..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpys2/lpx_cpys.etc +++ /dev/null @@ -1,69 +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/relocation/cpy_lift.ma". -include "basic_2/substitution/cpys.ma". -include "basic_2/reduction/lpx_ldrop.ma". - -(* SN EXTENDED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ********************) - -(* Properties on context-sensitive extended substitution for terms **********) - -lemma cpx_cpy_trans_lpx: ∀h,g,G,L1,T1,T. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T → - ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → - ∀T2,d,e. ⦃G, L2⦄ ⊢ T ▶[d, e] T2 → ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2. -#h #g #G #L1 #T1 #T #H elim H -G -L1 -T1 -T -[ #J #G #L1 #L2 #HL12 #T2 #d #e #H elim (cpy_inv_atom1 … H) -H // - * #I #K2 #V2 #i #_ #_ #HLK2 #HVT2 #H destruct - elim (lpx_ldrop_trans_O1 … HL12 … HLK2) -L2 #X #HLK1 #H - elim (lpx_inv_pair2 … H) -H #K1 #V1 #_ #HV12 #H destruct - /2 width=7 by cpx_delta/ -| #G #L1 #k #l #Hkl #L2 #_ #X #d #e #H >(cpy_inv_sort1 … H) -X /2 width=2 by cpx_sort/ -| #I #G #L1 #K1 #V1 #V #T #i #HLK1 #_ #HVT #IHV1 #L2 #HL12 #T2 #d #e #HT2 - elim (lpx_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2 - elim (lpx_inv_pair1 … H) -H #K2 #V0 #HK12 #_ #H destruct - lapply (ldrop_fwd_drop2 … HLK2) -V0 #HLK2 - lapply (cpy_weak … HT2 0 (∞) ? ?) -HT2 // #HT2 - elim (cpy_inv_lift1_be … HT2 … HLK2 … HVT) -HT2 -HLK2 -HVT - /3 width=7 by cpx_delta/ -| #a #I #G #L1 #V1 #V #T1 #T #HV1 #_ #IHV1 #IHT1 #L2 #HL12 #X #d #e #H elim (cpy_inv_bind1 … H) -H - #V2 #T2 #HV2 #HT2 #H destruct /4 width=5 by lpx_pair, cpx_bind/ -| #I #G #L1 #V1 #V #T1 #T #_ #_ #IHV1 #IHT1 #L2 #HL12 #X #d #e #H elim (cpy_inv_flat1 … H) -H - #V2 #T2 #HV2 #HT2 #H destruct /3 width=5 by cpx_flat/ -| #G #L1 #V1 #U1 #U #T #_ #HTU #IHU1 #L2 #HL12 #T2 #d #e #HT2 - lapply (cpy_weak … HT2 0 (∞) ? ?) -HT2 // #HT2 - elim (lift_total T2 0 1) #U2 #HTU2 - lapply (cpy_lift_be … HT2 (L2.ⓓV1) … (Ⓕ) … HTU … HTU2 ? ?) -T - /4 width=5 by cpx_zeta, lpx_pair, ldrop_drop/ -| /3 width=5 by cpx_tau/ -| /3 width=5 by cpx_ti/ -| #a #G #L1 #V1 #V #W1 #W #T1 #T #HV1 #HW1 #_ #IHV1 #IHW1 #IHT1 #L2 #HL12 #X #d #e #HX - elim (cpy_inv_bind1 … HX) -HX #Y #T2 #HY #HT2 #H destruct - elim (cpy_inv_flat1 … HY) -HY #W2 #V2 #HW2 #HV2 #H destruct - /5 width=11 by lpx_pair, cpx_beta, lsuby_cpy_trans, lsuby_succ/ -| #a #G #L1 #V1 #V #U #W1 #W #T1 #T #_ #HVU #HW1 #_ #IHV1 #IHW1 #IHT1 #L2 #HL12 #X #d #e #HX - elim (cpy_inv_bind1 … HX) -HX #W2 #Y #HW2 #HY #H destruct - elim (cpy_inv_flat1 … HY) -HY #U2 #T2 #HU2 #HT2 #H destruct - lapply (cpy_weak … HU2 0 (∞) ? ?) -HU2 // #HU2 - elim (cpy_inv_lift1_be … HU2 L2 … HVU) -U - /4 width=7 by lpx_pair, cpx_theta, ldrop_drop/ -] -qed-. - -lemma cpx_cpys_trans_lpx: ∀h,g,G,L1,T1,T. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T → - ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → - ∀T2,d,e. ⦃G, L2⦄ ⊢ T ▶*[d, e] T2 → ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2. -#h #g #G #L1 #T1 #T #HT1 #L2 #HL12 #T2 #d #e #H @(cpys_ind … H) -T2 -/2 width=7 by cpx_cpy_trans_lpx/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/cpys2/lsuby.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/cpys2/lsuby.etc deleted file mode 100644 index 657ad6b6e..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/cpys2/lsuby.etc +++ /dev/null @@ -1,15 +0,0 @@ -(* -lemma lsuby_weak: ∀L1,L2,d1,e1. L1 ⊑×[d1, e1] L2 → - ∀d2,e2. d1 ≤ d2 → e2 ≤ e1 → L1 ⊑×[d2, e2] L2. -#L1 #L2 #d1 #e1 #H elim H -L1 -L2 -d1 -e1 // -[ #I1 #I2 #L1 #L2 #V1 #V2 #HL12 #_ #d2 #e2 #_ #He21 - >(yle_inv_O2 … He21) -He21 - /4 width=3 by lsuby_fwd_length, lsuby_O1, monotonic_le_plus_l/ -| #I1 #I2 #L1 #L2 #V #e #HL12 #IHL12 #d2 #e2 #_ #He21 - elim (ynat_cases e2) /4 width=3 by lsuby_fwd_length, lsuby_O1, monotonic_le_plus_l/ - * #e0 #H destruct lapply (yle_inv_succ … He21) -He21 #He21 - elim (ynat_cases d2) /3 width=1 by lsuby_pair/ - * #d0 #H destruct @lsuby_succ @IHL12 // - [ destruct - -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/csup/csup.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/csup/csup.etc deleted file mode 100644 index 0a980f6a7..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/csup/csup.etc +++ /dev/null @@ -1,88 +0,0 @@ -(* Basic forward lemmas *****************************************************) - -lemma csup_fwd_ldrop: ∀L1,L2,T1,T2. ⦃L1, T1⦄ > ⦃L2, T2⦄ → - ∃i. ⇩[0, i] L1 ≡ L2 ∨ ⇩[0, i] L2 ≡ L1. -#L1 #L2 #T1 #T2 * -L1 -L2 -T1 -T2 /3 width=2/ /4 width=2/ -#I #L1 #K1 #V1 #i #HLK1 -lapply (ldrop_fwd_ldrop2 … HLK1) -HLK1 /3 width=2/ -qed-. - -(* Advanced forward lemmas **************************************************) - -lemma lift_csup_trans_eq: ∀T1,U1,d,e. ⇧[d, e] T1 ≡ U1 → - ∀L,U2. ⦃L, U1⦄ > ⦃L, U2⦄ → - ∃T2. ⇧[d, e] T2 ≡ U2. -#T1 #U1 #d #e * -T1 -U1 -d -e -[5: #a #I #V1 #W1 #T1 #U1 #d #e #HVW1 #_ #L #X #H - elim (csup_inv_bind1 … H) -H * - [ #_ #H destruct /2 width=2/ - | #H elim (discr_lpair_x_xy … H) - ] -|6: #I #V1 #W1 #T1 #U1 #d #e #HVW1 #HUT1 #L #X #H - elim (csup_inv_flat1 … H) -H #_ * #H destruct /2 width=2/ -] -#i #d #e [2,3: #_ ] #L #X #H -elim (csup_inv_atom1 … H) -H #I #j #HL #H destruct -lapply (ldrop_pair2_fwd_cw … HL X) -HL #H -elim (lt_refl_false … H) -qed-. -(* -lemma lift_csup_trans_gt: ∀L1,L2,U1,U2. ⦃L1, U1⦄ > ⦃L2, U2⦄ → - ⇩[0, 1] L2 ≡ L1 → ∀T1,d,e. ⇧[d, e] T1 ≡ U1 → - ∃T2. ⇧[d + 1, e] T2 ≡ U2. -#L1 #L2 #U1 #U2 * -L1 -L2 -U1 -U2 -[ #I #L1 #K1 #V #i #HLK1 #HKL1 - lapply (ldrop_fwd_lw … HLK1) -HLK1 #HLK1 - lapply (ldrop_fwd_lw … HKL1) -HKL1 #HKL1 - lapply (transitive_le … HLK1 HKL1) -L1 normalize #H - - -| #a -| #a -] -#I #L1 #W1 #U1 #HL1 - - - - #X #d #e #H - lapply (ldrop_inv_refl … HL1) -HL1 -| #a #I #L1 #W1 #U1 #j #HL1 #X #d #e #H - lapply (ldrop_inv_ldrop1 … HL1) - - elim (lift_inv_bind2 … H) -H #W2 #U2 #HW21 #HU21 #H destruct - - - /3 width=2/ /4 width=2/ - -*) - - - -(* Advanced inversion lemmas ************************************************) - -lemma csup_inv_lref2_be: ∀L,U,i. ⦃L, U⦄ > ⦃L, #i⦄ → - ∀T,d,e. ⇧[d, e] T ≡ U → d ≤ i → i < d + e → ⊥. -#L #U #i #H #T #d #e #HTU #Hdi #Hide -elim (lift_csup_trans_eq … HTU … H) -H -T #T #H -elim (lift_inv_lref2_be … H ? ?) // -qed-. - - -fact csup_inv_all4_refl_aux: ∀L1,L2,T1,T2. ⦃L1, T1⦄ > ⦃L2, T2⦄ → L1 = L2 → - ∨∨ ∃∃a,I,U. T1 = ⓑ{a,I}T2.U - | ∃∃I,W. T1 = ⓕ{I}W.T2 - | ∃∃I,U. T1 = ⓕ{I}T2.U. -#L1 #L2 #T1 #T2 * -L1 -L2 -T1 -T2 /3 width=3/ /3 width=4/ -[ #I #L #K #V #i #HLK #H destruct - lapply (ldrop_pair2_fwd_cw … HLK V) -HLK #H - elim (lt_refl_false … H) -| #a #I #L #V #T #H - elim (discr_lpair_x_xy … H) -] -qed-. - -lemma csup_inv_all4_refl: ∀L,T1,T2. ⦃L, T1⦄ > ⦃L, T2⦄ → - ∨∨ ∃∃a,I,U. T1 = ⓑ{a,I}T2.U - | ∃∃I,W. T1 = ⓕ{I}W.T2 - | ∃∃I,U. T1 = ⓕ{I}T2.U. -/2 width=4 by csup_inv_all4_refl_aux/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/csup/csup_csup.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/csup/csup_csup.etc deleted file mode 100644 index 661d89697..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/csup/csup_csup.etc +++ /dev/null @@ -1,33 +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/substitution/ldrop_ldrop.ma". -include "basic_2/substitution/csup.ma". - -(* SUPCLOSURE ***************************************************************) - -(* Main forward lemmas ******************************************************) - -theorem csup_trans_fwd_refl: ∀L,L0,T1,T2. ⦃L, T1⦄ > ⦃L0, T2⦄ → - ∀T3. ⦃L0, T2⦄ > ⦃L, T3⦄ → - L = L0 ∨ ⦃L, T1⦄ > ⦃L, T3⦄. -#L #L0 #T1 #T2 * -L -L0 -T1 -T2 /2 width=1/ -[ #I #L0 #K0 #V0 #i #HLK0 #T3 #H - lapply (ldrop_pair2_fwd_cw … HLK0 T3) -HLK0 #H1 - lapply (csup_fwd_cw … H) -H #H2 - lapply (transitive_lt … H1 H2) -H1 -H2 #H - elim (lt_refl_false … H) -| #a #I #L0 #V2 #T2 #T3 #HT23 - elim (csup_inv_ldrop … HT23 I V2 0 ?) -HT23 // #H1 #H2 destruct /2 width=1/ - qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/csup/csups_csups.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/csup/csups_csups.etc deleted file mode 100644 index 9978429d7..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/csup/csups_csups.etc +++ /dev/null @@ -1,57 +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/substitution/csup_csup.ma". -include "basic_2/unfold/csups.ma". - -(* STAR-ITERATED SUPCLOSURE *************************************************) - -(* Advanced forward lemmas **************************************************) - -(* -lemma csupp_strap2_fwd_refl: ∀L,L0,T1,T2. ⦃L, T1⦄ > ⦃L0, T2⦄ → - ∀T3. ⦃L0, T2⦄ >+ ⦃L, T3⦄ → - L = L0 ∨ ⦃L, T1⦄ >+ ⦃L, T3⦄. -#L #L0 #T1 #T2 * -L -L0 -T1 -T2 /2 width=1/ -[ #I #L0 #K0 #V0 #i #HLK0 #T3 #H - lapply (ldrop_pair2_fwd_cw … HLK0 T3) -HLK0 #H1 - lapply (csupp_fwd_cw … H) -H #H2 - lapply (transitive_lt … H1 H2) -H1 -H2 #H - elim (lt_refl_false … H) -| #a #I #L0 #V2 #T2 #T3 #HT23 - /3 width=5/ - - elim (csup_inv_ldrop … HT23 I V2 0 ?) -HT23 // #H1 #H2 destruct /2 width=1/ - qed-. - - - - - - - - -lemma csups_strap1_fwd_refl: ∀L,L0,T1,T2. ⦃L, T1⦄ >* ⦃L0, T2⦄ → - ∀T3. ⦃L0, T2⦄ > ⦃L, T3⦄ → L = L0. -#L #L0 #T1 #T2 #H @(csups_ind_dx … H) -L -T1 // -#L1 #L #T1 #T #HL1 #_ #IHL0 #T3 #HL0 -lapply (csup_trans_fwd_refl … HL10) … HL0) -T2 -*) -lemma lift_csups_trans_aux: ∀T1,U1,d,e. ⇧[d, e] T1 ≡ U1 → - ∀L1,L2,U2. ⦃L1, U1⦄ >* ⦃L2, U2⦄ → L1 = L2 → - ∃T2. ⇧[d, e] T2 ≡ U2. -#T1 #U1 #d #e #HTU1 #L1 #L2 #U2 #H @(csups_ind … H) -L2 -U2 /2 width=2/ -T1 -#L #L2 #U #U2 #HL1 #HL2 #IHL1 #H destruct - -* -T1 -U1 -d -e diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/delift/cpcs_delift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/delift/cpcs_delift.etc deleted file mode 100644 index 7012ec11e..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/delift/cpcs_delift.etc +++ /dev/null @@ -1,37 +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/unfold/delift_lift.ma". -include "basic_2/unfold/delift_delift.ma". -include "basic_2/computation/cprs_delift.ma". -include "basic_2/equivalence/cpcs_cpcs.ma". - -(* CONTEXT-SENSITIVE PARALLEL EQUIVALENCE ON TERMS **************************) - -(* Properties on inverse basic term relocation ******************************) - -lemma cpcs_zeta_delift_comm: ∀L,V,T1,T2. L.ⓓV ⊢ ▼*[O, 1] T1 ≡ T2 → - L ⊢ T2 ⬌* +ⓓV.T1. -/3 width=1/ qed. - -(* Basic_1: was only: pc3_gen_cabbr *) -lemma thin_cpcs_delift_mono: ∀L,U1,U2. L ⊢ U1 ⬌* U2 → - ∀K,d,e. ▼*[d, e] L ≡ K → ∀T1. L ⊢ ▼*[d, e] U1 ≡ T1 → - ∀T2. L ⊢ ▼*[d, e] U2 ≡ T2 → K ⊢ T1 ⬌* T2. -#L #U1 #U2 #H #K #d #e #HLK #T1 #HTU1 #T2 #HTU2 -elim (cpcs_inv_cprs … H) -H #U #HU1 #HU2 -elim (thin_cprs_delift_conf … HU1 … HLK … HTU1) -U1 #T #HT1 #HUT -elim (thin_cprs_delift_conf … HU2 … HLK … HTU2) -U2 -HLK #X #HT2 #H -lapply (delift_mono … H … HUT) -L #H destruct /2 width=3/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/delift/cpr_delift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/delift/cpr_delift.etc deleted file mode 100644 index 04eb4ae23..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/delift/cpr_delift.etc +++ /dev/null @@ -1,37 +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/unfold/thin_delift.ma". -include "basic_2/reducibility/tpr_delift.ma". -include "basic_2/reducibility/cpr.ma". - -(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS ****************************) - -(* Properties on inverse basic term relocation ******************************) - -(* Basic_1: was only: pr2_gen_cabbr *) -lemma thin_cpr_delift_conf: ∀L,U1,U2. L ⊢ U1 ➡ U2 → - ∀K,d,e. ▼*[d, e] L ≡ K → ∀T1. L ⊢ ▼*[d, e] U1 ≡ T1 → - ∃∃T2. K ⊢ T1 ➡ T2 & L ⊢ ▼*[d, e] U2 ≡ T2. -#L #U1 #U2 * #U #HU1 #HU2 #K #d #e #HLK #T1 #HTU1 -elim (tpr_delift_conf … HU1 … HTU1) -U1 #T #HT1 #HUT -elim (le_or_ge (|L|) d) #Hd -[ elim (thin_delift_tpss_conf_le … HU2 … HUT … HLK ?) -| elim (le_or_ge (|L|) (d+e)) #Hde - [ elim (thin_delift_tpss_conf_le_up … HU2 … HUT … HLK ? ? ?) - | elim (thin_delift_tpss_conf_be … HU2 … HUT … HLK ? ?) - ] -] -U -HLK // -Hd [2,3: -Hde] #T2 #HT2 -lapply (cpr_intro … HT1 HT2) -T /2 width=3/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/delift/cprs_delift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/delift/cprs_delift.etc deleted file mode 100644 index 6b7892611..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/delift/cprs_delift.etc +++ /dev/null @@ -1,37 +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/reducibility/cpr_delift.ma". -include "basic_2/reducibility/cpr_cpr.ma". -include "basic_2/computation/cprs.ma". - -(* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************) - -(* Properties on inverse basic term relocation ******************************) - -(* Note: this should be stated with tprs *) -lemma cprs_zeta_delift: ∀L,V,T1,T2. L.ⓓV ⊢ ▼*[O, 1] T1 ≡ T2 → L ⊢ +ⓓV.T1 ➡* T2. -#L #V #T1 #T2 * #T #HT1 #HT2 -@(cprs_strap2 … (+ⓓV.T)) [ /3 width=3/ | @inj /3 width=3/ ] (**) (* explicit constructor, /5 width=3/ is too slow *) -qed. - -(* Basic_1: was only: pr3_gen_cabbr *) -lemma thin_cprs_delift_conf: ∀L,U1,U2. L ⊢ U1 ➡* U2 → - ∀K,d,e. ▼*[d, e] L ≡ K → ∀T1. L ⊢ ▼*[d, e] U1 ≡ T1 → - ∃∃T2. K ⊢ T1 ➡* T2 & L ⊢ ▼*[d, e] U2 ≡ T2. -#L #U1 #U2 #H @(cprs_ind … H) -U2 /2 width=3/ -#U #U2 #_ #HU2 #IHU1 #K #d #e #HLK #T1 #HTU1 -elim (IHU1 … HLK … HTU1) -U1 #T #HT1 #HUT -elim (thin_cpr_delift_conf … HU2 … HLK … HUT) -U -HLK /3 width=3/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/delift/delift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/delift/delift.etc deleted file mode 100644 index eda839607..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/delift/delift.etc +++ /dev/null @@ -1,112 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( L ⊢ break ▼ * [ term 46 d , break term 46 e ] break term 46 T1 ≡ break term 46 T2 )" - non associative with precedence 45 - for @{ 'TSubst $L $T1 $d $e $T2 }. - -include "basic_2/unfold/tpss.ma". - -(* INVERSE BASIC TERM RELOCATION *******************************************) - -definition delift: nat → nat → lenv → relation term ≝ - λd,e,L,T1,T2. ∃∃T. L ⊢ T1 ▶* [d, e] T & ⇧[d, e] T2 ≡ T. - -interpretation "inverse basic relocation (term)" - 'TSubst L T1 d e T2 = (delift d e L T1 T2). - -(* Basic properties *********************************************************) - -lemma lift_delift: ∀T1,T2,d,e. ⇧[d, e] T1 ≡ T2 → - ∀L. L ⊢ ▼*[d, e] T2 ≡ T1. -/2 width=3/ qed. - -lemma delift_refl_O2: ∀L,T,d. L ⊢ ▼*[d, 0] T ≡ T. -/2 width=3/ qed. - -lemma delift_lsubr_trans: ∀L1,T1,T2,d,e. L1 ⊢ ▼*[d, e] T1 ≡ T2 → - ∀L2. L2 ⊑ [d, e] L1 → L2 ⊢ ▼*[d, e] T1 ≡ T2. -#L1 #T1 #T2 #d #e * /3 width=3/ -qed. - -lemma delift_sort: ∀L,d,e,k. L ⊢ ▼*[d, e] ⋆k ≡ ⋆k. -/2 width=3/ qed. - -lemma delift_lref_lt: ∀L,d,e,i. i < d → L ⊢ ▼*[d, e] #i ≡ #i. -/3 width=3/ qed. - -lemma delift_lref_ge: ∀L,d,e,i. d + e ≤ i → L ⊢ ▼*[d, e] #i ≡ #(i - e). -/3 width=3/ qed. - -lemma delift_gref: ∀L,d,e,p. L ⊢ ▼*[d, e] §p ≡ §p. -/2 width=3/ qed. - -lemma delift_bind: ∀a,I,L,V1,V2,T1,T2,d,e. - L ⊢ ▼*[d, e] V1 ≡ V2 → L. ⓑ{I} V2 ⊢ ▼*[d+1, e] T1 ≡ T2 → - L ⊢ ▼*[d, e] ⓑ{a,I} V1. T1 ≡ ⓑ{a,I} V2. T2. -#a #I #L #V1 #V2 #T1 #T2 #d #e * #V #HV1 #HV2 * #T #HT1 #HT2 -lapply (tpss_lsubr_trans … HT1 (L. ⓑ{I} V) ?) -HT1 /2 width=1/ /3 width=5/ -qed. - -lemma delift_flat: ∀I,L,V1,V2,T1,T2,d,e. - L ⊢ ▼*[d, e] V1 ≡ V2 → L ⊢ ▼*[d, e] T1 ≡ T2 → - L ⊢ ▼*[d, e] ⓕ{I} V1. T1 ≡ ⓕ{I} V2. T2. -#I #L #V1 #V2 #T1 #T2 #d #e * #V #HV1 #HV2 * /3 width=5/ -qed. - -(* Basic inversion lemmas ***************************************************) - -lemma delift_inv_sort1: ∀L,U2,d,e,k. L ⊢ ▼*[d, e] ⋆k ≡ U2 → U2 = ⋆k. -#L #U2 #d #e #k * #U #HU ->(tpss_inv_sort1 … HU) -HU #HU2 ->(lift_inv_sort2 … HU2) -HU2 // -qed-. - -lemma delift_inv_gref1: ∀L,U2,d,e,p. L ⊢ ▼*[d, e] §p ≡ U2 → U2 = §p. -#L #U #d #e #p * #U #HU ->(tpss_inv_gref1 … HU) -HU #HU2 ->(lift_inv_gref2 … HU2) -HU2 // -qed-. - -lemma delift_inv_bind1: ∀a,I,L,V1,T1,U2,d,e. L ⊢ ▼*[d, e] ⓑ{a,I} V1. T1 ≡ U2 → - ∃∃V2,T2. L ⊢ ▼*[d, e] V1 ≡ V2 & - L. ⓑ{I} V2 ⊢ ▼*[d+1, e] T1 ≡ T2 & - U2 = ⓑ{a,I} V2. T2. -#a #I #L #V1 #T1 #U2 #d #e * #U #HU #HU2 -elim (tpss_inv_bind1 … HU) -HU #V #T #HV1 #HT1 #X destruct -elim (lift_inv_bind2 … HU2) -HU2 #V2 #T2 #HV2 #HT2 -lapply (tpss_lsubr_trans … HT1 (L. ⓑ{I} V2) ?) -HT1 /2 width=1/ /3 width=5/ -qed-. - -lemma delift_inv_flat1: ∀I,L,V1,T1,U2,d,e. L ⊢ ▼*[d, e] ⓕ{I} V1. T1 ≡ U2 → - ∃∃V2,T2. L ⊢ ▼*[d, e] V1 ≡ V2 & - L ⊢ ▼*[d, e] T1 ≡ T2 & - U2 = ⓕ{I} V2. T2. -#I #L #V1 #T1 #U2 #d #e * #U #HU #HU2 -elim (tpss_inv_flat1 … HU) -HU #V #T #HV1 #HT1 #X destruct -elim (lift_inv_flat2 … HU2) -HU2 /3 width=5/ -qed-. - -lemma delift_inv_refl_O2: ∀L,T1,T2,d. L ⊢ ▼*[d, 0] T1 ≡ T2 → T1 = T2. -#L #T1 #T2 #d * #T #HT1 ->(tpss_inv_refl_O2 … HT1) -HT1 #HT2 ->(lift_inv_refl_O2 … HT2) -HT2 // -qed-. - -(* Basic forward lemmas *****************************************************) - -lemma delift_fwd_tw: ∀L,T1,T2,d,e. L ⊢ ▼*[d, e] T1 ≡ T2 → ♯{T1} ≤ ♯{T2}. -#L #T1 #T2 #d #e * #T #HT1 #HT2 ->(lift_fwd_tw … HT2) -T2 /2 width=4 by tpss_fwd_tw/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/delift/delift_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/delift/delift_alt.etc deleted file mode 100644 index e22911032..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/delift/delift_alt.etc +++ /dev/null @@ -1,104 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( L ⊢ break ▼ ▼ * [ term 46 d , break term 46 e ] break term 46 T1 ≡ break term 46 T2 )" - non associative with precedence 45 - for @{ 'TSubstAlt $L $T1 $d $e $T2 }. - -include "basic_2/unfold/delift_lift.ma". - -(* INVERSE BASIC TERM RELOCATION *******************************************) - -(* alternative definition of inverse basic term relocation *) -inductive delifta: nat → nat → lenv → relation term ≝ -| delifta_sort : ∀L,d,e,k. delifta d e L (⋆k) (⋆k) -| delifta_lref_lt: ∀L,d,e,i. i < d → delifta d e L (#i) (#i) -| delifta_lref_be: ∀L,K,V1,V2,W2,i,d,e. d ≤ i → i < d + e → - ⇩[0, i] L ≡ K. ⓓV1 → delifta 0 (d + e - i - 1) K V1 V2 → - ⇧[0, d] V2 ≡ W2 → delifta d e L (#i) W2 -| delifta_lref_ge: ∀L,d,e,i. d + e ≤ i → delifta d e L (#i) (#(i - e)) -| delifta_gref : ∀L,d,e,p. delifta d e L (§p) (§p) -| delifta_bind : ∀L,a,I,V1,V2,T1,T2,d,e. - delifta d e L V1 V2 → delifta (d + 1) e (L. ⓑ{I} V2) T1 T2 → - delifta d e L (ⓑ{a,I} V1. T1) (ⓑ{a,I} V2. T2) -| delifta_flat : ∀L,I,V1,V2,T1,T2,d,e. - delifta d e L V1 V2 → delifta d e L T1 T2 → - delifta d e L (ⓕ{I} V1. T1) (ⓕ{I} V2. T2) -. - -interpretation "inverse basic relocation (term) alternative" - 'TSubstAlt L T1 d e T2 = (delifta d e L T1 T2). - -(* Basic properties *********************************************************) - -lemma delifta_lsubr_trans: ∀L1,T1,T2,d,e. L1 ⊢ ▼▼*[d, e] T1 ≡ T2 → - ∀L2. L2 ⊑ [d, e] L1 → L2 ⊢ ▼▼*[d, e] T1 ≡ T2. -#L1 #T1 #T2 #d #e #H elim H -L1 -T1 -T2 -d -e // /2 width=1/ -[ #L1 #K1 #V1 #V2 #W2 #i #d #e #Hdi #Hide #HLK1 #_ #HVW2 #IHV12 #L2 #HL12 - elim (ldrop_lsubr_ldrop2_abbr … HL12 … HLK1 ? ?) -HL12 -HLK1 // /3 width=6/ -| /4 width=1/ -| /3 width=1/ -] -qed. - -lemma delift_delifta: ∀L,T1,T2,d,e. L ⊢ ▼*[d, e] T1 ≡ T2 → L ⊢ ▼▼*[d, e] T1 ≡ T2. -#L #T1 @(f2_ind … fw … L T1) -L -T1 #n #IH #L * -[ * #i #Hn #T2 #d #e #H destruct - [ >(delift_inv_sort1 … H) -H // - | elim (delift_inv_lref1 … H) -H * /2 width=1/ - #K #V1 #V2 #Hdi #Hide #HLK #HV12 #HVT2 - lapply (ldrop_pair2_fwd_fw … HLK) #H - lapply (IH … HV12) // -H /2 width=6/ - | >(delift_inv_gref1 … H) -H // - ] -| * [ #a ] #I #V1 #T1 #Hn #X #d #e #H - [ elim (delift_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct - lapply (delift_lsubr_trans … HT12 (L.ⓑ{I}V1) ?) -HT12 /2 width=1/ #HT12 - lapply (IH … HV12) -HV12 // #HV12 - lapply (IH … HT12) -IH -HT12 /2 width=1/ #HT12 - lapply (delifta_lsubr_trans … HT12 (L.ⓑ{I}V2) ?) -HT12 /2 width=1/ - | elim (delift_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct - lapply (IH … HV12) -HV12 // - lapply (IH … HT12) -IH -HT12 // /2 width=1/ - ] -] -qed. - -(* Basic inversion lemmas ***************************************************) - -lemma delifta_delift: ∀L,T1,T2,d,e. L ⊢ ▼▼*[d, e] T1 ≡ T2 → L ⊢ ▼*[d, e] T1 ≡ T2. -#L #T1 #T2 #d #e #H elim H -L -T1 -T2 -d -e // /2 width=1/ /2 width=6/ -qed-. - -lemma delift_ind_alt: ∀R:ℕ→ℕ→lenv→relation term. - (∀L,d,e,k. R d e L (⋆k) (⋆k)) → - (∀L,d,e,i. i < d → R d e L (#i) (#i)) → - (∀L,K,V1,V2,W2,i,d,e. d ≤ i → i < d + e → - ⇩[O, i] L ≡ K.ⓓV1 → K ⊢ ▼*[O, d + e - i - 1] V1 ≡ V2 → - ⇧[O, d] V2 ≡ W2 → R O (d+e-i-1) K V1 V2 → R d e L (#i) W2 - ) → - (∀L,d,e,i. d + e ≤ i → R d e L (#i) (#(i - e))) → - (∀L,d,e,p. R d e L (§p) (§p)) → - (∀L,a,I,V1,V2,T1,T2,d,e. L ⊢ ▼*[d, e] V1 ≡ V2 → - L.ⓑ{I}V2 ⊢ ▼*[d + 1, e] T1 ≡ T2 → R d e L V1 V2 → - R (d+1) e (L.ⓑ{I}V2) T1 T2 → R d e L (ⓑ{a,I}V1.T1) (ⓑ{a,I}V2.T2) - ) → - (∀L,I,V1,V2,T1,T2,d,e. L ⊢ ▼*[d, e] V1 ≡ V2 → - L⊢ ▼*[d, e] T1 ≡ T2 → R d e L V1 V2 → - R d e L T1 T2 → R d e L (ⓕ{I}V1.T1) (ⓕ{I}V2.T2) - ) → - ∀d,e,L,T1,T2. L ⊢ ▼*[d, e] T1 ≡ T2 → R d e L T1 T2. -#R #H1 #H2 #H3 #H4 #H5 #H6 #H7 #d #e #L #T1 #T2 #H elim (delift_delifta … H) -L -T1 -T2 -d -e -// /2 width=1 by delifta_delift/ /3 width=1 by delifta_delift/ /3 width=7 by delifta_delift/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/delift/delift_delift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/delift/delift_delift.etc deleted file mode 100644 index a5c563565..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/delift/delift_delift.etc +++ /dev/null @@ -1,29 +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/unfold/tpss_tpss.ma". -include "basic_2/unfold/delift.ma". - -(* INVERSE BASIC TERM RELOCATION *******************************************) - -(* Main properties **********************************************************) - -theorem delift_mono: ∀L,T,T1,T2,d,e. - L ⊢ ▼*[d, e] T ≡ T1 → L ⊢ ▼*[d, e] T ≡ T2 → T1 = T2. -#L #T #T1 #T2 #d #e * #U1 #H1TU1 #H2TU1 * #U2 #H1TU2 #H2TU2 -elim (tpss_conf_eq … H1TU1 … H1TU2) -T #U #HU1 #HU2 -lapply (tpss_inv_lift1_eq … HU1 … H2TU1) -HU1 #H destruct -lapply (tpss_inv_lift1_eq … HU2 … H2TU2) -HU2 #H destruct -lapply (lift_inj … H2TU1 … H2TU2) // -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/delift/delift_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/delift/delift_lift.etc deleted file mode 100644 index 8abaeb9f9..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/delift/delift_lift.etc +++ /dev/null @@ -1,164 +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/substitution/ldrop_lbotr.ma". -include "basic_2/unfold/tpss_lift.ma". -include "basic_2/unfold/delift.ma". - -(* INVERSE BASIC TERM RELOCATION *******************************************) - -(* Advanced properties ******************************************************) - -lemma delift_lref_be: ∀L,K,V1,V2,U2,i,d,e. d ≤ i → i < d + e → - ⇩[0, i] L ≡ K. ⓓV1 → K ⊢ ▼*[0, d + e - i - 1] V1 ≡ V2 → - ⇧[0, d] V2 ≡ U2 → L ⊢ ▼*[d, e] #i ≡ U2. -#L #K #V1 #V2 #U2 #i #d #e #Hdi #Hide #HLK * #V #HV1 #HV2 #HVU2 -elim (lift_total V 0 (i+1)) #U #HVU -lapply (lift_trans_be … HV2 … HVU ? ?) -HV2 // >minus_plus commutative_plus in ⊢ (??%??→?); H -H /2 width=1/ ] -Hde -H #V2 #V12 (**) (* H erased two times *) - elim (lift_total V2 0 d) /3 width=7/ -| #a #I #V1 #T1 #H #d #e #Hde #HL destruct - elim (IH … V1 … Hde HL) // #V2 #HV12 - elim (IH (L.ⓑ{I}V1) T1 … (d+1) e ??) -IH // [2,3: /2 width=1/ ] -Hde -HL #T2 #HT12 - lapply (delift_lsubr_trans … HT12 (L.ⓑ{I}V2) ?) -HT12 /2 width=1/ /3 width=4/ -| #I #V1 #T1 #H #d #e #Hde #HL destruct - elim (IH … V1 … Hde HL) // #V2 #HV12 - elim (IH … T1 … Hde HL) -IH -Hde -HL // /3 width=2/ -] -qed-. - -(* Advanced inversion lemmas ************************************************) - -lemma delift_inv_lref1_lt: ∀L,U2,i,d,e. L ⊢ ▼*[d, e] #i ≡ U2 → i < d → U2 = #i. -#L #U2 #i #d #e * #U #HU #HU2 #Hid -elim (tpss_inv_lref1 … HU) -HU -[ #H destruct >(lift_inv_lref2_lt … HU2) // -| * #K #V1 #V2 #Hdi - lapply (lt_to_le_to_lt … Hid Hdi) -Hid -Hdi #Hi - elim (lt_refl_false … Hi) -] -qed-. - -lemma delift_inv_lref1_be: ∀L,U2,d,e,i. L ⊢ ▼*[d, e] #i ≡ U2 → - d ≤ i → i < d + e → - ∃∃K,V1,V2. ⇩[0, i] L ≡ K. ⓓV1 & - K ⊢ ▼*[0, d + e - i - 1] V1 ≡ V2 & - ⇧[0, d] V2 ≡ U2. -#L #U2 #d #e #i * #U #HU #HU2 #Hdi #Hide -elim (tpss_inv_lref1 … HU) -HU -[ #H destruct elim (lift_inv_lref2_be … HU2 ? ?) // -| * #K #V1 #V #_ #_ #HLK #HV1 #HVU - elim (lift_div_be … HVU … HU2 ? ?) -U // /2 width=1/ /3 width=6/ -] -qed-. - -lemma delift_inv_lref1_ge: ∀L,U2,i,d,e. L ⊢ ▼*[d, e] #i ≡ U2 → - d + e ≤ i → U2 = #(i - e). -#L #U2 #i #d #e * #U #HU #HU2 #Hdei -elim (tpss_inv_lref1 … HU) -HU -[ #H destruct >(lift_inv_lref2_ge … HU2) // -| * #K #V1 #V2 #_ #Hide - lapply (lt_to_le_to_lt … Hide Hdei) -Hide -Hdei #Hi - elim (lt_refl_false … Hi) -] -qed-. - -lemma delift_inv_lref1: ∀L,U2,i,d,e. L ⊢ ▼*[d, e] #i ≡ U2 → - ∨∨ (i < d ∧ U2 = #i) - | (∃∃K,V1,V2. d ≤ i & i < d + e & - ⇩[0, i] L ≡ K. ⓓV1 & - K ⊢ ▼*[0, d + e - i - 1] V1 ≡ V2 & - ⇧[0, d] V2 ≡ U2 - ) - | (d + e ≤ i ∧ U2 = #(i - e)). -#L #U2 #i #d #e #H -elim (lt_or_ge i d) #Hdi -[ elim (delift_inv_lref1_lt … H Hdi) -H /3 width=1/ -| elim (lt_or_ge i (d+e)) #Hide - [ elim (delift_inv_lref1_be … H Hdi Hide) -H /3 width=6/ - | elim (delift_inv_lref1_ge … H Hide) -H /3 width=1/ - ] -] -qed-. - -(* Properties on basic term relocation **************************************) - -lemma delift_lift_le: ∀K,T1,T2,dt,et. K ⊢ ▼*[dt, et] T1 ≡ T2 → - ∀L,U1,d,e. dt + et ≤ d → ⇩[d, e] L ≡ K → - ⇧[d, e] T1 ≡ U1 → ∀U2. ⇧[d - et, e] T2 ≡ U2 → - L ⊢ ▼*[dt, et] U1 ≡ U2. -#K #T1 #T2 #dt #et * #T #HT1 #HT2 #L #U1 #d #e #Hdetd #HLK #HTU1 #U2 #HTU2 -elim (lift_total T d e) #U #HTU -lapply (tpss_lift_le … HT1 … HLK HTU1 … HTU) -T1 -HLK // #HU1 -elim (lift_trans_ge … HT2 … HTU ?) -T // -Hdetd #T #HT2 #HTU ->(lift_mono … HTU2 … HT2) -T2 /2 width=3/ -qed. - -lemma delift_lift_be: ∀K,T1,T2,dt,et. K ⊢ ▼*[dt, et] T1 ≡ T2 → - ∀L,U1,d,e. dt ≤ d → d ≤ dt + et → - ⇩[d, e] L ≡ K → ⇧[d, e] T1 ≡ U1 → - L ⊢ ▼*[dt, et + e] U1 ≡ T2. -#K #T1 #T2 #dt #et * #T #HT1 #HT2 #L #U1 #d #e #Hdtd #Hddet #HLK #HTU1 -elim (lift_total T d e) #U #HTU -lapply (tpss_lift_be … HT1 … HLK HTU1 … HTU) -T1 -HLK // #HU1 -lapply (lift_trans_be … HT2 … HTU ? ?) -T // -Hdtd -Hddet /2 width=3/ -qed. - -lemma delift_lift_ge: ∀K,T1,T2,dt,et. K ⊢ ▼*[dt, et] T1 ≡ T2 → - ∀L,U1,d,e. d ≤ dt → ⇩[d, e] L ≡ K → - ⇧[d, e] T1 ≡ U1 → ∀U2. ⇧[d, e] T2 ≡ U2 → - L ⊢ ▼*[dt + e, et] U1 ≡ U2. -#K #T1 #T2 #dt #et * #T #HT1 #HT2 #L #U1 #d #e #Hddt #HLK #HTU1 #U2 #HTU2 -elim (lift_total T d e) #U #HTU -lapply (tpss_lift_ge … HT1 … HLK HTU1 … HTU) -T1 -HLK // #HU1 -elim (lift_trans_le … HT2 … HTU ?) -T // -Hddt #T #HT2 #HTU ->(lift_mono … HTU2 … HT2) -T2 /2 width=3/ -qed. - -lemma delift_inv_lift1_eq: ∀L,U1,T2,d,e. L ⊢ ▼*[d, e] U1 ≡ T2 → - ∀K. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → T1 = T2. -#L #U1 #T2 #d #e * #U2 #HU12 #HTU2 #K #HLK #T1 #HTU1 -lapply (tpss_inv_lift1_eq … HU12 … HTU1) -L -K #H destruct -lapply (lift_inj … HTU1 … HTU2) -U2 // -qed-. - -lemma delift_lift_div_be: ∀L,T1,T,d,e,i. L ⊢ ▼*[i, d + e - i] T1 ≡ T → - ∀T2. ⇧[d, i - d] T2 ≡ T → d ≤ i → i ≤ d + e → - L ⊢ ▼*[d, e] T1 ≡ T2. -#L #T1 #T #d #e #i * #T0 #HT10 #HT0 #T2 #HT2 #Hdi #Hide -lapply (tpss_weak … HT10 d e ? ?) -HT10 // [ >commutative_plus /2 width=1/ ] #HT10 -lapply (lift_trans_be … HT2 … HT0 ? ?) -T // ->commutative_plus >commutative_plus in ⊢ (? ? (? % ?) ? ? → ?); -commutative_plus in H; >plus_plus_comm_23 #H - elim (le_plus_xySz_x_false … H) - ] - ] -| #a #I #V1 #T1 #Hn #X1 #H1 #L2 #HL12 #X2 #H2 - elim (cpr_inv_bind1 … H1) -H1 * - [ #V #T #HV1 #HT1 #H destruct - elim (cpr_inv_bind1 … H2) -H2 * - [ #V2 #T2 #HV2 #HT2 #H destruct - elim (IH … HV1 … HV2) // #HV12 destruct - [ @or_introl #H destruct /2 width=1/ - | elim (IH … HT1 … HT2) // /2 width=1/ -L1 -L2 #HT12 destruct - @or_introl #H destruct /2 width=1/ - ] - | #T2 #HT2 #HXT2 #H1 #H2 destruct - elim (IH … HT1 … HT2) // /2 width=1/ -L1 -L2 #HT12 destruct - | elim (term_eq_dec V1 V) #HV1 destruct - - ] - | #Y1 #HTY1 #HXY1 #H11 #H12 destruct - elim (lift_total (+ⓓV1.T1) 0 1) #Y2 #HXY2 - lapply (cpr_lift … H2 (L2.ⓓV1) … HXY1 … HXY2) /2 width=1/ -X1 /4 width=5/ - ] -| #I #V1 #T1 #Hn #X1 #H1 #L2 #HL12 #X2 #H2 - elim (cpr_inv_flat1 … H1) -H1 * - [ #V #T #HV1 #HT1 #H destruct - elim (cpr_inv_flat1 … H2) -H2 * - [ #V2 #T2 #HV2 #HT2 #H destruct /3 width=5/ - | #HX2 #H destruct /3 width=5/ - ] - | #HX1 #H destruct /3 width=5/ -] -qed-. -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/etc/ldrop.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/etc/ldrop.etc deleted file mode 100644 index e4caef0c8..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/etc/ldrop.etc +++ /dev/null @@ -1,11 +0,0 @@ -lemma ldrop_bor1: ∀L1,L2,s1,s2,d,e. ⇩[s1, d, e] L1 ≡ L2 → ⇩[s1 ∨ s2, d, e] L1 ≡ L2. -#L1 #L2 * /2 width=1 by ldrop_gen/ -qed. - -lemma ldrop_bor2: ∀L1,L2,s1,s2,d,e. ⇩[s2, d, e] L1 ≡ L2 → ⇩[s1 ∨ s2, d, e] L1 ≡ L2. -#L1 #L2 #s1 #s2 >commutative_orb /2 width=1 by ldrop_bor1/ -qed. - -(* Basic_1: was: drop_conf_rev *) -axiom ldrop_div: ∀e1,L1,L. ⇩[0, e1] L1 ≡ L → ∀e2,L2. ⇩[0, e2] L2 ≡ L → - ∃∃L0. ⇩[0, e1] L0 ≡ L2 & ⇩[e1, e2] L0 ≡ L1. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fleq/fpbc_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fleq/fpbc_lift.etc deleted file mode 100644 index 286290135..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fleq/fpbc_lift.etc +++ /dev/null @@ -1,9 +0,0 @@ -include "basic_2/reduction/lpx_ldrop.ma". - -lemma lpx_fpbc_trans: ∀h,g,G1,G2,K1,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≻[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, K1⦄ ⊢ ➡[h, g] L1 → - ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡[h, g] T & ⦃G1, K1, T⦄ ≻[h, g] ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g] L2. -#h #g #G1 #G2 #K1 #L1 #L2 #T1 #T2 * -G2 -L2 -T2 -[ #G2 #L2 #T2 #H12 #HKL1 elim (lpx_fqu_trans … H12 … HKL1) -L1 - /3 width=5 by fpbc_fqu, ex3_2_intro/ -| #T2 #HT12 #H #HKL1 diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fleq/fpbs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fleq/fpbs.etc deleted file mode 100644 index 017421feb..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fleq/fpbs.etc +++ /dev/null @@ -1,49 +0,0 @@ -lemma fpbs_fpbu_sn: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ≡[0] ⦃G2, L2, T2⦄ ∨ - ∃∃G,L,T. ⦃G1, L1, T1⦄ ≻[h, g] ⦃G, L, T⦄ & ⦃G, L, T⦄ ≥[h, g] ⦃G2, L2, T2⦄. -(* ALTERNATIVE PROOF -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbs_ind_dx … H) -G1 -L1 -T1 -[ /2 width=1 by or_introl/ -| #G1 #G #L1 #L #T1 #T #H1 #_ * [ #H2 | * #G0 #L0 #T0 #H0 #H02 ] - elim (fpb_fpbu … H1) -H1 #H1 - [ /3 width=1 by -*) -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H elim(fpbs_inv_alt … H) -H -#L0 #L #T #HT1 #HT2 #HL0 #HL2 elim (eq_term_dec T1 T) #H destruct -[ -HT1 elim (fqus_inv_gen … HT2) -HT2 - [ #H elim (fqup_inv_step_sn … H) -H - /4 width=11 by fpbs_intro_alt, fpbu_fqu, ex2_3_intro, or_intror/ - | * #HG #HL #HT destruct elim (lleq_dec T2 L0 L 0) #H - [ /4 width=3 by fleq_intro, lleq_trans, or_introl/ - | elim (lpxs_nlleq_inv_step_sn … HL0 H) -HL0 -H - /5 width=7 by lpxs_lleq_fpbs, fpbu_lpx, lleq_trans, ex2_3_intro, or_intror/ - ] - ] -| elim (cpxs_neq_inv_step_sn … HT1 H) -HT1 -H - /5 width=11 by fpbs_intro_alt, fpbu_cpx, ex2_3_intro, or_intror/ -] -qed-. - -(* alternative proof that needs decidability of bteq to go in fpbs.ma - * or lpx_fpbc_trans to go in fpbs_lift.ma (possibly) -*) - -axiom lpx_bteq_trans: ∀h,g,G1,G2,L1,L,L2,T1,T2. ⦃G1, L1⦄ ⊢➡ [h, g] L → - ⦃G1, L, T1⦄ ⋕[h, g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⋕[h, g] ⦃G2, L2, T2⦄. - -lemma fpbs_fwd_fpb_sn: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ⋕[h, g] ⦃G2, L2, T2⦄ ∨ - ∃∃G,L,T. ⦃G1, L1, T1⦄ ≻[h, g] ⦃G, L, T⦄ & ⦃G, L, T⦄ ≥[h, g] ⦃G2, L2, T2⦄. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbs_ind_dx … H) -G1 -L1 -T1 [ /2 width=1 by or_introl/ ] (**) (* auto fails without brackets *) -#G1 #G #L1 #L #T1 #T * -[ #G0 #L0 #T0 #H #H02 #IH1 elim (fquq_inv_gen … H) -H - [ -IH1 /4 width=5 by fpbc_fqu, ex2_3_intro, or_intror/ - | -H02 * #HG #HL #HT destruct /2 width=1 by/ - ] -| #T0 #HT10 #H02 #IH02 elim (eq_term_dec T1 T0) #H destruct - [ -H02 /2 width=1 by/ - | -IH02 /5 width=5 by fpbc_cpx, ex2_3_intro, or_intror/ - ] -| #L0 #HL10 #_ * [ /3 width=3 by or_introl, lpx_bteq_trans/ ] - * #G3 #L3 #T3 #H13 #H32 - diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/fpa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/fpa.etc deleted file mode 100644 index 8f72937c4..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/fpa.etc +++ /dev/null @@ -1,36 +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/notation/relations/rajust_5.ma". -include "basic_2/substitution/drop.ma". - -(* AJUSTMENT ****************************************************************) - -inductive fpa (s:bool): bi_relation lenv term ≝ -| fpa_fwd: ∀L,K,T,U,d,e. ⇩[s, d, e] L ≡ K → ⇧[d, e] T ≡ U → fpa s K T L U -| fpa_bwd: ∀L,K,T,U,d,e. ⇩[s, d, e] L ≡ K → ⇧[d, e] T ≡ U → fpa s L U K T -. - -interpretation - "ajustment (restricted closure)" - 'RAjust L1 T1 s L2 T2 = (fpa s L1 T1 L2 T2). - -(* Basic properties *********************************************************) - -lemma fpa_refl: ∀s. bi_reflexive … (fpa s). -/2 width=4 by fpa_fwd/ qed. - -lemma fpa_sym: ∀s. bi_symmetric … (fpa s). -#s #L1 #L2 #T1 #T2 * /2 width=4 by fpa_fwd, fpa_bwd/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/fpa_fpa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/fpa_fpa.etc deleted file mode 100644 index c62b8bfb9..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/fpa_fpa.etc +++ /dev/null @@ -1,22 +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/substitution/fpa.ma". - -(* AJUSTMENT ****************************************************************) - -(* Main properties **********************************************************) - -theorem fpa_conf: ∀s. bi_confluent … (fpa s). -/3 width=4 by fpa_sym, ex2_2_intro/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/fpas.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/fpas.etc deleted file mode 100644 index 6817d8c90..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/fpas.etc +++ /dev/null @@ -1,59 +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/notation/relations/rajuststar_5.ma". -include "basic_2/substitution/fpa.ma". - -(* MULTIPLE AJUSTMENT *******************************************************) - -definition fpas: bool → bi_relation lenv term ≝ λs. bi_TC … (fpa s). - -interpretation - "multiple ajustment (restricted closure)" - 'RAjustStar L1 T1 s L2 T2 = (fpas s L1 T1 L2 T2). - -(* Basic eliminators ********************************************************) - -lemma fpas_ind: ∀L1,T1,s. ∀R:relation2 …. R L1 T1 → - (∀L,L2,T,T2. ⦃L1, T1⦄ ⇳*[s] ⦃L, T⦄ → ⦃L, T⦄ ⇳[s] ⦃L2, T2⦄ → R L T → R L2 T2) → - ∀L2,T2. ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄ → R L2 T2. -#L1 #T1 #s #R #IH1 #IH2 #L2 #T2 #H -@(bi_TC_star_ind … IH1 IH2 L2 T2 H) // -qed-. - -lemma fpas_ind_dx: ∀L2,T2,s. ∀R:relation2 …. R L2 T2 → - (∀L1,L,T1,T. ⦃L1, T1⦄ ⇳[s] ⦃L, T⦄ → ⦃L, T⦄ ⇳*[s] ⦃L2, T2⦄ → R L T → R L1 T1) → - ∀L1,T1. ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄ → R L1 T1. -#L2 #T2 #s #R #IH1 #IH2 #L1 #T1 #H -@(bi_TC_star_ind_dx … IH1 IH2 L1 T1 H) // -qed-. - -(* Basic properties *********************************************************) - -lemma fpas_refl: ∀s. bi_reflexive … (fpas s). -/2 width=1 by bi_inj/ qed. - -lemma fpas_sym: ∀s. bi_symmetric … (fpas s). -/3 width=1 by fpa_sym, bi_TC_symmetric/ qed-. - -lemma fpa_fpas: ∀L1,L2,T1,T2,s. ⦃L1, T1⦄ ⇳[s] ⦃L2, T2⦄ → ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄. -/2 width=1 by bi_inj/ qed. - -lemma fpas_strap1: ∀L1,L,L2,T1,T,T2,s. ⦃L1, T1⦄ ⇳*[s] ⦃L, T⦄ → ⦃L, T⦄ ⇳[s] ⦃L2, T2⦄ → - ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄. -/2 width=4 by bi_step/ qed-. - -lemma fpas_strap2: ∀L1,L,L2,T1,T,T2,s. ⦃L1, T1⦄ ⇳[s] ⦃L, T⦄ → ⦃L, T⦄ ⇳*[s] ⦃L2, T2⦄ → - ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄. -/2 width=4 by bi_TC_strap/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/fpas_fpas.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/fpas_fpas.etc deleted file mode 100644 index 28d648e7b..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/fpas_fpas.etc +++ /dev/null @@ -1,40 +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/substitution/fpa_fpa.ma". -include "basic_2/multiple/fpas.ma". - -(* MULTIPLE AJUSTMENT *******************************************************) - -(* Advanced properties ******************************************************) - -lemma fpas_strip: ∀L0,L1,L2,T0,T1,T2,s. ⦃L0, T0⦄ ⇳[s] ⦃L1, T1⦄ → ⦃L0, T0⦄ ⇳*[s] ⦃L2, T2⦄ → - ∃∃L,T. ⦃L1, T1⦄ ⇳*[s] ⦃L, T⦄ & ⦃L2, T2⦄ ⇳[s] ⦃L, T⦄. -/3 width=4 by fpa_conf, bi_TC_strip/ qed-. - -(* Main properties **********************************************************) - -theorem fpas_conf: ∀s. bi_confluent … (fpas s). -/3 width=4 by fpa_conf, bi_TC_confluent/ qed-. - -theorem fpas_trans: ∀s. bi_transitive … (fpas s). -/2 width=4 by bi_TC_transitive/ qed-. - -theorem fpas_canc_sn: ∀L,L1,L2,T,T1,T2,s. - ⦃L, T⦄ ⇳*[s] ⦃L1, T1⦄→ ⦃L, T⦄ ⇳*[s] ⦃L2, T2⦄ → ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄. -/3 width=4 by fpas_trans, fpas_sym/ qed-. - -theorem fpas_canc_dx: ∀L1,L2,L,T1,T2,T,s. - ⦃L1, T1⦄ ⇳*[s] ⦃L, T⦄ → ⦃L2, T2⦄ ⇳*[s] ⦃L, T⦄ → ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄. -/3 width=4 by fpas_trans, fpas_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/fpas_vector.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/fpas_vector.etc deleted file mode 100644 index 65e8190e4..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/fpas_vector.etc +++ /dev/null @@ -1,56 +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/grammar/term_vector.ma". -include "basic_2/multiple/fpas.ma". - -(* MULTIPLE VECTOR AJUSTMENT ************************************************) - -inductive fpasv (s:bool): bi_relation lenv (list term) ≝ -| fpasv_nil : ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄ → fpasv s L1 (◊) L2 (◊) -| fpasv_cons: ∀L1,L2,T1s,T2s,T1,T2. ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄ → - fpasv s L1 T1s L2 T2s → - fpasv s L1 (T1 @ T1s) L2 (T2 @ T2s) -. - -interpretation - "multiple vector ajustment (restricted closure)" - 'RAjustStar L1 T1s s L2 T2s = (fpasv s L1 T1s L2 T2s). - -(* Basic inversion lemmas ***************************************************) - - - -(* Basic_1: was just: lifts1_flat (left to right) *) -lemma fpas_inv_applv1: ∀L1,L2,V1s,T1,X,s. ⦃L1, Ⓐ V1s.T1⦄ ⇳*[s] ⦃L2, X⦄ → - ∃∃V2s,T2. ⦃L1, V1s⦄ ⇳*[s] ⦃L2, V2s⦄ & ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄ & - X = Ⓐ V2s.T2. -#L1 #L2 #V1s elim V1s -V1s -[ #T1 #X #s #H - @(ex3_2_intro … (◊) X) /2 width=3 by fpasv_nil/ (**) (* explicit constructor *) -| #V1 #V1s #IHV1s #T1 #X #s #H - elim (lifts_inv_flat1 … H) -H #V2 #Y #HV12 #HY #H destruct - elim (IHV1s … HY) -IHV1s -HY #V2s #T2 #HV12s #HT12 #H destruct - @(ex3_2_intro) [4: // |3: /2 width=2 by liftsv_cons/ |1,2: skip | // ] (**) (* explicit constructor *) -] -qed-. - -(* Basic properties *********************************************************) - -(* Basic_1: was just: lifts1_flat (right to left) *) -lemma lifts_applv: ∀V1s,V2s,des. ⇧*[des] V1s ≡ V2s → - ∀T1,T2. ⇧*[des] T1 ≡ T2 → - ⇧*[des] Ⓐ V1s. T1 ≡ Ⓐ V2s. T2. -#V1s #V2s #des #H elim H -V1s -V2s /3 width=1 by lifts_flat/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/gcp.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/gcp.etc deleted file mode 100644 index b9b2db820..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/gcp.etc +++ /dev/null @@ -1,48 +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/grammar/genv.ma". -include "basic_2/multiple/fpas.ma". - -(* GENERIC COMPUTATION PROPERTIES *******************************************) - -definition candidate: Type[0] ≝ relation3 genv lenv term. - -definition CP0 ≝ λRR:relation4 genv lenv term term. λRS:relation term. - ∀G,L1,L2,T1,T2,s. ⦃L1, T1⦄ ⇳[s] ⦃L2, T2⦄ → - NF … (RR G L1) RS T1 → NF … (RR G L2) RS T2. - -definition CP0s ≝ λRR:relation4 genv lenv term term. λRS:relation term. - ∀G,L1,L2,T1,T2,s. ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄ → - NF … (RR G L1) RS T1 → NF … (RR G L2) RS T2. - -definition CP1 ≝ λRR:relation4 genv lenv term term. λRS:relation term. - ∀G,L. ∃k. NF … (RR G L) RS (⋆k). - -definition CP2 ≝ λRP:candidate. - ∀G,L,T,k. RP G L (ⓐ⋆k.T) → RP G L T. - -(* requirements for generic computation properties *) -record gcp (RR:relation4 genv lenv term term) (RS:relation term) (RP:candidate) : Prop ≝ -{ cp0: CP0 RR RS; - cp1: CP1 RR RS; - cp2: CP2 RP -}. - -(* Basic properties *********************************************************) - -(* Basic_1: was just: nf2_lift1 *) -lemma gcp_fpas: ∀RR,RS. CP0 RR RS → CP0s RR RS. -#RR #RS #HRR #G #L1 #L2 #T1 #T2 #s #H @(fpas_ind … H) -L2 -T2 /3 width=5 by/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/gcp_cr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/gcp_cr.etc deleted file mode 100644 index 76490987f..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/gcp_cr.etc +++ /dev/null @@ -1,185 +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/notation/relations/ineint_5.ma". -include "basic_2/grammar/aarity.ma". -include "basic_2/substitution/lift_vector.ma". -include "basic_2/computation/gcp.ma". - -(* GENERIC COMPUTATION PROPERTIES *******************************************) - -definition S0 ≝ λC:candidate. ∀G,L1,L2,T1,T2. ⦃L1, T1⦄ ⇳[Ⓕ] ⦃L2, T2⦄ → - C G L1 T1 → C G L2 T2. - -definition S0s ≝ λC:candidate. ∀G,L1,L2,T1,T2. ⦃L1, T1⦄ ⇳*[Ⓕ] ⦃L2, T2⦄ → - C G L1 T1 → C G L2 T2. - -(* Note: this is Girard's CR1 *) -definition S1 ≝ λRP,C:candidate. - ∀G,L,T. C G L T → RP G L T. - -(* Note: this is Tait's iii, or Girard's CR4 *) -definition S2 ≝ λRR:relation4 genv lenv term term. λRS:relation term. λRP,C:candidate. - ∀G,L,Vs. all … (RP G L) Vs → - ∀T. 𝐒⦃T⦄ → NF … (RR G L) RS T → C G L (ⒶVs.T). - -(* Note: this generalizes Tait's ii *) -definition S3 ≝ λC:candidate. - ∀a,G,L,Vs,V,T,W. - C G L (ⒶVs.ⓓ{a}ⓝW.V.T) → C G L (ⒶVs.ⓐV.ⓛ{a}W.T). - -definition S4 ≝ λRP,C:candidate. - ∀G,L,Vs. all … (RP G L) Vs → ∀k. C G L (ⒶVs.⋆k). - -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). - -definition S6 ≝ λRP,C:candidate. - ∀G,L,V1s,V2s. ⇧[0, 1] V1s ≡ V2s → - ∀a,V,T. C G (L.ⓓV) (ⒶV2s.T) → RP G L V → C G L (ⒶV1s.ⓓ{a}V.T). - -definition S7 ≝ λC:candidate. - ∀G,L,Vs,T,W. C G L (ⒶVs.T) → C G L (ⒶVs.W) → C G L (ⒶVs.ⓝW.T). - -(* requirements for the generic reducibility candidate *) -record gcr (RR:relation4 genv lenv term term) (RS:relation term) (RP,C:candidate) : Prop ≝ -{ s0: S0 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,V,U. ⦃K, T⦄ ⇳*[Ⓕ] ⦃L, U⦄ → - C1 G L V → C2 G L (ⓐV.U). - -(* the reducibility candidate associated to an atomic arity *) -let rec acr (RP:candidate) (A:aarity) on A: candidate ≝ -match A with -[ AAtom ⇒ RP -| APair B A ⇒ cfun (acr RP B) (acr RP A) -]. - -interpretation - "candidate of reducibility of an atomic arity (abstract)" - 'InEInt RP G L T A = (acr RP A G L T). - -(* Basic properties *********************************************************) - -(* Basic_1: was just: sc3_lift1 *) -lemma gcr_fpas: ∀C. S0 C → S0s C. -#C #HC #G #L1 #L2 #T1 #T2 #H @(fpas_ind … H) -L2 -T2 /3 width=5 by/ -qed. -(* -lemma rp_lifts: ∀RR,RS,RP. gcr RR RS RP RP → - ∀des,G,L0,L,V,V0. ⇩*[Ⓕ, des] L0 ≡ L → ⇧*[des] V ≡ V0 → - RP G L V → RP G L0 V0. -#RR #RS #RP #HRP #des #G #L0 #L #V #V0 #HL0 #HV0 #HV -@gcr_lifts /width=7 by/ -@(s0 … HRP) -qed. - -(* Basic_1: was only: sns3_lifts1 *) -lemma rp_liftsv_all: ∀RR,RS,RP. gcr RR RS RP RP → - ∀des,G,L0,L,Vs,V0s. ⇩*[Ⓕ, des] L0 ≡ L → ⇧*[des] Vs ≡ V0s → - all … (RP G L) Vs → all … (RP G L0) V0s. -#RR #RS #RP #HRP #des #G #L0 #L #Vs #V0s #HL0 #H elim H -Vs -V0s normalize // -#T1s #T2s #T1 #T2 #HT12 #_ #IHT2s * /3 width=7 by rp_lifts, conj/ -qed. -*) -(* Basic_1: was: - sc3_sn3 sc3_abst sc3_appl sc3_abbr sc3_bind sc3_cast sc3_lift -*) -lemma acr_gcr: ∀RR,RS,RP. gcp RR RS RP → gcr RR RS RP RP → - ∀A. gcr RR RS RP (acr RP A). -#RR #RS #RP #H1RP #H2RP #A elim A -A // -#B #A #IHB #IHA @mk_gcr -[ /3 width=4 by fpas_strap2/ -| #G #L #T #H - elim (cp1 … H1RP G L) #k #HK - lapply (H L (⋆k) T ? ?) -H // - [ @(s2 … IHB … (◊)) // - | #H @(cp2 … H1RP … k) @(s1 … IHA) // - ] -| #G #L #Vs #HVs #T #H1T #H2T #L0 #V0 #X #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=14 by rp_liftsv_all, gcp_lifts, cp0, lifts_simple_dx, conj/ -| #a #G #L #Vs #U #T #W #HA #L0 #V0 #X #des #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 - @(s3 … IHA … (V0 @ V0s)) /5 width=6 by lifts_applv, lifts_flat, lifts_bind/ -| #G #L #Vs #HVs #k #L0 #V0 #X #des #HL0 #H #HB - elim (lifts_inv_applv1 … H) -H #V0s #Y #HV0s #HY #H destruct - >(lifts_inv_sort1 … HY) -Y - lapply (s1 … IHB … HB) #HV0 - @(s4 … IHA … (V0 @ V0s)) /3 width=7 by rp_liftsv_all, conj/ -| #I #G #L #K #Vs #V1 #V2 #i #HA #HV12 #HLK #L0 #V0 #X #des #HL0 #H #HB - elim (lifts_inv_applv1 … H) -H #V0s #Y #HV0s #HY #H destruct - elim (lifts_inv_lref1 … HY) -HY #i0 #Hi0 #H destruct - elim (drops_drop_trans … HL0 … HLK) #X #des0 #i1 #HL02 #H #Hi1 #Hdes0 - >(at_mono … Hi1 … Hi0) in HL02; -i1 #HL02 - elim (drops_inv_skip2 … Hdes0 … H) -H -des0 #L2 #W1 #des0 #Hdes0 #HLK #HVW1 #H destruct - elim (lift_total W1 0 (i0 + 1)) #W2 #HW12 - elim (lifts_lift_trans … Hdes0 … HVW1 … HW12) // -Hdes0 -Hi0 #V3 #HV13 #HVW2 - >(lift_mono … HV13 … HV12) in HVW2; -V3 #HVW2 - @(s5 … IHA … (V0 @ V0s) … HW12 HL02) /3 width=5 by lifts_applv/ -| #G #L #V1s #V2s #HV12s #a #V #T #HA #HV #L0 #V10 #X #des #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 V10s) #V20s #HV120s - @(s6 … IHA … (V10 @ V10s) (V20 @ V20s)) /3 width=7 by rp_lifts, liftv_cons/ - @(HA … (des + 1)) /2 width=2 by drops_skip/ - [ @lifts_applv // - elim (liftsv_liftv_trans_le … HV10s … HV120s) -V10s #V10s #HV10s #HV120s - >(liftv_mono … HV12s … HV10s) -V1s // - | @(s0 … IHB … HB … HV120) /2 width=2 by drop_drop/ - ] -| #G #L #Vs #T #W #HA #HW #L0 #V0 #X #des #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 - @(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,des. ⇩*[Ⓕ, des] L0 ≡ L → ⇧*[des] W ≡ W0 → ⇧*[des + 1] 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 #des #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 … HL0 … HW0 HW) -HW [ @(s0 … HCB) ] #HW0 -@(s3 … HCA … (◊)) -@(s6 … HCA … (◊) (◊)) // -[ @(HA … HL0) // -| lapply (s1 … HCB) -HCB #HCB - @(s7 … H2RP … (◊)) /2 width=1 by/ -] -qed. - -(* Basic_1: removed theorems 2: sc3_arity_gen sc3_repl *) -(* Basic_1: removed local theorems 1: sc3_sn3_abst *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/rajust_5.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/rajust_5.etc deleted file mode 100644 index ef0fbc49b..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/rajust_5.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 L1, break term 46 T1 ⦄ ⇳ [ break term 46 s ] break ⦃ term 46 L2 , break term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'RAjust $L1 $T1 $s $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/rajuststar_5.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/rajuststar_5.etc deleted file mode 100644 index 7cf9191d6..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpa/rajuststar_5.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 L1, break term 46 T1 ⦄ ⇳ * [ break term 46 s ] break ⦃ term 46 L2 , break term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'RAjustStar $L1 $T1 $s $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbc.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbc.etc deleted file mode 100644 index 9c803f041..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbc.etc +++ /dev/null @@ -1,33 +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/notation/relations/lazybtpredproper_8.ma". -include "basic_2/multiple/fleq.ma". -include "basic_2/reduction/fpbu.ma". - -(* "QRST" PROPER PARALLEL REDUCTION FOR CLOSURES ****************************) - -definition fpbc: ∀h. sd h → tri_relation genv lenv term ≝ - λh,g,G1,L1,T1,G2,L2,T2. - ∃∃G,L,T. ⦃G1, L1, T1⦄ ≻[h, g] ⦃G, L, T⦄ & ⦃G, L, T⦄ ≡[0] ⦃G2, L2, T2⦄. - -interpretation - "'qrst' proper parallel reduction (closure)" - 'LazyBTPRedProper h g G1 L1 T1 G2 L2 T2 = (fpbc h g G1 L1 T1 G2 L2 T2). - -(* Baic properties **********************************************************) - -lemma fpbu_fpbc: ∀h,g,G1,G2,L1,L2,T1,T2. - ⦃G1, L1, T1⦄ ≻[h, g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G2, L2, T2⦄. -/2 width=5 by ex2_3_intro/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbc_fleq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbc_fleq.etc deleted file mode 100644 index aa5cd7f2b..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbc_fleq.etc +++ /dev/null @@ -1,34 +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/fleq_fleq.ma". -include "basic_2/reduction/fpbu_fleq.ma". -include "basic_2/reduction/fpbc.ma". - -(* "QRST" PROPER PARALLEL REDUCTION FOR CLOSURES ****************************) - -(* Properties on lazy equivalence on closures *******************************) - -lemma fpbc_fleq_trans: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G, L, T⦄ → - ⦃G, L, T⦄ ≡[0] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G2, L2, T2⦄. -#h #g #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 * -/3 width=9 by fleq_trans, ex2_3_intro/ -qed-. - -lemma fleq_fpbc_trans: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ≡[0] ⦃G, L, T⦄ → - ⦃G, L, T⦄ ≻≡[h, g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G2, L2, T2⦄. -#h #g #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 #H1 * -#G0 #L0 #T0 #H0 #H02 elim (fleq_fpbu_trans … H1 … H0) -G -L -T -/3 width=9 by fleq_trans, ex2_3_intro/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbg.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbg.etc deleted file mode 100644 index 574c35e10..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbg.etc +++ /dev/null @@ -1,61 +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/notation/relations/lazybtpredstarproper_8.ma". -include "basic_2/reduction/fpbc.ma". - -(* "QRST" PROPER PARALLEL COMPUTATION FOR CLOSURES **************************) - -definition fpbg: ∀h. sd h → tri_relation genv lenv term ≝ - λh,g. tri_TC … (fpbc h g). - -interpretation "'qrst' proper parallel computation (closure)" - 'LazyBTPRedStarProper h g G1 L1 T1 G2 L2 T2 = (fpbg h g G1 L1 T1 G2 L2 T2). - -(* Basic properties *********************************************************) - -lemma fpbc_fpbg: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. -/2 width=1 by tri_inj/ qed. - -lemma fpbg_strap1: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. - ⦃G1, L1, T1⦄ >≡[h, g] ⦃G, L, T⦄ → ⦃G, L, T⦄ ≻≡[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. -/2 width=5 by tri_step/ qed. - -lemma fpbg_strap2: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. - ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G, L, T⦄ → ⦃G, L, T⦄ >≡[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. -/2 width=5 by tri_TC_strap/ qed. - -lemma fpbu_fpbg: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≻[h,g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. -/3 width=1 by fpbu_fpbc, fpbc_fpbg/ qed. - -(* Basic eliminators ********************************************************) - -lemma fpbg_ind: ∀h,g,G1,L1,T1. ∀R:relation3 …. - (∀G2,L2,T2. ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G2, L2, T2⦄ → R G2 L2 T2) → - (∀G,G2,L,L2,T,T2. ⦃G1, L1, T1⦄ >≡[h, g] ⦃G, L, T⦄ → ⦃G, L, T⦄ ≻≡[h, g] ⦃G2, L2, T2⦄ → R G L T → R G2 L2 T2) → - ∀G2,L2,T2. ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄ → R G2 L2 T2. -#h #g #G1 #L1 #T1 #R #IH1 #IH2 #G2 #L2 #T2 #H -@(tri_TC_ind … IH1 IH2 G2 L2 T2 H) -qed-. - -lemma fpbg_ind_dx: ∀h,g,G2,L2,T2. ∀R:relation3 …. - (∀G1,L1,T1. ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G2, L2, T2⦄ → R G1 L1 T1) → - (∀G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G, L, T⦄ → ⦃G, L, T⦄ >≡[h, g] ⦃G2, L2, T2⦄ → R G L T → R G1 L1 T1) → - ∀G1,L1,T1. ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄ → R G1 L1 T1. -#h #g #G2 #L2 #T2 #R #IH1 #IH2 #G1 #L1 #T1 #H -@(tri_TC_ind_dx … IH1 IH2 G1 L1 T1 H) -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbg_fleq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbg_fleq.etc deleted file mode 100644 index 754811ec2..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbg_fleq.etc +++ /dev/null @@ -1,36 +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/reduction/fpbc_fleq.ma". -include "basic_2/computation/fpbg.ma". - -(* "QRST" PROPER PARALLEL COMPUTATION FOR CLOSURES **************************) - -(* Properties on lazy equivalence for closures ******************************) - -lemma fpbg_fleq_trans: ∀h,g,G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ >≡[h, g] ⦃G, L, T⦄ → - ∀G2,L2,T2. ⦃G, L, T⦄ ≡[0] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. -#h #g #G1 #G #L1 #L #T1 #T #H @(fpbg_ind … H) -G -L -T -[ /3 width=5 by fpbc_fpbg, fpbc_fleq_trans/ -| /4 width=9 by fpbg_strap1, fpbc_fleq_trans/ -] -qed-. - -lemma fleq_fpbg_trans: ∀h,g,G,G2,L,L2,T,T2. ⦃G, L, T⦄ >≡[h, g] ⦃G2, L2, T2⦄ → - ∀G1,L1,T1. ⦃G1, L1, T1⦄ ≡[0] ⦃G, L, T⦄ → ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. -#h #g #G #G2 #L #L2 #T #T2 #H @(fpbg_ind_dx … H) -G -L -T -[ /3 width=5 by fpbc_fpbg, fleq_fpbc_trans/ -| /4 width=9 by fpbg_strap2, fleq_fpbc_trans/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbg_fpbg.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbg_fpbg.etc deleted file mode 100644 index 57dd5ebb4..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbg_fpbg.etc +++ /dev/null @@ -1,53 +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/computation/fpbs_fpbu.ma". -include "basic_2/computation/fpbs_fpbc.ma". -include "basic_2/computation/fpbs_fpbs.ma". -include "basic_2/computation/fpbg_fpbs.ma". - -(* "QRST" PROPER PARALLEL COMPUTATION FOR CLOSURES **************************) - -(* Advanced inversion lemmas ************************************************) - -lemma fpbg_inv_fpbu_sn: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄ → - ∃∃G,L,T. ⦃G1, L1, T1⦄ ≻[h, g] ⦃G, L, T⦄ & ⦃G, L, T⦄ ≥[h, g] ⦃G2, L2, T2⦄. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbg_ind_dx … H) -G1 -L1 -T1 -[ #G1 #L1 #T1 * /3 width=5 by fleq_fpbs, ex2_3_intro/ -| #G1 #G #L1 #L #T1 #T * - #G0 #L0 #T0 #H10 #H0 #_ * - /5 width=9 by fpbu_fpbs, fpbs_trans, fleq_fpbs, ex2_3_intro/ -] -qed-. - -(* Advanced forward lemmas **************************************************) - -lemma fpbg_fwd_fpbs: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbg_ind … H) -G2 -L2 -T2 -[2: #G #G2 #L #L2 #T #T2 #_ #H2 #IH1 @(fpbs_trans … IH1) -IH1 ] (**) (* full auto fails *) -/2 width=1 by fpbc_fpbs/ -qed-. - -(* Advanced properties ******************************************************) - -lemma fpbs_fpbu_trans: ∀h,g,F1,F2,K1,K2,T1,T2. ⦃F1, K1, T1⦄ ≥[h, g] ⦃F2, K2, T2⦄ → - ∀G2,L2,U2. ⦃F2, K2, T2⦄ ≻[h, g] ⦃G2, L2, U2⦄ → - ∃∃G1,L1,U1. ⦃F1, K1, T1⦄ ≻[h, g] ⦃G1, L1, U1⦄ & ⦃G1, L1, U1⦄ ≥[h, g] ⦃G2, L2, U2⦄. -/5 width=5 by fpbg_inv_fpbu_sn, fpbs_fpbg_trans, fpbc_fpbg, fpbu_fpbc/ qed-. - -(* Man properties ***********************************************************) - -theorem fpbg_trans: ∀h,g. tri_transitive … (fpbg h g). -/2 width=5 by tri_TC_transitive/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbg_fpbs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbg_fpbs.etc deleted file mode 100644 index 4b8662295..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbg_fpbs.etc +++ /dev/null @@ -1,88 +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/computation/lpxs_lleq.ma". -include "basic_2/computation/fpbs_lift.ma". -include "basic_2/computation/fpbg_fleq.ma". - -(* "QRST" PROPER PARALLEL COMPUTATION FOR CLOSURES **************************) - -(* Properties on "qrst" parallel reduction on closures **********************) - -lemma fpbg_fpb_trans: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. - ⦃G1, L1, T1⦄ >≡[h, g] ⦃G, L, T⦄ → ⦃G, L, T⦄ ≽[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. -#h #g #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 #H1 #H2 elim (fpb_fpbu … H2) -H2 -/3 width=5 by fpbg_fleq_trans, fpbg_strap1, fpbu_fpbc/ -qed-. - -lemma fpb_fpbg_trans: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. - ⦃G1, L1, T1⦄ ≽[h, g] ⦃G, L, T⦄ → ⦃G, L, T⦄ >≡[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. -#h #g #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 #H1 elim (fpb_fpbu … H1) -H1 -/3 width=5 by fleq_fpbg_trans, fpbg_strap2, fpbu_fpbc/ -qed-. - -(* Properties on "qrst" parallel compuutation on closures *******************) - -lemma fpbs_fpbg_trans: ∀h,g,G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G, L, T⦄ → - ∀G2,L2,T2. ⦃G, L, T⦄ >≡[h, g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. -#h #g #G1 #G #L1 #L #T1 #T #H @(fpbs_ind … H) -G -L -T /3 width=5 by fpb_fpbg_trans/ -qed-. - -(* Note: this is used in the closure proof *) -lemma fpbg_fpbs_trans: ∀h,g,G,G2,L,L2,T,T2. ⦃G, L, T⦄ ≥[h, g] ⦃G2, L2, T2⦄ → - ∀G1,L1,T1. ⦃G1, L1, T1⦄ >≡[h, g] ⦃G, L, T⦄ → ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. -#h #g #G #G2 #L #L2 #T #T2 #H @(fpbs_ind_dx … H) -G -L -T /3 width=5 by fpbg_fpb_trans/ -qed-. - -lemma fpbu_fpbs_fpbg: ∀h,g,G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ ≻[h, g] ⦃G, L, T⦄ → - ∀G2,L2,T2. ⦃G, L, T⦄ ≥[h, g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. -/3 width=5 by fpbg_fpbs_trans, fpbu_fpbg/ qed. - -(* Note: this is used in the closure proof *) -lemma fqup_fpbg: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H elim (fqup_inv_step_sn … H) -H -/3 width=5 by fqus_fpbs, fpbu_fqu, fpbu_fpbs_fpbg/ -qed. - -lemma cpxs_fpbg: ∀h,g,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡*[h, g] T2 → - (T1 = T2 → ⊥) → ⦃G, L, T1⦄ >≡[h, g] ⦃G, L, T2⦄. -#h #g #G #L #T1 #T2 #H #H0 elim (cpxs_neq_inv_step_sn … H … H0) -H -H0 -/4 width=5 by cpxs_fpbs, fpbu_cpx, fpbu_fpbs_fpbg/ -qed. - -lemma lstas_fpbg: ∀h,g,G,L,T1,T2,l2. ⦃G, L⦄ ⊢ T1 •*[h, l2] T2 → (T1 = T2 → ⊥) → - ∀l1. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 → ⦃G, L, T1⦄ >≡[h, g] ⦃G, L, T2⦄. -/3 width=5 by lstas_cpxs, cpxs_fpbg/ qed. - -lemma lpxs_fpbg: ∀h,g,G,L1,L2,T. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → - (L1 ≡[T, 0] L2 → ⊥) → ⦃G, L1, T⦄ >≡[h, g] ⦃G, L2, T⦄. -#h #g #G #L1 #L2 #T #H #H0 elim (lpxs_nlleq_inv_step_sn … H … H0) -H -H0 -/4 width=5 by fpbu_fpbs_fpbg, fpbu_lpx, lpxs_lleq_fpbs/ -qed. - -lemma fpbs_fpbg: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ≡[0] ⦃G2, L2, T2⦄ ∨ - ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbs_ind … H) -G2 -L2 -T2 -[ /2 width=1 by or_introl/ -| #G #G2 #L #L2 #T #T2 #_ #H2 * #H1 elim (fpb_fpbu … H2) -H2 #H2 - [ /3 width=5 by fleq_trans, or_introl/ - | /5 width=5 by fpbc_fpbg, fleq_fpbc_trans, fpbu_fpbc, or_intror/ - | /3 width=5 by fpbg_fleq_trans, or_intror/ - | /4 width=5 by fpbg_strap1, fpbu_fpbc, or_intror/ - ] -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbg_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbg_lift.etc deleted file mode 100644 index 58ecd1200..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbg_lift.etc +++ /dev/null @@ -1,24 +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/reduction/fpbu_lift.ma". -include "basic_2/computation/fpbg.ma". - -(* "QRST" PARALLEL COMPUTATION FOR CLOSURES *********************************) - -(* Advanced properties ******************************************************) - -lemma sta_fpbg: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 → - ⦃G, L⦄ ⊢ T1 •*[h, 1] T2 → ⦃G, L, T1⦄ >≡[h, g] ⦃G, L, T2⦄. -/4 width=2 by fpbu_fpbg, sta_fpbu/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbs_fpbc.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbs_fpbc.etc deleted file mode 100644 index a88d51925..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/fpbs_fpbc.etc +++ /dev/null @@ -1,26 +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/reduction/fpbc.ma". -include "basic_2/computation/fpbs_fleq.ma". - -(* "QRST" PARALLEL COMPUTATION FOR CLOSURES *********************************) - -(* Properties on "qrst" proper parallel reduction for closures **************) - -lemma fpbc_fpbs: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 * -/3 width=5 by fpbu_fwd_fpb, fpbs_strap2, fleq_fpbs/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/lazybtpredproper_8.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/lazybtpredproper_8.etc deleted file mode 100644 index 6abdbeb59..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpbc/lazybtpredproper_8.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ≻≡ break [ term 46 h, break term 46 g ] break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'LazyBTPRedProper $h $g $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/bteq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/bteq.etc deleted file mode 100644 index c909e2ed6..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/bteq.etc +++ /dev/null @@ -1,46 +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/notation/relations/bteq_6.ma". -include "basic_2/grammar/lenv_length.ma". -include "basic_2/grammar/genv.ma". - -(* EQUIVALENT "BIG TREE" NORMAL FORMS ***************************************) - -definition bteq: tri_relation genv lenv term ≝ - λG1,L1,T1,G2,L2,T2. - ∧∧ G1 = G2 & |L1| = |L2| & T1 = T2. - -interpretation - "equivalent 'big tree' normal forms (closure)" - 'BTEq G1 L1 T1 G2 L2 T2 = (bteq G1 L1 T1 G2 L2 T2). - -(* Basic_properties *********************************************************) - -lemma bteq_refl: tri_reflexive … bteq. -/2 width=1 by and3_intro/ qed. - -lemma bteq_sym: tri_symmetric … bteq. -#G1 #G2 #L1 #L2 #T1 #T2 * // -qed-. - -lemma bteq_dec: ∀G1,G2,L1,L2,T1,T2. Decidable (⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄). -#G1 #G2 #L1 #L2 #T1 #T2 elim (genv_eq_dec G1 G2) -#H1G [2: @or_intror * #H2G #H2L #H2T destruct /2 width=1 by/ ] -elim (eq_nat_dec (|L1|) (|L2|)) -#H1L [2: @or_intror * #H2G #H2L #H2T destruct /2 width=1 by/ ] -elim (term_eq_dec T1 T2) -#H1T [2: @or_intror * #H2G #H2L #H2T destruct /2 width=1 by/ ] -/3 width=1 by and3_intro, or_introl/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/bteq_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/bteq_6.etc deleted file mode 100644 index 5ee962fe5..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/bteq_6.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ⋕ break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'BTEq $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/bteq_bteq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/bteq_bteq.etc deleted file mode 100644 index 7870b2644..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/bteq_bteq.etc +++ /dev/null @@ -1,31 +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/grammar/bteq.ma". - -(* EQUIVALENT "BIG TREE" NORMAL FORMS ***************************************) - -(* Main properties **********************************************************) - -theorem bteq_trans: tri_transitive … bteq. -#G1 #G #L1 #L #T1 #T * // -qed-. - -theorem bteq_canc_sn: ∀G,G1,G2,L,L1,L2,T,T1,T2. ⦃G, L, T⦄ ⋕ ⦃G1, L1, T1⦄ → - ⦃G, L, T⦄ ⋕ ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄. -/3 width=5 by bteq_trans, bteq_sym/ qed-. - -theorem bteq_canc_dx: ∀G1,G2,G,L1,L2,L,T1,T2,T. ⦃G1, L1, T1⦄ ⋕ ⦃G, L, T⦄ → - ⦃G2, L2, T2⦄ ⋕ ⦃G, L, T⦄ → ⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄. -/3 width=5 by bteq_trans, bteq_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/btpredsn_8.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/btpredsn_8.etc deleted file mode 100644 index 0350d1495..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/btpredsn_8.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ⊢ ⋕ ➡ break [ term 46 h , break term 46 g ] break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'BTPRedSn $h $g $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpb.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpb.etc deleted file mode 100644 index e6698349d..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpb.etc +++ /dev/null @@ -1,14 +0,0 @@ -include "basic_2/reduction/fpn.ma". - -(* Basic forward lemmas *****************************************************) - -lemma fpb_bteq_fwd_fpn: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≽[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊢ ➡[h, g] ⦃G2, L2, T2⦄. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 * -G2 -L2 -T2 /2 width=1 by and3_intro/ -[ #G2 #L2 #T2 #H elim (fquq_inv_gen … H) -H - [ #H1 #H2 elim (fqu_fwd_bteq … H1 H2) - | * #HG #HL #HT #_ destruct // - ] -| #T2 #HT12 * // -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpbc.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpbc.etc deleted file mode 100644 index 1ed366cdd..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpbc.etc +++ /dev/null @@ -1,24 +0,0 @@ -lemma fpb_fpbc_or_fpn: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≽[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ≻[h, g] ⦃G2, L2, T2⦄ ∨ - ⦃G1, L1, T1⦄ ⊢ ➡[h,g] ⦃G2, L2, T2⦄. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 * -G2 -L2 -T2 -/3 width=1 by and3_intro, or_intror/ -[ #G2 #L2 #T2 #H elim (fquq_inv_gen … H) -H [| * ] - /3 width=1 by fpbc_fqu, and3_intro, or_introl, or_intror/ -| #T2 #HT12 elim (eq_term_dec T1 T2) #H destruct - /4 width=1 by and3_intro, or_introl, or_intror, fpbc_cpx/ -] -qed-. - -lemma fpb_fpbc: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≽[h, g] ⦃G2, L2, T2⦄ → - (⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⊥) → - ⦃G1, L1, T1⦄ ≻[h, g] ⦃G2, L2, T2⦄. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H #H0 elim (fpb_fpbc_or_fpn … H) -H // -#H elim H0 -H0 /2 width=3 by fpn_fwd_bteq/ -qed. - -lemma fpbc_fwd_bteq: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≻[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⊥. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 * -G2 -L2 -T2 /2 width=8 by fqu_fwd_bteq/ -#T2 #_ #HT12 * /2 width=1 by/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpbs_conj.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpbs_conj.etc deleted file mode 100644 index 8d0f137df..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpbs_conj.etc +++ /dev/null @@ -1,34 +0,0 @@ -(* -inclade "basic_2/computation/fpns.ma". -inclade "basic_2/computation/fpbs.ma". -inclade "basic_2/reduction/fpbc.ma". - -lemma fpn_dec: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≽[h, g] ⦃G2, L2, T2⦄ → - Decidable (⦃G1, L1, T1⦄ ⊢ ➡[h, g] ⦃G2, L2, T2⦄). -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H elim (fpb_fpbc_or_fpn … H) -H /2 width=1 by or_introl/ -#H12 @or_intror -#H @(fpbc_fwd_bteq … H12) -H12 @(fpn_fwd_bteq … H) -qed-. -*) -(* -lemma fpns_dec: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ → - Decidable (⦃G1, L1, T1⦄ ⊢ ➡*[h, g] ⦃G2, L2, T2⦄). -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbs_ind … H) -G2 -L2 -T2 /2 width=1 by or_introl/ -#G #G2 #L #L2 #T #T2 #H #H2 * -#H1 elim (fpn_dec … H2) -H2 #H2 /3 width=5 by fpns_strap1, or_introl/ -[ @or_intror #H12 -| @or_intror #H12 @H1 -H1 -*) -(* -inclade "basic_2/grammar/bteq_bteq.ma". -inclade "basic_2/computation/fpns.ma". - -(* Advanced forward lemmas **************************************************) - -lemma fpbs_bteq_fwd_fpns: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊢ ➡*[h, g] ⦃G2, L2, T2⦄. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbs_ind … H) -G2 -L2 -T2 // -#G #G2 #L #L2 #T #T2 #H1 #H2 #IH1 #H12 elim (bteq_dec G1 G L1 L T1 T) -[ -H1 /4 width=10 by fpns_strap1, fpb_bteq_fwd_fpn, bteq_canc_sn/ -| -IH1 #H -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpn.etc deleted file mode 100644 index 406e6eb8e..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpn.etc +++ /dev/null @@ -1,39 +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/notation/relations/btpredsn_8.ma". -include "basic_2/relocation/lleq.ma". -include "basic_2/reduction/lpx.ma". - -(* REDUCTION FOR "BIG TREE" NORMAL FORMS ************************************) - -inductive fpn (h) (g) (G) (L1) (T): relation3 genv lenv term ≝ -| fpn_intro: ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → L1 ⋕[T] L2 → fpn h g G L1 T G L2 T -. - -interpretation - "reduction for 'big tree' normal forms (closure)" - 'BTPRedSn h g G1 L1 T1 G2 L2 T2 = (fpn h g G1 L1 T1 G2 L2 T2). - -(* Basic_properties *********************************************************) - -lemma fpn_refl: ∀h,g. tri_reflexive … (fpn h g). -/2 width=1 by fpn_intro/ qed. - -(* Basic inversion lemmas ***************************************************) - -lemma fpn_inv_gen: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊢ ⋕➡[h, g] ⦃G2, L2, T2⦄ → - ∧∧ G1 = G2 & ⦃G1, L1⦄ ⊢ ➡[h, g] L2 & L1 ⋕[T1] L2 & T1 = T2. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 * -G2 -L2 -T2 /2 width=1 by and4_intro/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpn_fpn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpn_fpn.etc deleted file mode 100644 index adda4b538..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpn_fpn.etc +++ /dev/null @@ -1,52 +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/reduction/lpx_lpx.ma". -include "basic_2/reduction/fpn.ma". - -(* REDUCTION FOR "BIG TREE" NORMAL FORMS ************************************) - -(* Advanced properties ******************************************************) - -lemma fpn_fqu_trans: ∀h,g,F1,G1,K1,L1,V1,T1. ⦃F1, K1, V1⦄ ⊢ ⋕➡[h, g] ⦃G1, L1, T1⦄ → - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ → - ∃∃F2,K2,V2. ⦃F1, K1, V1⦄ ⊃ ⦃F2, K2, V2⦄ & ⦃F2, K2, V2⦄ ⊢ ⋕➡[h, g] ⦃G2, L2, T2⦄. -#h #g #F1 #G1 #K1 #L1 #V1 #T1 * -G1 -L1 -T1 -#L1 #HKL1 #HV1 #G2 #L2 #T2 #H12 elim (lpx_lleq_fqu_trans … H12 … HKL1 HV1) -L1 -/3 width=5 by fpn_intro, ex2_3_intro/ -qed-. - -lemma fpn_fquq_trans: ∀h,g,F1,G1,K1,L1,V1,T1. ⦃F1, K1, V1⦄ ⊢ ⋕➡[h, g] ⦃G1, L1, T1⦄ → - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ → - ∃∃F2,K2,V2. ⦃F1, K1, V1⦄ ⊃⸮ ⦃F2, K2, V2⦄ & ⦃F2, K2, V2⦄ ⊢ ⋕➡[h, g] ⦃G2, L2, T2⦄. -#h #g #F1 #G1 #K1 #L1 #V1 #T1 * -G1 -L1 -T1 -#L1 #HKL1 #HV1 #G2 #L2 #T2 #H12 elim (lpx_lleq_fquq_trans … H12 … HKL1 HV1) -L1 -/3 width=5 by fpn_intro, ex2_3_intro/ -qed-. - -lemma fpn_fqup_trans: ∀h,g,F1,G1,K1,L1,V1,T1. ⦃F1, K1, V1⦄ ⊢ ⋕➡[h, g] ⦃G1, L1, T1⦄ → - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊃+ ⦃G2, L2, T2⦄ → - ∃∃F2,K2,V2. ⦃F1, K1, V1⦄ ⊃+ ⦃F2, K2, V2⦄ & ⦃F2, K2, V2⦄ ⊢ ⋕➡[h, g] ⦃G2, L2, T2⦄. -#h #g #F1 #G1 #K1 #L1 #V1 #T1 * -G1 -L1 -T1 -#L1 #HKL1 #HV1 #G2 #L2 #T2 #H12 elim (lpx_lleq_fqup_trans … H12 … HKL1 HV1) -L1 -/3 width=5 by fpn_intro, ex2_3_intro/ -qed-. - -lemma fpn_fqus_trans: ∀h,g,F1,G1,K1,L1,V1,T1. ⦃F1, K1, V1⦄ ⊢ ⋕➡[h, g] ⦃G1, L1, T1⦄ → - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊃* ⦃G2, L2, T2⦄ → - ∃∃F2,K2,V2. ⦃F1, K1, V1⦄ ⊃* ⦃F2, K2, V2⦄ & ⦃F2, K2, V2⦄ ⊢ ⋕➡[h, g] ⦃G2, L2, T2⦄. -#h #g #F1 #G1 #K1 #L1 #V1 #T1 * -G1 -L1 -T1 -#L1 #HKL1 #HV1 #G2 #L2 #T2 #H12 elim (lpx_lleq_fqus_trans … H12 … HKL1 HV1) -L1 -/3 width=5 by fpn_intro, ex2_3_intro/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpns.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpns.etc deleted file mode 100644 index 0a208fedf..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpns.etc +++ /dev/null @@ -1,58 +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/notation/relations/btpredsnstar_8.ma". -include "basic_2/reduction/fpn.ma". - -(* COMPUTATION FOR "BIG TREE" NORMAL FORMS **********************************) - -definition fpns: ∀h. sd h → tri_relation genv lenv term ≝ - λh,g. tri_TC … (fpn h g). - -interpretation - "computation for 'big tree' normal forms (closure)" - 'BTPRedSnStar h g G1 L1 T1 G2 L2 T2 = (fpns h g G1 L1 T1 G2 L2 T2). - -(* Basic eliminators ********************************************************) - -lemma fpns_ind: ∀h,g,G1,L1,T1. ∀R:relation3 …. R G1 L1 T1 → - (∀G,G2,L,L2,T,T2. ⦃G1, L1, T1⦄ ⊢ ⋕➡*[h, g] ⦃G, L, T⦄ → ⦃G, L, T⦄ ⊢ ⋕➡[h, g] ⦃G2, L2, T2⦄ → R G L T → R G2 L2 T2) → - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊢ ⋕➡*[h, g] ⦃G2, L2, T2⦄ → R G2 L2 T2. -#h #g #G1 #L1 #T1 #R #IH1 #IH2 #G2 #L2 #T2 #H -lapply (tri_TC_star_ind … IH1 IH2 G2 L2 T2 H) // -qed-. - -lemma fpns_ind_dx: ∀h,g,G2,L2,T2. ∀R:relation3 …. R G2 L2 T2 → - (∀G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ ⊢ ⋕➡[h, g] ⦃G, L, T⦄ → ⦃G, L, T⦄ ⊢ ⋕➡*[h, g] ⦃G2, L2, T2⦄ → R G L T → R G1 L1 T1) → - ∀G1,L1,T1. ⦃G1, L1, T1⦄ ⊢ ⋕➡*[h, g] ⦃G2, L2, T2⦄ → R G1 L1 T1. -#h #g #G2 #L2 #T2 #R #IH1 #IH2 #G1 #L1 #T1 #H -@(tri_TC_star_ind_dx … IH1 IH2 G1 L1 T1 H) // -qed-. - -(* Basic_properties *********************************************************) - -lemma fpns_refl: ∀h,g. tri_reflexive … (fpns h g). -/2 width=1 by tri_inj/ qed. - -lemma fpn_fpns: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊢ ⋕➡[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ⊢ ⋕➡*[h, g] ⦃G2, L2, T2⦄. -/2 width=1 by tri_inj/ qed. - -lemma fpns_strap1: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ⊢ ⋕➡*[h, g] ⦃G, L, T⦄ → - ⦃G, L, T⦄ ⊢ ⋕➡[h, g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊢ ⋕➡*[h, g] ⦃G2, L2, T2⦄. -/2 width=5 by tri_step/ qed-. - -lemma fpns_strap2: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ⊢ ⋕➡[h, g] ⦃G, L, T⦄ → - ⦃G, L, T⦄ ⊢ ⋕➡*[h, g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊢ ⋕➡*[h, g] ⦃G2, L2, T2⦄. -/2 width=5 by tri_TC_strap/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpns_fpns.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpns_fpns.etc deleted file mode 100644 index 5aaea6a9e..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fpns_fpns.etc +++ /dev/null @@ -1,74 +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/relocation/lleq_lleq.ma". -include "basic_2/computation/lpxs.ma". -include "basic_2/computation/fpns.ma". - -(* COMPUTATION FOR "BIG TREE" NORMAL FORMS **********************************) - -(* Advanced inversion lemmas ************************************************) - -lemma fpns_inv_gen: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊢ ⋕➡*[h, g] ⦃G2, L2, T2⦄ → - ∧∧ G1 = G2 & ⦃G1, L1⦄ ⊢ ➡*[h, g] L2 & L1 ⋕[T1] L2 & T1 = T2. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpns_ind … H) -G2 -L2 -T2 /2 width=1 by and4_intro/ -#G #G2 #L #L2 #T #T2 #_ #H2 * #HG #HL1 #HT1 #HT destruct -elim (fpn_inv_gen … H2) -H2 #HG #HL2 #HT #HT2 destruct -/3 width=3 by lpxs_strap1, lleq_trans, and4_intro/ -qed-. - -(* Advanced properties ******************************************************) - -lemma lpxs_lleq_fpns: ∀h,g,G,L1,L2,T. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → L1 ⋕[T] L2 → - ⦃G, L1, T⦄ ⊢ ⋕➡*[h, g] ⦃G, L2, T⦄. -#h #g #G #L1 #L2 #T #H @(lpxs_ind … H) -L2 // -#L #L2 #HL1 #HL2 #IHL1 #HL12 elim (lleq_dec T L1 L) #HT -[ -HL1 @fpns_strap1 [4: @IHL1 // |1,2,3: skip ] - /3 width=3 by fpn_intro, lleq_canc_sn/ -| -IHL1 - -(* Main properties **********************************************************) - -theorem fpns_trans: tri_transitive … fqus. -/2 width=5 by tri_TC_transitive/ qed-. - - -(* -lemma fpns_refl: ∀h,g. tri_reflexive … (fpns h g). -/2 width=1 by and3_intro/ qed. - -lemma fpn_fpns: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊢ ➡[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ⊢ ➡*[h, g] ⦃G2, L2, T2⦄. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 * /3 width=1 by lpx_lpxs, and3_intro/ -qed. - -lemma fpns_strap1: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ⊢ ➡*[h, g] ⦃G, L, T⦄ → - ⦃G, L, T⦄ ⊢ ➡[h, g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊢ ➡*[h, g] ⦃G2, L2, T2⦄. -#h #g #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 * #H1G #H1L #G1T * -/3 width=3 by lpxs_strap1, and3_intro/ -qed-. - -lemma fpns_strap2: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ⊢ ➡[h, g] ⦃G, L, T⦄ → - ⦃G, L, T⦄ ⊢ ➡*[h, g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊢ ➡*[h, g] ⦃G2, L2, T2⦄. -#h #g #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 * #H1G #H1L #G1T * -/3 width=3 by lpxs_strap2, and3_intro/ -qed-. - -(* Basic forward lemmas *****************************************************) - -lemma fpns_fwd_bteq: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊢ ➡*[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 * /3 width=4 by lpxs_fwd_length, and3_intro/ -qed-. -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fqu.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fqu.etc deleted file mode 100644 index 1e4defb3c..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fqu.etc +++ /dev/null @@ -1,14 +0,0 @@ -include "basic_2/grammar/bteq.ma". - -lemma fqu_fwd_bteq: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⊥. -#G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 -[ #I #G #L #V * #_ #H elim (plus_xSy_x_false … H) -| #I #G #L #V #T * #_ #_ #H elim (discr_tpair_xy_x … H) -| #a #I #G #L #V #T * #_ #_ #H elim (discr_tpair_xy_y … H) -| #I #G #L #V #T * #_ #_ #H elim (discr_tpair_xy_y … H) -| #G #L #K #T #U #e #HLK #_ * #_ #H - lapply (ldrop_fwd_length_lt4 … HLK ?) // >H -L #H - elim (lt_refl_false … H) -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fsb.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fsb.etc deleted file mode 100644 index 3cd6861ad..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fsb.etc +++ /dev/null @@ -1,12 +0,0 @@ -(* Basic eliminators ********************************************************) - -theorem fsb_ind_alt: ∀h,g. ∀R: relation3 …. ( - ∀G1,L1,T1. ⦃G1, L1⦄ ⊢ ⦥[h,g] T1 → ( - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≽[h, g] ⦃G2, L2, T2⦄ → - (⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⊥) → R G2 L2 T2 - ) → R G1 L1 T1 - ) → - ∀G,L,T. ⦃G, L⦄ ⊢ ⦥[h, g] T → R G L T. -#h #g #R #IH #G #L #T #H elim H -G -L -T -/5 width=1 by fpb_fpbc, fsb_intro/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fsb_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fsb_alt.etc deleted file mode 100644 index 8c69a001d..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/fsb_alt.etc +++ /dev/null @@ -1,105 +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/notation/relations/btsnalt_5.ma". -include "basic_2/computation/fpbs_fpbs.ma". -include "basic_2/computation/fsb.ma". - -(* "BIG TREE" STRONGLY NORMALIZING TERMS ************************************) - -(* Note: alternative definition of fsb *) -inductive fsba (h) (g): relation3 genv lenv term ≝ -| fsba_intro: ∀G1,L1,T1. ( - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ → - (⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⊥) → fsba h g G2 L2 T2 - ) → fsba h g G1 L1 T1. - -interpretation - "'big tree' strong normalization (closure) alternative" - 'BTSNAlt h g G L T = (fsba h g G L T). - -(* Basic eliminators ********************************************************) - -theorem fsba_ind_alt: ∀h,g. ∀R: relation3 …. ( - ∀G1,L1,T1. ⦃G1, L1⦄ ⊢ ⦥⦥[h,g] T1 → ( - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ → - (⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⊥) → R G2 L2 T2 - ) → R G1 L1 T1 - ) → - ∀G,L,T. ⦃G, L⦄ ⊢ ⦥⦥[h, g] T → R G L T. -#h #g #R #IH #G #L #T #H elim H -G -L -T -/5 width=1 by fsba_intro/ -qed-. - -(* Basic_properties *********************************************************) - -fact fsba_intro_aux: ∀h,g,G1,L1,T1. ( - ∀G,G2,L,L2,T,T2. ⦃G, L, T⦄ ≥[h, g] ⦃G2, L2, T2⦄ → - ⦃G1, L1, T1⦄ ⋕ ⦃G, L, T⦄ → - (⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⊥) → fsba h g G2 L2 T2 - ) → fsba h g G1 L1 T1. -/4 width=5 by fsba_intro/ qed-. - -lemma fsba_fpbs_trans: ∀h,g,G1,L1,T1. ⦃G1, L1⦄ ⊢ ⦥⦥[h, g] T1 → - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ → ⦃G2, L2⦄ ⊢ ⦥⦥[h, g] T2. -#h #g #G1 #L1 #T1 #H @(fsba_ind_alt … H) -G1 -L1 -T1 -#G1 #L1 #T1 #H0 #IH0 #G #L #T #H1 @fsba_intro -#G2 #L2 #T2 #H2 #_ lapply (fpbs_trans … H1 … H2) -G -L -T -#H12 elim (bteq_dec G1 G2 L1 L2 T1 T2) /3 width=6 by fpb_fpbs/ --IH0 #H212 - - - -H0 -H #H @(IH0 … H) -IH0 -H // @(fpbs_trans … H1 … H2) - -lemma fsba_intro_fpb: ∀h,g,G1,L1,T1. ( - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≽[h, g] ⦃G2, L2, T2⦄ → - (⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⊥) → ⦃G2, L2⦄ ⊢ ⦥⦥[h, g] T2 - ) → ⦃G1, L1⦄ ⊢ ⦥⦥[h, g] T1. -#h #g #G1 #L1 #T1 #IH1 @fsba_intro_aux -#G #G2 #L #L2 #T #T2 #H @(fpbs_ind_dx … H) -G -L -T -[ #H1 #H2 -IH1 elim H2 -H2 // -| #G0 #G #L0 #L #T0 #T #H10 #H12 #IH2 #H210 #H212 elim (bteq_dec G1 G L1 L T1 T) - [ -IH1 -H210 -H10 -H12 /3 width=1 by/ - | -IH2 -H212 #H21 lapply (IH1 … H21) -IH1 -H21 - [ - | -H10 -H210 #H -(* -(* Main inversion lemmas ****************************************************) - -theorem fsba_inv_fsb: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ ⦥⦥[h, g] T → ⦃G, L⦄ ⊢ ⦥[h, g] T. -#h #g #G #L #T #H elim H -G -L -T -/5 width=12 by fsb_intro, fpb_fpbs, fpbc_fwd_fpb, fpbc_fwd_gen/ -qed-. - -(* Main properties **********************************************************) - -theorem fsb_fsba: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ ⦥[h, g] T → ⦃G, L⦄ ⊢ ⦥⦥[h, g] T. -#h #g #G #L #T #H @(fsb_ind_alt … H) -G -L -T -/4 width=1 by fsba_intro_fpb/ -qed. -(* -| fsba_intro: ∀G1,L1,T1. ( - ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≻[h, g] ⦃G2, L2, T2⦄ → fsb h g G2 L2 T2 - ) → fsb h g G1 L1 T1 -. - - - -(****************************************************************************) - -include "basic_2/substitution/fqup.ma". - -lemma fsb_csx: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ ⬊*[h, g] T → ⦃G, L⦄ ⊢ ⦥[h, g] T. -#h #g #G #L #T #H @(csx_ind … H) -T -*)*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/lazyeq_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/lazyeq_6.etc deleted file mode 100644 index 105a47363..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpn/lazyeq_6.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ⋕ break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'LazyEq $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/cfpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/cfpr.etc deleted file mode 100644 index f58a52c37..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/cfpr.etc +++ /dev/null @@ -1,59 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( L ⊢ break ⦃ term 46 L1, break term 46 T1 ⦄ ➡ break ⦃ term 46 L2 , break term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'FocalizedPRed $L $L1 $T1 $L2 $T2 }. - -include "basic_2/reducibility/cpr.ma". -include "basic_2/reducibility/fpr.ma". - -(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON CLOSURES *************************) - -definition cfpr: lenv → bi_relation lenv term ≝ - λL,L1,T1,L2,T2. |L1| = |L2| ∧ L ⊢ L1 @@ T1 ➡ L2 @@ T2. - -interpretation - "context-sensitive parallel reduction (closure)" - 'FocalizedPRed L L1 T1 L2 T2 = (cfpr L L1 T1 L2 T2). - -(* Basic properties *********************************************************) - -lemma cfpr_refl: ∀L. bi_reflexive … (cfpr L). -/2 width=1/ qed. - -lemma fpr_cfpr: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ → ⋆ ⊢ ⦃L1, T1⦄ ➡ ⦃L2, T2⦄. -#L1 #L2 #T1 #T2 * /3 width=1/ -qed. - -(* Basic inversion lemmas ***************************************************) - -lemma cfpr_inv_atom1: ∀L,L2,T1,T2. L ⊢ ⦃⋆, T1⦄ ➡ ⦃L2, T2⦄ → L ⊢ T1 ➡ T2 ∧ L2 = ⋆. -#L #L2 #T1 #T2 * #H >(length_inv_zero_sn … H) /2 width=1/ -qed-. - -(* Advanced inversion lemmas ************************************************) - -lemma fpr_inv_pair1_sn: ∀I,K1,L2,V1,T1,T2. ⦃⋆.ⓑ{I}V1@@K1, T1⦄ ➡ ⦃L2, T2⦄ → - ∃∃K2,V2. V1 ➡ V2 & - ⋆.ⓑ{I}V2 ⊢ ⦃K1, T1⦄ ➡ ⦃K2, T2⦄ & - L2 = ⋆.ⓑ{I}V2@@K2. -#I1 #K1 #L2 #V1 #T1 #T2 * >append_length #H -elim (length_inv_pos_sn_append … H) -H #I2 #K2 #V2 #HK12 #H destruct ->shift_append_assoc >shift_append_assoc normalize in ⊢ (%→?); #H -elim (tpr_inv_bind1 … H) -H * -[ #V0 #T #T0 #HV10 #HT1 #HT0 #H destruct /5 width=5/ -| #T0 #_ #_ #H destruct -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/cfpr_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/cfpr_aaa.etc deleted file mode 100644 index 72802e499..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/cfpr_aaa.etc +++ /dev/null @@ -1,27 +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/reducibility/cpr_aaa.ma". -include "basic_2/reducibility/cfpr_cpr.ma". - -(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON CLOSURES *************************) - -(* Properties about atomic arity assignment on terms ************************) - -lemma aaa_fpr_conf: ∀L1,T1,A. L1 ⊢ T1 ⁝ A → - ∀L2,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ → L2 ⊢ T2 ⁝ A. -#L1 #T1 #A #HT1 #L2 #T2 #H -elim (fpr_inv_all … H) -H -/4 width=5 by aaa_cpr_conf, aaa_ltpr_conf, aaa_ltpss_sn_conf/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/cfpr_cfpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/cfpr_cfpr.etc deleted file mode 100644 index f442be28b..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/cfpr_cfpr.etc +++ /dev/null @@ -1,26 +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/reducibility/cpr_cpr.ma". -include "basic_2/reducibility/cfpr.ma". - -(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON CLOSURES *************************) - -(* Main properties **********************************************************) - -theorem cfpr_conf: ∀L. bi_confluent … (cfpr L). -#L #L0 #L1 #T0 #T1 * #HL01 #HT01 #L2 #T2 * >HL01 #HL12 #HT02 -elim (cpr_conf … HT01 HT02) -L0 -T0 #X #H1 #H2 -elim (cpr_fwd_shift1 … H1) #L0 #T0 #HL10 #H destruct /3 width=5/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/cfpr_cpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/cfpr_cpr.etc deleted file mode 100644 index a1e20a025..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/cfpr_cpr.etc +++ /dev/null @@ -1,64 +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/reducibility/cpr_tpss.ma". -include "basic_2/reducibility/cpr_cpr.ma". -include "basic_2/reducibility/cfpr_ltpss.ma". - -(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON CLOSURES *************************) - -(* Advanced properties ******************************************************) - -lemma fpr_all: ∀L1,L. L1 ➡ L → ∀L2,T1,T2. L ⊢ T1 ➡ T2 → - L ⊢ ▶* [0, |L|] L2 → ⦃L1, T1⦄ ➡ ⦃L2, T2⦄. -#L1 #L #H elim H -L1 -L -[ #L2 #T1 #T2 #HT12 #HL2 - lapply (ltpss_sn_inv_atom1 … HL2) -HL2 #H destruct - lapply (cpr_inv_atom … HT12) -HT12 /2 width=1/ -| #I #L1 #L #V1 #V #_ #HV1 #IH #X #T1 #T2 #HT12 #H - elim (ltpss_sn_inv_tpss21 … H ?) -H // append_length >append_length #H - lapply (injective_plus_r … H) -H #H - @(ex3_intro … (⋆.ⓑ{I}V@@Y)) append_length H -H >commutative_plus /3 width=1/ -] -qed-. - -lemma fpr_inv_all: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ → - ∃∃L. L1 ➡ L & L ⊢ T1 ➡ T2 & L ⊢ ▶* [0, |L|] L2. -#L1 #L2 #T1 #T2 #H -lapply (fpr_cfpr … H) -H #H -elim (cfpr_inv_all … H) -H /2 width=4/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/cfpr_ltpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/cfpr_ltpss.etc deleted file mode 100644 index 66e102e63..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/cfpr_ltpss.etc +++ /dev/null @@ -1,39 +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/reducibility/cpr_lift.ma". -include "basic_2/reducibility/cpr_ltpss_sn.ma". -include "basic_2/reducibility/cfpr.ma". - -(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON CLOSURES *************************) - -(* Advanced inversion lemmas ************************************************) - -lemma cfpr_inv_pair1: ∀I,L,K1,L2,V1,T1,T2. L ⊢ ⦃⋆.ⓑ{I}V1@@K1, T1⦄ ➡ ⦃L2, T2⦄ → - ∃∃K2,V,V2. V1 ➡ V & L ⊢ V ▶* [0, |L|] V2 & - L.ⓑ{I}V ⊢ ⦃K1, T1⦄ ➡ ⦃K2, T2⦄ & - L2 = ⋆.ⓑ{I}V2@@K2. -* #L #K1 #L2 #V1 #T1 #T2 * >append_length #H -elim (length_inv_pos_sn_append … H) -H #I2 #K2 #V2 #HK12 #H destruct ->shift_append_assoc >shift_append_assoc normalize in ⊢ (??%%→?); #H -[ elim (cpr_inv_abbr1 … H) -H * - [ #V #V0 #T0 #HV1 #HV0 #HT10 #H destruct /3 width=7/ - | #T0 #_ #_ #H destruct - ] -| elim (cpr_inv_abst1 … H Abst V2) -H - #V #T * #V0 #HV10 #HV0 #HT1 #H destruct - lapply (ltpss_sn_cpr_trans (L.ⓛV0) … 0 (|L|+1) … HT1) -HT1 /2 width=1/ #HT12 - /3 width=7/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpc.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpc.etc deleted file mode 100644 index ee362471b..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpc.etc +++ /dev/null @@ -1,48 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( ⦃ term 46 L1 , break term 46 T1 ⦄ ⬌ break ⦃ term 46 L2 , break term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'FocalizedPConv $L1 $T1 $L2 $T2 }. - -notation "hvbox( ⦃ term 46 L1 , break term 46 T1 ⦄ ⬌ ⬌ break ⦃ term 46 L2 , break term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'FocalizedPConvAlt $L1 $T1 $L2 $T2 }. - -include "basic_2/reducibility/fpr.ma". - -(* CONTEXT-FREE PARALLEL CONVERSION ON CLOSURES *****************************) - -definition fpc: bi_relation lenv term ≝ - λL1,T1,L2,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ ∨ ⦃L2, T2⦄ ➡ ⦃L1, T1⦄. - -interpretation - "context-free parallel conversion (closure)" - 'FocalizedPConv L1 T1 L2 T2 = (fpc L1 T1 L2 T2). - -(* Basic properties *********************************************************) - -lemma fpc_refl: bi_reflexive … fpc. -/2 width=1/ qed. - -lemma fpc_sym: bi_symmetric … fpc. -#L1 #L2 #T1 #T2 * /2 width=1/ -qed. - -(* Basic forward lemmas *****************************************************) - -lemma fpc_fwd_fpr: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⬌ ⦃L2, T2⦄ → - ∃∃L,T. ⦃L1, T1⦄ ➡ ⦃L, T⦄ & ⦃L2, T2⦄ ➡ ⦃L, T⦄. -#L1 #L2 #T1 #T2 * /2 width=4/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpc_fpc.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpc_fpc.etc deleted file mode 100644 index 22fc16f37..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpc_fpc.etc +++ /dev/null @@ -1,24 +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/conversion/fpc.ma". - -(* CONTEXT-FREE PARALLEL CONVERSION ON CLOSURES *****************************) - -(* Main properties **********************************************************) - -theorem fpc_conf: ∀L0,L1,T0,T1. ⦃L0, T0⦄ ⬌ ⦃L1, T1⦄ → - ∀L2,T2. ⦃L0, T0⦄ ⬌ ⦃L2, T2⦄ → - ∃∃L,T. ⦃L1, T1⦄ ⬌ ⦃L, T⦄ & ⦃L2, T2⦄ ⬌ ⦃L, T⦄. -/3 width=4/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpcs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpcs.etc deleted file mode 100644 index 68c946ce8..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpcs.etc +++ /dev/null @@ -1,84 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( ⦃ term 46 L1 , break term 46 T1 ⦄ ⬌ * break ⦃ term 46 L2 , break term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'FocalizedPConvStar $L1 $T1 $L2 $T2 }. - -notation "hvbox( ⦃ term 46 L1 , break term 46 T1 ⦄ ⬌ ⬌ * break ⦃ term 46 L2 , break term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'FocalizedPConvStarAlt $L1 $T1 $L2 $T2 }. - -include "basic_2/conversion/fpc.ma". - -(* CONTEXT-FREE PARALLEL EQUIVALENCE ON CLOSURES ****************************) - -definition fpcs: bi_relation lenv term ≝ bi_TC … fpc. - -interpretation "context-free parallel equivalence (closure)" - 'FocalizedPConvStar L1 T1 L2 T2 = (fpcs L1 T1 L2 T2). - -(* Basic eliminators ********************************************************) - -lemma fpcs_ind: ∀L1,T1. ∀R:relation2 lenv term. R L1 T1 → - (∀L,L2,T,T2. ⦃L1, T1⦄ ⬌* ⦃L, T⦄ → ⦃L, T⦄ ⬌ ⦃L2, T2⦄ → R L T → R L2 T2) → - ∀L2,T2. ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄ → R L2 T2. -/3 width=7 by bi_TC_star_ind/ qed-. - -lemma fpcs_ind_dx: ∀L2,T2. ∀R:relation2 lenv term. R L2 T2 → - (∀L1,L,T1,T. ⦃L1, T1⦄ ⬌ ⦃L, T⦄ → ⦃L, T⦄ ⬌* ⦃L2, T2⦄ → R L T → R L1 T1) → - ∀L1,T1. ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄ → R L1 T1. -/3 width=7 by bi_TC_star_ind_dx/ qed-. - -(* Basic properties *********************************************************) - -lemma fpcs_refl: bi_reflexive … fpcs. -/2 width=1/ qed. - -lemma fpcs_sym: bi_symmetric … fpcs. -/3 width=1/ qed. - -lemma fpc_fpcs: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⬌ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -/2 width=1/ qed. - -lemma fpcs_strap1: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ⬌* ⦃L, T⦄ → ⦃L, T⦄ ⬌ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -/2 width=4/ qed. - -lemma fpcs_strap2: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ⬌ ⦃L, T⦄ → ⦃L, T⦄ ⬌* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -/2 width=4/ qed. - -lemma fpcs_fpr_dx: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -/3 width=1/ qed. - -lemma fpcs_fpr_sn: ∀L1,L2,T1,T2. ⦃L2, T2⦄ ➡ ⦃L1, T1⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -/3 width=1/ qed. - -lemma fpcs_fpr_strap1: ∀L1,L,T1,T. ⦃L1, T1⦄ ⬌* ⦃L, T⦄ → - ∀L2,T2. ⦃L, T⦄ ➡ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -/3 width=4/ qed. - -lemma fpcs_fpr_strap2: ∀L1,L,T1,T. ⦃L1, T1⦄ ➡ ⦃L, T⦄ → - ∀L2,T2. ⦃L, T⦄ ⬌* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -/3 width=4/ qed. - -lemma fpcs_fpr_div: ∀L1,L,T1,T. ⦃L1, T1⦄ ⬌* ⦃L, T⦄ → - ∀L2,T2. ⦃L2, T2⦄ ➡ ⦃L, T⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -/3 width=4/ qed. - -lemma fpr_div: ∀L1,L,T1,T. ⦃L1, T1⦄ ➡ ⦃L, T⦄ → ∀L2,T2. ⦃L2, T2⦄ ➡ ⦃L, T⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -/3 width=4/ qed-. - -lemma fpcs_fpr_conf: ∀L1,L,T1,T. ⦃L, T⦄ ➡ ⦃L1, T1⦄ → - ∀L2,T2. ⦃L, T⦄ ⬌* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -/3 width=4/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpcs_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpcs_aaa.etc deleted file mode 100644 index 9f4327bff..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpcs_aaa.etc +++ /dev/null @@ -1,30 +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/computation/fprs_aaa.ma". -include "basic_2/equivalence/fpcs_fpcs.ma". - -(* CONTEXT-FREE PARALLEL EQUIVALENCE ON CLOSURES ****************************) - -(* Main properties about atomic arity assignment on terms *******************) - -theorem aaa_fpcs_mono: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄ → - ∀A1. L1 ⊢ T1 ⁝ A1 → ∀A2. L2 ⊢ T2 ⁝ A2 → - A1 = A2. -#L1 #L2 #T1 #T2 #H12 #A1 #HT1 #A2 #HT2 -elim (fpcs_inv_fprs … H12) -H12 #L #T #H1 #H2 -lapply (aaa_fprs_conf … HT1 … H1) -L1 -T1 #HT1 -lapply (aaa_fprs_conf … HT2 … H2) -L2 -T2 #HT2 -lapply (aaa_mono … HT1 … HT2) -L -T // -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpcs_cpcs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpcs_cpcs.etc deleted file mode 100644 index b1288f751..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpcs_cpcs.etc +++ /dev/null @@ -1,86 +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/computation/fprs_cprs.ma". -include "basic_2/equivalence/cpcs_cpcs.ma". -include "basic_2/equivalence/fpcs_fpcs.ma". - -(* CONTEXT-FREE PARALLEL EQUIVALENCE ON CLOSURES ****************************) - -(* Advanced properties ******************************************************) - -lemma fpcs_flat_dx_tpr: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄ → ∀V1,V2. V1 ➡ V2 → - ∀I. ⦃L1, ⓕ{I}V1.T1⦄ ⬌* ⦃L2, ⓕ{I}V2.T2⦄. -#L1 #L2 #T1 #T2 #HT12 -elim (fpcs_inv_fprs … HT12) -HT12 -/3 width=6 by fprs_flat_dx_tpr, fprs_div/ (**) (* auto too slow without trace *) -qed. - -lemma fpcs_shift: ∀I,L1,L2,V1,V2,T1,T2. ⦃L1, -ⓑ{I}V1.T1⦄ ⬌* ⦃L2, -ⓑ{I}V2.T2⦄ → - ⦃L1.ⓑ{I}V1, T1⦄ ⬌* ⦃L2.ⓑ{I}V2, T2⦄. -#I #L1 #L2 #V1 #V2 #T1 #T2 #H12 -elim (fpcs_inv_fprs … H12) -H12 #L #T #H1 #H2 -elim (fprs_bind2_minus … H1) -H1 #W1 #U1 #HTU1 #H destruct -elim (fprs_bind2_minus … H2) -H2 #W2 #U2 #HTU2 #H destruct /2 width=4/ -qed. - -(* Advanced inversion lemmas ************************************************) - -lemma fpcs_inv_shift: ∀I,L1,L2,V1,V2,T1,T2. ⦃L1.ⓑ{I}V1, T1⦄ ⬌* ⦃L2.ⓑ{I}V2, T2⦄ → - ⦃L1, -ⓑ{I}V1.T1⦄ ⬌* ⦃L2, -ⓑ{I}V2.T2⦄. -#I #L1 #L2 #V1 #V2 #T1 #T2 #H12 -elim (fpcs_inv_fprs … H12) -H12 #L #T #H1 #H2 -elim (fprs_inv_pair1 … H1) -H1 #K1 #U1 #_ #HTU1 #H destruct -elim (fprs_inv_pair1 … H2) -H2 #K2 #U2 #_ #HTU2 #H destruct /2 width=4/ -qed-. - -(* Advanced forward lemmas **************************************************) - -lemma fpcs_fwd_bind_minus: ∀I,L1,L2,V1,V2,T1,T2. ⦃L1, -ⓑ{I}V1.T1⦄ ⬌* ⦃L2, -ⓑ{I}V2.T2⦄ → - ∀b. ⦃L1, ⓑ{b,I}V1.T1⦄ ⬌* ⦃L2, ⓑ{b,I}V2.T2⦄. -#I #L1 #L2 #V1 #V2 #T1 #T2 #H12 #b -elim (fpcs_inv_fprs … H12) -H12 #L #T #H1 #H2 -elim (fprs_fwd_bind2_minus … H1 b) -H1 #W1 #U1 #HTU1 #H destruct -elim (fprs_fwd_bind2_minus … H2 b) -H2 #W2 #U2 #HTU2 #H destruct /2 width=4/ -qed-. - -lemma fpcs_fwd_shift: ∀I,L1,L2,V1,V2,T1,T2. ⦃L1.ⓑ{I}V1, T1⦄ ⬌* ⦃L2.ⓑ{I}V2, T2⦄ → - ∀b. ⦃L1, ⓑ{b,I}V1.T1⦄ ⬌* ⦃L2, ⓑ{b,I}V2.T2⦄. -/3 width=1 by fpcs_inv_shift, fpcs_fwd_bind_minus/ qed-. - -lemma fpcs_fwd_abst24: ∀a,L1,L2,V1,V2,T1,T2. ⦃L1, ⓛ{a}V1.T1⦄ ⬌* ⦃L2, ⓛ{a}V2.T2⦄ → - ∀b,I,W. ⦃L1, ⓑ{b,I}W.T1⦄ ⬌* ⦃L2, ⓑ{b,I}W.T2⦄. -#a #L1 #L2 #V1 #V2 #T1 #T2 #H12 #b #I #W -elim (fpcs_inv_fprs … H12) -H12 #L #U #H1 #H2 -elim (fprs_fwd_abst2 … H1 b I W) -H1 #W1 #U1 #HTU1 #H destruct -elim (fprs_fwd_abst2 … H2 b I W) -H2 #W2 #U2 #HTU2 #H destruct /2 width=4/ -qed-. - -lemma fpcs_fwd_abst13: ∀L1,L2,V1,V2,T1,T2. ⦃L1.ⓛV1, T1⦄ ⬌* ⦃L2.ⓛV2, T2⦄ → - ∀I,W. ⦃L1.ⓑ{I}W, T1⦄ ⬌* ⦃L2.ⓑ{I}W, T2⦄. -/4 width=4 by fpcs_fwd_shift, fpcs_fwd_abst24, fpcs_shift/ qed-. - -(* Properties on context-sensitive parallel equivalence for terms ***********) - -lemma cpcs_fpcs: ∀L,T1,T2. L ⊢ T1 ⬌* T2 → ⦃L, T1⦄ ⬌* ⦃L, T2⦄. -#L #T1 #T2 #H -elim (cpcs_inv_cprs … H) -H /3 width=4 by fprs_div, cprs_fprs/ (**) (* too slow without trace *) -qed. - -(* Inversion lemmas on context-sensitive parallel equivalence for terms *****) - -lemma fpcs_inv_cpcs: ∀L,T1,T2. ⦃L, T1⦄ ⬌* ⦃L, T2⦄ → L ⊢ T1 ⬌* T2. -#L #T1 #T2 #H -elim (fpcs_inv_fprs … H) -H /3 width=4 by cprs_div, fprs_fwd_cprs/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpcs_fpcs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpcs_fpcs.etc deleted file mode 100644 index 270e8dc40..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpcs_fpcs.etc +++ /dev/null @@ -1,66 +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/computation/fprs_fprs.ma". -include "basic_2/conversion/fpc_fpc.ma". -include "basic_2/equivalence/fpcs_fprs.ma". - -(* CONTEXT-FREE PARALLEL EQUIVALENCE ON CLOSURES ****************************) - -(* Advanced inversion lemmas ************************************************) - -lemma fpcs_inv_fprs: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄ → - ∃∃L,T. ⦃L1, T1⦄ ➡* ⦃L, T⦄ & ⦃L2, T2⦄ ➡* ⦃L, T⦄. -#L1 #L2 #T1 #T2 #H @(fpcs_ind … H) -L2 -T2 -[ /3 width=4/ -| #L #L2 #T #T2 #_ #HT2 * #L0 #T0 #HT10 elim HT2 -HT2 #HT2 #HT0 - [ elim (fprs_strip … HT2 … HT0) -L -T #L #T #HT2 #HT0 - lapply (fprs_strap1 … HT10 … HT0) -L0 -T0 /2 width=4/ - | lapply (fprs_strap2 … HT2 … HT0) -L -T /2 width=4/ - ] -] -qed-. - -(* Advanced properties ******************************************************) - -lemma fpr_fprs_conf: ∀L,L1,L2,T,T1,T2. ⦃L, T⦄ ➡* ⦃L1, T1⦄ → ⦃L, T⦄ ➡ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -#L #L1 #L2 #T #T1 #T2 #HT1 #HT2 -elim (fprs_strip … HT2 … HT1) /2 width=4 by fpr_fprs_div/ -qed-. - -lemma fprs_fpr_conf: ∀L,L1,L2,T,T1,T2. ⦃L, T⦄ ➡* ⦃L1, T1⦄ → ⦃L, T⦄ ➡ ⦃L2, T2⦄ → ⦃L2, T2⦄ ⬌* ⦃L1, T1⦄. -#L #L1 #L2 #T #T1 #T2 #HT1 #HT2 -elim (fprs_strip … HT2 … HT1) /2 width=4 by fprs_fpr_div/ -qed-. - -lemma fprs_conf: ∀L,L1,L2,T,T1,T2. ⦃L, T⦄ ➡* ⦃L1, T1⦄ → ⦃L, T⦄ ➡* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -#L #L1 #L2 #T #T1 #T2 #HT1 #HT2 -elim (fprs_conf … HT1 … HT2) /2 width=4/ -qed-. - -lemma fpcs_strip: ∀L0,L1,T0,T1. ⦃L0, T0⦄ ⬌ ⦃L1, T1⦄ → - ∀L2,T2. ⦃L0, T0⦄ ⬌* ⦃L2, T2⦄ → - ∃∃L,T. ⦃L1, T1⦄ ⬌* ⦃L, T⦄ & ⦃L2, T2⦄ ⬌ ⦃L, T⦄. -/3 width=4/ qed. - -(* Main properties **********************************************************) - -theorem fpcs_trans: bi_transitive … fpcs. -/2 width=4/ qed. - -theorem fpcs_canc_sn: ∀L,L1,L2,T,T1,T2. ⦃L, T⦄ ⬌* ⦃L1, T1⦄ → ⦃L, T⦄ ⬌* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -/3 width=4 by fpcs_trans, fpcs_sym/ qed. (**) (* /3 width=3/ is too slow *) - -theorem fpcs_canc_dx: ∀L1,L2,L,T1,T2,T. ⦃L1, T1⦄ ⬌* ⦃L, T⦄ → ⦃L2, T2⦄ ⬌* ⦃L, T⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -/3 width=4 by fpcs_trans, fpcs_sym/ qed. (**) (* /3 width=3/ is too slow *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpcs_fprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpcs_fprs.etc deleted file mode 100644 index 43239eadd..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpcs_fprs.etc +++ /dev/null @@ -1,55 +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/computation/fprs.ma". -include "basic_2/equivalence/fpcs.ma". - -(* CONTEXT-FREE PARALLEL EQUIVALENCE ON CLOSURES ****************************) - -(* Properties on context-free parallel computation for closures *************) - -(* Note: was lemma 1000 *) -lemma fpcs_fprs_dx: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -#L1 #L2 #T1 #T2 #H @(fprs_ind … H) -L2 -T2 /width=1/ /3 width=4/ -qed. - -lemma fpcs_fprs_sn: ∀L1,L2,T1,T2. ⦃L2, T2⦄ ➡* ⦃L1, T1⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -#L1 #L2 #T1 #T2 #H @(fprs_ind_dx … H) -L2 -T2 /width=1/ /3 width=4/ -qed. - -lemma fpcs_fprs_strap1: ∀L1,L,T1,T. ⦃L1, T1⦄ ⬌* ⦃L, T⦄ → ∀L2,T2. ⦃L, T⦄ ➡* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -#L1 #L #T1 #T #HT1 #L2 #T2 #H @(fprs_ind … H) -L2 -T2 /width=1/ /2 width=4/ -qed. - -lemma fpcs_fprs_strap2: ∀L1,L,T1,T. ⦃L1, T1⦄ ➡* ⦃L, T⦄ → ∀L2,T2. ⦃L, T⦄ ⬌* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -#L1 #L #T1 #T #H #L2 #T2 #HT2 @(fprs_ind_dx … H) -L1 -T1 /width=1/ /2 width=4/ -qed. - -lemma fpcs_fprs_div: ∀L1,L,T1,T. ⦃L1, T1⦄ ⬌* ⦃L, T⦄ → ∀L2,T2. ⦃L2, T2⦄ ➡* ⦃L, T⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -#L1 #L #T1 #T #HT1 #L2 #T2 #H @(fprs_ind_dx … H) -L2 -T2 /width=1/ /2 width=4/ -qed. - -lemma fpcs_fprs_conf: ∀L1,L,T1,T. ⦃L, T⦄ ➡* ⦃L1, T1⦄ → ∀L2,T2. ⦃L, T⦄ ⬌* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -#L1 #L #T1 #T #H #T2 #HT2 @(fprs_ind … H) -L1 -T1 /width=1/ /3 width=4 by fpcs_fpr_conf/ (**) (* /2 width=4/ does not work *) -qed. - -lemma fprs_div: ∀L1,L,T1,T. ⦃L1, T1⦄ ➡* ⦃L, T⦄ → ∀L2,T2. ⦃L2, T2⦄ ➡* ⦃L, T⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -#L1 #L #T1 #T #HT1 #T2 #L2 #H @(fprs_ind_dx … H) -L2 -T2 /2 width=1/ /2 width=4/ -qed. - -lemma fprs_fpr_div: ∀L1,L,T1,T. ⦃L1, T1⦄ ➡* ⦃L, T⦄ → ∀L2,T2. ⦃L2, T2⦄ ➡ ⦃L, T⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -/3 width=7 by bi_step, fprs_div/ qed-. - -lemma fpr_fprs_div: ∀L1,L,T1,T. ⦃L1, T1⦄ ➡ ⦃L, T⦄ → ∀L2,T2. ⦃L2, T2⦄ ➡* ⦃L, T⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. -/3 width=4 by bi_step, fprs_div/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpr.etc deleted file mode 100644 index 3bb168f9e..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpr.etc +++ /dev/null @@ -1,68 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( ⦃ term 46 L1, break term 46 T1 ⦄ ➡ break ⦃ term 46 L2 , break term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'FocalizedPRed $L1 $T1 $L2 $T2 }. - -include "basic_2/reducibility/tpr.ma". - -(* CONTEXT-FREE PARALLEL REDUCTION ON CLOSURES ******************************) - -definition fpr: bi_relation lenv term ≝ - λL1,T1,L2,T2. |L1| = |L2| ∧ L1 @@ T1 ➡ L2 @@ T2. - -interpretation - "context-free parallel reduction (closure)" - 'FocalizedPRed L1 T1 L2 T2 = (fpr L1 T1 L2 T2). - -(* Basic properties *********************************************************) - -lemma fpr_refl: bi_reflexive … fpr. -/2 width=1/ qed. - -lemma fpr_shift: ∀I1,I2,L1,L2,V1,V2,T1,T2. - ⦃L1, -ⓑ{I1}V1.T1⦄ ➡ ⦃L2, -ⓑ{I2}V2.T2⦄ → - ⦃L1.ⓑ{I1}V1, T1⦄ ➡ ⦃L2.ⓑ{I2}V2, T2⦄. -#I1 #I2 #L1 #L2 #V1 #V2 #T1 #T2 * #HL12 #HT12 -@conj // normalize // (**) (* explicit constructor *) -qed. - -(* Basic inversion lemmas ***************************************************) - -lemma fpr_inv_atom1: ∀L2,T1,T2. ⦃⋆, T1⦄ ➡ ⦃L2, T2⦄ → T1 ➡ T2 ∧ L2 = ⋆. -#L2 #T1 #T2 * #H -lapply (length_inv_zero_sn … H) -H #H destruct /2 width=1/ -qed-. - -lemma fpr_inv_atom3: ∀L1,T1,T2. ⦃L1,T1⦄ ➡ ⦃⋆,T2⦄ → T1 ➡ T2 ∧ L1 = ⋆. -#L1 #T1 #T2 * #H -lapply (length_inv_zero_dx … H) -H #H destruct /2 width=1/ -qed-. - -(* Basic forward lemmas *****************************************************) - -lemma fpr_fwd_pair1: ∀I1,K1,L2,V1,T1,T2. ⦃K1.ⓑ{I1}V1, T1⦄ ➡ ⦃L2, T2⦄ → - ∃∃I2,K2,V2. ⦃K1, -ⓑ{I1}V1.T1⦄ ➡ ⦃K2, -ⓑ{I2}V2.T2⦄ & - L2 = K2.ⓑ{I2}V2. -#I1 #K1 #L2 #V1 #T1 #T2 * #H -elim (length_inv_pos_sn … H) -H #I2 #K2 #V2 #HK12 #H destruct /3 width=5/ -qed-. - -lemma fpr_fwd_pair3: ∀I2,L1,K2,V2,T1,T2. ⦃L1, T1⦄ ➡ ⦃K2.ⓑ{I2}V2, T2⦄ → - ∃∃I1,K1,V1. ⦃K1, -ⓑ{I1}V1.T1⦄ ➡ ⦃K2, -ⓑ{I2}V2.T2⦄ & - L1 = K1.ⓑ{I1}V1. -#I2 #L1 #K2 #V2 #T1 #T2 * #H -elim (length_inv_pos_dx … H) -H #I1 #K1 #V1 #HK12 #H destruct /3 width=5/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpr_cpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpr_cpr.etc deleted file mode 100644 index baa630f5b..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpr_cpr.etc +++ /dev/null @@ -1,125 +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/reducibility/cfpr_cpr.ma". - -(* CONTEXT-FREE PARALLEL REDUCTION ON CLOSURES ******************************) - -(* Properties on context-sensitive parallel reduction for terms *************) - -lemma ltpr_tpr_fpr: ∀L1,L2. L1 ➡ L2 → ∀T1,T2. T1 ➡ T2 → ⦃L1, T1⦄ ➡ ⦃L2, T2⦄. -/3 width=4/ qed. - -lemma cpr_fpr: ∀L,T1,T2. L ⊢ T1 ➡ T2 → ⦃L, T1⦄ ➡ ⦃L, T2⦄. -/2 width=4/ qed. - -lemma fpr_lift: ∀K1,K2,T1,T2. ⦃K1, T1⦄ ➡ ⦃K2, T2⦄ → - ∀d,e,L1. ⇩[d, e] L1 ≡ K1 → - ∀U1,U2. ⇧[d, e] T1 ≡ U1 → ⇧[d, e] T2 ≡ U2 → - ∃∃L2. ⦃L1, U1⦄ ➡ ⦃L2, U2⦄ & ⇩[d, e] L2 ≡ K2. -#K1 #K2 #T1 #T2 #HT12 #d #e #L1 #HLK1 #U1 #U2 #HTU1 #HTU2 -elim (fpr_inv_all … HT12) -HT12 #K #HK1 #HT12 #HK2 -elim (ldrop_ltpr_trans … HLK1 … HK1) -K1 #L #HL1 #HLK -lapply (cpr_lift … HLK … HTU1 … HTU2 HT12) -T1 -T2 #HU12 -elim (le_or_ge (|K|) d) #Hd -[ elim (ldrop_ltpss_sn_trans_ge … HLK … HK2 …) -| elim (ldrop_ltpss_sn_trans_be … HLK … HK2 …) -] // -Hd #L2 #HL2 #HLK2 -lapply (ltpss_sn_weak_full … HL2) -K /3 width=4/ -qed-. - -(* Advanced properties ******************************************************) - -lemma fpr_flat_dx: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ → ∀V1,V2. V1 ➡ V2 → - ∀I. ⦃L1, ⓕ{I}V1.T1⦄ ➡ ⦃L2, ⓕ{I}V2.T2⦄. -#L1 #L2 #T1 #T2 #HT12 -elim (fpr_inv_all … HT12) -HT12 /4 width=4/ -qed. - -lemma fpr_bind_sn: ∀L1,L2,V1,V2. ⦃L1, V1⦄ ➡ ⦃L2, V2⦄ → ∀T1,T2. T1 ➡ T2 → - ∀a,I. ⦃L1, ⓑ{a,I}V1.T1⦄ ➡ ⦃L2, ⓑ{a,I}V2.T2⦄. -#L1 #L2 #V1 #V2 #H #T1 #T2 #HT12 #a #I -elim (fpr_inv_all … H) /3 width=4/ -qed. - -lemma fpr_bind2_minus: ∀I,L1,L2,V1,T1,U2. ⦃L1, -ⓑ{I}V1.T1⦄ ➡ ⦃L2, U2⦄ → - ∃∃V2,T2. ⦃L1.ⓑ{I}V1, T1⦄ ➡ ⦃L2.ⓑ{I}V2, T2⦄ & - U2 = -ⓑ{I}V2.T2. -#I1 #L1 #L2 #V1 #T1 #U2 #H -elim (fpr_inv_all … H) -H #L #HL1 #H #HL2 -elim (cpr_fwd_bind1_minus … H false) -H /4 width=4/ -qed-. - -(* Advanced forward lemmas **************************************************) - -lemma fpr_fwd_bind2_minus: ∀I,L1,L,V1,T1,T. ⦃L1, -ⓑ{I}V1.T1⦄ ➡ ⦃L, T⦄ → ∀b. - ∃∃V2,T2. ⦃L1, ⓑ{b,I}V1.T1⦄ ➡ ⦃L, ⓑ{b,I}V2.T2⦄ & - T = -ⓑ{I}V2.T2. -#I #L1 #L #V1 #T1 #T #H1 #b -elim (fpr_inv_all … H1) -H1 #L0 #HL10 #HT1 #HL0 -elim (cpr_fwd_bind1_minus … HT1 b) -HT1 /3 width=4/ -qed-. - -lemma fpr_fwd_shift_bind_minus: ∀I1,I2,L1,L2,V1,V2,T1,T2. - ⦃L1, -ⓑ{I1}V1.T1⦄ ➡ ⦃L2, -ⓑ{I2}V2.T2⦄ → - ⦃L1, V1⦄ ➡ ⦃L2, V2⦄ ∧ I1 = I2. -* #I2 #L1 #L2 #V1 #V2 #T1 #T2 #H -elim (fpr_inv_all … H) -H #L #HL1 #H #HL2 -[ elim (cpr_inv_abbr1 … H) -H * - [ #V #V0 #T #HV1 #HV0 #_ #H destruct /4 width=4/ - | #T #_ #_ #H destruct - ] -| elim (cpr_inv_abst1 … H Abst V2) -H - #V #T #HV1 #_ #H destruct /3 width=4/ -] -qed-. - -lemma fpr_fwd_abst2: ∀a,L1,L2,V1,T1,U2. ⦃L1, ⓛ{a}V1.T1⦄ ➡ ⦃L2, U2⦄ → ∀b,I,W. - ∃∃V2,T2. ⦃L1, ⓑ{b,I}W.T1⦄ ➡ ⦃L2, ⓑ{b,I}W.T2⦄ & - U2 = ⓛ{a}V2.T2. -#a #L1 #L2 #V1 #T1 #U2 #H -elim (fpr_inv_all … H) #L #HL1 #H #HL2 #b #I #W -elim (cpr_fwd_abst1 … H b I W) -H /3 width=4/ -qed-. - -(* Advanced inversion lemmas ************************************************) - -lemma fpr_inv_pair1: ∀I,K1,L2,V1,T1,T2. ⦃K1.ⓑ{I}V1, T1⦄ ➡ ⦃L2, T2⦄ → - ∃∃K2,V2. ⦃K1, V1⦄ ➡ ⦃K2, V2⦄ & - ⦃K1, -ⓑ{I}V1.T1⦄ ➡ ⦃K2, -ⓑ{I}V2.T2⦄ & - L2 = K2.ⓑ{I}V2. -#I1 #K1 #X #V1 #T1 #T2 #H -elim (fpr_fwd_pair1 … H) -H #I2 #K2 #V2 #HT12 #H destruct -elim (fpr_fwd_shift_bind_minus … HT12) #HV12 #H destruct /2 width=5/ -qed-. - -lemma fpr_inv_pair3: ∀I,L1,K2,V2,T1,T2. ⦃L1, T1⦄ ➡ ⦃K2.ⓑ{I}V2, T2⦄ → - ∃∃K1,V1. ⦃K1, V1⦄ ➡ ⦃K2, V2⦄ & - ⦃K1, -ⓑ{I}V1.T1⦄ ➡ ⦃K2, -ⓑ{I}V2.T2⦄ & - L1 = K1.ⓑ{I}V1. -#I2 #X #K2 #V2 #T1 #T2 #H -elim (fpr_fwd_pair3 … H) -H #I1 #K1 #V1 #HT12 #H destruct -elim (fpr_fwd_shift_bind_minus … HT12) #HV12 #H destruct /2 width=5/ -qed-. - -(* More advanced forward lemmas *********************************************) - -lemma fpr_fwd_pair1_full: ∀I,K1,L2,V1,T1,T2. ⦃K1.ⓑ{I}V1, T1⦄ ➡ ⦃L2, T2⦄ → - ∀b. ∃∃K2,V2. ⦃K1, V1⦄ ➡ ⦃K2, V2⦄ & - ⦃K1, ⓑ{b,I}V1.T1⦄ ➡ ⦃K2, ⓑ{b,I}V2.T2⦄ & - L2 = K2.ⓑ{I}V2. -#I #K1 #L2 #V1 #T1 #T2 #H #b -elim (fpr_inv_pair1 … H) -H #K2 #V2 #HV12 #HT12 #H destruct -elim (fpr_fwd_bind2_minus … HT12 b) -HT12 #W1 #U1 #HTU1 #H destruct /2 width=5/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpr_fpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpr_fpr.etc deleted file mode 100644 index 3f7ac2ceb..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fpr_fpr.etc +++ /dev/null @@ -1,26 +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/reducibility/tpr_tpr.ma". -include "basic_2/reducibility/fpr.ma". - -(* CONTEXT-FREE PARALLEL REDUCTION ON CLOSURES ******************************) - -(* Main properties **********************************************************) - -theorem fpr_conf: bi_confluent … fpr. -#L0 #L1 #T0 #T1 * #HL01 #HT01 #L2 #T2 * >HL01 #HL12 #HT02 -elim (tpr_conf … HT01 HT02) -L0 -T0 #X #H1 #H2 -elim (tpr_fwd_shift1 … H1) #L #T #HL1 #H destruct /3 width=5/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fprs.etc deleted file mode 100644 index f42bdf7e2..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fprs.etc +++ /dev/null @@ -1,58 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( ⦃ term 46 L1 , term 46 T1 ⦄ ➡ * break ⦃ term 46 L2 , term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'FocalizedPRedStar $L1 $T1 $L2 $T2 }. - -notation "hvbox( ⦃ term 46 L1 , term 46 T1 ⦄ ➡ ➡ * break ⦃ term 46 L2 , term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'FocalizedPRedStarAlt $L1 $T1 $L2 $T2 }. - -include "basic_2/reducibility/fpr.ma". - -(* CONTEXT-FREE PARALLEL COMPUTATION ON CLOSURES ****************************) - -definition fprs: bi_relation lenv term ≝ bi_TC … fpr. - -interpretation "context-free parallel computation (closure)" - 'FocalizedPRedStar L1 T1 L2 T2 = (fprs L1 T1 L2 T2). - -(* Basic eliminators ********************************************************) - -lemma fprs_ind: ∀L1,T1. ∀R:relation2 lenv term. R L1 T1 → - (∀L,L2,T,T2. ⦃L1, T1⦄ ➡* ⦃L, T⦄ → ⦃L, T⦄ ➡ ⦃L2, T2⦄ → R L T → R L2 T2) → - ∀L2,T2. ⦃L1, T1⦄ ➡* ⦃L2, T2⦄ → R L2 T2. -/3 width=7 by bi_TC_star_ind/ qed-. - -lemma fprs_ind_dx: ∀L2,T2. ∀R:relation2 lenv term. R L2 T2 → - (∀L1,L,T1,T. ⦃L1, T1⦄ ➡ ⦃L, T⦄ → ⦃L, T⦄ ➡* ⦃L2, T2⦄ → R L T → R L1 T1) → - ∀L1,T1. ⦃L1, T1⦄ ➡* ⦃L2, T2⦄ → R L1 T1. -/3 width=7 by bi_TC_star_ind_dx/ qed-. - -(* Basic properties *********************************************************) - -lemma fpr_fprs: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ → ⦃L1, T1⦄ ➡* ⦃L2, T2⦄. -/2 width=1/ qed. - -lemma fprs_refl: bi_reflexive … fprs. -/2 width=1/ qed. - -lemma fprs_strap1: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ➡* ⦃L, T⦄ → ⦃L, T⦄ ➡ ⦃L2, T2⦄ → - ⦃L1, T1⦄ ➡* ⦃L2, T2⦄. -/2 width=4/ qed. - -lemma fprs_strap2: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ➡ ⦃L, T⦄ → ⦃L, T⦄ ➡* ⦃L2, T2⦄ → - ⦃L1, T1⦄ ➡* ⦃L2, T2⦄. -/2 width=4/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fprs_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fprs_aaa.etc deleted file mode 100644 index b76637ff7..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fprs_aaa.etc +++ /dev/null @@ -1,26 +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/reducibility/cfpr_aaa.ma". -include "basic_2/computation/fprs.ma". - -(* CONTEXT-FREE PARALLEL COMPUTATION ON CLOSURES ****************************) - -(* Properties about atomic arity assignment on terms ************************) - -lemma aaa_fprs_conf: ∀L1,T1,A. L1 ⊢ T1 ⁝ A → - ∀L2,T2. ⦃L1, T1⦄ ➡* ⦃L2, T2⦄ → L2 ⊢ T2 ⁝ A. -#L1 #T1 #A #HT1 #L2 #T2 #HLT12 -@(bi_TC_Conf3 … HT1 ?? HLT12) /2 width=4/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fprs_cprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fprs_cprs.etc deleted file mode 100644 index 9d4d954b8..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fprs_cprs.etc +++ /dev/null @@ -1,138 +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/reducibility/fpr_cpr.ma". -include "basic_2/computation/cprs_lfprs.ma". -include "basic_2/computation/lfprs_ltprs.ma". -include "basic_2/computation/lfprs_fprs.ma". - -(* CONTEXT-FREE PARALLEL COMPUTATION ON CLOSURES ****************************) - -(* Advanced properties ******************************************************) - -lemma fprs_flat_dx_tpr: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡* ⦃L2, T2⦄ → ∀V1,V2. V1 ➡ V2 → - ∀I. ⦃L1, ⓕ{I}V1.T1⦄ ➡* ⦃L2, ⓕ{I}V2.T2⦄. -#L1 #L2 #T1 #T2 #HT12 @(fprs_ind … HT12) -L2 -T2 /3 width=1/ -#L #L2 #T #T2 #_ #HT2 #IHT2 #V1 #V2 #HV12 #I -lapply (IHT2 … HV12 I) -IHT2 -HV12 /3 width=6/ -qed. - -lemma fprs_bind2_minus: ∀I,L1,L2,V1,T1,U2. ⦃L1, -ⓑ{I}V1.T1⦄ ➡* ⦃L2, U2⦄ → - ∃∃V2,T2. ⦃L1.ⓑ{I}V1, T1⦄ ➡* ⦃L2.ⓑ{I}V2, T2⦄ & - U2 = -ⓑ{I}V2.T2. -#I #L1 #L2 #V1 #T1 #U2 #H @(fprs_ind … H) -L2 -U2 /2 width=4/ -#L #L2 #U #U2 #_ #HU2 * #V #T #HT1 #H destruct -elim (fpr_bind2_minus … HU2) -HU2 /3 width=4/ -qed-. - -lemma fprs_lift: ∀K1,K2,T1,T2. ⦃K1, T1⦄ ➡* ⦃K2, T2⦄ → - ∀d,e,L1. ⇩[d, e] L1 ≡ K1 → - ∀U1,U2. ⇧[d, e] T1 ≡ U1 → ⇧[d, e] T2 ≡ U2 → - ∃∃L2. ⦃L1, U1⦄ ➡* ⦃L2, U2⦄ & ⇩[d, e] L2 ≡ K2. -#K1 #K2 #T1 #T2 #HT12 @(fprs_ind … HT12) -K2 -T2 -[ #d #e #L1 #HLK1 #U1 #U2 #HTU1 #HTU2 - >(lift_mono … HTU2 … HTU1) -U2 /2 width=3/ -| #K #K2 #T #T2 #_ #HT2 #IHT1 #d #e #L1 #HLK1 #U1 #U2 #HTU1 #HTU2 - elim (lift_total T d e) #U #HTU - elim (IHT1 … HLK1 … HTU1 HTU) -K1 -T1 #L #HU1 #HKL - elim (fpr_lift … HT2 … HKL … HTU HTU2) -K -T -T2 /3 width=4/ -] -qed-. - -(* Advanced inversion lemmas ************************************************) - -lemma fprs_inv_pair1: ∀I,K1,L2,V1,T1,T2. ⦃K1.ⓑ{I}V1, T1⦄ ➡* ⦃L2, T2⦄ → - ∃∃K2,V2. ⦃K1, V1⦄ ➡* ⦃K2, V2⦄ & - ⦃K1, -ⓑ{I}V1.T1⦄ ➡* ⦃K2, -ⓑ{I}V2.T2⦄ & - L2 = K2.ⓑ{I}V2. -#I #K1 #L2 #V1 #T1 #T2 #H @(fprs_ind … H) -L2 -T2 /2 width=5/ -#L #L2 #T #T2 #_ #HT2 * #K #V #HV1 #HT1 #H destruct -elim (fpr_inv_pair1 … HT2) -HT2 #K2 #V2 #HV2 #HT2 #H destruct /3 width=5/ -qed-. - -lemma fprs_inv_pair3: ∀I,L1,K2,V2,T1,T2. ⦃L1, T1⦄ ➡* ⦃K2.ⓑ{I}V2, T2⦄ → - ∃∃K1,V1. ⦃K1, V1⦄ ➡* ⦃K2, V2⦄ & - ⦃K1, -ⓑ{I}V1.T1⦄ ➡* ⦃K2, -ⓑ{I}V2.T2⦄ & - L1 = K1.ⓑ{I}V1. -#I2 #L1 #K2 #V2 #T1 #T2 #H @(fprs_ind_dx … H) -L1 -T1 /2 width=5/ -#L1 #L #T1 #T #HT1 #_ * #K #V #HV2 #HT2 #H destruct -elim (fpr_inv_pair3 … HT1) -HT1 #K1 #V1 #HV1 #HT1 #H destruct /3 width=5/ -qed-. - -(* Advanced forward lemmas **************************************************) - -lemma fprs_fwd_bind2_minus: ∀I,L1,L,V1,T1,T. ⦃L1, -ⓑ{I}V1.T1⦄ ➡* ⦃L, T⦄ → ∀b. - ∃∃V2,T2. ⦃L1, ⓑ{b,I}V1.T1⦄ ➡* ⦃L, ⓑ{b,I}V2.T2⦄ & - T = -ⓑ{I}V2.T2. -#I #L1 #L #V1 #T1 #T #H1 #b @(fprs_ind … H1) -L -T /2 width=4/ -#L0 #L #T0 #T #_ #H0 * #W1 #U1 #HTU1 #H destruct -elim (fpr_fwd_bind2_minus … H0 b) -H0 /3 width=4/ -qed-. - -lemma fprs_fwd_pair1_full: ∀I,K1,L2,V1,T1,T2. ⦃K1.ⓑ{I}V1, T1⦄ ➡* ⦃L2, T2⦄ → - ∀b. ∃∃K2,V2. ⦃K1, V1⦄ ➡* ⦃K2, V2⦄ & - ⦃K1, ⓑ{b,I}V1.T1⦄ ➡* ⦃K2, ⓑ{b,I}V2.T2⦄ & - L2 = K2.ⓑ{I}V2. -#I #K1 #L2 #V1 #T1 #T2 #H #b -elim (fprs_inv_pair1 … H) -H #K2 #V2 #HV12 #HT12 #H destruct -elim (fprs_fwd_bind2_minus … HT12 b) -HT12 #W1 #U1 #HTU1 #H destruct /2 width=5/ -qed-. - -lemma fprs_fwd_abst2: ∀a,L1,L2,V1,T1,U2. ⦃L1, ⓛ{a}V1.T1⦄ ➡* ⦃L2, U2⦄ → ∀b,I,W. - ∃∃V2,T2. ⦃L1, ⓑ{b,I}W.T1⦄ ➡* ⦃L2, ⓑ{b,I}W.T2⦄ & - U2 = ⓛ{a}V2.T2. -#a #L1 #L2 #V1 #T1 #U2 #H #b #I #W @(fprs_ind … H) -L2 -U2 /2 width=4/ -#L #L2 #U #U2 #_ #H2 * #V #T #HT1 #H destruct -elim (fpr_fwd_abst2 … H2 b I W) -H2 /3 width=4/ -qed-. - -(* Properties on context-sensitive parallel computation for terms ***********) - -lemma cprs_fprs: ∀L,T1,T2. L ⊢ T1 ➡* T2 → ⦃L, T1⦄ ➡* ⦃L, T2⦄. -#L #T1 #T2 #H @(cprs_ind … H) -T2 // /3 width=4/ -qed. - -(* Forward lemmas on context-sensitive parallel computation for terms *******) - -lemma fprs_fwd_cprs: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡* ⦃L2, T2⦄ → L1 ⊢ T1 ➡* T2. -#L1 #L2 #T1 #T2 #H @(fprs_ind … H) -L2 -T2 // -#L #L2 #T #T2 #H1 #H2 #IH1 -elim (fpr_inv_all … H2) -H2 #L0 #HL0 #HT2 #_ -L2 -lapply (lfprs_cpr_trans L1 … HT2) -HT2 /3 width=3/ -qed-. -(* -(* Advanced properties ******************************************************) - -lamma fpr_bind_sn: ∀L1,L2,V1,V2. ⦃L1, V1⦄ ➡ ⦃L2, V2⦄ → ∀T1,T2. T1 ➡ T2 → - ∀a,I. ⦃L1, ⓑ{a,I}V1.T1⦄ ➡ ⦃L2, ⓑ{a,I}V2.T2⦄. -#L1 #L2 #V1 #V2 #H #T1 #T2 #HT12 #a #I -elim (fpr_inv_all … H) /3 width=4/ -qed. - -(* Advanced forward lemmas **************************************************) - -lamma fpr_fwd_shift_bind_minus: ∀I1,I2,L1,L2,V1,V2,T1,T2. - ⦃L1, -ⓑ{I1}V1.T1⦄ ➡ ⦃L2, -ⓑ{I2}V2.T2⦄ → - ⦃L1, V1⦄ ➡ ⦃L2, V2⦄ ∧ I1 = I2. -* #I2 #L1 #L2 #V1 #V2 #T1 #T2 #H -elim (fpr_inv_all … H) -H #L #HL1 #H #HL2 -[ elim (cpr_inv_abbr1 … H) -H * - [ #V #V0 #T #HV1 #HV0 #_ #H destruct /4 width=4/ - | #T #_ #_ #H destruct - ] -| elim (cpr_inv_abst1 … H Abst V2) -H - #V #T #HV1 #_ #H destruct /3 width=4/ -] -qed-. -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fprs_fprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fprs_fprs.etc deleted file mode 100644 index e0c1b3058..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fprs_fprs.etc +++ /dev/null @@ -1,34 +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/reducibility/fpr_fpr.ma". -include "basic_2/computation/fprs.ma". - -(* CONTEXT-FREE PARALLEL COMPUTATION ON CLOSURES ****************************) - -(* Advanced properties ******************************************************) - -lemma fprs_strip: ∀L0,L1,T0,T1. ⦃L0, T0⦄ ➡ ⦃L1, T1⦄ → - ∀L2,T2. ⦃L0, T0⦄ ➡* ⦃L2, T2⦄ → - ∃∃L,T. ⦃L1, T1⦄ ➡* ⦃L, T⦄ & ⦃L2, T2⦄ ➡ ⦃L, T⦄. -#H1 #H2 #H3 #H4 #H5 #H6 #H7 #H8 -/2 width=4/ qed. - -(* Main propertis ***********************************************************) - -theorem fprs_conf: bi_confluent … fprs. -/2 width=4/ qed. - -theorem fprs_trans: bi_transitive … fprs. -/2 width=4/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/lenv_px_bi.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/lenv_px_bi.etc deleted file mode 100644 index 931d075ab..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/lenv_px_bi.etc +++ /dev/null @@ -1,88 +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/grammar/lenv_length.ma". - -(* POINTWISE EXTENSION OF A FOCALIZED REALTION FOR TERMS ********************) - -inductive lpx_bi (R:bi_relation lenv term): relation lenv ≝ -| lpx_bi_stom: lpx_bi R (⋆) (⋆) -| lpx_bi_pair: ∀I,K1,K2,V1,V2. - lpx_bi R K1 K2 → R K1 V1 K2 V2 → - lpx_bi R (K1. ⓑ{I} V1) (K2. ⓑ{I} V2) -. - -(* Basic inversion lemmas ***************************************************) - -fact lpx_bi_inv_atom1_aux: ∀R,L1,L2. lpx_bi R L1 L2 → L1 = ⋆ → L2 = ⋆. -#R #L1 #L2 * -L1 -L2 -[ // -| #I #K1 #K2 #V1 #V2 #_ #_ #H destruct -] -qed-. - -lemma lpx_bi_inv_atom1: ∀R,L2. lpx_bi R (⋆) L2 → L2 = ⋆. -/2 width=4 by lpx_bi_inv_atom1_aux/ qed-. - -fact lpx_bi_inv_pair1_aux: ∀R,L1,L2. lpx_bi R L1 L2 → - ∀I,K1,V1. L1 = K1. ⓑ{I} V1 → - ∃∃K2,V2. lpx_bi R K1 K2 & - R K1 V1 K2 V2 & L2 = K2. ⓑ{I} V2. -#R #L1 #L2 * -L1 -L2 -[ #J #K1 #V1 #H destruct -| #I #K1 #K2 #V1 #V2 #HK12 #HV12 #J #L #W #H destruct /2 width=5/ -] -qed-. - -lemma lpx_bi_inv_pair1: ∀R,I,K1,V1,L2. lpx_bi R (K1. ⓑ{I} V1) L2 → - ∃∃K2,V2. lpx_bi R K1 K2 & R K1 V1 K2 V2 & - L2 = K2. ⓑ{I} V2. -/2 width=3 by lpx_bi_inv_pair1_aux/ qed-. - -fact lpx_bi_inv_atom2_aux: ∀R,L1,L2. lpx_bi R L1 L2 → L2 = ⋆ → L1 = ⋆. -#R #L1 #L2 * -L1 -L2 -[ // -| #I #K1 #K2 #V1 #V2 #_ #_ #H destruct -] -qed-. - -lemma lpx_bi_inv_atom2: ∀R,L1. lpx_bi R L1 (⋆) → L1 = ⋆. -/2 width=4 by lpx_bi_inv_atom2_aux/ qed-. - -fact lpx_bi_inv_pair2_aux: ∀R,L1,L2. lpx_bi R L1 L2 → - ∀I,K2,V2. L2 = K2. ⓑ{I} V2 → - ∃∃K1,V1. lpx_bi R K1 K2 & R K1 V1 K2 V2 & - L1 = K1. ⓑ{I} V1. -#R #L1 #L2 * -L1 -L2 -[ #J #K2 #V2 #H destruct -| #I #K1 #K2 #V1 #V2 #HK12 #HV12 #J #K #W #H destruct /2 width=5/ -] -qed-. - -lemma lpx_bi_inv_pair2: ∀R,I,L1,K2,V2. lpx_bi R L1 (K2. ⓑ{I} V2) → - ∃∃K1,V1. lpx_bi R K1 K2 & R K1 V1 K2 V2 & - L1 = K1. ⓑ{I} V1. -/2 width=3 by lpx_bi_inv_pair2_aux/ qed-. - -(* Basic forward lemmas *****************************************************) - -lemma lpx_bi_fwd_length: ∀R,L1,L2. lpx_bi R L1 L2 → |L1| = |L2|. -#R #L1 #L2 #H elim H -L1 -L2 normalize // -qed-. - -(* Basic properties *********************************************************) - -lemma lpx_bi_refl: ∀R. bi_reflexive ? ? R → reflexive … (lpx_bi R). -#R #HR #L elim L -L // /2 width=1/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/lfpr_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/lfpr_alt.etc deleted file mode 100644 index 95ec60ba2..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/lfpr_alt.etc +++ /dev/null @@ -1,87 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( L1 ⊢ ➡ ➡ break term 46 L2 )" - non associative with precedence 45 - for @{ 'PRedSnAlt $L1 $L2 }. - -notation "hvbox( ⦃ term 46 L1 ⦄ ➡ ➡ break ⦃ term 46 L2 ⦄ )" - non associative with precedence 45 - for @{ 'FocalizedPRedAlt $L1 $L2 }. - -include "basic_2/grammar/lenv_px_bi.ma". -include "basic_2/reducibility/fpr_cpr.ma". -include "basic_2/reducibility/lfpr_fpr.ma". - -(* FOCALIZED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS **********************) - -(* alternative definition *) -definition lfpra: relation lenv ≝ lpx_bi fpr. - -interpretation - "focalized parallel reduction (environment) alternative" - 'FocalizedPRedAlt L1 L2 = (lfpra L1 L2). - -(* Basic properties *********************************************************) - -lemma lfpra_refl: reflexive … lfpra. -/2 width=1/ qed. - -lemma fpr_lfpra: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ → ⦃L1⦄ ➡➡ ⦃L2⦄. -#L1 elim L1 -L1 -[ #L2 #T1 #T2 #H - elim (fpr_inv_atom1 … H) -H #_ #H destruct // -| #L1 #I #V1 #IH #L2 #T1 #T2 #H - elim (fpr_inv_pair1 … H) -H #L #V #HV1 #HL1 #H destruct /3 width=3/ -] -qed. - -(* Basic inversion lemmas ***************************************************) - -lemma lfpra_inv_atom1: ∀L2. ⦃⋆⦄ ➡➡ ⦃L2⦄ → L2 = ⋆. -/2 width=2 by lpx_bi_inv_atom1/ qed-. - -lemma lfpra_inv_pair1: ∀K1,I,V1,L2. ⦃K1. ⓑ{I} V1⦄ ➡➡ ⦃L2⦄ → - ∃∃K2,V2. ⦃K1⦄ ➡➡ ⦃K2⦄ & ⦃K1, V1⦄ ➡ ⦃K2, V2⦄ & - L2 = K2. ⓑ{I} V2. -/2 width=1 by lpx_bi_inv_pair1/ qed-. - -lemma lfpra_inv_atom2: ∀L1. ⦃L1⦄ ➡➡ ⦃⋆⦄ → L1 = ⋆. -/2 width=2 by lpx_bi_inv_atom2/ qed-. - -lemma lfpra_inv_pair2: ∀L1,K2,I,V2. ⦃L1⦄ ➡➡ ⦃K2. ⓑ{I} V2⦄ → - ∃∃K1,V1. ⦃K1⦄ ➡➡ ⦃K2⦄ & ⦃K1, V1⦄ ➡ ⦃K2, V2⦄ & - L1 = K1. ⓑ{I} V1. -/2 width=1 by lpx_bi_inv_pair2/ qed-. - -lemma lfpra_inv_fpr: ∀L1,L2. ⦃L1⦄ ➡➡ ⦃L2⦄ → ∀T.⦃L1, T⦄ ➡ ⦃L2, T⦄. -#L1 #L2 * -L1 -L2 // /3 width=1/ -qed-. - -(* Basic forward lemmas *****************************************************) - -lemma lfpra_fwd_length: ∀L1,L2. ⦃L1⦄ ➡➡ ⦃L2⦄ → |L1| = |L2|. -/2 width=2 by lpx_bi_fwd_length/ qed-. - -(* Main properties **********************************************************) - -theorem lfpr_lfpra: ∀L1,L2. ⦃L1⦄ ➡ ⦃L2⦄ → ⦃L1⦄ ➡➡ ⦃L2⦄. -#L1 #L2 #H -lapply (lfpr_inv_fpr … H (⋆0)) -H /2 width=3/ -qed. - -theorem lfpra_lfpr: ∀L1,L2. ⦃L1⦄ ➡➡ ⦃L2⦄ → ⦃L1⦄ ➡ ⦃L2⦄. -#L1 #L2 #H -lapply (lfpra_inv_fpr … H (⋆0)) -H /2 width=3/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/lfpr_fpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/lfpr_fpr.etc deleted file mode 100644 index f798d566b..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/lfpr_fpr.etc +++ /dev/null @@ -1,31 +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/reducibility/lfpr.ma". -include "basic_2/reducibility/cfpr_cpr.ma". - -(* FOCALIZED PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ***********************) - -(* Properties on context-free parallel reduction for closures ***************) - -lemma fpr_lfpr: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ → ⦃L1⦄ ➡ ⦃L2⦄. -#L1 #L2 #T1 #T2 #H -elim (fpr_inv_all … H) -H /2 width=3/ -qed. - -(* Inversion lemmas on context-free parallel reduction for closures *********) - -lemma lfpr_inv_fpr: ∀L1,L2. ⦃L1⦄ ➡ ⦃L2⦄ → ∀T. ⦃L1, T⦄ ➡ ⦃L2, T⦄. -#L1 #L2 * /2 width=4/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/lfprs_fprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/lfprs_fprs.etc deleted file mode 100644 index a5c42ba65..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/fpr/lfprs_fprs.etc +++ /dev/null @@ -1,41 +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/reducibility/lfpr_fpr.ma". -include "basic_2/computation/fprs_fprs.ma". -include "basic_2/computation/lfprs.ma". - -(* FOCALIZED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS *********************) - -(* Inversion lemmas on context-free parallel reduction for closures *********) - -lemma lfprs_inv_fprs: ∀L1,L2. ⦃L1⦄ ➡* ⦃L2⦄ → ∀T. ⦃L1, T⦄ ➡* ⦃L2, T⦄. -#L1 #L2 #H @(lfprs_ind … H) -L2 // -#L #L2 #_ #HL2 #IHL1 #T -lapply (lfpr_inv_fpr … HL2 T) -HL2 /3 width=4/ -qed-. - -(* Properties on context-free parallel computation for closures *************) - -lemma fprs_lfprs: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡* ⦃L2, T2⦄ → ⦃L1⦄ ➡* ⦃L2⦄. -#L1 #L2 #T1 #T2 #H @(fprs_ind … H) -L2 -T2 // /3 width=5/ -qed. - -lemma lfprs_fprs_trans: ∀L1,L,L2,T1,T2. ⦃L1⦄ ➡* ⦃L⦄ → ⦃L, T1⦄ ➡* ⦃L2, T2⦄ → ⦃L1, T1⦄ ➡* ⦃L2, T2⦄. -#L1 #L #L2 #T1 #T2 #HL1 #HL2 -lapply (lfprs_inv_fprs … HL1 T1) -HL1 /2 width=4/ -qed. -(* -lamma lfprs_cprs_conf: ∀L1,L,L2,T1,T2. ⦃L1⦄ ➡* ⦃L2⦄ → L1 ⊢ T1 ➡* T2 → ⦃L1, T1⦄ ➡* ⦃L2, T2⦄. -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/frsup/frsup.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/frsup/frsup.etc deleted file mode 100644 index 077fd7422..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/frsup/frsup.etc +++ /dev/null @@ -1,123 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( ⦃ term 46 L1, break term 46 T1 ⦄ ⧁ break ⦃ term 46 L2 , break term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'RestSupTerm $L1 $T1 $L2 $T2 }. - -include "basic_2/grammar/cl_weight.ma". -include "basic_2/substitution/lift.ma". - -(* RESTRICTED SUPCLOSURE ****************************************************) - -inductive frsup: bi_relation lenv term ≝ -| frsup_bind_sn: ∀a,I,L,V,T. frsup L (ⓑ{a,I}V.T) L V -| frsup_bind_dx: ∀a,I,L,V,T. frsup L (ⓑ{a,I}V.T) (L.ⓑ{I}V) T -| frsup_flat_sn: ∀I,L,V,T. frsup L (ⓕ{I}V.T) L V -| frsup_flat_dx: ∀I,L,V,T. frsup L (ⓕ{I}V.T) L T -. - -interpretation - "restricted structural predecessor (closure)" - 'RestSupTerm L1 T1 L2 T2 = (frsup L1 T1 L2 T2). - -(* Basic inversion lemmas ***************************************************) - -fact frsup_inv_atom1_aux: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → - ∀J. T1 = ⓪{J} → ⊥. -#L1 #L2 #T1 #T2 * -L1 -L2 -T1 -T2 -[ #a #I #L #V #T #J #H destruct -| #a #I #L #V #T #J #H destruct -| #I #L #V #T #J #H destruct -| #I #L #V #T #J #H destruct -] -qed-. - -lemma frsup_inv_atom1: ∀J,L1,L2,T2. ⦃L1, ⓪{J}⦄ ⧁ ⦃L2, T2⦄ → ⊥. -/2 width=7 by frsup_inv_atom1_aux/ qed-. - -fact frsup_inv_bind1_aux: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → - ∀b,J,W,U. T1 = ⓑ{b,J}W.U → - (L2 = L1 ∧ T2 = W) ∨ - (L2 = L1.ⓑ{J}W ∧ T2 = U). -#L1 #L2 #T1 #T2 * -L1 -L2 -T1 -T2 -[ #a #I #L #V #T #b #J #W #U #H destruct /3 width=1/ -| #a #I #L #V #T #b #J #W #U #H destruct /3 width=1/ -| #I #L #V #T #b #J #W #U #H destruct -| #I #L #V #T #b #J #W #U #H destruct -] -qed-. - -lemma frsup_inv_bind1: ∀b,J,L1,L2,W,U,T2. ⦃L1, ⓑ{b,J}W.U⦄ ⧁ ⦃L2, T2⦄ → - (L2 = L1 ∧ T2 = W) ∨ - (L2 = L1.ⓑ{J}W ∧ T2 = U). -/2 width=4 by frsup_inv_bind1_aux/ qed-. - -fact frsup_inv_flat1_aux: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → - ∀J,W,U. T1 = ⓕ{J}W.U → - L2 = L1 ∧ (T2 = W ∨ T2 = U). -#L1 #L2 #T1 #T2 * -L1 -L2 -T1 -T2 -[ #a #I #L #V #T #J #W #U #H destruct -| #a #I #L #V #T #J #W #U #H destruct -| #I #L #V #T #J #W #U #H destruct /3 width=1/ -| #I #L #V #T #J #W #U #H destruct /3 width=1/ -] -qed-. - -lemma frsup_inv_flat1: ∀J,L1,L2,W,U,T2. ⦃L1, ⓕ{J}W.U⦄ ⧁ ⦃L2, T2⦄ → - L2 = L1 ∧ (T2 = W ∨ T2 = U). -/2 width=4 by frsup_inv_flat1_aux/ qed-. - -(* Basic forward lemmas *****************************************************) - -lemma frsup_fwd_fw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → ♯{L2, T2} < ♯{L1, T1}. -#L1 #L2 #T1 #T2 * -L1 -L2 -T1 -T2 /width=1/ -qed-. - -lemma frsup_fwd_lw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → ♯{L1} ≤ ♯{L2}. -#L1 #L2 #T1 #T2 * -L1 -L2 -T1 -T2 /width=1/ -qed-. - -lemma frsup_fwd_tw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → ♯{T2} < ♯{T1}. -#L1 #L2 #T1 #T2 * -L1 -L2 -T1 -T2 /width=1/ /2 width=1 by le_minus_to_plus/ -qed-. - -lemma frsup_fwd_append: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → ∃L. L2 = L1 @@ L. -#L1 #L2 #T1 #T2 * -L1 -L2 -T1 -T2 -[ #a -| #a #I #L #V #_ @(ex_intro … (⋆.ⓑ{I}V)) // -] -#I #L #V #T @(ex_intro … (⋆)) // -qed-. - -(* Advanced forward lemmas **************************************************) - -lemma lift_frsup_trans: ∀T1,U1,d,e. ⇧[d, e] T1 ≡ U1 → - ∀L,K,U2. ⦃L, U1⦄ ⧁ ⦃L @@ K, U2⦄ → - ∃T2. ⇧[d + |K|, e] T2 ≡ U2. -#T1 #U1 #d #e * -T1 -U1 -d -e -[5: #a #I #V1 #W1 #T1 #U1 #d #e #HVW1 #HTU1 #L #K #X #H - elim (frsup_inv_bind1 … H) -H * - [ -HTU1 #H1 #H2 destruct - >(append_inv_refl_dx … H1) -L -K normalize /2 width=2/ - | -HVW1 #H1 #H2 destruct - >(append_inv_pair_dx … H1) -L -K normalize /2 width=2/ - ] -|6: #I #V1 #W1 #T1 #U1 #d #e #HVW1 #HUT1 #L #K #X #H - elim (frsup_inv_flat1 … H) -H #H1 * #H2 destruct - >(append_inv_refl_dx … H1) -L -K normalize /2 width=2/ -] -#i #d #e [2,3: #_ ] #L #K #X #H -elim (frsup_inv_atom1 … H) -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/frsup/frsupp.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/frsup/frsupp.etc deleted file mode 100644 index 9f7a8dc9d..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/frsup/frsupp.etc +++ /dev/null @@ -1,110 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( ⦃ term 46 L1, break term 46 T1 ⦄ ⧁ + break ⦃ term 46 L2 , break term 46 T2 ⦄ )" - non associative with precedence 45 - for @{ 'RestSupTermPlus $L1 $T1 $L2 $T2 }. - -include "basic_2/substitution/frsup.ma". - -(* PLUS-ITERATED RESTRICTED SUPCLOSURE **************************************) - -definition frsupp: bi_relation lenv term ≝ bi_TC … frsup. - -interpretation "plus-iterated restricted structural predecessor (closure)" - 'RestSupTermPlus L1 T1 L2 T2 = (frsupp L1 T1 L2 T2). - -(* Basic eliminators ********************************************************) - -lemma frsupp_ind: ∀L1,T1. ∀R:relation2 lenv term. - (∀L2,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → R L2 T2) → - (∀L,T,L2,T2. ⦃L1, T1⦄ ⧁+ ⦃L, T⦄ → ⦃L, T⦄ ⧁ ⦃L2, T2⦄ → R L T → R L2 T2) → - ∀L2,T2. ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄ → R L2 T2. -#L1 #T1 #R #IH1 #IH2 #L2 #T2 #H -@(bi_TC_ind … IH1 IH2 ? ? H) -qed-. - -lemma frsupp_ind_dx: ∀L2,T2. ∀R:relation2 lenv term. - (∀L1,T1. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → R L1 T1) → - (∀L1,L,T1,T. ⦃L1, T1⦄ ⧁ ⦃L, T⦄ → ⦃L, T⦄ ⧁+ ⦃L2, T2⦄ → R L T → R L1 T1) → - ∀L1,T1. ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄ → R L1 T1. -#L2 #T2 #R #IH1 #IH2 #L1 #T1 #H -@(bi_TC_ind_dx … IH1 IH2 ? ? H) -qed-. - -(* Baic inversion lemmas ****************************************************) - -lemma frsupp_inv_dx: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ ∨ - ∃∃L,T. ⦃L1, T1⦄ ⧁+ ⦃L, T⦄ & ⦃L, T⦄ ⧁ ⦃L2, T2⦄. -/2 width=1 by bi_TC_decomp_r/ qed-. - -lemma frsupp_inv_sn: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ ∨ - ∃∃L,T. ⦃L1, T1⦄ ⧁ ⦃L, T⦄ & ⦃L, T⦄ ⧁+ ⦃L2, T2⦄. -/2 width=1 by bi_TC_decomp_l/ qed-. - -(* Basic properties *********************************************************) - -lemma frsup_frsupp: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄. -/2 width=1/ qed. - -lemma frsupp_strap1: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ⧁+ ⦃L, T⦄ → ⦃L, T⦄ ⧁ ⦃L2, T2⦄ → - ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄. -/2 width=4/ qed. - -lemma frsupp_strap2: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ⧁ ⦃L, T⦄ → ⦃L, T⦄ ⧁+ ⦃L2, T2⦄ → - ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄. -/2 width=4/ qed. - -(* Basic forward lemmas *****************************************************) - -lemma frsupp_fwd_fw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄ → ♯{L2, T2} < ♯{L1, T1}. -#L1 #L2 #T1 #T2 #H @(frsupp_ind … H) -L2 -T2 -/3 width=3 by frsup_fwd_fw, transitive_lt/ -qed-. - -lemma frsupp_fwd_lw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄ → ♯{L1} ≤ ♯{L2}. -#L1 #L2 #T1 #T2 #H @(frsupp_ind … H) -L2 -T2 -/2 width=3 by frsup_fwd_lw/ (**) (* /3 width=5 by frsup_fwd_lw, transitive_le/ is too slow *) -#L #T #L2 #T2 #_ #HL2 #HL1 -lapply (frsup_fwd_lw … HL2) -HL2 /2 width=3 by transitive_le/ -qed-. - -lemma frsupp_fwd_tw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄ → ♯{T2} < ♯{T1}. -#L1 #L2 #T1 #T2 #H @(frsupp_ind … H) -L2 -T2 -/3 width=3 by frsup_fwd_tw, transitive_lt/ -qed-. - -lemma frsupp_fwd_append: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄ → ∃L. L2 = L1 @@ L. -#L1 #L2 #T1 #T2 #H @(frsupp_ind … H) -L2 -T2 /2 width=3 by frsup_fwd_append/ -#L #T #L2 #T2 #_ #HL2 * #K1 #H destruct -elim (frsup_fwd_append … HL2) -HL2 #K2 #H destruct /2 width=2/ -qed-. - -(* Advanced forward lemmas **************************************************) - -lemma lift_frsupp_trans: ∀L,U1,K,U2. ⦃L, U1⦄ ⧁+ ⦃L @@ K, U2⦄ → - ∀T1,d,e. ⇧[d, e] T1 ≡ U1 → - ∃T2. ⇧[d + |K|, e] T2 ≡ U2. -#L #U1 @(f2_ind … fw … L U1) -L -U1 #n #IH -#L #U1 #Hn #K #U2 #H #T1 #d #e #HTU1 destruct -elim (frsupp_inv_sn … H) -H /2 width=5 by lift_frsup_trans/ * -#L0 #U0 #HL0 #HL -elim (frsup_fwd_append … HL0) #K0 #H destruct -elim (frsupp_fwd_append … HL) #L0 >append_assoc #H -elim (append_inj_dx … H ?) -H // #_ #H destruct -(append_inv_refl_dx … (sym_eq … H1)) -H1 normalize /2 width=2/ -| /2 width=5 by lift_frsupp_trans/ -] -qed-. - -(* Advanced inversion lemmas for frsupp **************************************) - -lemma frsupp_inv_atom1_frsups: ∀J,L1,L2,T2. ⦃L1, ⓪{J}⦄ ⧁+ ⦃L2, T2⦄ → ⊥. -#J #L1 #L2 #T2 #H @(frsupp_ind … H) -L2 -T2 // -#L2 #T2 #H elim (frsup_inv_atom1 … H) -qed-. - -lemma frsupp_inv_bind1_frsups: ∀b,J,L1,L2,W,U,T2. ⦃L1, ⓑ{b,J}W.U⦄ ⧁+ ⦃L2, T2⦄ → - ⦃L1, W⦄ ⧁* ⦃L2, T2⦄ ∨ ⦃L1.ⓑ{J}W, U⦄ ⧁* ⦃L2, T2⦄. -#b #J #L1 #L2 #W #U #T2 #H @(frsupp_ind … H) -L2 -T2 -[ #L2 #T2 #H - elim (frsup_inv_bind1 … H) -H * #H1 #H2 destruct /2 width=1/ -| #L #T #L2 #T2 #_ #HT2 * /3 width=4/ -] -qed-. - -lemma frsupp_inv_flat1_frsups: ∀J,L1,L2,W,U,T2. ⦃L1, ⓕ{J}W.U⦄ ⧁+ ⦃L2, T2⦄ → - ⦃L1, W⦄ ⧁* ⦃L2, T2⦄ ∨ ⦃L1, U⦄ ⧁* ⦃L2, T2⦄. -#J #L1 #L2 #W #U #T2 #H @(frsupp_ind … H) -L2 -T2 -[ #L2 #T2 #H - elim (frsup_inv_flat1 … H) -H #H1 * #H2 destruct /2 width=1/ -| #L #T #L2 #T2 #_ #HT2 * /3 width=4/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/frsup/frsups_frsups.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/frsup/frsups_frsups.etc deleted file mode 100644 index e7b7de26e..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/frsup/frsups_frsups.etc +++ /dev/null @@ -1,22 +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/unfold/frsups.ma". - -(* STAR-ITERATED RESTRICTED SUPCLOSURE **************************************) - -(* Main propertis ***********************************************************) - -theorem frsups_trans: bi_transitive … frsups. -/2 width=4/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/frsup/ssta_frsups.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/frsup/ssta_frsups.etc deleted file mode 100644 index 9eb1fbd8b..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/frsup/ssta_frsups.etc +++ /dev/null @@ -1,70 +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/unfold/frsups.ma". -include "basic_2/static/ssta.ma". - -(* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************) - -(* Advanced inversion lemmas ************************************************) - -lemma ssta_inv_frsupp: ∀h,g,L,T,U,l. ⦃h, L⦄ ⊢ T •[g] ⦃l, U⦄ → ⦃L, U⦄ ⧁+ ⦃L, T⦄ → ⊥. -#h #g #L #T #U #l #H elim H -L -T -U -l -[ #L #k #l #_ #H - elim (frsupp_inv_atom1_frsups … H) -| #L #K #V #W #U #i #l #_ #_ #HWU #_ #H - elim (lift_frsupp_trans … (⋆) … H … HWU) -U #X #H - elim (lift_inv_lref2_be … H ? ?) -H // -| #L #K #W #V #U #i #l #_ #_ #HWU #_ #H - elim (lift_frsupp_trans … (⋆) … H … HWU) -U #X #H - elim (lift_inv_lref2_be … H ? ?) -H // -| #a #I #L #V #T #U #l #_ #IHTU #H - elim (frsupp_inv_bind1_frsups … H) -H #H [2: /4 width=4/ ] -IHTU - lapply (frsups_fwd_fw … H) -H normalize - (lcoeq_inv_O2 … HL1) -HL1 // -| #I1 #I #L1 #L #V1 #V #e #_ #IHL1 #X #H elim (lcoeq_inv_pair1 … H) -H // - #I2 #L2 #V2 #HL2 #H destruct /3 width=1 by lcoeq_pair/ -| #I #L1 #L #V #d #e #_ #IHL1 #X #H elim (lcoeq_inv_succ1 … H) -H // - #L2 #HL2 #H destruct /3 width=1 by lcoeq_succ/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lcoeq/ldrop_lcoeq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lcoeq/ldrop_lcoeq.etc deleted file mode 100644 index 4891949c2..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lcoeq/ldrop_lcoeq.etc +++ /dev/null @@ -1,51 +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 "ground_2/ynat/ynat_minus.ma". -include "basic_2/grammar/lcoeq.ma". -include "basic_2/relocation/ldrop.ma". - -(* BASIC SLICING FOR LOCAL ENVIRONMENTS *************************************) - -(* Properties on coequivalence **********************************************) - -lemma lcoeq_ldrop_trans_lt: ∀L1,L2,d,e. L1 ≅[d, e] L2 → - ∀I,K2,W,s,i. ⇩[s, 0, i] L2 ≡ K2.ⓑ{I}W → i < d → - ∃∃K1. K1 ≅[⫰(d-i), e] K2 & ⇩[s, 0, i] L1 ≡ K1.ⓑ{I}W. -#L1 #L2 #d #e #H elim H -L1 -L2 -d -e -[ #d #e #J #K2 #W #s #i #H - elim (ldrop_inv_atom1 … H) -H #H destruct -| #I #L1 #L2 #V #_ #_ #J #K2 #W #s #i #_ #H - elim (ylt_yle_false … H) // -| #I1 #I2 #L1 #L2 #V1 #V2 #e #_ #_ #J #K2 #W #s #i #_ #H - elim (ylt_yle_false … H) // -| #I #L1 #L2 #V #d #e #HL12 #IHL12 #J #K2 #W #s #i #H - elim (ldrop_inv_O1_pair1 … H) -H * #Hi #HLK1 [ -IHL12 | -HL12 ] - [ #_ destruct >ypred_succ - /2 width=3 by ldrop_pair, ex2_intro/ - | lapply (ylt_inv_O1 i ?) /2 width=1 by ylt_inj/ - #H yminus_succ (cpys_inv_sort1 … H) -H // -qed. - -lemma lleq_gref: ∀L1,L2,d,p. |L1| = |L2| → L1 ⋕[§p, d] L2. -#L1 #L2 #d #k #HL12 @conj // -HL12 -#U @conj #H >(cpys_inv_gref1 … H) -H // -qed. - -lemma lleq_bind: ∀a,I,L1,L2,V,T,d. - L1 ⋕[V, d] L2 → L1.ⓑ{I}V ⋕[T, ⫯d] L2.ⓑ{I}V → - L1 ⋕[ⓑ{a,I}V.T, d] L2. -#a #I #L1 #L2 #V #T #d * #HL12 #IHV * #_ #IHT @conj // -HL12 -#X @conj #H elim (cpys_inv_bind1 … H) -H -#W #U #HVW #HTU #H destruct -elim (IHV W) -IHV elim (IHT U) -IHT /3 width=1 by cpys_bind/ -qed. - -lemma lleq_flat: ∀I,L1,L2,V,T,d. - L1 ⋕[V, d] L2 → L1 ⋕[T, d] L2 → L1 ⋕[ⓕ{I}V.T, d] L2. -#I #L1 #L2 #V #T #d * #HL12 #IHV * #_ #IHT @conj // -HL12 -#X @conj #H elim (cpys_inv_flat1 … H) -H -#W #U #HVW #HTU #H destruct -elim (IHV W) -IHV elim (IHT U) -IHT -/3 width=1 by cpys_flat/ -qed. - -lemma lleq_be: ∀L1,L2,U,dt. L1 ⋕[U, dt] L2 → ∀T,d,e. ⇧[d, e] T ≡ U → - d ≤ dt → dt ≤ d + e → L1 ⋕[U, d] L2. -#L1 #L2 #U #dt * #HL12 #IH #T #d #e #HTU #Hddt #Hdtde @conj // -HL12 -#U0 elim (IH U0) -IH #H12 #H21 @conj -#HU0 elim (cpys_fwd_up … HU0 … HTU) // -HU0 /4 width=5 by cpys_weak/ -qed-. - -lemma lsuby_lleq_trans: ∀L2,L,T,d. L2 ⋕[T, d] L → - ∀L1. L1 ⊑×[d, ∞] L2 → |L1| = |L2| → L1 ⋕[T, d] L. -#L2 #L #T #d * #HL2 #IH #L1 #HL12 #H @conj // -HL2 -#U elim (IH U) -IH #Hdx #Hsn @conj #HTU -[ @Hdx -Hdx -Hsn @(lsuby_cpys_trans … HTU) -HTU - /2 width=1 by lsuby_sym/ (**) (* full auto does not work *) -| -H -Hdx /3 width=3 by lsuby_cpys_trans/ -] -qed-. - -lemma lleq_lsuby_trans: ∀L,L1,T,d. L ⋕[T, d] L1 → - ∀L2. L1 ⊑×[d, ∞] L2 → |L1| = |L2| → L ⋕[T, d] L2. -/5 width=4 by lsuby_lleq_trans, lleq_sym, lsuby_sym/ qed-. - -lemma lleq_lsuby_repl: ∀L1,L2,T,d. L1 ⋕[T, d] L2 → - ∀K1. K1 ⊑×[d, ∞] L1 → |K1| = |L1| → - ∀K2. L2 ⊑×[d, ∞] K2 → |L2| = |K2| → - K1 ⋕[T, d] K2. -/3 width=4 by lleq_lsuby_trans, lsuby_lleq_trans/ qed-. - -(* Basic forward lemmas *****************************************************) - -lemma lleq_fwd_length: ∀L1,L2,T,d. L1 ⋕[T, d] L2 → |L1| = |L2|. -#L1 #L2 #T #d * // -qed-. - -lemma lleq_fwd_ldrop_sn: ∀L1,L2,T,d. L1 ⋕[d, T] L2 → ∀K1,i. ⇩[i] L1 ≡ K1 → - ∃K2. ⇩[i] L2 ≡ K2. -#L1 #L2 #T #d #H #K1 #i #HLK1 lapply (lleq_fwd_length … H) -H -#HL12 lapply (ldrop_fwd_length_le2 … HLK1) -HLK1 /2 width=1 by ldrop_O1_le/ -qed-. - -lemma lleq_fwd_ldrop_dx: ∀L1,L2,T,d. L1 ⋕[d, T] L2 → ∀K2,i. ⇩[i] L2 ≡ K2 → - ∃K1. ⇩[i] L1 ≡ K1. -/3 width=6 by lleq_fwd_ldrop_sn, lleq_sym/ qed-. - -lemma lleq_fwd_bind_sn: ∀a,I,L1,L2,V,T,d. - L1 ⋕[ⓑ{a,I}V.T, d] L2 → L1 ⋕[V, d] L2. -#a #I #L1 #L2 #V #T #d * #HL12 #H @conj // -HL12 -#U elim (H (ⓑ{a,I}U.T)) -H -#H1 #H2 @conj -#H [ lapply (H1 ?) | lapply (H2 ?) ] -H1 -H2 -/2 width=1 by cpys_bind/ -H -#H elim (cpys_inv_bind1 … H) -H -#X #Y #H1 #H2 #H destruct // -qed-. - -lemma lleq_fwd_bind_dx: ∀a,I,L1,L2,V,T,d. - L1 ⋕[ⓑ{a,I}V.T, d] L2 → L1.ⓑ{I}V ⋕[T, ⫯d] L2.ⓑ{I}V. -#a #I #L1 #L2 #V #T #d * #HL12 #H @conj [ normalize // ] -HL12 -#U elim (H (ⓑ{a,I}V.U)) -H -#H1 #H2 @conj -#H [ lapply (H1 ?) | lapply (H2 ?) ] -H1 -H2 -/2 width=1 by cpys_bind/ -H -#H elim (cpys_inv_bind1 … H) -H -#X #Y #H1 #H2 #H destruct // -qed-. - -lemma lleq_fwd_flat_sn: ∀I,L1,L2,V,T,d. - L1 ⋕[ⓕ{I}V.T, d] L2 → L1 ⋕[V, d] L2. -#I #L1 #L2 #V #T #d * #HL12 #H @conj // -HL12 -#U elim (H (ⓕ{I}U.T)) -H -#H1 #H2 @conj -#H [ lapply (H1 ?) | lapply (H2 ?) ] -H1 -H2 -/2 width=1 by cpys_flat/ -H -#H elim (cpys_inv_flat1 … H) -H -#X #Y #H1 #H2 #H destruct // -qed-. - -lemma lleq_fwd_flat_dx: ∀I,L1,L2,V,T,d. - L1 ⋕[ⓕ{I}V.T, d] L2 → L1 ⋕[T, d] L2. -#I #L1 #L2 #V #T #d * #HL12 #H @conj // -HL12 -#U elim (H (ⓕ{I}V.U)) -H -#H1 #H2 @conj -#H [ lapply (H1 ?) | lapply (H2 ?) ] -H1 -H2 -/2 width=1 by cpys_flat/ -H -#H elim (cpys_inv_flat1 … H) -H -#X #Y #H1 #H2 #H destruct // -qed-. - -(* Basic inversion lemmas ***************************************************) - -lemma lleq_inv_bind: ∀a,I,L1,L2,V,T,d. L1 ⋕[ⓑ{a,I}V.T, d] L2 → - L1 ⋕[V, d] L2 ∧ L1.ⓑ{I}V ⋕[T, ⫯d] L2.ⓑ{I}V. -/3 width=4 by lleq_fwd_bind_sn, lleq_fwd_bind_dx, conj/ qed-. - -lemma lleq_inv_flat: ∀I,L1,L2,V,T,d. L1 ⋕[ⓕ{I}V.T, d] L2 → - L1 ⋕[V, d] L2 ∧ L1 ⋕[T, d] L2. -/3 width=3 by lleq_fwd_flat_sn, lleq_fwd_flat_dx, conj/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lleq_alt/lleq_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lleq_alt/lleq_alt.etc deleted file mode 100644 index a8fb526e5..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lleq_alt/lleq_alt.etc +++ /dev/null @@ -1,85 +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/notation/relations/lazyeqalt_4.ma". -include "basic_2/substitution/lleq_lleq.ma". - -(* LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **********************************) - -(* Note: alternative definition of lleq *) -inductive lleqa: relation4 ynat term lenv lenv ≝ -| lleqa_sort: ∀L1,L2,d,k. |L1| = |L2| → lleqa d (⋆k) L1 L2 -| lleqa_skip: ∀L1,L2,d,i. |L1| = |L2| → yinj i < d → lleqa d (#i) L1 L2 -| lleqa_lref: ∀I1,I2,L1,L2,K1,K2,V,d,i. d ≤ yinj i → - ⇩[i] L1 ≡ K1.ⓑ{I1}V → ⇩[i] L2 ≡ K2.ⓑ{I2}V → - lleqa (yinj 0) V K1 K2 → lleqa d (#i) L1 L2 -| lleqa_free: ∀L1,L2,d,i. |L1| = |L2| → |L1| ≤ i → |L2| ≤ i → lleqa d (#i) L1 L2 -| lleqa_gref: ∀L1,L2,d,p. |L1| = |L2| → lleqa d (§p) L1 L2 -| lleqa_bind: ∀a,I,L1,L2,V,T,d. - lleqa d V L1 L2 → lleqa (⫯d) T (L1.ⓑ{I}V) (L2.ⓑ{I}V) → - lleqa d (ⓑ{a,I}V.T) L1 L2 -| lleqa_flat: ∀I,L1,L2,V,T,d. - lleqa d V L1 L2 → lleqa d T L1 L2 → lleqa d (ⓕ{I}V.T) L1 L2 -. - -interpretation - "lazy equivalence (local environment) alternative" - 'LazyEqAlt T d L1 L2 = (lleqa d T L1 L2). - -(* Main inversion lemmas ****************************************************) - -theorem lleqa_inv_lleq: ∀L1,L2,T,d. L1 ⋕⋕[T, d] L2 → L1 ⋕[T, d] L2. -#L1 #L2 #T #d #H elim H -L1 -L2 -T -d -/2 width=8 by lleq_flat, lleq_bind, lleq_gref, lleq_free, lleq_lref, lleq_skip, lleq_sort/ -qed-. - -(* Main properties **********************************************************) - -theorem lleq_lleqa: ∀L1,T,L2,d. L1 ⋕[T, d] L2 → L1 ⋕⋕[T, d] L2. -#L1 #T @(f2_ind … rfw … L1 T) -L1 -T -#n #IH #L1 * * /3 width=3 by lleqa_gref, lleqa_sort, lleq_fwd_length/ -[ #i #Hn #L2 #d #H elim (lleq_fwd_lref … H) [ * || * ] - /4 width=9 by lleqa_free, lleqa_lref, lleqa_skip, lleq_fwd_length, ldrop_fwd_rfw/ -| #a #I #V #T #Hn #L2 #d #H elim (lleq_inv_bind … H) -H /3 width=1 by lleqa_bind/ -| #I #V #T #Hn #L2 #d #H elim (lleq_inv_flat … H) -H /3 width=1 by lleqa_flat/ -] -qed. - -(* Advanced eliminators *****************************************************) - -lemma lleq_ind_alt: ∀R:relation4 ynat term lenv lenv. ( - ∀L1,L2,d,k. |L1| = |L2| → R d (⋆k) L1 L2 - ) → ( - ∀L1,L2,d,i. |L1| = |L2| → yinj i < d → R d (#i) L1 L2 - ) → ( - ∀I1,I2,L1,L2,K1,K2,V,d,i. d ≤ yinj i → - ⇩[i] L1 ≡ K1.ⓑ{I1}V → ⇩[i] L2 ≡ K2.ⓑ{I2}V → - K1 ⋕[V, yinj O] K2 → R (yinj O) V K1 K2 → R d (#i) L1 L2 - ) → ( - ∀L1,L2,d,i. |L1| = |L2| → |L1| ≤ i → |L2| ≤ i → R d (#i) L1 L2 - ) → ( - ∀L1,L2,d,p. |L1| = |L2| → R d (§p) L1 L2 - ) → ( - ∀a,I,L1,L2,V,T,d. - L1 ⋕[V, d]L2 → L1.ⓑ{I}V ⋕[T, ⫯d] L2.ⓑ{I}V → - R d V L1 L2 → R (⫯d) T (L1.ⓑ{I}V) (L2.ⓑ{I}V) → R d (ⓑ{a,I}V.T) L1 L2 - ) → ( - ∀I,L1,L2,V,T,d. - L1 ⋕[V, d]L2 → L1 ⋕[T, d] L2 → - R d V L1 L2 → R d T L1 L2 → R d (ⓕ{I}V.T) L1 L2 - ) → - ∀d,T,L1,L2. L1 ⋕[T, d] L2 → R d T L1 L2. -#R #H1 #H2 #H3 #H4 #H5 #H6 #H7 #d #T #L1 #L2 #H elim (lleq_lleqa … H) -H -/3 width=9 by lleqa_inv_lleq/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lleq_alt/lleq_ext.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lleq_alt/lleq_ext.etc deleted file mode 100644 index d6bb03fa7..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lleq_alt/lleq_ext.etc +++ /dev/null @@ -1,91 +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/substitution/lleq_alt.ma". - -(* LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **********************************) - -(* Advanced inversion lemmas ************************************************) - -fact lleq_inv_S_aux: ∀L1,L2,T,d0. L1 ⋕[T, d0] L2 → ∀d. d0 = d + 1 → - ∀K1,K2,I,V. ⇩[d] L1 ≡ K1.ⓑ{I}V → ⇩[d] L2 ≡ K2.ⓑ{I}V → - K1 ⋕[V, 0] K2 → L1 ⋕[T, d] L2. -#L1 #L2 #T #d0 #H @(lleq_ind_alt … H) -L1 -L2 -T -d0 -/2 width=1 by lleq_gref, lleq_free, lleq_sort/ -[ #L1 #L2 #d0 #i #HL12 #Hid #d #H #K1 #K2 #I #V #HLK1 #HLK2 #HV destruct - elim (yle_split_eq i d) /2 width=1 by lleq_skip, ylt_fwd_succ2/ -HL12 -Hid - #H destruct /2 width=8 by lleq_lref/ -| #I1 #I2 #L1 #L2 #K11 #K22 #V #d0 #i #Hd0i #HLK11 #HLK22 #HV #_ #d #H #K1 #K2 #J #W #_ #_ #_ destruct - /3 width=8 by lleq_lref, yle_pred_sn/ -| #a #I #L1 #L2 #V #T #d0 #_ #_ #IHV #IHT #d #H #K1 #K2 #J #W #HLK1 #HLK2 destruct - /4 width=7 by lleq_bind, ldrop_drop/ -| #I #L1 #L2 #V #T #d0 #_ #_ #IHV #IHT #d #H #K1 #K2 #J #W #HLK1 #HLK2 destruct - /3 width=7 by lleq_flat/ -] -qed-. - -lemma lleq_inv_S: ∀T,L1,L2,d. L1 ⋕[T, d+1] L2 → - ∀K1,K2,I,V. ⇩[d] L1 ≡ K1.ⓑ{I}V → ⇩[d] L2 ≡ K2.ⓑ{I}V → - K1 ⋕[V, 0] K2 → L1 ⋕[T, d] L2. -/2 width=7 by lleq_inv_S_aux/ qed-. - -lemma lleq_inv_bind_O: ∀a,I,L1,L2,V,T. L1 ⋕[ⓑ{a,I}V.T, 0] L2 → - L1 ⋕[V, 0] L2 ∧ L1.ⓑ{I}V ⋕[T, 0] L2.ⓑ{I}V. -#a #I #L1 #L2 #V #T #H elim (lleq_inv_bind … H) -H -/3 width=7 by ldrop_pair, conj, lleq_inv_S/ -qed-. - -(* Advanced forward lemmas **************************************************) - -lemma lleq_fwd_bind_O: ∀a,I,L1,L2,V,T. L1 ⋕[ⓑ{a,I}V.T, 0] L2 → - L1.ⓑ{I}V ⋕[T, 0] L2.ⓑ{I}V. -#a #I #L1 #L2 #V #T #H elim (lleq_inv_bind_O … H) -H // -qed-. - -(* Advanced properties ******************************************************) - -lemma lleq_ge: ∀L1,L2,T,d1. L1 ⋕[T, d1] L2 → ∀d2. d1 ≤ d2 → L1 ⋕[T, d2] L2. -#L1 #L2 #T #d1 #H @(lleq_ind_alt … H) -L1 -L2 -T -d1 -/4 width=1 by lleq_sort, lleq_free, lleq_gref, lleq_bind, lleq_flat, yle_succ/ -[ /3 width=3 by lleq_skip, ylt_yle_trans/ -| #I1 #I2 #L1 #L2 #K1 #K2 #V #d1 #i #Hi #HLK1 #HLK2 #HV #IHV #d2 #Hd12 elim (ylt_split i d2) - [ lapply (lleq_fwd_length … HV) #HK12 #Hid2 - lapply (ldrop_fwd_length … HLK1) lapply (ldrop_fwd_length … HLK2) - normalize in ⊢ (%→%→?); -I1 -I2 -V -d1 /2 width=1 by lleq_skip/ - | /3 width=8 by lleq_lref, yle_trans/ - ] -] -qed-. - -lemma lleq_bind_O: ∀a,I,L1,L2,V,T. L1 ⋕[V, 0] L2 → L1.ⓑ{I}V ⋕[T, 0] L2.ⓑ{I}V → - L1 ⋕[ⓑ{a,I}V.T, 0] L2. -/3 width=3 by lleq_ge, lleq_bind/ qed. - -lemma lleq_bind_repl_SO: ∀I1,I2,L1,L2,V1,V2,T. L1.ⓑ{I1}V1 ⋕[T, 0] L2.ⓑ{I2}V2 → - ∀J1,J2,W1,W2. L1.ⓑ{J1}W1 ⋕[T, 1] L2.ⓑ{J2}W2. -#I1 #I2 #L1 #L2 #V1 #V2 #T #HT #J1 #J2 #W1 #W2 lapply (lleq_ge … HT 1 ?) // -HT -#HT @(lleq_lsuby_repl … HT) /2 width=1 by lsuby_succ/ (**) (* full auto fails *) -qed-. - -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. -/3 width=7 by lleq_bind_repl_SO, lleq_inv_S/ qed-. - -(* Inversion lemmas on negated lazy quivalence for local environments *******) - -lemma nlleq_inv_bind_O: ∀a,I,L1,L2,V,T. (L1 ⋕[ⓑ{a,I}V.T, 0] L2 → ⊥) → - (L1 ⋕[V, 0] L2 → ⊥) ∨ (L1.ⓑ{I}V ⋕[T, 0] L2.ⓑ{I}V → ⊥). -#a #I #L1 #L2 #V #T #H elim (lleq_dec V L1 L2 0) -/4 width=1 by lleq_bind_O, or_intror, or_introl/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lleq_alt/lleq_fqus.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lleq_alt/lleq_fqus.etc deleted file mode 100644 index 18744a539..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lleq_alt/lleq_fqus.etc +++ /dev/null @@ -1,75 +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/substitution/fqus_alt.ma". -include "basic_2/substitution/lleq_ext.ma". - -(* LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **********************************) - -(* Properties on supclosure and derivatives *********************************) - -lemma lleq_fqu_trans: ∀G1,G2,L2,K2,T,U. ⦃G1, L2, T⦄ ⊃ ⦃G2, K2, U⦄ → - ∀L1. L1 ⋕[T, 0] L2 → - ∃∃K1. ⦃G1, L1, T⦄ ⊃ ⦃G2, K1, U⦄ & K1 ⋕[U, 0] K2. -#G1 #G2 #L2 #K2 #T #U #H elim H -G1 -G2 -L2 -K2 -T -U -[ #I #G #L2 #V #L1 #H elim (lleq_inv_lref_ge_dx … H … I L2 V) -H // - #I1 #K1 #H1 #H2 lapply (ldrop_inv_O2 … H1) -H1 - #H destruct /2 width=3 by fqu_lref_O, ex2_intro/ -| * [ #a ] #I #G #L2 #V #T #L1 #H - [ elim (lleq_inv_bind … H) - | elim (lleq_inv_flat … H) - ] -H - /2 width=3 by fqu_pair_sn, ex2_intro/ -| #a #I #G #L2 #V #T #L1 #H elim (lleq_inv_bind_O … H) -H - #H3 #H4 /2 width=3 by fqu_bind_dx, ex2_intro/ -| #I #G #L2 #V #T #L1 #H elim (lleq_inv_flat … H) -H - /2 width=3 by fqu_flat_dx, ex2_intro/ -| #G #L2 #K2 #T #U #e #HLK2 #HTU #L1 #HL12 - elim (ldrop_O1_le (e+1) L1) - [ /3 width=12 by fqu_drop, lleq_inv_lift_le, ex2_intro/ - | lapply (ldrop_fwd_length_le2 … HLK2) -K2 - lapply (lleq_fwd_length … HL12) -T -U // - ] -] -qed-. - -lemma lleq_fquq_trans: ∀G1,G2,L2,K2,T,U. ⦃G1, L2, T⦄ ⊃⸮ ⦃G2, K2, U⦄ → - ∀L1. L1 ⋕[T, 0] L2 → - ∃∃K1. ⦃G1, L1, T⦄ ⊃⸮ ⦃G2, K1, U⦄ & K1 ⋕[U, 0] K2. -#G1 #G2 #L2 #K2 #T #U #H #L1 #HL12 elim(fquq_inv_gen … H) -H -[ #H elim (lleq_fqu_trans … H … HL12) -L2 /3 width=3 by fqu_fquq, ex2_intro/ -| * #HG #HL #HT destruct /2 width=3 by ex2_intro/ -] -qed-. - -lemma lleq_fqup_trans: ∀G1,G2,L2,K2,T,U. ⦃G1, L2, T⦄ ⊃+ ⦃G2, K2, U⦄ → - ∀L1. L1 ⋕[T, 0] L2 → - ∃∃K1. ⦃G1, L1, T⦄ ⊃+ ⦃G2, K1, U⦄ & K1 ⋕[U, 0] K2. -#G1 #G2 #L2 #K2 #T #U #H @(fqup_ind … H) -G2 -K2 -U -[ #G2 #K2 #U #HTU #L1 #HL12 elim (lleq_fqu_trans … HTU … HL12) -L2 - /3 width=3 by fqu_fqup, ex2_intro/ -| #G #G2 #K #K2 #U #U2 #_ #HU2 #IHTU #L1 #HL12 elim (IHTU … HL12) -L2 - #K1 #HTU #HK1 elim (lleq_fqu_trans … HU2 … HK1) -K - /3 width=5 by fqup_strap1, ex2_intro/ -] -qed-. - -lemma lleq_fqus_trans: ∀G1,G2,L2,K2,T,U. ⦃G1, L2, T⦄ ⊃* ⦃G2, K2, U⦄ → - ∀L1. L1 ⋕[T, 0] L2 → - ∃∃K1. ⦃G1, L1, T⦄ ⊃* ⦃G2, K1, U⦄ & K1 ⋕[U, 0] K2. -#G1 #G2 #L2 #K2 #T #U #H #L1 #HL12 elim(fqus_inv_gen … H) -H -[ #H elim (lleq_fqup_trans … H … HL12) -L2 /3 width=3 by fqup_fqus, ex2_intro/ -| * #HG #HL #HT destruct /2 width=3 by ex2_intro/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lleq_alt/lleq_ldrop.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lleq_alt/lleq_ldrop.etc deleted file mode 100644 index 9cb597c6f..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lleq_alt/lleq_ldrop.etc +++ /dev/null @@ -1,123 +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/substitution/cpys_lift.ma". -include "basic_2/substitution/lleq.ma". - -(* LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **********************************) - -(* Advanced properties ******************************************************) - -lemma lleq_skip: ∀L1,L2,d,i. yinj i < d → |L1| = |L2| → L1 ⋕[#i, d] L2. -#L1 #L2 #d #i #Hid #HL12 @conj // -HL12 -#U @conj #H elim (cpys_inv_lref1 … H) -H // * -#I #Z #Y #X #H elim (ylt_yle_false … Hid … H) -qed. - -lemma lleq_lref: ∀I1,I2,L1,L2,K1,K2,V,d,i. d ≤ yinj i → - ⇩[i] L1 ≡ K1.ⓑ{I1}V → ⇩[i] L2 ≡ K2.ⓑ{I2}V → - K1 ⋕[V, 0] K2 → L1 ⋕[#i, d] L2. -#I1 #I2 #L1 #L2 #K1 #K2 #V #d #i #Hdi #HLK1 #HLK2 * #HK12 #IH @conj [ -IH | -HK12 ] -[ lapply (ldrop_fwd_length … HLK1) -HLK1 #H1 - lapply (ldrop_fwd_length … HLK2) -HLK2 #H2 - >H1 >H2 -H1 -H2 normalize // -| #U @conj #H elim (cpys_inv_lref1 … H) -H // * - >yminus_Y_inj #I #K #X #W #_ #_ #H #HVW #HWU - [ letin HLK ≝ HLK1 | letin HLK ≝ HLK2 ] - lapply (ldrop_mono … H … HLK) -H #H destruct elim (IH W) - /3 width=7 by cpys_subst_Y2/ -] -qed. - -lemma lleq_free: ∀L1,L2,d,i. |L1| ≤ i → |L2| ≤ i → |L1| = |L2| → L1 ⋕[#i, d] L2. -#L1 #L2 #d #i #HL1 #HL2 #HL12 @conj // -HL12 -#U @conj #H elim (cpys_inv_lref1 … H) -H // * -#I #Z #Y #X #_ #_ #H lapply (ldrop_fwd_length_lt2 … H) -H -#H elim (lt_refl_false i) /2 width=3 by lt_to_le_to_lt/ -qed. - -(* Properties on relocation *************************************************) - -lemma lleq_lift_le: ∀K1,K2,T,dt. K1 ⋕[T, dt] K2 → - ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → - ∀U. ⇧[d, e] T ≡ U → dt ≤ d → L1 ⋕[U, dt] L2. -#K1 #K2 #T #dt * #HK12 #IHT #L1 #L2 #d #e #HLK1 #HLK2 #U #HTU #Hdtd -lapply (ldrop_fwd_length … HLK1) lapply (ldrop_fwd_length … HLK2) -#H2 #H1 @conj // -HK12 -H1 -H2 #U0 @conj #HU0 -[ letin HLKA ≝ HLK1 letin HLKB ≝ HLK2 | letin HLKA ≝ HLK2 letin HLKB ≝ HLK1 ] -elim (cpys_inv_lift1_be … HU0 … HLKA … HTU) // -HU0 >yminus_Y_inj #T0 #HT0 #HTU0 -elim (IHT T0) [ #H #_ | #_ #H ] -IHT /3 width=12 by cpys_lift_be/ -qed-. - -lemma lleq_lift_ge: ∀K1,K2,T,dt. K1 ⋕[T, dt] K2 → - ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → - ∀U. ⇧[d, e] T ≡ U → d ≤ dt → L1 ⋕[U, dt+e] L2. -#K1 #K2 #T #dt * #HK12 #IHT #L1 #L2 #d #e #HLK1 #HLK2 #U #HTU #Hddt -lapply (ldrop_fwd_length … HLK1) lapply (ldrop_fwd_length … HLK2) -#H2 #H1 @conj // -HK12 -H1 -H2 #U0 @conj #HU0 -[ letin HLKA ≝ HLK1 letin HLKB ≝ HLK2 | letin HLKA ≝ HLK2 letin HLKB ≝ HLK1 ] -elim (cpys_inv_lift1_ge … HU0 … HLKA … HTU) /2 width=1 by monotonic_yle_plus_dx/ -HU0 >yplus_minus_inj #T0 #HT0 #HTU0 -elim (IHT T0) [ #H #_ | #_ #H ] -IHT /3 width=10 by cpys_lift_ge/ -qed-. - -(* Inversion lemmas on relocation *******************************************) - -lemma lleq_inv_lift_le: ∀L1,L2,U,dt. L1 ⋕[U, dt] L2 → - ∀K1,K2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → - ∀T. ⇧[d, e] T ≡ U → dt ≤ d → K1 ⋕[T, dt] K2. -#L1 #L2 #U #dt * #HL12 #IH #K1 #K2 #d #e #HLK1 #HLK2 #T #HTU #Hdtd -lapply (ldrop_fwd_length_minus2 … HLK1) lapply (ldrop_fwd_length_minus2 … HLK2) -#H2 #H1 @conj // -HL12 -H1 -H2 -#T0 elim (lift_total T0 d e) -#U0 #HTU0 elim (IH U0) -IH -#H12 #H21 @conj #HT0 -[ letin HLKA ≝ HLK1 letin HLKB ≝ HLK2 letin H0 ≝ H12 | letin HLKA ≝ HLK2 letin HLKB ≝ HLK1 letin H0 ≝ H21 ] -lapply (cpys_lift_be … HT0 … HLKA … HTU … HTU0) // -HT0 ->yplus_Y1 #HU0 elim (cpys_inv_lift1_be … (H0 HU0) … HLKB … HTU) // -L1 -L2 -U -Hdtd -#X #HT0 #HX lapply (lift_inj … HX … HTU0) -U0 // -qed-. - -lemma lleq_inv_lift_ge: ∀L1,L2,U,dt. L1 ⋕[U, dt] L2 → - ∀K1,K2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → - ∀T. ⇧[d, e] T ≡ U → yinj d + e ≤ dt → K1 ⋕[T, dt-e] K2. -#L1 #L2 #U #dt * #HL12 #IH #K1 #K2 #d #e #HLK1 #HLK2 #T #HTU #Hdedt -lapply (ldrop_fwd_length_minus2 … HLK1) lapply (ldrop_fwd_length_minus2 … HLK2) -#H2 #H1 @conj // -HL12 -H1 -H2 -elim (yle_inv_plus_inj2 … Hdedt) #Hddt #Hedt -#T0 elim (lift_total T0 d e) -#U0 #HTU0 elim (IH U0) -IH -#H12 #H21 @conj #HT0 -[ letin HLKA ≝ HLK1 letin HLKB ≝ HLK2 letin H0 ≝ H12 | letin HLKA ≝ HLK2 letin HLKB ≝ HLK1 letin H0 ≝ H21 ] -lapply (cpys_lift_ge … HT0 … HLKA … HTU … HTU0) // -HT0 -Hddt ->ymax_pre_sn // #HU0 elim (cpys_inv_lift1_ge … (H0 HU0) … HLKB … HTU) // -L1 -L2 -U -Hdedt -Hedt -#X #HT0 #HX lapply (lift_inj … HX … HTU0) -U0 // -qed-. - -lemma lleq_inv_lift_be: ∀L1,L2,U,dt. L1 ⋕[U, dt] L2 → - ∀K1,K2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → - ∀T. ⇧[d, e] T ≡ U → d ≤ dt → dt ≤ yinj d + e → K1 ⋕[T, d] K2. -#L1 #L2 #U #dt * #HL12 #IH #K1 #K2 #d #e #HLK1 #HLK2 #T #HTU #Hddt #Hdtde -lapply (ldrop_fwd_length_minus2 … HLK1) lapply (ldrop_fwd_length_minus2 … HLK2) -#H2 #H1 @conj // -HL12 -H1 -H2 -#T0 elim (lift_total T0 d e) -#U0 #HTU0 elim (IH U0) -IH -#H12 #H21 @conj #HT0 -[ letin HLKA ≝ HLK1 letin HLKB ≝ HLK2 letin H0 ≝ H12 | letin HLKA ≝ HLK2 letin HLKB ≝ HLK1 letin H0 ≝ H21 ] -lapply (cpys_lift_ge … HT0 … HLKA … HTU … HTU0) // -HT0 -#HU0 lapply (cpys_weak … HU0 dt (∞) ? ?) // -HU0 -#HU0 lapply (H0 HU0) -#HU0 lapply (cpys_weak … HU0 d (∞) ? ?) // -HU0 -#HU0 elim (cpys_inv_lift1_ge_up … HU0 … HLKB … HTU) // -L1 -L2 -U -Hddt -Hdtde -#X #HT0 #HX lapply (lift_inj … HX … HTU0) -U0 // -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lleq_alt/lleq_lleq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lleq_alt/lleq_lleq.etc deleted file mode 100644 index 2a8873d9b..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lleq_alt/lleq_lleq.etc +++ /dev/null @@ -1,175 +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/substitution/cpys_cpys.ma". -include "basic_2/substitution/lleq_ldrop.ma". - -(* Advanced forward lemmas **************************************************) - -lemma lleq_fwd_lref: ∀L1,L2. ∀d:ynat. ∀i:nat. L1 ⋕[#i, d] L2 → - ∨∨ |L1| ≤ i ∧ |L2| ≤ i - | yinj i < d - | ∃∃I1,I2,K1,K2,V. ⇩[i] L1 ≡ K1.ⓑ{I1}V & - ⇩[i] L2 ≡ K2.ⓑ{I2}V & - K1 ⋕[V, yinj 0] K2 & d ≤ yinj i. -#L1 #L2 #d #i * #HL12 #IH elim (lt_or_ge i (|L1|)) /3 width=3 by or3_intro0, conj/ -elim (ylt_split i d) /2 width=1 by or3_intro1/ #Hdi #Hi -elim (ldrop_O1_lt … Hi) #I1 #K1 #V1 #HLK1 -elim (ldrop_O1_lt L2 i) // -Hi #I2 #K2 #V2 #HLK2 -lapply (ldrop_fwd_length_minus2 … HLK2) #H -lapply (ldrop_fwd_length_minus2 … HLK1) >HL12 yminus_Y_inj ] /3 width=7 by cpys_subst_Y2, yle_inj/ -qed-. - -lemma lleq_fwd_lref_dx: ∀L1,L2,d,i. L1 ⋕[#i, d] L2 → - ∀I2,K2,V. ⇩[i] L2 ≡ K2.ⓑ{I2}V → - i < d ∨ - ∃∃I1,K1. ⇩[i] L1 ≡ K1.ⓑ{I1}V & K1 ⋕[V, 0] K2 & d ≤ i. -#L1 #L2 #d #i #H #I2 #K2 #V #HLK2 elim (lleq_fwd_lref … H) -H [ * || * ] -[ #_ #H elim (lt_refl_false i) - lapply (ldrop_fwd_length_lt2 … HLK2) -HLK2 - /2 width=3 by lt_to_le_to_lt/ (**) (* full auto too slow *) -| /2 width=1 by or_introl/ -| #I1 #I2 #K11 #K22 #V0 #HLK11 #HLK22 #HV0 #Hdi lapply (ldrop_mono … HLK22 … HLK2) -L2 - #H destruct /3 width=5 by ex3_2_intro, or_intror/ -] -qed-. - -lemma lleq_fwd_lref_sn: ∀L1,L2,d,i. L1 ⋕[#i, d] L2 → - ∀I1,K1,V. ⇩[i] L1 ≡ K1.ⓑ{I1}V → - i < d ∨ - ∃∃I2,K2. ⇩[i] L2 ≡ K2.ⓑ{I2}V & K1 ⋕[V, 0] K2 & d ≤ i. -#L1 #L2 #d #i #HL12 #I1 #K1 #V #HLK1 elim (lleq_fwd_lref_dx L2 … d … HLK1) -HLK1 -[2: * ] /4 width=6 by lleq_sym, ex3_2_intro, or_introl, or_intror/ -qed-. - -(* Advanced inversion lemmas ************************************************) - -lemma lleq_inv_lref_ge_dx: ∀L1,L2,d,i. L1 ⋕[#i, d] L2 → d ≤ i → - ∀I2,K2,V. ⇩[i] L2 ≡ K2.ⓑ{I2}V → - ∃∃I1,K1. ⇩[i] L1 ≡ K1.ⓑ{I1}V & K1 ⋕[V, 0] K2. -#L1 #L2 #d #i #H #Hdi #I2 #K2 #V #HLK2 elim (lleq_fwd_lref_dx … H … HLK2) -L2 -[ #H elim (ylt_yle_false … H Hdi) -| * /2 width=4 by ex2_2_intro/ -] -qed-. - -lemma lleq_inv_lref_ge_sn: ∀L1,L2,d,i. L1 ⋕[#i, d] L2 → d ≤ i → - ∀I1,K1,V. ⇩[i] L1 ≡ K1.ⓑ{I1}V → - ∃∃I2,K2. ⇩[i] L2 ≡ K2.ⓑ{I2}V & K1 ⋕[V, 0] K2. -#L1 #L2 #d #i #HL12 #Hdi #I1 #K1 #V #HLK1 elim (lleq_inv_lref_ge_dx L2 … Hdi … HLK1) -Hdi -HLK1 -/3 width=4 by lleq_sym, ex2_2_intro/ -qed-. - -lemma lleq_inv_lref_ge_gen: ∀L1,L2,d,i. L1 ⋕[#i, d] L2 → d ≤ i → - ∀I1,I2,K1,K2,V1,V2. - ⇩[i] L1 ≡ K1.ⓑ{I1}V1 → ⇩[i] L2 ≡ K2.ⓑ{I2}V2 → - V1 = V2 ∧ K1 ⋕[V2, 0] K2. -#L1 #L2 #d #i #HL12 #Hdi #I1 #I2 #K1 #K2 #V1 #V2 #HLK1 #HLK2 -elim (lleq_inv_lref_ge_sn … HL12 … HLK1) // -L1 -d -#J #Y #HY lapply (ldrop_mono … HY … HLK2) -L2 -i #H destruct /2 width=1 by conj/ -qed-. - -lemma lleq_inv_lref_ge: ∀L1,L2,d,i. L1 ⋕[#i, d] L2 → d ≤ i → - ∀I,K1,K2,V. ⇩[i] L1 ≡ K1.ⓑ{I}V → ⇩[i] L2 ≡ K2.ⓑ{I}V → - K1 ⋕[V, 0] K2. -#L1 #L2 #d #i #HL12 #Hdi #I #K1 #K2 #V #HLK1 #HLK2 -elim (lleq_inv_lref_ge_gen … HL12 … HLK1 HLK2) // -qed-. - -(* Advanced properties ******************************************************) - -lemma lleq_dec: ∀T,L1,L2,d. Decidable (L1 ⋕[T, d] L2). -#T #L1 @(f2_ind … rfw … L1 T) -L1 -T -#n #IH #L1 * * -[ #k #Hn #L2 elim (eq_nat_dec (|L1|) (|L2|)) /3 width=1 by or_introl, lleq_sort/ -| #i #Hn #L2 elim (eq_nat_dec (|L1|) (|L2|)) - [ #HL12 #d elim (ylt_split i d) /3 width=1 by lleq_skip, or_introl/ - #Hdi elim (lt_or_ge i (|L1|)) #HiL1 - elim (lt_or_ge i (|L2|)) #HiL2 /3 width=1 by or_introl, lleq_free/ - elim (ldrop_O1_lt … HiL2) #I2 #K2 #V2 #HLK2 - elim (ldrop_O1_lt … HiL1) #I1 #K1 #V1 #HLK1 - elim (eq_term_dec V2 V1) - [ #H3 elim (IH K1 V1 … K2 0) destruct - /3 width=8 by lleq_lref, ldrop_fwd_rfw, or_introl/ - ] - -IH #H3 @or_intror - #H elim (lleq_fwd_lref … H) -H [1,3,4,6: * ] - [1,3: /3 width=4 by lt_to_le_to_lt, lt_refl_false/ - |5,6: /2 width=4 by ylt_yle_false/ - ] - #Z1 #Z2 #Y1 #Y2 #X #HLY1 #HLY2 #HX #_ - lapply (ldrop_mono … HLY1 … HLK1) -HLY1 -HLK1 - lapply (ldrop_mono … HLY2 … HLK2) -HLY2 -HLK2 - #H2 #H1 destruct /2 width=1 by/ - ] -| #p #Hn #L2 elim (eq_nat_dec (|L1|) (|L2|)) /3 width=1 by or_introl, lleq_gref/ -| #a #I #V #T #Hn #L2 #d destruct - elim (IH L1 V … L2 d) /2 width=1 by/ - elim (IH (L1.ⓑ{I}V) T … (L2.ⓑ{I}V) (d+1)) -IH /3 width=1 by or_introl, lleq_bind/ - #H1 #H2 @or_intror - #H elim (lleq_inv_bind … H) -H /2 width=1 by/ -| #I #V #T #Hn #L2 #d destruct - elim (IH L1 V … L2 d) /2 width=1 by/ - elim (IH L1 T … L2 d) -IH /3 width=1 by or_introl, lleq_flat/ - #H1 #H2 @or_intror - #H elim (lleq_inv_flat … H) -H /2 width=1 by/ -] --n /4 width=3 by lleq_fwd_length, or_intror/ -qed-. - -(* Main properties **********************************************************) - -theorem lleq_trans: ∀d,T. Transitive … (lleq d T). -#d #T #L1 #L * #HL1 #IH1 #L2 * #HL2 #IH2 /3 width=3 by conj, iff_trans/ -qed-. - -theorem lleq_canc_sn: ∀L,L1,L2,T,d. L ⋕[d, T] L1→ L ⋕[d, T] L2 → L1 ⋕[d, T] L2. -/3 width=3 by lleq_trans, lleq_sym/ qed-. - -theorem lleq_canc_dx: ∀L1,L2,L,T,d. L1 ⋕[d, T] L → L2 ⋕[d, T] L → L1 ⋕[d, T] L2. -/3 width=3 by lleq_trans, lleq_sym/ qed-. - -(* Inversion lemmas on negated lazy quivalence for local environments *******) - -lemma nlleq_inv_bind: ∀a,I,L1,L2,V,T,d. (L1 ⋕[ⓑ{a,I}V.T, d] L2 → ⊥) → - (L1 ⋕[V, d] L2 → ⊥) ∨ (L1.ⓑ{I}V ⋕[T, ⫯d] L2.ⓑ{I}V → ⊥). -#a #I #L1 #L2 #V #T #d #H elim (lleq_dec V L1 L2 d) -/4 width=1 by lleq_bind, or_intror, or_introl/ -qed-. - -lemma nlleq_inv_flat: ∀I,L1,L2,V,T,d. (L1 ⋕[ⓕ{I}V.T, d] L2 → ⊥) → - (L1 ⋕[V, d] L2 → ⊥) ∨ (L1 ⋕[T, d] L2 → ⊥). -#I #L1 #L2 #V #T #d #H elim (lleq_dec V L1 L2 d) -/4 width=1 by lleq_flat, or_intror, or_introl/ -qed-. - -(* Note: lleq_nlleq_trans: ∀d,T,L1,L. L1⋕[T, d] L → - ∀L2. (L ⋕[T, d] L2 → ⊥) → (L1 ⋕[T, d] L2 → ⊥). -/3 width=3 by lleq_canc_sn/ qed-. -works with /4 width=8/ so lleq_canc_sn is more convenient -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llneq/lazynegatedeq_4.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llneq/lazynegatedeq_4.etc deleted file mode 100644 index 6b0cb85e5..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llneq/lazynegatedeq_4.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( L1 ⧣ break [ term 46 T , break term 46 d ] break term 46 L2 )" - non associative with precedence 45 - for @{ 'LazyNegatedEq $T $d $L1 $L2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llneq/lazynegatedeqalt_4.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llneq/lazynegatedeqalt_4.etc deleted file mode 100644 index b150f63ff..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llneq/lazynegatedeqalt_4.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( L1 ⧣ ⧣ break [ term 46 T , break term 46 d ] break term 46 L2 )" - non associative with precedence 45 - for @{ 'LazyNegatedEqAlt $T $d $L1 $L2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llneq/llneq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llneq/llneq.etc deleted file mode 100644 index d41a4e83c..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llneq/llneq.etc +++ /dev/null @@ -1,25 +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/notation/relations/lazynegatedeq_4.ma". -include "basic_2/substitution/lleq.ma". - -(* NEGATED LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **************************) - -definition llneq: relation4 ynat term lenv lenv ≝ - λd,T,L1,L2. |L1| = |L2| ∧ (L1 ⋕[T, d] L2 → ⊥). - -interpretation - "negated lazy equivalence (local environment)" - 'LazyNegatedEq T d L1 L2 = (llneq d T L1 L2). diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llneq/llneq_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llneq/llneq_alt.etc deleted file mode 100644 index 00eb2c34e..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llneq/llneq_alt.etc +++ /dev/null @@ -1,68 +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/notation/relations/lazynegatedeqalt_4.ma". -include "basic_2/substitution/lleq_lleq.ma". -include "basic_2/substitution/llneq.ma". - -(* NEGATED LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **************************) - -(* alternative definition of llneq *) -inductive llneqa: relation4 ynat term lenv lenv ≝ -| llneqa_neq: ∀I1,I2,L1,L2,K1,K2,V1,V2,d,i. d ≤ yinj i → - ⇩[i]L1 ≡ K1.ⓑ{I1}V1 → ⇩[i]L2 ≡ K2.ⓑ{I2}V2 → - |K1| = |K2| → (V1 = V2 → ⊥) → llneqa d (#i) L1 L2 -| llneqa_eq : ∀I1,I2,L1,L2,K1,K2,V,d,i. d ≤ yinj i → - ⇩[i]L1 ≡ K1.ⓑ{I1}V → ⇩[i]L2 ≡ K2.ⓑ{I2}V → - llneqa 0 (V) K1 K2 → llneqa d (#i) L1 L2 -| llneqa_bind_sn: ∀a,I,L1,L2,V,T,d. - llneqa d V L1 L2 → llneqa d (ⓑ{a,I}V.T) L1 L2 -| llneqa_bind_dx: ∀a,I,L1,L2,V,T,d. - llneqa (⫯d) T (L1.ⓑ{I}V) (L2.ⓑ{I}V) → llneqa d (ⓑ{a,I}V.T) L1 L2 -| llneqa_flat_sn: ∀I,L1,L2,V,T,d. - llneqa d V L1 L2 → llneqa d (ⓕ{I}V.T) L1 L2 -| llneqa_flat_dx: ∀I,L1,L2,V,T,d. - llneqa d T L1 L2 → llneqa d (ⓕ{I}V.T) L1 L2 -. - -interpretation - "negated lazy equivalence (local environment) alternative" - 'LazyNegatedEqAlt T d L1 L2 = (llneqa d T L1 L2). - -(* Main properties **********************************************************) - -theorem llneq_llneqa: ∀T,L1,L2,d. L1 ⧣[T, d] L2 → L1 ⧣⧣[T, d] L2. -#T #L1 @(f2_ind … rfw … L1 T) -L1 -T -#n #IH #L1 * * -[ #k #Hn #L2 #d * #HL12 #H elim H /2 width=1 by lleq_sort/ -| #i #Hn #L2 #d * #HL12 #H elim (ylt_split i d) #Hdi - [ elim H /2 width=1 by lleq_skip/ ] - elim (lt_or_ge i (|L1|)) #HiL1 - [2: elim H /3 width=3 by lleq_free, le_repl_sn_aux/ ] - elim (ldrop_O1_lt … HiL1) #I1 #K1 #V1 #HLK1 - elim (ldrop_O1_lt L2 i) /2 width=1 by/ #I2 #K2 #V2 #HLK2 - lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) normalize - elim (eq_term_dec V1 V2) #HnV12 destruct - [2: #H @(llneqa_neq … HLK1 … HLK2) /2 width=1 by/ ] (**) (* explicit constructor *) - elim (lleq_dec V2 K1 K2 0) #HnV2 [ elim H /2 width=8 by lleq_lref/ ] - #H @(llneqa_eq … HLK1 … HLK2) /4 width=2 by ldrop_fwd_rfw, conj/ (**) (* explicit constructor *) -| #p #Hn #L2 #d * #HL12 #H elim H /2 width=1 by lleq_gref/ -| #a #I #V #T #Hn #L2 #d * #HL12 #H destruct elim (nlleq_inv_bind … H) -H - [ /5 width=1 by llneqa_bind_sn, conj/ - | #H @llneqa_bind_dx @IH // @conj normalize /2 width=1 by/ - ] -| #I #V #T #Hn #L2 #d * #HL12 #H destruct elim (nlleq_inv_flat … H) -H - /5 width=1 by llneqa_flat_dx, llneqa_flat_sn, conj/ -] -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llneq/llneq_ext.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llneq/llneq_ext.etc deleted file mode 100644 index 235d869c2..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llneq/llneq_ext.etc +++ /dev/null @@ -1,33 +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/substitution/llneq_alt.ma". - -(* NEGATED LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **************************) - -(* Advanced inversion lemmas ************************************************) - -lemma llneq_inv_atom1: ∀L1,L2,T,d. L1 ⧣⧣[T, d] L2 → |L1| ≤ d → ⊥. -#L1 #L2 #T #d #H elim H -L1 -L2 -T -d /2 width=1 by/ -[ #I1 #I2 #L1 #L2 #K1 #K2 #V1 #V2 #d #i #Hdi #HLK1 #_ #_ #_ - >(ldrop_fwd_length … HLK1) -HLK1 normalize - #H lapply (yle_trans … H … Hdi) -d - /3 width=4 by yle_inv_inj, le_plus_xySz_x_false/ -| #I1 #I2 #L1 #L2 #K1 #K2 #V #d #i #Hdi #HLK1 #_ #_ #_ - >(ldrop_fwd_length … HLK1) -HLK1 normalize - #H lapply (yle_trans … H … Hdi) -d - /3 width=4 by yle_inv_inj, le_plus_xySz_x_false/ -| #a #I #L1 (cprs_inv_sort1 … H1) -T #H2 -lapply (cprs_inv_sort1 … H2) -L #H destruct // -qed-. - -lemma cpcs_inv_abst1: ∀a,G,L,W1,T1,T. ⦃G, L⦄ ⊢ ⓛ{a}W1.T1 ⬌* T → - ∃∃W2,T2. ⦃G, L⦄ ⊢ T ➡* ⓛ{a}W2.T2 & ⦃G, L⦄ ⊢ ⓛ{a}W1.T1 ➡* ⓛ{a}W2.T2. -#a #G #L #W1 #T1 #T #H -elim (cpcs_inv_cprs … H) -H #X #H1 #H2 -elim (cprs_inv_abst1 … H1) -H1 #W2 #T2 #HW12 #HT12 #H destruct -/3 width=6 by cprs_bind, ex2_2_intro/ -qed-. - -lemma cpcs_inv_abst2: ∀a,G,L,W1,T1,T. ⦃G, L⦄ ⊢ T ⬌* ⓛ{a}W1.T1 → - ∃∃W2,T2. ⦃G, L⦄ ⊢ T ➡* ⓛ{a}W2.T2 & ⦃G, L⦄ ⊢ ⓛ{a}W1.T1 ➡* ⓛ{a}W2.T2. -/3 width=1 by cpcs_inv_abst1, cpcs_sym/ qed-. - -(* Basic_1: was: pc3_gen_sort_abst *) -lemma cpcs_inv_sort_abst: ∀a,G,L,W,T,k. ⦃G, L⦄ ⊢ ⋆k ⬌* ⓛ{a}W.T → ⊥. -#a #G #L #W #T #k #H -elim (cpcs_inv_cprs … H) -H #X #H1 ->(cprs_inv_sort1 … H1) -X #H2 -elim (cprs_inv_abst1 … H2) -H2 #W0 #T0 #_ #_ #H destruct -qed-. - -(* Basic_1: was: pc3_gen_lift *) -lemma cpcs_inv_lift: ∀G,L,K,s,d,e. ⇩[s, d, e] L ≡ K → - ∀T1,U1. ⇧[d, e] T1 ≡ U1 → ∀T2,U2. ⇧[d, e] T2 ≡ U2 → - ⦃G, L⦄ ⊢ U1 ⬌* U2 → ⦃G, K⦄ ⊢ T1 ⬌* T2. -#G #L #K #s #d #e #HLK #T1 #U1 #HTU1 #T2 #U2 #HTU2 #HU12 -elim (cpcs_inv_cprs … HU12) -HU12 #U #HU1 #HU2 -elim (cprs_inv_lift1 … HU1 … HLK … HTU1) -U1 #T #HTU #HT1 -elim (cprs_inv_lift1 … HU2 … HLK … HTU2) -L -U2 #X #HXU ->(lift_inj … HXU … HTU) -X -U -d -e /2 width=3 by cprs_div/ -qed-. - -(* Advanced properties ******************************************************) - -lemma llpr_cpcs_trans: ∀G,L1,L2,T1,T2. ⦃G, L1⦄ ⊢ ➡[T1, 0] L2 → ⦃G, L1⦄ ⊢ ➡[T2, 0] L2 → - ⦃G, L2⦄ ⊢ T1 ⬌* T2 → ⦃G, L1⦄ ⊢ T1 ⬌* T2. -#G #L1 #L2 #T1 #T2 #HT1 #HT2 #H elim (cpcs_inv_cprs … H) -H -/4 width=5 by cprs_div, cprs_llpr_trans/ -qed-. - -lemma llprs_cpcs_trans: ∀G,L1,L2,T1,T2. ⦃G, L1⦄ ⊢ ➡*[T1, 0] L2 → ⦃G, L1⦄ ⊢ ➡*[T2, 0] L2 → - ⦃G, L2⦄ ⊢ T1 ⬌* T2 → ⦃G, L1⦄ ⊢ T1 ⬌* T2. -#G #L1 #L2 #T1 #T2 #HT1 #HT2 #H elim (cpcs_inv_cprs … H) -H -/4 width=5 by cprs_div, llprs_cprs_trans/ -qed-. - -lemma cpr_cprs_conf_cpcs: ∀G,L,T,T1,T2. ⦃G, L⦄ ⊢ T ➡* T1 → ⦃G, L⦄ ⊢ T ➡ T2 → ⦃G, L⦄ ⊢ T1 ⬌* T2. -#G #L #T #T1 #T2 #HT1 #HT2 elim (cprs_strip … HT1 … HT2) -HT1 -HT2 -/2 width=3 by cpr_cprs_div/ -qed-. - -lemma cprs_cpr_conf_cpcs: ∀G,L,T,T1,T2. ⦃G, L⦄ ⊢ T ➡* T1 → ⦃G, L⦄ ⊢ T ➡ T2 → ⦃G, L⦄ ⊢ T2 ⬌* T1. -#G #L #T #T1 #T2 #HT1 #HT2 elim (cprs_strip … HT1 … HT2) -HT1 -HT2 -/2 width=3 by cprs_cpr_div/ -qed-. - -lemma cprs_conf_cpcs: ∀G,L,T,T1,T2. ⦃G, L⦄ ⊢ T ➡* T1 → ⦃G, L⦄ ⊢ T ➡* T2 → ⦃G, L⦄ ⊢ T1 ⬌* T2. -#G #L #T #T1 #T2 #HT1 #HT2 elim (cprs_conf … HT1 … HT2) -HT1 -HT2 -/2 width=3 by cprs_div/ -qed-. - -(* Basic_1: was: pc3_wcpr0_t *) -(* Basic_1: note: pc3_wcpr0_t should be renamed *) -lemma llpr_cprs_conf: ∀G,L1,L2,T1. ⦃G, L1⦄ ⊢ ➡[T1, 0] L2 → - ∀T2. ⦃G, L1⦄ ⊢ T1 ➡* T2 → ⦃G, L2⦄ ⊢ T1 ⬌* T2. -#G #L1 #L2 #T1 #HL12 #T2 #HT12 elim (cprs_llpr_conf_dx … HT12 … HL12) -L1 -/2 width=3 by cprs_div/ -qed-. - -(* Basic_1: was only: pc3_pr0_pr2_t *) -(* Basic_1: note: pc3_pr0_pr2_t should be renamed *) -lemma llpr_cpr_conf: ∀G,L1,L2,T1. ⦃G, L1⦄ ⊢ ➡[T1, 0] L2 → - ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ⦃G, L2⦄ ⊢ T1 ⬌* T2. -/3 width=5 by llpr_cprs_conf, cpr_cprs/ qed-. - -(* Basic_1: was only: pc3_thin_dx *) -lemma cpcs_flat: ∀G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬌* V2 → ∀T1,T2. ⦃G, L⦄ ⊢ T1 ⬌* T2 → - ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ⬌* ⓕ{I}V2.T2. -#G #L #V1 #V2 #HV12 #T1 #T2 #HT12 -elim (cpcs_inv_cprs … HV12) -HV12 -elim (cpcs_inv_cprs … HT12) -HT12 -/3 width=5 by cprs_flat, cprs_div/ -qed. - -lemma cpcs_flat_dx_cpr_rev: ∀G,L,V1,V2. ⦃G, L⦄ ⊢ V2 ➡ V1 → ∀T1,T2. ⦃G, L⦄ ⊢ T1 ⬌* T2 → - ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ⬌* ⓕ{I}V2.T2. -/3 width=1 by cpr_cpcs_sn, cpcs_flat/ qed. - -lemma cpcs_bind_dx: ∀a,I,G,L,V,T1,T2. ⦃G, L.ⓑ{I}V⦄ ⊢ T1 ⬌* T2 → - ⦃G, L⦄ ⊢ ⓑ{a,I}V.T1 ⬌* ⓑ{a,I}V.T2. -#a #I #G #L #V #T1 #T2 #HT12 elim (cpcs_inv_cprs … HT12) -HT12 -/3 width=5 by cprs_div, cprs_bind/ -qed. - -lemma cpcs_bind_sn: ∀a,I,G,L,V1,V2,T. ⦃G, L⦄ ⊢ V1 ⬌* V2 → ⦃G, L⦄ ⊢ ⓑ{a,I}V1. T ⬌* ⓑ{a,I}V2. T. -#a #I #G #L #V1 #V2 #T #HV12 elim (cpcs_inv_cprs … HV12) -HV12 -/3 width=5 by cprs_div, cprs_bind/ -qed. - -lemma lsubr_cpcs_trans: ∀G,L1,T1,T2. ⦃G, L1⦄ ⊢ T1 ⬌* T2 → - ∀L2. L2 ⊑ L1 → ⦃G, L2⦄ ⊢ T1 ⬌* T2. -#G #L1 #T1 #T2 #HT12 elim (cpcs_inv_cprs … HT12) -HT12 -/3 width=5 by cprs_div, lsubr_cprs_trans/ -qed-. - -(* Basic_1: was: pc3_lift *) -lemma cpcs_lift: ∀G,L,K,s,d,e. ⇩[s, d, e] L ≡ K → - ∀T1,U1. ⇧[d, e] T1 ≡ U1 → ∀T2,U2. ⇧[d, e] T2 ≡ U2 → - ⦃G, K⦄ ⊢ T1 ⬌* T2 → ⦃G, L⦄ ⊢ U1 ⬌* U2. -#G #L #K #s #d #e #HLK #T1 #U1 #HTU1 #T2 #U2 #HTU2 #HT12 -elim (cpcs_inv_cprs … HT12) -HT12 #T #HT1 #HT2 -elim (lift_total T d e) /3 width=12 by cprs_div, cprs_lift/ -qed. - -lemma cpcs_strip: ∀G,L,T1,T. ⦃G, L⦄ ⊢ T ⬌* T1 → ∀T2. ⦃G, L⦄ ⊢ T ⬌ T2 → - ∃∃T0. ⦃G, L⦄ ⊢ T1 ⬌ T0 & ⦃G, L⦄ ⊢ T2 ⬌* T0. -#G #L #T1 #T @TC_strip1 /2 width=3 by cpc_conf/ qed-. - -(* More inversion lemmas ****************************************************) - -axiom cpcs_inv_abst_sn: ∀a1,a2,G,L,W1,W2,T1,T2. ⦃G, L⦄ ⊢ ⓛ{a1}W1.T1 ⬌* ⓛ{a2}W2.T2 → - ∧∧ ⦃G, L⦄ ⊢ W1 ⬌* W2 & ⦃G, L.ⓛW1⦄ ⊢ T1 ⬌* T2 & a1 = a2. -(* -#a1 #a2 #G #L #W1 #W2 #T1 #T2 #H -elim (cpcs_inv_cprs … H) -H #T #H1 #H2 -elim (cprs_inv_abst1 … H1) -H1 #W0 #T0 #HW10 #HT10 #H destruct -elim (cprs_inv_abst1 … H2) -H2 #W #T #HW2 #HT2 #H destruct -lapply (llprs_cprs_conf … (L.ⓛW) … HT2) /2 width=1 by llprs_pair/ -HT2 #HT2 -lapply (llprs_cpcs_trans … (L.ⓛW1) … HT2) /2 width=1 by llprs_pair/ -HT2 #HT2 -/4 width=3 by and3_intro, cprs_div, cpcs_cprs_div, cpcs_sym/ -qed-. -*) -lemma cpcs_inv_abst_dx: ∀a1,a2,G,L,W1,W2,T1,T2. ⦃G, L⦄ ⊢ ⓛ{a1}W1.T1 ⬌* ⓛ{a2}W2.T2 → - ∧∧ ⦃G, L⦄ ⊢ W1 ⬌* W2 & ⦃G, L.ⓛW2⦄ ⊢ T1 ⬌* T2 & a1 = a2. -#a1 #a2 #G #L #W1 #W2 #T1 #T2 #HT12 lapply (cpcs_sym … HT12) -HT12 -#HT12 elim (cpcs_inv_abst_sn … HT12) -HT12 /3 width=1 by cpcs_sym, and3_intro/ -qed-. - -(* Main properties **********************************************************) - -(* Basic_1: was pc3_t *) -theorem cpcs_trans: ∀G,L,T1,T. ⦃G, L⦄ ⊢ T1 ⬌* T → ∀T2. ⦃G, L⦄ ⊢ T ⬌* T2 → ⦃G, L⦄ ⊢ T1 ⬌* T2. -#G #L #T1 #T #HT1 #T2 @(trans_TC … HT1) qed-. - -theorem cpcs_canc_sn: ∀G,L,T,T1,T2. ⦃G, L⦄ ⊢ T ⬌* T1 → ⦃G, L⦄ ⊢ T ⬌* T2 → ⦃G, L⦄ ⊢ T1 ⬌* T2. -/3 width=3 by cpcs_trans, cpcs_sym/ qed-. - -theorem cpcs_canc_dx: ∀G,L,T,T1,T2. ⦃G, L⦄ ⊢ T1 ⬌* T → ⦃G, L⦄ ⊢ T2 ⬌* T → ⦃G, L⦄ ⊢ T1 ⬌* T2. -/3 width=3 by cpcs_trans, cpcs_sym/ qed-. - -lemma cpcs_bind1: ∀a,I,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬌* V2 → - ∀T1,T2. ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ⬌* T2 → - ⦃G, L⦄ ⊢ ⓑ{a,I}V1. T1 ⬌* ⓑ{a,I}V2. T2. -/3 width=3 by cpcs_trans, cpcs_bind_sn, cpcs_bind_dx/ qed. - -lemma cpcs_bind2: ∀a,I,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬌* V2 → - ∀T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ⬌* T2 → - ⦃G, L⦄ ⊢ ⓑ{a,I}V1. T1 ⬌* ⓑ{a,I}V2. T2. -/3 width=3 by cpcs_trans, cpcs_bind_sn, cpcs_bind_dx/ qed. - -(* Basic_1: was: pc3_wcpr0 *) -lemma llpr_cpcs_conf: ∀G,L1,L2,T1,T2. ⦃G, L1⦄ ⊢ ➡[T1, 0] L2 → ⦃G, L1⦄ ⊢ ➡[T2, 0] L2 → - ⦃G, L1⦄ ⊢ T1 ⬌* T2 → ⦃G, L2⦄ ⊢ T1 ⬌* T2. -#G #L1 #L2 #T1 #T2 #HT1 #HT2 #H elim (cpcs_inv_cprs … H) -H -/3 width=5 by cpcs_canc_dx, llpr_cprs_conf/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/cprs_cprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/cprs_cprs.etc deleted file mode 100644 index a85488cdf..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/cprs_cprs.etc +++ /dev/null @@ -1,166 +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/reduction/llpr_llpr.ma". -include "basic_2/computation/cprs_lift.ma". - -(* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************) - -(* Main properties **********************************************************) - -(* Basic_1: was: pr3_t *) -(* Basic_1: includes: pr1_t *) -theorem cprs_trans: ∀G,L. Transitive … (cprs G L). -normalize /2 width=3 by trans_TC/ qed-. - -(* Basic_1: was: pr3_confluence *) -(* Basic_1: includes: pr1_confluence *) -theorem cprs_conf: ∀G,L. confluent2 … (cprs G L) (cprs G L). -normalize /3 width=3 by cpr_conf, TC_confluent2/ qed-. - -theorem cprs_bind: ∀a,I,G,L,V1,V2,T1,T2. ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ➡* T2 → ⦃G, L⦄ ⊢ V1 ➡* V2 → - ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡* ⓑ{a,I}V2.T2. -#a #I #G #L #V1 #V2 #T1 #T2 #HT12 #H @(cprs_ind … H) -V2 -/3 width=5 by cprs_trans, cprs_bind_dx/ -qed. - -(* Basic_1: was: pr3_flat *) -theorem cprs_flat: ∀I,G,L,V1,V2,T1,T2. ⦃G, L⦄ ⊢ T1 ➡* T2 → ⦃G, L⦄ ⊢ V1 ➡* V2 → - ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ➡* ⓕ{I}V2.T2. -#I #G #L #V1 #V2 #T1 #T2 #HT12 #H @(cprs_ind … H) -V2 -/3 width=3 by cprs_flat_dx, cprs_strap1, cpr_pair_sn/ -qed. - -theorem cprs_beta_rc: ∀a,G,L,V1,V2,W1,W2,T1,T2. - ⦃G, L⦄ ⊢ V1 ➡ V2 → ⦃G, L.ⓛW1⦄ ⊢ T1 ➡* T2 → ⦃G, L⦄ ⊢ W1 ➡* W2 → - ⦃G, L⦄ ⊢ ⓐV1.ⓛ{a}W1.T1 ➡* ⓓ{a}ⓝW2.V2.T2. -#a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HV12 #HT12 #H @(cprs_ind … H) -W2 /2 width=1 by cprs_beta_dx/ -#W #W2 #_ #HW2 #IHW1 (**) (* fulla uto too slow 14s *) -@(cprs_trans … IHW1) -IHW1 /3 width=1 by cprs_flat_dx, cprs_bind/ -qed. - -theorem cprs_beta: ∀a,G,L,V1,V2,W1,W2,T1,T2. - ⦃G, L.ⓛW1⦄ ⊢ T1 ➡* T2 → ⦃G, L⦄ ⊢ W1 ➡* W2 → ⦃G, L⦄ ⊢ V1 ➡* V2 → - ⦃G, L⦄ ⊢ ⓐV1.ⓛ{a}W1.T1 ➡* ⓓ{a}ⓝW2.V2.T2. -#a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HT12 #HW12 #H @(cprs_ind … H) -V2 /2 width=1 by cprs_beta_rc/ -#V #V2 #_ #HV2 #IHV1 -@(cprs_trans … IHV1) -IHV1 /3 width=1 by cprs_flat_sn, cprs_bind/ -qed. - -theorem cprs_theta_rc: ∀a,G,L,V1,V,V2,W1,W2,T1,T2. - ⦃G, L⦄ ⊢ V1 ➡ V → ⇧[0, 1] V ≡ V2 → ⦃G, L.ⓓW1⦄ ⊢ T1 ➡* T2 → - ⦃G, L⦄ ⊢ W1 ➡* W2 → ⦃G, L⦄ ⊢ ⓐV1.ⓓ{a}W1.T1 ➡* ⓓ{a}W2.ⓐV2.T2. -#a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 #HT12 #H elim H -W2 -/3 width=5 by cprs_trans, cprs_theta_dx, cprs_bind_dx/ -qed. - -theorem cprs_theta: ∀a,G,L,V1,V,V2,W1,W2,T1,T2. - ⇧[0, 1] V ≡ V2 → ⦃G, L⦄ ⊢ W1 ➡* W2 → ⦃G, L.ⓓW1⦄ ⊢ T1 ➡* T2 → - ⦃G, L⦄ ⊢ V1 ➡* V → ⦃G, L⦄ ⊢ ⓐV1.ⓓ{a}W1.T1 ➡* ⓓ{a}W2.ⓐV2.T2. -#a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV2 #HW12 #HT12 #H @(TC_ind_dx … V1 H) -V1 -/3 width=3 by cprs_trans, cprs_theta_rc, cprs_flat_dx/ -qed. - -(* Advanced inversion lemmas ************************************************) - -(* Basic_1: was pr3_gen_appl *) -lemma cprs_inv_appl1: ∀G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓐV1.T1 ➡* U2 → - ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡* V2 & ⦃G, L⦄ ⊢ T1 ➡* T2 & - U2 = ⓐV2. T2 - | ∃∃a,W,T. ⦃G, L⦄ ⊢ T1 ➡* ⓛ{a}W.T & - ⦃G, L⦄ ⊢ ⓓ{a}ⓝW.V1.T ➡* U2 - | ∃∃a,V0,V2,V,T. ⦃G, L⦄ ⊢ V1 ➡* V0 & ⇧[0,1] V0 ≡ V2 & - ⦃G, L⦄ ⊢ T1 ➡* ⓓ{a}V.T & - ⦃G, L⦄ ⊢ ⓓ{a}V.ⓐV2.T ➡* U2. -#G #L #V1 #T1 #U2 #H @(cprs_ind … H) -U2 /3 width=5 by or3_intro0, ex3_2_intro/ -#U #U2 #_ #HU2 * * -[ #V0 #T0 #HV10 #HT10 #H destruct - elim (cpr_inv_appl1 … HU2) -HU2 * - [ #V2 #T2 #HV02 #HT02 #H destruct /4 width=5 by cprs_strap1, or3_intro0, ex3_2_intro/ - | #a #V2 #W #W2 #T #T2 #HV02 #HW2 #HT2 #H1 #H2 destruct - lapply (cprs_strap1 … HV10 … HV02) -V0 #HV12 - lapply (lsubr_cpr_trans … HT2 (L.ⓓⓝW.V1) ?) -HT2 - /5 width=5 by cprs_flat_dx, cpr_cprs, cprs_bind, lsubr_abst, ex2_3_intro, or3_intro1/ - | #a #V #V2 #W0 #W2 #T #T2 #HV0 #HV2 #HW02 #HT2 #H1 #H2 destruct - @or3_intro2 @(ex4_5_intro … HV2 HT10) /3 width=3 by cprs_flat_sn, cprs_strap1, cpr_cprs, cprs_bind/ (**) (* full auto is too slow 11s *) - ] -| /4 width=9 by cprs_strap1, or3_intro1, ex2_3_intro/ -| /4 width=11 by cprs_strap1, or3_intro2, ex4_5_intro/ -] -qed-. - -(* Properties concerning sn parallel reduction on local environments ********) - -(* Basic_1: was just: pr3_pr2_pr2_t *) -(* Basic_1: includes: pr3_pr0_pr2_t *) -lemma llpr_cpr_trans: ∀G. s_r_transitive … (cpr G) (llpr G 0). -#G #L2 #T1 #T2 #HT12 elim HT12 -G -L2 -T1 -T2 -[ /2 width=3 by/ -| #G #L2 #K2 #V0 #V2 #W2 #i #HLK2 #_ #HVW2 #IHV02 #L1 #HL12 - elim (llpr_inv_lref_ge_dx … HL12 … HLK2) -L2 - /5 width=7 by cprs_delta, cprs_strap2, llpr_cpr_conf/ -| #a #I #G #L2 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #HL12 - elim (llpr_inv_bind_O … HL12) -HL12 /4 width=1 by cprs_bind/ -| #I #G #L2 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #HL12 - elim (llpr_inv_flat … HL12) -HL12 /3 width=1 by cprs_flat/ -| #G #L2 #V2 #T1 #T #T2 #_ #HT2 #IHT1 #L1 #HL12 - elim (llpr_inv_bind_O … HL12) /3 width=3 by cprs_zeta/ -| #G #L2 #V2 #T1 #T2 #HT12 #IHT12 #L1 #HL12 - elim (llpr_inv_flat … HL12) /3 width=1 by cprs_tau/ -| #a #G #L2 #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #L1 #HL12 - elim (llpr_inv_flat … HL12) -HL12 #HV1 #HL12 - elim (llpr_inv_bind_O … HL12) /3 width=3 by cprs_beta/ -| #a #G #L2 #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV1 #IHW12 #IHT12 #L1 #HL12 - elim (llpr_inv_flat … HL12) -HL12 #HV1 #HL12 - elim (llpr_inv_bind_O … HL12) /3 width=3 by cprs_theta/ -] -qed-. - -lemma cpr_bind2: ∀G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡ V2 → ∀I,T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ➡ T2 → - ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡* ⓑ{a,I}V2.T2. -/4 width=9 by llpr_cpr_trans, cprs_bind_dx, llpr_bind_repl_O/ qed. - -(* Advanced properties ******************************************************) - -(* Basic_1: was only: pr3_pr2_pr3_t pr3_wcpr0_t *) -lemma cprs_llpr_trans: ∀G. s_rs_transitive … (cpr G) (llpr G 0). -/3 width=6 by llpr_cpr_trans, llpr_cpr_conf, s_r_trans_LTC1/ qed-. - -(* Basic_1: was: pr3_strip *) -(* Basic_1: includes: pr1_strip *) -lemma cprs_strip: ∀G,L. confluent2 … (cprs G L) (cpr G L). -normalize /4 width=3 by cpr_conf, TC_strip1/ qed-. - -lemma cprs_llpr_conf_dx: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡* T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡[T0, 0] L1 → - ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡* T & ⦃G, L1⦄ ⊢ T0 ➡* T. -#G #L0 #T0 #T1 #H @(cprs_ind_dx … T0 H) -T0 /2 width=3 by ex2_intro/ -#T0 #T #HT0 #_ #IHT1 #L1 #HL01 -elim (IHT1 … L1) /2 by llpr_cpr_conf/ -IHT1 #T2 #HT12 #HT2 -elim (llpr_cpr_conf_dx … HT0 … HL01) -L0 #T3 #HT03 #HT3 -elim (cprs_strip … HT2 … HT3) -T -/4 width=5 by cprs_strap2, cprs_strap1, ex2_intro/ -qed-. - -lemma cprs_llpr_conf_sn: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡* T1 → - ∀L1. ⦃G, L0⦄ ⊢ ➡[T0, 0] L1 → - ∃∃T. ⦃G, L0⦄ ⊢ T1 ➡* T & ⦃G, L1⦄ ⊢ T0 ➡* T. -#G #L0 #T0 #T1 #HT01 #L1 #HL01 -elim (cprs_llpr_conf_dx … HT01 … HL01) -/4 width=5 by cprs_llpr_trans, cprs_llpr_conf, ex2_intro/ -qed-. - -lemma cprs_bind2_dx: ∀G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡ V2 → - ∀I,T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ➡* T2 → - ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡* ⓑ{a,I}V2.T2. -/4 width=9 by cprs_llpr_trans, cprs_bind_dx, llpr_bind_repl_O/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/cprs_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/cprs_lift.etc deleted file mode 100644 index 27f0bb6e5..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/cprs_lift.etc +++ /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/reduction/llpr_ldrop.ma". -include "basic_2/computation/cprs.ma". - -(* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************) - -(* Advanced properties ******************************************************) - -(* Note: apparently this was missing in basic_1 *) -lemma cprs_delta: ∀G,L,K,V,V2,i. - ⇩[i] L ≡ K.ⓓV → ⦃G, K⦄ ⊢ V ➡* V2 → - ∀W2. ⇧[0, i + 1] V2 ≡ W2 → ⦃G, L⦄ ⊢ #i ➡* W2. -#G #L #K #V #V2 #i #HLK #H elim H -V2 [ /3 width=6 by cpr_cprs, cpr_delta/ ] -#V1 #V2 #_ #HV12 #IHV1 #W2 #HVW2 -lapply (ldrop_fwd_drop2 … HLK) -HLK #HLK -elim (lift_total V1 0 (i+1)) /4 width=12 by cpr_lift, cprs_strap1/ -qed. - -lemma cprs_llpr_conf: ∀G. s_r_confluent1 … (cprs G) (llpr G 0). -/3 width=5 by llpr_cpr_conf, s_r_conf1_LTC1/ qed-. - -(* Advanced inversion lemmas ************************************************) - -(* Basic_1: was: pr3_gen_lref *) -lemma cprs_inv_lref1: ∀G,L,T2,i. ⦃G, L⦄ ⊢ #i ➡* T2 → - T2 = #i ∨ - ∃∃K,V1,T1. ⇩[i] L ≡ K.ⓓV1 & ⦃G, K⦄ ⊢ V1 ➡* T1 & - ⇧[0, i + 1] T1 ≡ T2. -#G #L #T2 #i #H @(cprs_ind … H) -T2 /2 width=1 by or_introl/ -#T #T2 #_ #HT2 * -[ #H destruct - elim (cpr_inv_lref1 … HT2) -HT2 /2 width=1 by or_introl/ - * /4 width=6 by cpr_cprs, ex3_3_intro, or_intror/ -| * #K #V1 #T1 #HLK #HVT1 #HT1 - lapply (ldrop_fwd_drop2 … HLK) #H0LK - elim (cpr_inv_lift1 … HT2 … H0LK … HT1) -H0LK -T - /4 width=6 by cprs_strap1, ex3_3_intro, or_intror/ -] -qed-. - -(* Relocation properties ****************************************************) - -(* Basic_1: was: pr3_lift *) -lemma cprs_lift: ∀G. l_liftable (cprs G). -/3 width=10 by l_liftable_LTC, cpr_lift/ qed. - -(* Basic_1: was: pr3_gen_lift *) -lemma cprs_inv_lift1: ∀G. l_deliftable_sn (cprs G). -/3 width=6 by l_deliftable_sn_LTC, cpr_inv_lift1/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/lazypredsn_5.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/lazypredsn_5.etc deleted file mode 100644 index 01ce586f8..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/lazypredsn_5.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G , break term 46 L1 ⦄ ⊢ ➡ break [ term 46 T , break term 46 d ] break term 46 L2 )" - non associative with precedence 45 - for @{ 'LazyPRedSn $G $L1 $L2 $T $d }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/lazypredsnstar_5.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/lazypredsnstar_5.etc deleted file mode 100644 index 824933fba..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/lazypredsnstar_5.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G , break term 46 L1 ⦄ ⊢ ➡* break [ term 46 T , break term 46 d ] break term 46 L2 )" - non associative with precedence 45 - for @{ 'LazyPRedSnStar $G $L1 $L2 $T $d }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llpr.etc deleted file mode 100644 index e4c1a01be..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llpr.etc +++ /dev/null @@ -1,51 +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/notation/relations/lazypredsn_5.ma". -include "basic_2/relocation/llpx_sn.ma". -include "basic_2/reduction/cpr.ma". - -(* LAZY SN PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ************************) - -definition llpr: genv → relation4 ynat term lenv lenv ≝ λG. llpx_sn (cpr G). - -interpretation "lazy parallel reduction (local environment, sn variant)" - 'LazyPRedSn G L1 L2 T d = (llpr G d T L1 L2). - -(* Basic inversion lemmas ***************************************************) - -lemma llpr_inv_flat: ∀I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡[ⓕ{I}V.T, d] L2 → - ⦃G, L1⦄ ⊢ ➡[V, d] L2 ∧ ⦃G, L1⦄ ⊢ ➡[T, d] L2. -/2 width=2 by llpx_sn_inv_flat/ qed-. - -(* Basic forward lemmas *****************************************************) - -lemma llpr_fwd_length: ∀G,L1,L2,T,d. ⦃G, L1⦄ ⊢ ➡[T, d] L2 → |L1| = |L2|. -/2 width=4 by llpx_sn_fwd_length/ qed-. - -(* Basic properties *********************************************************) - -lemma llpr_lref: ∀I,G,L1,L2,K1,K2,V1,V2,d,i. d ≤ yinj i → - ⇩[i] L1 ≡ K1.ⓑ{I}V1 → ⇩[i] L2 ≡ K2.ⓑ{I}V2 → - ⦃G, K1⦄ ⊢ ➡[V1, 0] K2 → ⦃G, K1⦄ ⊢ V1 ➡ V2 → ⦃G, L1⦄ ⊢ ➡[#i, d] L2. -/2 width=9 by llpx_sn_lref/ qed. - -(* Note: lemma 250 *) -lemma llpr_refl: ∀G,T,d. reflexive … (llpr G d T). -/2 width=1 by llpx_sn_refl/ qed. - -(* Basic_1: removed theorems 5: wcpr0_gen_sort wcpr0_gen_head - wcpr0_getl wcpr0_getl_back - pr0_subst1_back -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llpr_ldrop.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llpr_ldrop.etc deleted file mode 100644 index 74f7cc6b3..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llpr_ldrop.etc +++ /dev/null @@ -1,97 +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/relocation/fquq_alt.ma". -include "basic_2/static/ssta_llpx_sn.ma". -include "basic_2/reduction/cpr_lift.ma". -include "basic_2/reduction/cpr_llpx_sn.ma". -include "basic_2/reduction/llpr.ma". - -(* LAZY SN PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ************************) - -(* Advanced inversion lemmas ************************************************) - -lemma llpr_inv_lref_ge_dx: ∀G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡[#i, d] L2 → d ≤ i → - ∀I,K2,V2. ⇩[i] L2 ≡ K2.ⓑ{I}V2 → - ∃∃K1,V1. ⇩[i] L1 ≡ K1.ⓑ{I}V1 & - ⦃G, K1⦄ ⊢ ➡[V1, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡ V2. -/2 width=5 by llpx_sn_inv_lref_ge_dx/ qed-. - -lemma llpr_inv_lref_ge_sn: ∀G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡[#i, d] L2 → d ≤ i → - ∀I,K1,V1. ⇩[i] L1 ≡ K1.ⓑ{I}V1 → - ∃∃K2,V2. ⇩[i] L2 ≡ K2.ⓑ{I}V2 & - ⦃G, K1⦄ ⊢ ➡[V1, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡ V2. -/2 width=5 by llpx_sn_inv_lref_ge_sn/ qed-. - -lemma llpr_inv_lref_ge_bi: ∀G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡[#i, d] L2 → d ≤ i → - ∀I1,I2,K1,K2,V1,V2. - ⇩[i] L1 ≡ K1.ⓑ{I1}V1 → ⇩[i] L2 ≡ K2.ⓑ{I2}V2 → - ∧∧ I1 = I2 & ⦃G, K1⦄ ⊢ ➡[V1, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡ V2. -/2 width=8 by llpx_sn_inv_lref_ge_bi/ qed-. - -lemma llpr_inv_bind_O: ∀a,I,G,L1,L2,V,T. ⦃G, L1⦄ ⊢ ➡ [ⓑ{a,I}V.T, 0] L2 → - ⦃G, L1⦄ ⊢ ➡[V, 0] L2 ∧ ⦃G, L1.ⓑ{I}V⦄ ⊢ ➡[T, 0] L2.ⓑ{I}V. -/2 width=2 by llpx_sn_inv_bind_O/ qed-. - -lemma llpr_bind_repl_O: ∀I,G,L1,L2,V1,V2,T. ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡[T, 0] L2.ⓑ{I}V2 → - ∀J,W1,W2. ⦃G, L1⦄ ⊢ ➡[W1, 0] L2 → ⦃G, L1⦄ ⊢ W1 ➡ W2 → ⦃G, L1.ⓑ{J}W1⦄ ⊢ ➡[T, 0] L2.ⓑ{J}W2. -/2 width=4 by llpx_sn_bind_repl_O/ qed-. - -(* Advanced properties ******************************************************) - -lemma llpr_ssta_conf: ∀h,g,G. s_r_confluent1 … (ssta h g G) (llpr G 0). -/3 width=10 by ssta_llpx_sn_conf, cpr_lift/ qed-. - -lemma llpr_cpr_conf: ∀G. s_r_confluent1 … (cpr G) (llpr G 0). -/3 width=10 by cpr_llpx_sn_conf, cpr_inv_lift1, cpr_lift/ qed-. - -(* Properties on context-sensitive parallel reduction for terms *************) - -lemma fqu_cpr_trans_dx: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ → - ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 → - ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[T1, 0] L & ⦃G1, L⦄ ⊢ T1 ➡ U1 & ⦃G1, L, U1⦄ ⊃ ⦃G2, L2, U2⦄. -#G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 -/3 width=10 by llpr_lref, cpr_pair_sn, cpr_atom, cpr_bind, cpr_flat, fqu_lref_O, fqu_pair_sn, fqu_bind_dx, fqu_flat_dx, ldrop_pair, ex3_2_intro/ -#G #L #K #U #T #e #HLK #HUT #U2 #HU2 -elim (lift_total U2 0 (e+1)) #T2 #HUT2 -lapply (cpr_lift … HU2 … HLK … HUT … HUT2) -HU2 -HUT /3 width=9 by fqu_drop, ex3_2_intro/ -qed-. - -lemma fquq_cpr_trans_dx: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ → - ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 → - ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[T1, 0] L & ⦃G1, L⦄ ⊢ T1 ➡ U1 & ⦃G1, L, U1⦄ ⊃⸮ ⦃G2, L2, U2⦄. -#G1 #G2 #L1 #L2 #T1 #T2 #H #U2 #HTU2 elim (fquq_inv_gen … H) -H -[ #HT12 elim (fqu_cpr_trans_dx … HT12 … HTU2) /3 width=5 by fqu_fquq, ex3_2_intro/ -| * #H1 #H2 #H3 destruct /2 width=5 by ex3_2_intro/ -] -qed-. - -lemma fqu_cpr_trans_sn: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ → - ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 → - ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[T1, 0] L & ⦃G1, L1⦄ ⊢ T1 ➡ U1 & ⦃G1, L, U1⦄ ⊃ ⦃G2, L2, U2⦄. -#G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 -/3 width=10 by llpr_lref, cpr_pair_sn, cpr_bind, cpr_flat, fqu_lref_O, fqu_pair_sn, fqu_bind_dx, fqu_flat_dx, ldrop_pair, ex3_2_intro/ -#G #L #K #U #T #e #HLK #HUT #U2 #HU2 -elim (lift_total U2 0 (e+1)) #T2 #HUT2 -lapply (cpr_lift … HU2 … HLK … HUT … HUT2) -HU2 -HUT /3 width=9 by fqu_drop, ex3_2_intro/ -qed-. - -lemma fquq_cpr_trans_sn: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ → - ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 → - ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[T1, 0] L & ⦃G1, L1⦄ ⊢ T1 ➡ U1 & ⦃G1, L, U1⦄ ⊃⸮ ⦃G2, L2, U2⦄. -#G1 #G2 #L1 #L2 #T1 #T2 #H #U2 #HTU2 elim (fquq_inv_gen … H) -H -[ #HT12 elim (fqu_cpr_trans_sn … HT12 … HTU2) /3 width=5 by fqu_fquq, ex3_2_intro/ -| * #H1 #H2 #H3 destruct /2 width=5 by ex3_2_intro/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llpr_llpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llpr_llpr.etc deleted file mode 100644 index 4e5b9e2be..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llpr_llpr.etc +++ /dev/null @@ -1,375 +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/relocation/llpx_sn_llpx_sn.ma". -include "basic_2/substitution/fqup.ma". -include "basic_2/reduction/llpr_ldrop.ma". - -(* SN PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS *****************************) - -(* Main properties on context-sensitive parallel reduction for terms ********) - -fact cpr_conf_llpr_atom_atom: - ∀I,G,L1,L2. ∃∃T. ⦃G, L1⦄ ⊢ ⓪{I} ➡ T & ⦃G, L2⦄ ⊢ ⓪{I} ➡ T. -/2 width=3 by cpr_atom, ex2_intro/ qed-. - -fact cpr_conf_llpr_atom_delta: - ∀G,L0,i. ( - ∀L,T. ⦃G, L0, #i⦄ ⊃+ ⦃G, L, T⦄ → - ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → - ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → - ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 - ) → - ∀K0,V0. ⇩[i] L0 ≡ K0.ⓓV0 → - ∀V2. ⦃G, K0⦄ ⊢ V0 ➡ V2 → ∀T2. ⇧[O, i + 1] V2 ≡ T2 → - ∀L1. ⦃G, L0⦄ ⊢ ➡[#i, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[#i, 0] L2 → - ∃∃T. ⦃G, L1⦄ ⊢ #i ➡ T & ⦃G, L2⦄ ⊢ T2 ➡ T. -#G #L0 #i #IH #K0 #V0 #HLK0 #V2 #HV02 #T2 #HVT2 #L1 #HL01 #L2 #HL02 -elim (llpr_inv_lref_ge_sn … HL01 … HLK0) -HL01 // #K1 #V1 #HLK1 #HK01 #HV01 -elim (llpr_inv_lref_ge_sn … HL02 … HLK0) -HL02 // #K2 #W2 #HLK2 #HK02 #_ -lapply (ldrop_fwd_drop2 … HLK2) -W2 #HLK2 -lapply (fqup_lref … G … HLK0) -HLK0 #HLK0 -elim (IH … HLK0 … HV01 … HV02 … HK01 … HK02) -L0 -K0 -V0 #V #HV1 #HV2 -elim (lift_total V 0 (i+1)) -/3 width=12 by cpr_lift, cpr_delta, ex2_intro/ -qed-. - -(* Basic_1: includes: pr0_delta_delta pr2_delta_delta *) -fact cpr_conf_llpr_delta_delta: - ∀G,L0,i. ( - ∀L,T. ⦃G, L0, #i⦄ ⊃+ ⦃G, L, T⦄ → - ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → - ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → - ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 - ) → - ∀K0,V0. ⇩[i] L0 ≡ K0.ⓓV0 → - ∀V1. ⦃G, K0⦄ ⊢ V0 ➡ V1 → ∀T1. ⇧[O, i + 1] V1 ≡ T1 → - ∀KX,VX. ⇩[i] L0 ≡ KX.ⓓVX → - ∀V2. ⦃G, KX⦄ ⊢ VX ➡ V2 → ∀T2. ⇧[O, i + 1] V2 ≡ T2 → - ∀L1. ⦃G, L0⦄ ⊢ ➡[#i, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[#i, 0] L2 → - ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡ T & ⦃G, L2⦄ ⊢ T2 ➡ T. -#G #L0 #i #IH #K0 #V0 #HLK0 #V1 #HV01 #T1 #HVT1 -#KX #VX #H #V2 #HV02 #T2 #HVT2 #L1 #HL01 #L2 #HL02 -lapply (ldrop_mono … H … HLK0) -H #H destruct -elim (llpr_inv_lref_ge_sn … HL01 … HLK0) -HL01 // #K1 #W1 #HLK1 #HK01 #_ -lapply (ldrop_fwd_drop2 … HLK1) -W1 #HLK1 -elim (llpr_inv_lref_ge_sn … HL02 … HLK0) -HL02 // #K2 #W2 #HLK2 #HK02 #_ -lapply (ldrop_fwd_drop2 … HLK2) -W2 #HLK2 -lapply (fqup_lref … G … HLK0) -HLK0 #HLK0 -elim (IH … HLK0 … HV01 … HV02 … HK01 … HK02) -L0 -K0 -V0 #V #HV1 #HV2 -elim (lift_total V 0 (i+1)) /3 width=12 by cpr_lift, ex2_intro/ -qed-. - -fact cpr_conf_llpr_bind_bind: - ∀a,I,G,L0,V0,T0. ( - ∀L,T. ⦃G, L0, ⓑ{a,I}V0.T0⦄ ⊃+ ⦃G, L, T⦄ → - ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → - ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → - ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 - ) → - ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀T1. ⦃G, L0.ⓑ{I}V0⦄ ⊢ T0 ➡ T1 → - ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀T2. ⦃G, L0.ⓑ{I}V0⦄ ⊢ T0 ➡ T2 → - ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓑ{a,I}V0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓑ{a,I}V0.T0, 0] L2 → - ∃∃T. ⦃G, L1⦄ ⊢ ⓑ{a,I}V1.T1 ➡ T & ⦃G, L2⦄ ⊢ ⓑ{a,I}V2.T2 ➡ T. -#a #I #G #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01 -#V2 #HV02 #T2 #HT02 #L1 #HL01 #L2 #HL02 -elim (llpr_inv_bind_O … HL01) -HL01 #H1V0 #H1T0 -elim (llpr_inv_bind_O … HL02) -HL02 #H2V0 #H2T0 -elim (IH … HV01 … HV02 … H1V0 … H2V0) // -elim (IH … HT01 … HT02 (L1.ⓑ{I}V1) … (L2.ⓑ{I}V2)) -IH -/3 width=5 by llpr_bind_repl_O, cpr_bind, ex2_intro/ -qed-. - -fact cpr_conf_llpr_bind_zeta: - ∀G,L0,V0,T0. ( - ∀L,T. ⦃G, L0, +ⓓV0.T0⦄ ⊃+ ⦃G, L, T⦄ → - ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → - ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → - ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 - ) → - ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀T1. ⦃G, L0.ⓓV0⦄ ⊢ T0 ➡ T1 → - ∀T2. ⦃G, L0.ⓓV0⦄ ⊢ T0 ➡ T2 → ∀X2. ⇧[O, 1] X2 ≡ T2 → - ∀L1. ⦃G, L0⦄ ⊢ ➡[+ⓓV0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[+ⓓV0.T0, 0] L2 → - ∃∃T. ⦃G, L1⦄ ⊢ +ⓓV1.T1 ➡ T & ⦃G, L2⦄ ⊢ X2 ➡ T. -#G #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01 -#T2 #HT02 #X2 #HXT2 #L1 #HL01 #L2 #HL02 -elim (llpr_inv_bind_O … HL01) -HL01 #H1V0 #H1T0 -elim (llpr_inv_bind_O … HL02) -HL02 #H2V0 #H2T0 -elim (IH … HT01 … HT02 (L1.ⓓV1) … (L2.ⓓV1)) -IH -HT01 -HT02 /2 width=4 by llpr_bind_repl_O/ -L0 -V0 -T0 #T #HT1 #HT2 -elim (cpr_inv_lift1 … HT2 L2 … HXT2) -T2 /3 width=3 by cpr_zeta, ldrop_drop, ex2_intro/ -qed-. - -fact cpr_conf_llpr_zeta_zeta: - ∀G,L0,V0,T0. ( - ∀L,T. ⦃G, L0, +ⓓV0.T0⦄ ⊃+ ⦃G, L, T⦄ → - ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → - ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → - ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 - ) → - ∀T1. ⦃G, L0.ⓓV0⦄ ⊢ T0 ➡ T1 → ∀X1. ⇧[O, 1] X1 ≡ T1 → - ∀T2. ⦃G, L0.ⓓV0⦄ ⊢ T0 ➡ T2 → ∀X2. ⇧[O, 1] X2 ≡ T2 → - ∀L1. ⦃G, L0⦄ ⊢ ➡[+ⓓV0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[+ⓓV0.T0, 0] L2 → - ∃∃T. ⦃G, L1⦄ ⊢ X1 ➡ T & ⦃G, L2⦄ ⊢ X2 ➡ T. -#G #L0 #V0 #T0 #IH #T1 #HT01 #X1 #HXT1 -#T2 #HT02 #X2 #HXT2 #L1 #HL01 #L2 #HL02 -elim (llpr_inv_bind_O … HL01) -HL01 #H1V0 #H1T0 -elim (llpr_inv_bind_O … HL02) -HL02 #H2V0 #H2T0 -elim (IH … HT01 … HT02 (L1.ⓓV0) … (L2.ⓓV0)) -IH -HT01 -HT02 /2 width=4 by llpr_bind_repl_O/ -L0 -T0 #T #HT1 #HT2 -elim (cpr_inv_lift1 … HT1 L1 … HXT1) -T1 /2 width=2 by ldrop_drop/ #T1 #HT1 #HXT1 -elim (cpr_inv_lift1 … HT2 L2 … HXT2) -T2 /2 width=2 by ldrop_drop/ #T2 #HT2 #HXT2 -lapply (lift_inj … HT2 … HT1) -T #H destruct /2 width=3 by ex2_intro/ -qed-. - -fact cpr_conf_llpr_flat_flat: - ∀I,G,L0,V0,T0. ( - ∀L,T. ⦃G, L0, ⓕ{I}V0.T0⦄ ⊃+ ⦃G, L, T⦄ → - ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → - ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → - ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 - ) → - ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → - ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀T2. ⦃G, L0⦄ ⊢ T0 ➡ T2 → - ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓕ{I}V0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓕ{I}V0.T0, 0] L2 → - ∃∃T. ⦃G, L1⦄ ⊢ ⓕ{I}V1.T1 ➡ T & ⦃G, L2⦄ ⊢ ⓕ{I}V2.T2 ➡ T. -#I #G #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01 -#V2 #HV02 #T2 #HT02 #L1 #HL01 #L2 #HL02 -elim (llpr_inv_flat … HL01) -HL01 #H1V0 #H1T0 -elim (llpr_inv_flat … HL02) -HL02 #H2V0 #H2T0 -elim (IH … HV01 … HV02 … H1V0 … H2V0) // -elim (IH … HT01 … HT02 … H1T0 … H2T0) /3 width=5 by cpr_flat, ex2_intro/ -qed-. - -fact cpr_conf_llpr_flat_tau: - ∀G,L0,V0,T0. ( - ∀L,T. ⦃G, L0, ⓝV0.T0⦄ ⊃+ ⦃G, L, T⦄ → - ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → - ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → - ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 - ) → - ∀V1,T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → ∀T2. ⦃G, L0⦄ ⊢ T0 ➡ T2 → - ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓝV0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓝV0.T0, 0] L2 → - ∃∃T. ⦃G, L1⦄ ⊢ ⓝV1.T1 ➡ T & ⦃G, L2⦄ ⊢ T2 ➡ T. -#G #L0 #V0 #T0 #IH #V1 #T1 #HT01 -#T2 #HT02 #L1 #HL01 #L2 #HL02 -elim (llpr_inv_flat … HL01) -HL01 #_ #H1T0 -elim (llpr_inv_flat … HL02) -HL02 #_ #H2T0 -elim (IH … HT01 … HT02 … H1T0 … H2T0) // -L0 -V0 -T0 /3 width=3 by cpr_tau, ex2_intro/ -qed-. - -fact cpr_conf_llpr_tau_tau: - ∀G,L0,V0,T0. ( - ∀L,T. ⦃G, L0, ⓝV0.T0⦄ ⊃+ ⦃G, L, T⦄ → - ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → - ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → - ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 - ) → - ∀T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → ∀T2. ⦃G, L0⦄ ⊢ T0 ➡ T2 → - ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓝV0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓝV0.T0, 0] L2 → - ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡ T & ⦃G, L2⦄ ⊢ T2 ➡ T. -#G #L0 #V0 #T0 #IH #T1 #HT01 -#T2 #HT02 #L1 #HL01 #L2 #HL02 -elim (llpr_inv_flat … HL01) -HL01 #_ #H1T0 -elim (llpr_inv_flat … HL02) -HL02 #_ #H2T0 -elim (IH … HT01 … HT02 … H1T0 … H2T0) // -L0 -V0 -T0 /2 width=3 by ex2_intro/ -qed-. - -fact cpr_conf_llpr_flat_beta: - ∀a,G,L0,V0,W0,T0. ( - ∀L,T. ⦃G, L0, ⓐV0.ⓛ{a}W0.T0⦄ ⊃+ ⦃G, L, T⦄ → - ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → - ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → - ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 - ) → - ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀T1. ⦃G, L0⦄ ⊢ ⓛ{a}W0.T0 ➡ T1 → - ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀W2. ⦃G, L0⦄ ⊢ W0 ➡ W2 → ∀T2. ⦃G, L0.ⓛW0⦄ ⊢ T0 ➡ T2 → - ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓛ{a}W0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓛ{a}W0.T0, 0] L2 → - ∃∃T. ⦃G, L1⦄ ⊢ ⓐV1.T1 ➡ T & ⦃G, L2⦄ ⊢ ⓓ{a}ⓝW2.V2.T2 ➡ T. -#a #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #X #H -#V2 #HV02 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02 -elim (cpr_inv_abst1 … H) -H #W1 #T1 #HW01 #HT01 #H destruct -elim (llpr_inv_flat … HL01) -HL01 #H1V0 #HL01 -elim (llpr_inv_bind_O … HL01) -HL01 #H1W0 #H1T0 -elim (llpr_inv_flat … HL02) -HL02 #H2V0 #HL02 -elim (llpr_inv_bind_O … HL02) -HL02 #H2W0 #H2T0 -elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2 -elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1 by/ #W #HW1 #HW2 -elim (IH … HT01 … HT02 (L1.ⓛW1) … (L2.ⓛW2)) /2 width=4 by llpr_bind_repl_O/ -L0 -V0 -W0 -T0 #T #HT1 #HT2 -lapply (lsubr_cpr_trans … HT2 (L2.ⓓⓝW2.V2) ?) -HT2 /2 width=1 by lsubr_abst/ (**) (* full auto not tried *) -/4 width=5 by cpr_bind, cpr_flat, cpr_beta, ex2_intro/ -qed-. - -(* Basic-1: includes: - pr0_cong_upsilon_refl pr0_cong_upsilon_zeta - pr0_cong_upsilon_cong pr0_cong_upsilon_delta -*) -fact cpr_conf_llpr_flat_theta: - ∀a,G,L0,V0,W0,T0. ( - ∀L,T. ⦃G, L0, ⓐV0.ⓓ{a}W0.T0⦄ ⊃+ ⦃G, L, T⦄ → - ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → - ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → - ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 - ) → - ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀T1. ⦃G, L0⦄ ⊢ ⓓ{a}W0.T0 ➡ T1 → - ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀U2. ⇧[O, 1] V2 ≡ U2 → - ∀W2. ⦃G, L0⦄ ⊢ W0 ➡ W2 → ∀T2. ⦃G, L0.ⓓW0⦄ ⊢ T0 ➡ T2 → - ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓓ{a}W0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓓ{a}W0.T0, 0] L2 → - ∃∃T. ⦃G, L1⦄ ⊢ ⓐV1.T1 ➡ T & ⦃G, L2⦄ ⊢ ⓓ{a}W2.ⓐU2.T2 ➡ T. -#a #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #X #H -#V2 #HV02 #U2 #HVU2 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02 -elim (llpr_inv_flat … HL01) -HL01 #H1V0 #HL01 -elim (llpr_inv_bind_O … HL01) -HL01 #H1W0 #H1T0 -elim (llpr_inv_flat … HL02) -HL02 #H2V0 #HL02 -elim (llpr_inv_bind_O … HL02) -HL02 #H2W0 #H2T0 -elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2 -elim (lift_total V 0 1) #U #HVU -lapply (cpr_lift … HV2 (L2.ⓓW2) … HVU2 … HVU) -HVU2 /2 width=2 by ldrop_drop/ #HU2 -elim (cpr_inv_abbr1 … H) -H * -[ #W1 #T1 #HW01 #HT01 #H destruct - elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1 by/ - elim (IH … HT01 … HT02 (L1.ⓓW1) … (L2.ⓓW2)) /2 width=4 by llpr_bind_repl_O/ -L0 -V0 -W0 -T0 - /4 width=7 by cpr_bind, cpr_flat, cpr_theta, ex2_intro/ -| #T1 #HT01 #HXT1 #H destruct - elim (IH … HT01 … HT02 (L1.ⓓW2) … (L2.ⓓW2)) /2 width=4 by llpr_bind_repl_O/ -L0 -V0 -W0 -T0 #T #HT1 #HT2 - elim (cpr_inv_lift1 … HT1 L1 … HXT1) -HXT1 - /4 width=9 by cpr_flat, cpr_zeta, ldrop_drop, lift_flat, ex2_intro/ -] -qed-. - -fact cpr_conf_llpr_beta_beta: - ∀a,G,L0,V0,W0,T0. ( - ∀L,T. ⦃G, L0, ⓐV0.ⓛ{a}W0.T0⦄ ⊃+ ⦃G, L, T⦄ → - ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → - ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → - ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 - ) → - ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀W1. ⦃G, L0⦄ ⊢ W0 ➡ W1 → ∀T1. ⦃G, L0.ⓛW0⦄ ⊢ T0 ➡ T1 → - ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀W2. ⦃G, L0⦄ ⊢ W0 ➡ W2 → ∀T2. ⦃G, L0.ⓛW0⦄ ⊢ T0 ➡ T2 → - ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓛ{a}W0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓛ{a}W0.T0, 0] L2 → - ∃∃T. ⦃G, L1⦄ ⊢ ⓓ{a}ⓝW1.V1.T1 ➡ T & ⦃G, L2⦄ ⊢ ⓓ{a}ⓝW2.V2.T2 ➡ T. -#a #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #W1 #HW01 #T1 #HT01 -#V2 #HV02 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02 -elim (llpr_inv_flat … HL01) -HL01 #H1V0 #HL01 -elim (llpr_inv_bind_O … HL01) -HL01 #H1W0 #H1T0 -elim (llpr_inv_flat … HL02) -HL02 #H2V0 #HL02 -elim (llpr_inv_bind_O … HL02) -HL02 #H2W0 #H2T0 -elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2 -elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1/ #W #HW1 #HW2 -elim (IH … HT01 … HT02 (L1.ⓛW1) … (L2.ⓛW2)) /2 width=4 by llpr_bind_repl_O/ -L0 -V0 -W0 -T0 #T #HT1 #HT2 -lapply (lsubr_cpr_trans … HT1 (L1.ⓓⓝW1.V1) ?) -HT1 /2 width=1 by lsubr_abst/ -lapply (lsubr_cpr_trans … HT2 (L2.ⓓⓝW2.V2) ?) -HT2 /2 width=1 by lsubr_abst/ -/4 width=5 by cpr_bind, cpr_flat, ex2_intro/ (**) (* full auto not tried *) -qed-. - -(* Basic_1: includes: pr0_upsilon_upsilon *) -fact cpr_conf_llpr_theta_theta: - ∀a,G,L0,V0,W0,T0. ( - ∀L,T. ⦃G, L0, ⓐV0.ⓓ{a}W0.T0⦄ ⊃+ ⦃G, L, T⦄ → - ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → - ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → - ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 - ) → - ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀U1. ⇧[O, 1] V1 ≡ U1 → - ∀W1. ⦃G, L0⦄ ⊢ W0 ➡ W1 → ∀T1. ⦃G, L0.ⓓW0⦄ ⊢ T0 ➡ T1 → - ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀U2. ⇧[O, 1] V2 ≡ U2 → - ∀W2. ⦃G, L0⦄ ⊢ W0 ➡ W2 → ∀T2. ⦃G, L0.ⓓW0⦄ ⊢ T0 ➡ T2 → - ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓓ{a}W0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓓ{a}W0.T0, 0] L2 → - ∃∃T. ⦃G, L1⦄ ⊢ ⓓ{a}W1.ⓐU1.T1 ➡ T & ⦃G, L2⦄ ⊢ ⓓ{a}W2.ⓐU2.T2 ➡ T. -#a #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #U1 #HVU1 #W1 #HW01 #T1 #HT01 -#V2 #HV02 #U2 #HVU2 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02 -elim (llpr_inv_flat … HL01) -HL01 #H1V0 #HL01 -elim (llpr_inv_bind_O … HL01) -HL01 #H1W0 #H1T0 -elim (llpr_inv_flat … HL02) -HL02 #H2V0 #HL02 -elim (llpr_inv_bind_O … HL02) -HL02 #H2W0 #H2T0 -elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2 -elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1 by/ -elim (IH … HT01 … HT02 (L1.ⓓW1) … (L2.ⓓW2)) /2 width=4 by llpr_bind_repl_O/ -L0 -V0 -W0 -T0 -elim (lift_total V 0 1) #U #HVU -lapply (cpr_lift … HV1 (L1.ⓓW1) … HVU1 … HVU) -HVU1 /2 width=2 by ldrop_drop/ -lapply (cpr_lift … HV2 (L2.ⓓW2) … HVU2 … HVU) -HVU2 /2 width=2 by ldrop_drop/ -/4 width=7 by cpr_bind, cpr_flat, ex2_intro/ (**) (* full auto not tried *) -qed-. - -theorem cpr_conf_llpr: ∀G. llpx_sn_confluent2 (cpr G) (cpr G). -#G #L0 #T0 @(fqup_wf_ind_eq … G L0 T0) -G -L0 -T0 #G #L #T #IH #G0 #L0 * [| * ] -[ #I0 #HG #HL #HT #T1 #H1 #T2 #H2 #L1 #HL01 #L2 #HL02 destruct - elim (cpr_inv_atom1 … H1) -H1 - elim (cpr_inv_atom1 … H2) -H2 - [ #H2 #H1 destruct - /2 width=1 by cpr_conf_llpr_atom_atom/ - | * #K0 #V0 #V2 #i2 #HLK0 #HV02 #HVT2 #H2 #H1 destruct - /3 width=10 by cpr_conf_llpr_atom_delta/ - | #H2 * #K0 #V0 #V1 #i1 #HLK0 #HV01 #HVT1 #H1 destruct - /4 width=10 by ex2_commute, cpr_conf_llpr_atom_delta/ - | * #X #Y #V2 #z #H #HV02 #HVT2 #H2 - * #K0 #V0 #V1 #i #HLK0 #HV01 #HVT1 #H1 destruct - /3 width=17 by cpr_conf_llpr_delta_delta/ - ] -| #a #I #V0 #T0 #HG #HL #HT #X1 #H1 #X2 #H2 #L1 #HL01 #L2 #HL02 destruct - elim (cpr_inv_bind1 … H1) -H1 * - [ #V1 #T1 #HV01 #HT01 #H1 - | #T1 #HT01 #HXT1 #H11 #H12 - ] - elim (cpr_inv_bind1 … H2) -H2 * - [1,3: #V2 #T2 #HV02 #HT02 #H2 - |2,4: #T2 #HT02 #HXT2 #H21 #H22 - ] destruct - [ /3 width=10 by cpr_conf_llpr_bind_bind/ - | /4 width=11 by ex2_commute, cpr_conf_llpr_bind_zeta/ - | /3 width=11 by cpr_conf_llpr_bind_zeta/ - | /3 width=12 by cpr_conf_llpr_zeta_zeta/ - ] -| #I #V0 #T0 #HG #HL #HT #X1 #H1 #X2 #H2 #L1 #HL01 #L2 #HL02 destruct - elim (cpr_inv_flat1 … H1) -H1 * - [ #V1 #T1 #HV01 #HT01 #H1 - | #HX1 #H1 - | #a1 #V1 #Y1 #W1 #Z1 #T1 #HV01 #HYW1 #HZT1 #H11 #H12 #H13 - | #a1 #V1 #U1 #Y1 #W1 #Z1 #T1 #HV01 #HVU1 #HYW1 #HZT1 #H11 #H12 #H13 - ] - elim (cpr_inv_flat1 … H2) -H2 * - [1,5,9,13: #V2 #T2 #HV02 #HT02 #H2 - |2,6,10,14: #HX2 #H2 - |3,7,11,15: #a2 #V2 #Y2 #W2 #Z2 #T2 #HV02 #HYW2 #HZT2 #H21 #H22 #H23 - |4,8,12,16: #a2 #V2 #U2 #Y2 #W2 #Z2 #T2 #HV02 #HVU2 #HYW2 #HZT2 #H21 #H22 #H23 - ] destruct - [ /3 width=10 by cpr_conf_llpr_flat_flat/ - | /4 width=8 by ex2_commute, cpr_conf_llpr_flat_tau/ - | /4 width=12 by ex2_commute, cpr_conf_llpr_flat_beta/ - | /4 width=14 by ex2_commute, cpr_conf_llpr_flat_theta/ - | /3 width=8 by cpr_conf_llpr_flat_tau/ - | /3 width=8 by cpr_conf_llpr_tau_tau/ - | /3 width=12 by cpr_conf_llpr_flat_beta/ - | /3 width=13 by cpr_conf_llpr_beta_beta/ - | /3 width=14 by cpr_conf_llpr_flat_theta/ - | /3 width=17 by cpr_conf_llpr_theta_theta/ - ] -] -qed-. - -(* Basic_1: includes: pr0_confluence pr2_confluence *) -theorem cpr_conf: ∀G,L. confluent … (cpr G L). -/2 width=6 by cpr_conf_llpr/ qed-. - -(* Properties on context-sensitive parallel reduction for terms *************) - -lemma llpr_cpr_conf_dx: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡[T0, 0] L1 → - ∃∃T. ⦃G, L1⦄ ⊢ T0 ➡ T & ⦃G, L1⦄ ⊢ T1 ➡ T. -#G #L0 #T0 #T1 #HT01 #L1 #HL01 -elim (cpr_conf_llpr … HT01 T0 … HL01 … HL01) /2 width=3 by ex2_intro/ -qed-. - -lemma llpr_cpr_conf_sn: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡[T0, 0] L1 → - ∃∃T. ⦃G, L1⦄ ⊢ T0 ➡ T & ⦃G, L0⦄ ⊢ T1 ➡ T. -#G #L0 #T0 #T1 #HT01 #L1 #HL01 -elim (cpr_conf_llpr … HT01 T0 … L0 … HL01) /2 width=3 by ex2_intro/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llprs.etc deleted file mode 100644 index d3c2a6f27..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llprs.etc +++ /dev/null @@ -1,61 +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/notation/relations/lazypredsnstar_5.ma". -include "basic_2/reduction/llpr.ma". - -(* LAZY SN PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS ***********************) - -definition llprs: genv → relation4 ynat term lenv lenv ≝ - λG,d. LTC … (llpr G d). - -interpretation "lazy parallel computation (local environment, sn variant)" - 'LazyPRedSnStar G L1 L2 T d = (llprs G d T L1 L2). - -(* Basic eliminators ********************************************************) - -lemma llprs_ind: ∀G,L1,T,d. ∀R:predicate lenv. R L1 → - (∀L,L2. ⦃G, L1⦄ ⊢ ➡*[T, d] L → ⦃G, L⦄ ⊢ ➡[T, d] L2 → R L → R L2) → - ∀L2. ⦃G, L1⦄ ⊢ ➡*[T, d] L2 → R L2. -#G #L1 #T #d #R #HL1 #IHL1 #L2 #HL12 -@(TC_star_ind … HL1 IHL1 … HL12) // -qed-. - -lemma llprs_ind_dx: ∀G,L2,T,d. ∀R:predicate lenv. R L2 → - (∀L1,L. ⦃G, L1⦄ ⊢ ➡[T, d] L → ⦃G, L⦄ ⊢ ➡*[T, d] L2 → R L → R L1) → - ∀L1. ⦃G, L1⦄ ⊢ ➡*[T, d] L2 → R L1. -#G #L2 #T #d #R #HL2 #IHL2 #L1 #HL12 -@(TC_star_ind_dx … HL2 IHL2 … HL12) // -qed-. - -(* Basic properties *********************************************************) - -lemma lpr_llprs: ∀G,L1,L2,T,d. ⦃G, L1⦄ ⊢ ➡[T, d] L2 → ⦃G, L1⦄ ⊢ ➡*[T, d] L2. -/2 width=1 by inj/ qed. - -lemma llprs_refl: ∀G,L,T,d. ⦃G, L⦄ ⊢ ➡*[T, d] L. -/2 width=1 by lpr_llprs/ qed. - -lemma llprs_strap1: ∀G,L1,L,L2,T,d. ⦃G, L1⦄ ⊢ ➡*[T, d] L → ⦃G, L⦄ ⊢ ➡[T, d] L2 → ⦃G, L1⦄ ⊢ ➡*[T, d] L2. -normalize /2 width=3 by step/ qed-. - -lemma llprs_strap2: ∀G,L1,L,L2,T,d. ⦃G, L1⦄ ⊢ ➡[T, d] L → ⦃G, L⦄ ⊢ ➡*[T, d] L2 → ⦃G, L1⦄ ⊢ ➡*[T, d] L2. -normalize /2 width=3 by TC_strap/ qed-. - -(* Basic forward lemmas *****************************************************) - -lemma llprs_fwd_length: ∀G,L1,L2,T,d. ⦃G, L1⦄ ⊢ ➡*[T, d] L2 → |L1| = |L2|. -#G #L1 #L2 #T #d #H @(llprs_ind … H) -L2 -/3 width=6 by llpr_fwd_length, trans_eq/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llprs_cprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llprs_cprs.etc deleted file mode 100644 index b9bf0f963..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llprs_cprs.etc +++ /dev/null @@ -1,122 +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/relocation/llpx_sn_tc.ma". -include "basic_2/computation/cprs_cprs.ma". -include "basic_2/computation/llprs.ma". - -(* LAZY SN PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS ***********************) - -(* Advanced properties ******************************************************) - -lemma llprs_pair_dx: ∀G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡* V2 → - ∀I,T. ⦃G, L.ⓑ{I}V1⦄ ⊢ ➡*[T, 0] L.ⓑ{I}V2. -/2 width=1 by llpx_sn_TC_pair_dx/ qed. - -(* Properties on context-sensitive parallel computation for terms ***********) - -lemma llprs_cpr_trans: ∀G. s_r_transitive … (cpr G) (llprs G 0). -/3 width=5 by cprs_llpr_trans, s_r_trans_LTC2/ qed-. - -(* Basic_1: was just: pr3_pr3_pr3_t *) -lemma llprs_cprs_trans: ∀G. s_rs_transitive … (cpr G) (llprs G 0). -#G @s_r_to_s_rs_trans @s_r_trans_LTC2 -/3 width=5 by cprs_llpr_trans, s_rs_trans_TC1/ (**) (* full auto too slow *) -qed-. - -(* Note: this is an instance of a general theorem *) -lemma llprs_cprs_conf_dx: ∀G2,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡* U2 → - ∀L0. ⦃G2, L0⦄ ⊢ ➡*[T2, O] L2 → ⦃G2, L0⦄ ⊢ ➡*[U2, O] L2. -#G2 #L2 #T2 #U2 #HTU2 #L0 #H @(llprs_ind_dx … H) -L0 // -#L0 #L #HL0 #HL2 #IHL2 @(llprs_strap2 … IHL2) -IHL2 -lapply (llprs_cprs_trans … HTU2 … HL2) -L2 #HTU2 -/3 width=3 by cprs_llpr_trans, cprs_llpr_conf/ -qed-. - -(* Note: this is an instance of a general theorem *) -lemma llprs_cpr_conf_dx: ∀G2,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 → - ∀L0. ⦃G2, L0⦄ ⊢ ➡*[T2, O] L2 → ⦃G2, L0⦄ ⊢ ➡*[U2, O] L2. -#G2 #L2 #T2 #U2 #HTU2 #L0 #H @(llprs_ind_dx … H) -L0 // -#L0 #L #HL0 #HL2 #IHL2 @(llprs_strap2 … IHL2) -IHL2 -lapply (llprs_cpr_trans … HTU2 … HL2) -L2 #HTU2 -/3 width=3 by cprs_llpr_trans, cprs_llpr_conf/ -qed-. - -lemma llprs_cprs_conf_sn: ∀G,L0,L1,T0. ⦃G, L0⦄ ⊢ ➡*[T0, 0] L1 → - ∀T1. ⦃G, L0⦄ ⊢ T0 ➡* T1 → - ∃∃T. ⦃G, L0⦄ ⊢ T1 ➡* T & ⦃G, L1⦄ ⊢ T0 ➡* T. -#G #L0 #L1 #T0 #H @(llprs_ind_dx … H) -L0 /2 width=3 by ex2_intro/ -#L0 #L #HL0 #HL1 #IHL1 #T1 #HT01 elim (cprs_llpr_conf_sn … HT01 … HL0) -#T2 #HT12 #HT02 elim (IHL1 … HT02) -IHL1 -HT02 -lapply (cprs_trans … HT01 … HT12) #HT02 -lapply (cprs_llpr_conf … HT02 … HL0) -HT02 -HL0 -/4 width=5 by cprs_llpr_trans, cprs_trans, ex2_intro/ -qed-. - -lemma llprs_cpr_conf_sn: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → - ∀L1. ⦃G, L0⦄ ⊢ ➡*[T0, 0] L1 → - ∃∃T. ⦃G, L0⦄ ⊢ T1 ➡* T & ⦃G, L1⦄ ⊢ T0 ➡* T. -/3 width=3 by llprs_cprs_conf_sn, cpr_cprs/ qed-. - -lemma cprs_bind2: ∀G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡* V2 → - ∀I,T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ➡* T2 → - ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡* ⓑ{a,I}V2.T2. -/4 width=3 by llprs_cprs_trans, llprs_pair_dx, cprs_bind/ qed-. - -(* Inversion lemmas on context-sensitive parallel computation for terms *****) - -(* Basic_1: was: pr3_gen_abst *) -lemma cprs_inv_abst1: ∀a,G,L,W1,T1,U2. ⦃G, L⦄ ⊢ ⓛ{a}W1.T1 ➡* U2 → - ∃∃W2,T2. ⦃G, L⦄ ⊢ W1 ➡* W2 & ⦃G, L.ⓛW1⦄ ⊢ T1 ➡* T2 & - U2 = ⓛ{a}W2.T2. -#a #G #L #V1 #T1 #U2 #H @(cprs_ind … H) -U2 /2 width=5 by ex3_2_intro/ -#U0 #U2 #_ #HU02 * #V0 #T0 #HV10 #HT10 #H destruct -elim (cpr_inv_abst1 … HU02) -HU02 #V2 #T2 #HV02 #HT02 #H destruct -lapply (llprs_cpr_trans … HT02 (L.ⓛV1) ?) -/3 width=5 by llprs_pair_dx, cprs_trans, cprs_strap1, ex3_2_intro/ -qed-. - -lemma cprs_inv_abst: ∀a,G,L,W1,W2,T1,T2. ⦃G, L⦄ ⊢ ⓛ{a}W1.T1 ➡* ⓛ{a}W2.T2 → - ⦃G, L⦄ ⊢ W1 ➡* W2 ∧ ⦃G, L.ⓛW1⦄ ⊢ T1 ➡* T2. -#a #G #L #W1 #W2 #T1 #T2 #H -elim (cprs_inv_abst1 … H) -H #W #T #HW1 #HT1 #H destruct /2 width=1 by conj/ -qed-. - -(* Basic_1: was pr3_gen_abbr *) -lemma cprs_inv_abbr1: ∀a,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓓ{a}V1.T1 ➡* U2 → ( - ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡* V2 & ⦃G, L.ⓓV1⦄ ⊢ T1 ➡* T2 & - U2 = ⓓ{a}V2.T2 - ) ∨ - ∃∃T2. ⦃G, L.ⓓV1⦄ ⊢ T1 ➡* T2 & ⇧[0, 1] U2 ≡ T2 & a = true. -#a #G #L #V1 #T1 #U2 #H @(cprs_ind … H) -U2 /3 width=5 by ex3_2_intro, or_introl/ -#U0 #U2 #_ #HU02 * * -[ #V0 #T0 #HV10 #HT10 #H destruct - elim (cpr_inv_abbr1 … HU02) -HU02 * - [ #V2 #T2 #HV02 #HT02 #H destruct - lapply (llprs_cpr_trans … HT02 (L.ⓓV1) ?) - /4 width=5 by llprs_pair_dx, cprs_trans, cprs_strap1, ex3_2_intro, or_introl/ - | #T2 #HT02 #HUT2 - lapply (llprs_cpr_trans … HT02 (L.ⓓV1) ?) -HT02 - /4 width=3 by llprs_pair_dx, cprs_trans, ex3_intro, or_intror/ - ] -| #U1 #HTU1 #HU01 - elim (lift_total U2 0 1) #U #HU2 - lapply (cpr_lift … HU02 (L.ⓓV1) … HU01 … HU2) -U0 - /4 width=3 by cprs_strap1, ldrop_drop, ex3_intro, or_intror/ -] -qed-. - -(* Note: we loose lprs_cprs_conf_dx and derivatives: - lprs_cpr_conf_dx lprs_cprs_conf -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llprs_llprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llprs_llprs.etc deleted file mode 100644 index 4f97672f3..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llprs_llprs.etc +++ /dev/null @@ -1,22 +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/computation/llprs.ma". - -(* LAZY SN PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS ***********************) - -(* Main properties **********************************************************) - -theorem llprs_trans: ∀G,T,d. Transitive … (llprs G d T). -normalize /2 width=3 by trans_TC/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llpx_sn_llpx_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llpx_sn_llpx_sn.etc deleted file mode 100644 index 0df9690ee..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpr/llpx_sn_llpx_sn.etc +++ /dev/null @@ -1,24 +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/relocation/llpx_sn.ma". - -(* LAZY SN POINTWISE EXTENSION OF A CONTEXT-SENSITIVE REALTION FOR TERMS ****) - -definition llpx_sn_confluent2: relation (lenv→relation term) ≝ λR1,R2. - ∀L0,T0,T1. R1 L0 T0 T1 → ∀T2. R2 L0 T0 T2 → - ∀L1. llpx_sn R1 0 T0 L0 L1 → ∀L2. llpx_sn R2 0 T0 L0 L2 → - ∃∃T. R2 L1 T1 T & R1 L2 T2 T. - -(* Note: we miss llpx_sn_conf and derivatives: lpr_conf lprs_conf *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/cpxs_llpx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/cpxs_llpx.etc deleted file mode 100644 index bec908ef7..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/cpxs_llpx.etc +++ /dev/null @@ -1,53 +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/reduction/llpx_ldrop.ma". -include "basic_2/computation/cpxs_cpxs.ma". - -(* CONTEXT-SENSITIVE EXTENDED PARALLEL COMPUTATION ON TERMS *****************) - -(* Properties on lazy sn reduction on local environments ********************) - -lemma cpxs_llpx_conf: ∀h,g,G. s_r_confluent1 … (cpxs h g G) (llpx h g G 0). -/3 width=5 by llpx_cpx_conf, s_r_conf1_LTC1/ qed-. - -lemma llpx_cpx_trans: ∀h,g,G. s_r_transitive … (cpx h g G) (llpx h g G 0). -#h #g #G #L2 #T1 #T2 #HT12 elim HT12 -G -L2 -T1 -T2 -[ /2 width=3 by/ -| /3 width=2 by cpx_cpxs, cpx_sort/ -| #I #G #L2 #K2 #V0 #V2 #W2 #i #HLK2 #_ #HVW2 #IHV02 #L1 #HL12 - elim (llpx_inv_lref_ge_dx … HL12 … HLK2) -L2 - /5 width=8 by cpxs_delta, cpxs_strap2, llpx_cpx_conf/ -| #a #I #G #L2 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #HL12 - elim (llpx_inv_bind_O … HL12) -HL12 /4 width=1 by cpxs_bind/ -| #I #G #L2 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #HL12 - elim (llpx_inv_flat … HL12) -HL12 /3 width=1 by cpxs_flat/ -| #G #L2 #V2 #T1 #T #T2 #_ #HT2 #IHT1 #L1 #HL12 - elim (llpx_inv_bind_O … HL12) /3 width=3 by cpxs_zeta/ -| #G #L2 #V2 #T1 #T2 #HT12 #IHT12 #L1 #HL12 - elim (llpx_inv_flat … HL12) /3 width=1 by cpxs_tau/ -| #G #L2 #V1 #V2 #T2 #HV12 #IHV12 #L1 #HL12 - elim (llpx_inv_flat … HL12) /3 width=1 by cpxs_ti/ -| #a #G #L2 #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #L1 #HL12 - elim (llpx_inv_flat … HL12) -HL12 #HV1 #HL12 - elim (llpx_inv_bind_O … HL12) /3 width=3 by cpxs_beta/ -| #a #G #L2 #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV1 #IHW12 #IHT12 #L1 #HL12 - elim (llpx_inv_flat … HL12) -HL12 #HV1 #HL12 - elim (llpx_inv_bind_O … HL12) /3 width=3 by cpxs_theta/ -] -qed-. - -lemma llpx_cpxs_trans: ∀h,g,G. s_rs_transitive … (cpx h g G) (llpx h g G 0). -#h #g #G @s_r_trans_LTC1 /2 width=3 by llpx_cpx_trans, llpx_cpx_conf/ (**) (* full auto fails here but works in cprs_cprs *) -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/csx_llpx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/csx_llpx.etc deleted file mode 100644 index c14492f21..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/csx_llpx.etc +++ /dev/null @@ -1,26 +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/computation/cpxs_llpx.ma". -include "basic_2/computation/csx_alt.ma". - -(* CONTEXT-SENSITIVE EXTENDED STRONGLY NORMALIZING TERMS ********************) - -(* Properties on lazy sn extended reduction for local environments **********) - -lemma csx_llpx_conf: ∀h,g,G,L1,T. ⦃G, L1⦄ ⊢ ⬊*[h, g] T → - ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g, T, 0] L2 → ⦃G, L2⦄ ⊢ ⬊*[h, g] T. -#h #g #G #L1 #T #H @(csx_ind_alt … H) -T -/5 width=3 by csx_intro_cpxs, llpx_cpxs_trans, cpxs_llpx_conf/ (* 2 cpxs_llpx_trans *) -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/csx_llpxs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/csx_llpxs.etc deleted file mode 100644 index aad3e8bf0..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/csx_llpxs.etc +++ /dev/null @@ -1,25 +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/computation/csx_llpx.ma". -include "basic_2/computation/llpxs.ma". - -(* CONTEXT-SENSITIVE EXTENDED STRONGLY NORMALIZING TERMS ********************) - -(* Properties on lazy sn extended computation for local environments ********) - -lemma csx_llpxs_conf: ∀h,g,G,L1,T. ⦃G, L1⦄ ⊢ ⬊*[h, g] T → - ∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, 0] L2 → ⦃G, L2⦄ ⊢ ⬊*[h, g] T. -#h #g #G #L1 #T #HT #L2 #H @(llpxs_ind … H) -L2 /3 by llpxs_strap1, csx_llpx_conf/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/fpbs_lpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/fpbs_lpr.etc deleted file mode 100644 index 34b60ad1d..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/fpbs_lpr.etc +++ /dev/null @@ -1,36 +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/reduction/cpx_lift.ma". -include "basic_2/reduction/llpx_lpr.ma". -include "basic_2/computation/fpbs.ma". - -(* "BIG TREE" PARALLEL COMPUTATION FOR CLOSURES *****************************) - -(* Properties on sn parallel reduction for local environments ***************) - -(* Note: this is used in the closure proof *) -(* Note: original proof: /4 width=5 by fpbs_strap1, lpr_fpb, cpr_fpb/ *) -(* Note: this should be moved *) -lemma cpr_lpr_fpbs: ∀h,g,G,L1,L2,T1,T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ⦃G, L1⦄ ⊢ ➡ L2 → - ⦃G, L1, T1⦄ ≥[h, g] ⦃G, L2, T2⦄. -/5 width=5 by fpbs_strap1, cpr_fpb, fpb_llpx, lpr_llpx/ qed. - -(* Note: this is used in the closure proof *) -(* Note: this should be moved *) -lemma cpr_lpr_ssta_fpbs: ∀h,g,G,L1,L2,T1,T2,U2,l2. - ⦃G, L1⦄ ⊢ T1 ➡ T2 → ⦃G, L1⦄ ⊢ ➡ L2 → - ⦃G, L2⦄ ⊢ T2 ▪[h, g] l2+1 → ⦃G, L2⦄ ⊢ T2 •[h, g] U2 → - ⦃G, L1, T1⦄ ≥[h, g] ⦃G, L2, U2⦄. -/4 width=5 by fpbs_strap1, cpr_lpr_fpbs, ssta_cpx, fpb_cpx/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/lazypredsn_7.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/lazypredsn_7.etc deleted file mode 100644 index 2350f5efc..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/lazypredsn_7.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G , break term 46 L1 ⦄ ⊢ ➡ break [ term 46 h , break term 46 g , break term 46 T , break term 46 d ] break term 46 L2 )" - non associative with precedence 45 - for @{ 'LazyPRedSn $G $L1 $L2 $h $g $T $d }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/lazypredsnstar_7.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/lazypredsnstar_7.etc deleted file mode 100644 index f8209e2f8..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/lazypredsnstar_7.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G , break term 46 L1 ⦄ ⊢ ➡* break [ term 46 h , break term 46 g , break term 46 T , break term 46 d ] break term 46 L2 )" - non associative with precedence 45 - for @{ 'LazyPRedSnStar $G $L1 $L2 $h $g $T $d }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/lazysn_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/lazysn_6.etc deleted file mode 100644 index 0c52a6ea5..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/lazysn_6.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( G ⊢ ⋕ ⬊ * break [ term 46 h , break term 46 g , break term 46 T , break term 46 d ] break term 46 L )" - non associative with precedence 45 - for @{ 'LazySN $h $g $T $d $G $L }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/lazysnalt_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/lazysnalt_6.etc deleted file mode 100644 index 0976a3136..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/lazysnalt_6.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( G ⊢ ⋕ ⬊ ⬊ * break [ term 46 h , break term 46 g , break term 46 T , break term 46 d ] break term 46 L )" - non associative with precedence 45 - for @{ 'LazySNAlt $h $g $T $d $G $L }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpx.etc deleted file mode 100644 index 3276008b4..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpx.etc +++ /dev/null @@ -1,69 +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/notation/relations/lazypredsn_7.ma". -include "basic_2/relocation/llpx_sn.ma". -include "basic_2/reduction/cpx.ma". - -(* LAZY SN EXTENDED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ***************) - -definition llpx: ∀h. sd h → genv → relation4 ynat term lenv lenv ≝ - λh,g,G. llpx_sn (cpx h g G). - -interpretation "lazy extended parallel reduction (local environment, sn variant)" - 'LazyPRedSn G L1 L2 h g T d = (llpx h g G d T L1 L2). - -(* Basic inversion lemmas ***************************************************) - -lemma llpx_inv_flat: ∀h,g,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡[h, g, ⓕ{I}V.T, d] L2 → - ⦃G, L1⦄ ⊢ ➡[h, g, V, d] L2 ∧ ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2. -/2 width=2 by llpx_sn_inv_flat/ qed-. - -(* Basic forward lemmas *****************************************************) - -lemma llpx_fwd_length: ∀h,g,G,L1,L2,T,d. ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2 → |L1| = |L2|. -/2 width=4 by llpx_sn_fwd_length/ qed-. - -lemma llpx_fwd_flat_dx: ∀h,g,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡[h, g, ⓕ{I}V.T, d] L2 → - ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2. -/2 width=3 by llpx_sn_fwd_flat_dx/ qed-. - -lemma llpx_fwd_pair_sn: ∀h,g,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡[h, g, ②{I}V.T, d] L2 → - ⦃G, L1⦄ ⊢ ➡[h, g, V, d] L2. -/2 width=3 by llpx_sn_fwd_pair_sn/ qed-. - -(* Note: this might be removed *) -lemma llpx_fwd_bind_sn: ∀h,g,a,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡[h, g, ⓑ{a,I}V.T, d] L2 → - ⦃G, L1⦄ ⊢ ➡[h, g, V, d] L2. -/2 width=4 by llpx_sn_fwd_bind_sn/ qed-. - -(* Note: this might be removed *) -lemma llpx_fwd_bind_dx: ∀h,g,a,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡[h, g, ⓑ{a,I}V.T, d] L2 → - ⦃G, L1.ⓑ{I}V⦄ ⊢ ➡[h, g, T, ⫯d] L2.ⓑ{I}V. -/2 width=2 by llpx_sn_fwd_bind_dx/ qed-. - -(* Note: this might be removed *) -lemma llpx_fwd_flat_sn: ∀h,g,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡[h, g, ⓕ{I}V.T, d] L2 → - ⦃G, L1⦄ ⊢ ➡[h, g, V, d] L2. -/2 width=3 by llpx_sn_fwd_flat_sn/ qed-. - -(* Basic properties *********************************************************) - -lemma llpx_lref: ∀h,g,I,G,L1,L2,K1,K2,V1,V2,d,i. d ≤ yinj i → - ⇩[i] L1 ≡ K1.ⓑ{I}V1 → ⇩[i] L2 ≡ K2.ⓑ{I}V2 → - ⦃G, K1⦄ ⊢ ➡[h, g, V1, 0] K2 → ⦃G, K1⦄ ⊢ V1 ➡[h, g] V2 → ⦃G, L1⦄ ⊢ ➡[h, g, #i, d] L2. -/2 width=9 by llpx_sn_lref/ qed. - -lemma llpx_refl: ∀h,g,G,T,d. reflexive … (llpx h g G d T). -/2 width=1 by llpx_sn_refl/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpx_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpx_aaa.etc deleted file mode 100644 index 99eef8d55..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpx_aaa.etc +++ /dev/null @@ -1,82 +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/static/aaa_lift.ma". -include "basic_2/static/lsuba_aaa.ma". -include "basic_2/reduction/llpx_ldrop.ma". - -(* SN EXTENDED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ********************) - -(* Properties on atomic arity assignment for terms **************************) - -(* Note: lemma 500 *) -lemma aaa_cpx_llpx_conf: ∀h,g,G,L1,T1,A. ⦃G, L1⦄ ⊢ T1 ⁝ A → - ∀T2. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2 → - ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g, T1, 0] L2 → ⦃G, L2⦄ ⊢ T2 ⁝ A. -#h #g #G #L1 #T1 #A #H elim H -G -L1 -T1 -A -[ #g #L1 #k #X #H elim (cpx_inv_sort1 … H) -H // * // -| #I #G #L1 #K1 #V1 #B #i #HLK1 #_ #IHV1 #X #H #L2 #HL12 - elim (cpx_inv_lref1 … H) -H - [ #H destruct - elim (llpx_inv_lref_ge_sn … HL12 … HLK1) -L1 /3 width=6 by aaa_lref/ - | * #J #Y #Z #V2 #H #HV12 #HV2 - lapply (ldrop_mono … H … HLK1) -H #H destruct - elim (llpx_inv_lref_ge_sn … HL12 … HLK1) -L1 /3 width=8 by aaa_lift, ldrop_fwd_drop2/ - ] -| #a #G #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12 - elim (llpx_inv_bind_O … HL12) -HL12 #HV1 #HT1 - elim (cpx_inv_abbr1 … H) -H * - [ #V2 #T2 #HV12 #HT12 #H destruct /4 width=4 by llpx_bind_repl_O, aaa_abbr/ - | #T2 #HT12 #HT2 #H destruct -IHV1 /3 width=8 by aaa_inv_lift, ldrop_drop/ - ] -| #a #G #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12 - elim (llpx_inv_bind_O … HL12) -HL12 #HV1 #HT1 - elim (cpx_inv_abst1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct - /4 width=4 by llpx_bind_repl_O, aaa_abst/ -| #G #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12 - elim (llpx_inv_flat … HL12) -HL12 #HV1 #HT1 - elim (cpx_inv_appl1 … H) -H * - [ #V2 #T2 #HV12 #HT12 #H destruct /3 width=3 by aaa_appl/ - | #b #V2 #W1 #W2 #U1 #U2 #HV12 #HW12 #HU12 #H1 #H2 destruct - lapply (IHV1 … HV12 … HV1) -IHV1 -HV12 #HV2 - lapply (IHT1 (ⓛ{b}W2.U2) … HT1) -IHT1 /2 width=1 by cpx_bind/ -L1 #H - elim (aaa_inv_abst … H) -H #B0 #A0 #HW1 #HU2 #H destruct - /5 width=6 by lsuba_aaa_trans, lsuba_abbr, aaa_abbr, aaa_cast/ - | #b #V #V2 #W1 #W2 #U1 #U2 #HV1 #HV2 #HW12 #HU12 #H1 #H2 destruct - lapply (aaa_lift G L2 … B … (L2.ⓓW2) … HV2) -HV2 /2 width=2 by ldrop_drop/ #HV2 - lapply (IHT1 (ⓓ{b}W2.U2) … HT1) -IHT1 /2 width=1 by cpx_bind/ -L1 #H - elim (aaa_inv_abbr … H) -H /3 width=3 by aaa_abbr, aaa_appl/ - ] -| #G #L1 #V1 #T1 #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12 - elim (llpx_inv_flat … HL12) -HL12 #HV1 #HT1 - elim (cpx_inv_cast1 … H) -H - [ * #V2 #T2 #HV12 #HT12 #H destruct /3 width=1 by aaa_cast/ - | -IHV1 /2 width=1 by/ - | -IHT1 /2 width=1 by/ - ] -] -qed-. - -lemma aaa_cpx_conf: ∀h,g,G,L,T1,A. ⦃G, L⦄ ⊢ T1 ⁝ A → ∀T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 → ⦃G, L⦄ ⊢ T2 ⁝ A. -/2 width=7 by aaa_cpx_llpx_conf/ qed-. - -lemma aaa_llpx_conf: ∀h,g,G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A → ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g, T, 0] L2 → ⦃G, L2⦄ ⊢ T ⁝ A. -/2 width=7 by aaa_cpx_llpx_conf/ qed-. - -lemma aaa_cpr_conf: ∀G,L,T1,A. ⦃G, L⦄ ⊢ T1 ⁝ A → ∀T2. ⦃G, L⦄ ⊢ T1 ➡ T2 → ⦃G, L⦄ ⊢ T2 ⁝ A. -/3 width=5 by aaa_cpx_conf, cpr_cpx/ qed-. -(* -lamma aaa_llpr_conf: ∀G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A → ∀L2. ⦃G, L1⦄ ⊢ ➡[T, 0] L2 → ⦃G, L2⦄ ⊢ T ⁝ A. -/3 width=5 by aaa_llpx_conf, llpr_llpx/ qed-. -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpx_ldrop.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpx_ldrop.etc deleted file mode 100644 index 3e4bcab8f..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpx_ldrop.etc +++ /dev/null @@ -1,90 +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/reduction/cpx_llpx_sn.ma". -include "basic_2/reduction/cpx_lift.ma". -include "basic_2/reduction/llpx.ma". - -(* LAZY SN EXTENDED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ***************) - -(* Advanced inversion lemmas ************************************************) - -lemma llpx_inv_lref_ge_dx: ∀h,g,G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡[h, g, #i, d] L2 → d ≤ i → - ∀I,K2,V2. ⇩[i] L2 ≡ K2.ⓑ{I}V2 → - ∃∃K1,V1. ⇩[i] L1 ≡ K1.ⓑ{I}V1 & - ⦃G, K1⦄ ⊢ ➡[h, g, V1, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡[h, g] V2. -/2 width=5 by llpx_sn_inv_lref_ge_dx/ qed-. - -lemma llpx_inv_lref_ge_sn: ∀h,g,G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡[h, g, #i, d] L2 → d ≤ i → - ∀I,K1,V1. ⇩[i] L1 ≡ K1.ⓑ{I}V1 → - ∃∃K2,V2. ⇩[i] L2 ≡ K2.ⓑ{I}V2 & - ⦃G, K1⦄ ⊢ ➡[h, g, V1, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡[h, g] V2. -/2 width=5 by llpx_sn_inv_lref_ge_sn/ qed-. - -lemma llpx_inv_lref_ge_bi: ∀h,g,G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡[h, g, #i, d] L2 → d ≤ i → - ∀I1,I2,K1,K2,V1,V2. - ⇩[i] L1 ≡ K1.ⓑ{I1}V1 → ⇩[i] L2 ≡ K2.ⓑ{I2}V2 → - ∧∧ I1 = I2 & ⦃G, K1⦄ ⊢ ➡[h, g, V1, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡[h, g] V2. -/2 width=8 by llpx_sn_inv_lref_ge_bi/ qed-. - -lemma llpx_inv_bind_O: ∀h,g,a,I,G,L1,L2,V,T. ⦃G, L1⦄ ⊢ ➡ [h, g, ⓑ{a,I}V.T, 0] L2 → - ⦃G, L1⦄ ⊢ ➡[h, g, V, 0] L2 ∧ ⦃G, L1.ⓑ{I}V⦄ ⊢ ➡[h, g, T, 0] L2.ⓑ{I}V. -/2 width=2 by llpx_sn_inv_bind_O/ qed-. - -lemma llpx_bind_repl_O: ∀h,g,I,G,L1,L2,V1,V2,T. ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡[h, g, T, 0] L2.ⓑ{I}V2 → - ∀J,W1,W2. ⦃G, L1⦄ ⊢ ➡[h, g, W1, 0] L2 → ⦃G, L1⦄ ⊢ W1 ➡[h, g] W2 → ⦃G, L1.ⓑ{J}W1⦄ ⊢ ➡[h, g, T, 0] L2.ⓑ{J}W2. -/2 width=4 by llpx_sn_bind_repl_O/ qed-. - -(* Advanced forward lemmas **************************************************) - -lemma llpx_fwd_bind_O_dx: ∀h,g,a,I,G,L1,L2,V,T. ⦃G, L1⦄ ⊢ ➡[h, g, ⓑ{a,I}V.T, 0] L2 → - ⦃G, L1.ⓑ{I}V⦄ ⊢ ➡[h, g, T, 0] L2.ⓑ{I}V. -/2 width=3 by llpx_sn_fwd_bind_O_dx/ qed-. - -(* Advanced properties ******************************************************) - -lemma llpx_cpx_conf: ∀h,g,G. s_r_confluent1 … (cpx h g G) (llpx h g G 0). -/3 width=10 by cpx_llpx_sn_conf, cpx_inv_lift1, cpx_lift/ qed-. - -(* Inversion lemmas on relocation *******************************************) - -lemma llpx_ldrop_trans_O: ∀h,g,G,L1,L2,U. ⦃G, L1⦄ ⊢ ➡[h, g, U, 0] L2 → - ∀K2,e. ⇩[e] L2 ≡ K2 → ∀T. ⇧[0, e] T ≡ U → - ∃∃K1. ⇩[e] L1 ≡ K1 & ⦃G, K1⦄ ⊢ ➡[h, g, T, 0] K2. -/2 width=5 by llpx_sn_ldrop_trans_O/ qed-. - -(* Properties on supclosure *************************************************) - -lemma llpx_fqu_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ → - ∀K1. ⦃G1, K1⦄ ⊢ ➡[h, g, T1, 0] L1 → - ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡[h, g] T & ⦃G1, K1, T⦄ ⊃ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g, T2, 0] L2. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 -/3 width=7 by llpx_fwd_bind_O_dx, llpx_fwd_pair_sn,llpx_fwd_flat_dx, ex3_2_intro/ -[ #I #G1 #L1 #V1 #K1 #H elim (llpx_inv_lref_ge_dx … H) -H [5,6: // |2,3,4: skip ] - #Y1 #W1 #HKL1 #HW1 #HWV1 elim (lift_total V1 0 1) - /4 width=7 by llpx_cpx_conf, cpx_delta, fqu_drop, ldrop_fwd_drop2, ex3_2_intro/ -| #G #L1 #K1 #T1 #U1 #e #HLK1 #HTU1 #L0 #HU1 - elim (llpx_ldrop_trans_O … HU1 … HLK1) -L1 - /3 width=5 by fqu_drop, ex3_2_intro/ -] -qed-. - -lemma llpx_fquq_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ → - ∀K1. ⦃G1, K1⦄ ⊢ ➡[h, g, T1, 0] L1 → - ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡[h, g] T & ⦃G1, K1, T⦄ ⊃⸮ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g, T2, 0] L2. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H #K1 #HKL1 elim (fquq_inv_gen … H) -H -[ #HT12 elim (llpx_fqu_trans … HT12 … HKL1) /3 width=5 by fqu_fquq, ex3_2_intro/ -| * #H1 #H2 #H3 destruct /2 width=5 by ex3_2_intro/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpx_lleq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpx_lleq.etc deleted file mode 100644 index e936cc531..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpx_lleq.etc +++ /dev/null @@ -1,31 +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/reduction/cpx_lleq.ma". -include "basic_2/reduction/llpx.ma". - -(* LAZY SN EXTENDED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ***************) - -(* Properties on lazy equivalence for local environments ********************) - -lemma llpx_lrefl: ∀h,g,G,L1,L2,T,d. L1 ⋕[T, d] L2 → ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2. -/2 width=1 by llpx_sn_lrefl/ qed-. - -lemma lleq_llpx_trans: ∀h,g,G,L1,L2,T,d. L1 ⋕[T, d] L2 → - ∀L.⦃G, L2⦄ ⊢ ➡[h, g, T, d] L → ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L. -/3 width=3 by lleq_cpx_trans, lleq_llpx_sn_trans/ qed-. - -lemma lleq_llpx_conf: ∀h,g,G,L1,L2,T,d. L1 ⋕[T, d] L2 → - ∀L.⦃G, L1⦄ ⊢ ➡[h, g, T, d] L → ⦃G, L2⦄ ⊢ ➡[h, g, T, d] L. -/3 width=3 by lleq_cpx_trans, lleq_llpx_sn_conf/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpx_lpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpx_lpr.etc deleted file mode 100644 index 6ceb64b51..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpx_lpr.etc +++ /dev/null @@ -1,25 +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/relocation/llpx_sn_lpx_sn.ma". -include "basic_2/reduction/lpr.ma". -include "basic_2/reduction/llpx.ma". - -(* LAZY SN EXTENDED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ***************) - -(* Properties on sn parallel reduction **************************************) - -(* Note: this should be moved *) -lemma lpr_llpx: ∀h,g,G,L1,L2,T,d. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2. -/3 width=4 by cpr_cpx, lpx_sn_llpx_sn, llpx_sn_co/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpxs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpxs.etc deleted file mode 100644 index 750d0b5b1..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpxs.etc +++ /dev/null @@ -1,89 +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/notation/relations/lazypredsnstar_7.ma". -include "basic_2/reduction/llpx.ma". - -(* LAZY SN EXTENDED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS **************) - -definition llpxs: ∀h. sd h → genv → relation4 ynat term lenv lenv ≝ - λh,g,G,d. LTC … (llpx h g G d). - -interpretation "lazy extended parallel computation (local environment, sn variant)" - 'LazyPRedSnStar G L1 L2 h g T d = (llpxs h g G d T L1 L2). - -(* Basic eliminators ********************************************************) - -lemma llpxs_ind: ∀h,g,G,L1,T,d. ∀R:predicate lenv. R L1 → - (∀L,L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L → ⦃G, L⦄ ⊢ ➡[h, g, T, d] L2 → R L → R L2) → - ∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → R L2. -#h #g #G #L1 #T #d #R #HL1 #IHL1 #L2 #HL12 -@(TC_star_ind … HL1 IHL1 … HL12) // -qed-. - -lemma llpxs_ind_dx: ∀h,g,G,L2,T,d. ∀R:predicate lenv. R L2 → - (∀L1,L. ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L → ⦃G, L⦄ ⊢ ➡*[h, g, T, d] L2 → R L → R L1) → - ∀L1. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → R L1. -#h #g #G #L2 #T #d #R #HL2 #IHL2 #L1 #HL12 -@(TC_star_ind_dx … HL2 IHL2 … HL12) // -qed-. - -(* Basic properties *********************************************************) - -lemma llpx_llpxs: ∀h,g,G,L1,L2,T,d. ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2 → ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2. -normalize /2 width=1 by inj/ qed. - -lemma llpxs_refl: ∀h,g,G,L,T,d. ⦃G, L⦄ ⊢ ➡*[h, g, T, d] L. -/2 width=1 by llpx_llpxs/ qed. - -lemma llpxs_strap1: ∀h,g,G,L1,L,L2,T,d. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L → ⦃G, L⦄ ⊢ ➡[h, g, T, d] L2 → ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2. -normalize /2 width=3 by step/ qed. - -lemma llpxs_strap2: ∀h,g,G,L1,L,L2,T,d. ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L → ⦃G, L⦄ ⊢ ➡*[h, g, T, d] L2 → ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2. -normalize /2 width=3 by TC_strap/ qed. - -(* Basic forward lemmas *****************************************************) - -lemma llpxs_fwd_length: ∀h,g,G,L1,L2,T,d. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → |L1| = |L2|. -#h #g #G #L1 #L2 #T #d #H @(llpxs_ind … H) -L2 -/3 width=8 by llpx_fwd_length, trans_eq/ -qed-. - -(* Note: this might be moved *) -lemma llpxs_fwd_bind_sn: ∀h,g,a,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡*[h, g, ⓑ{a,I}V.T, d] L2 → - ⦃G, L1⦄ ⊢ ➡*[h, g, V, d] L2. -#h #g #a #I #G #L1 #L2 #V #T #d #H @(llpxs_ind … H) -L2 -/3 width=6 by llpx_fwd_bind_sn, llpxs_strap1/ -qed-. - -(* Note: this might be moved *) -lemma llpxs_fwd_bind_dx: ∀h,g,a,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡*[h, g, ⓑ{a,I}V.T, d] L2 → - ⦃G, L1.ⓑ{I}V⦄ ⊢ ➡*[h, g, T, ⫯d] L2.ⓑ{I}V. -#h #g #a #I #G #L1 #L2 #V #T #d #H @(llpxs_ind … H) -L2 -/3 width=6 by llpx_fwd_bind_dx, llpxs_strap1/ -qed-. - -(* Note: this might be moved *) -lemma llpxs_fwd_flat_sn: ∀h,g,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡*[h, g, ⓕ{I}V.T, d] L2 → - ⦃G, L1⦄ ⊢ ➡*[h, g, V, d] L2. -#h #g #I #G #L1 #L2 #V #T #d #H @(llpxs_ind … H) -L2 -/3 width=6 by llpx_fwd_flat_sn, llpxs_strap1/ -qed-. - -(* Note: this might be moved *) -lemma llpxs_fwd_flat_dx: ∀h,g,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡*[h, g, ⓕ{I}V.T, d] L2 → - ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2. -#h #g #I #G #L1 #L2 #V #T #d #H @(llpxs_ind … H) -L2 -/3 width=6 by llpx_fwd_flat_dx, llpxs_strap1/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpxs_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpxs_aaa.etc deleted file mode 100644 index ededb03a2..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpxs_aaa.etc +++ /dev/null @@ -1,31 +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/reduction/llpx_aaa.ma". -include "basic_2/computation/llpxs.ma". - -(* LAZY SN EXTENDED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS **************) - -(* Properties about atomic arity assignment on terms ************************) - -lemma aaa_llpxs_conf: ∀h,g,G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A → - ∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, 0] L2 → ⦃G, L2⦄ ⊢ T ⁝ A. -#h #g #G #L1 #T #A #HT #L2 #HL12 -@(TC_Conf3 … (λL,A. ⦃G, L⦄ ⊢ T ⁝ A) … HT ? HL12) /2 width=5 by aaa_llpx_conf/ -qed-. -(* -lamma aaa_llprs_conf: ∀G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A → - ∀L2. ⦃G, L1⦄ ⊢ ➡*[T, 0] L2 → ⦃G, L2⦄ ⊢ T ⁝ A. -/3 width=5 by aaa_llpxs_conf, llprs_llpxs/ qed-. -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpxs_cpxs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpxs_cpxs.etc deleted file mode 100644 index 35472d7e5..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpxs_cpxs.etc +++ /dev/null @@ -1,172 +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/relocation/llpx_sn_tc.ma". -include "basic_2/computation/cpxs_llpx.ma". -include "basic_2/computation/llpxs.ma". - -(* LAZY SN EXTENDED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS **************) - -(* Advanced properties ******************************************************) - -lemma llpxs_pair_dx: ∀h,g,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡*[h, g] V2 → - ∀I,T. ⦃G, L.ⓑ{I}V1⦄ ⊢ ➡*[h, g, T, 0] L.ⓑ{I}V2. -/2 width=1 by llpx_sn_TC_pair_dx/ qed. - -(* Properties on context-sensitive extended parallel computation for terms **) - -lemma llpxs_cpx_trans: ∀h,g,G. s_r_transitive … (cpx h g G) (llpxs h g G 0). -/3 width=5 by s_r_trans_LTC2, llpx_cpxs_trans/ qed-. - -lemma llpxs_cpxs_trans: ∀h,g,G. s_rs_transitive … (cpx h g G) (llpxs h g G 0). -#h #g #G @s_r_to_s_rs_trans @s_r_trans_LTC2 -/3 width=5 by llpx_cpxs_trans, s_rs_trans_TC1/ (**) (* full auto too slow *) -qed-. - -(* Note: this is an instance of a general theorem *) -lemma llpxs_cpxs_conf_dx: ∀h,g,G2,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡*[h, g] U2 → - ∀L0. ⦃G2, L0⦄ ⊢ ➡*[h, g, T2, O] L2 → ⦃G2, L0⦄ ⊢ ➡*[h, g, U2, O] L2. -#h #g #G2 #L2 #T2 #U2 #HTU2 #L0 #H @(llpxs_ind_dx … H) -L0 // -#L0 #L #HL0 #HL2 #IHL2 @(llpxs_strap2 … IHL2) -IHL2 -lapply (llpxs_cpxs_trans … HTU2 … HL2) -L2 #HTU2 -/3 width=3 by llpx_cpxs_trans, cpxs_llpx_conf/ -qed-. - -(* Note: this is an instance of a general theorem *) -lemma llpxs_cpx_conf_dx: ∀h,g,G2,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡[h, g] U2 → - ∀L0. ⦃G2, L0⦄ ⊢ ➡*[h, g, T2, O] L2 → ⦃G2, L0⦄ ⊢ ➡*[h, g, U2, O] L2. -#h #g #G2 #L2 #T2 #U2 #HTU2 #L0 #H @(llpxs_ind_dx … H) -L0 // -#L0 #L #HL0 #HL2 #IHL2 @(llpxs_strap2 … IHL2) -IHL2 -lapply (llpxs_cpx_trans … HTU2 … HL2) -L2 #HTU2 -/3 width=3 by llpx_cpxs_trans, cpxs_llpx_conf/ -qed-. - -lemma cpxs_bind2: ∀h,g,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡*[h, g] V2 → - ∀I,T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ➡*[h, g] T2 → - ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡*[h, g] ⓑ{a,I}V2.T2. -/4 width=5 by llpxs_cpxs_trans, llpxs_pair_dx, cpxs_bind/ qed. - -(* Advanced forward lemmas **************************************************) - -(* Note: this might be moved *) -lemma llpxs_fwd_lref_ge_sn: ∀h,g,G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡*[h, g, #i, d] L2 → d ≤ i → - ∀I,K1,V1. ⇩[i] L1 ≡ K1.ⓑ{I}V1 → - ∃∃K2,V2. ⇩[i] L2 ≡ K2.ⓑ{I}V2 & - ⦃G, K1⦄ ⊢ ➡*[h, g, V2, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡*[h, g] V2. -#h #g #G #L1 #L2 #d #i #H #Hdi #I #K1 #V1 #HLK1 @(llpxs_ind … H) -L2 /2 width=5 by ex3_2_intro/ -HLK1 -#L #L2 #_ #HL2 * #K #V #HLK #HK1 #HV1 elim (llpx_inv_lref_ge_sn … HL2 … HLK) // -HL2 -HLK -Hdi -#K2 #V2 #HLK2 #HK2 #HV2 -@(ex3_2_intro … HLK2) -HLK2 -[ /3 width=5 by llpxs_cpx_conf_dx, llpxs_strap1, llpx_cpx_conf/ -| /3 width=5 by llpxs_cpx_trans, cpxs_trans/ -] -qed-. - -(* Inversion lemmas on context-sensitive ext parallel computation for terms *) - -lemma cpxs_inv_abst1: ∀h,g,a,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓛ{a}V1.T1 ➡*[h, g] U2 → - ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡*[h, g] V2 & ⦃G, L.ⓛV1⦄ ⊢ T1 ➡*[h, g] T2 & - U2 = ⓛ{a}V2.T2. -#h #g #a #G #L #V1 #T1 #U2 #H @(cpxs_ind … H) -U2 /2 width=5 by ex3_2_intro/ -#U0 #U2 #_ #HU02 * #V0 #T0 #HV10 #HT10 #H destruct -elim (cpx_inv_abst1 … HU02) -HU02 #V2 #T2 #HV02 #HT02 #H destruct -lapply (llpxs_cpx_trans … HT02 (L.ⓛV1) ?) -/3 width=5 by llpxs_pair_dx, cpxs_trans, cpxs_strap1, ex3_2_intro/ -qed-. - -lemma cpxs_inv_abbr1: ∀h,g,a,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓓ{a}V1.T1 ➡*[h, g] U2 → ( - ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡*[h, g] V2 & ⦃G, L.ⓓV1⦄ ⊢ T1 ➡*[h, g] T2 & - U2 = ⓓ{a}V2.T2 - ) ∨ - ∃∃T2. ⦃G, L.ⓓV1⦄ ⊢ T1 ➡*[h, g] T2 & ⇧[0, 1] U2 ≡ T2 & a = true. -#h #g #a #G #L #V1 #T1 #U2 #H @(cpxs_ind … H) -U2 /3 width=5 by ex3_2_intro, or_introl/ -#U0 #U2 #_ #HU02 * * -[ #V0 #T0 #HV10 #HT10 #H destruct - elim (cpx_inv_abbr1 … HU02) -HU02 * - [ #V2 #T2 #HV02 #HT02 #H destruct - lapply (llpxs_cpx_trans … HT02 (L.ⓓV1) ?) - /4 width=5 by llpxs_pair_dx, cpxs_trans, cpxs_strap1, ex3_2_intro, or_introl/ - | #T2 #HT02 #HUT2 - lapply (llpxs_cpx_trans … HT02 (L.ⓓV1) ?) -HT02 - /4 width=3 by llpxs_pair_dx, cpxs_trans, ex3_intro, or_intror/ - ] -| #U1 #HTU1 #HU01 - elim (lift_total U2 0 1) #U #HU2 - /6 width=12 by cpxs_strap1, cpx_lift, ldrop_drop, ex3_intro, or_intror/ -] -qed-. - -(* Properties on supclosure *************************************************) - -lemma llpx_fqup_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃+ ⦃G2, L2, T2⦄ → - ∀K1. ⦃G1, K1⦄ ⊢ ➡[h, g, T1, 0] L1 → - ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡*[h, g] T & ⦃G1, K1, T⦄ ⊃+ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g, T2, 0] L2. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2 -[ #G2 #L2 #T2 #H12 #K1 #HKL1 elim (llpx_fqu_trans … H12 … HKL1) -L1 - /3 width=5 by cpx_cpxs, fqu_fqup, ex3_2_intro/ -| #G #G2 #L #L2 #T #T2 #_ #H2 #IH1 #K1 #HLK1 elim (IH1 … HLK1) -L1 - #L0 #T0 #HT10 #HT0 #HL0 elim (llpx_fqu_trans … H2 … HL0) -L - #L #T3 #HT3 #HT32 #HL2 elim (fqup_cpx_trans … HT0 … HT3) -T - /3 width=7 by cpxs_strap1, fqup_strap1, ex3_2_intro/ -] -qed-. - -lemma llpx_fqus_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃* ⦃G2, L2, T2⦄ → - ∀K1. ⦃G1, K1⦄ ⊢ ➡[h, g, T1, 0] L1 → - ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡*[h, g] T & ⦃G1, K1, T⦄ ⊃* ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g, T2, 0] L2. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqus_ind … H) -G2 -L2 -T2 /2 width=5 by ex3_2_intro/ -#G #G2 #L #L2 #T #T2 #_ #H2 #IH1 #K1 #HLK1 elim (IH1 … HLK1) -L1 -#L0 #T0 #HT10 #HT0 #HL0 elim (llpx_fquq_trans … H2 … HL0) -L -#L #T3 #HT3 #HT32 #HL2 elim (fqus_cpx_trans … HT0 … HT3) -T -/3 width=7 by cpxs_strap1, fqus_strap1, ex3_2_intro/ -qed-. - -lemma llpxs_fquq_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ → - ∀K1. ⦃G1, K1⦄ ⊢ ➡*[h, g, T1, 0] L1 → - ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡*[h, g] T & ⦃G1, K1, T⦄ ⊃⸮ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡*[h, g, T2, 0] L2. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #HT12 #K1 #H @(llpxs_ind_dx … H) -K1 -[ /2 width=5 by ex3_2_intro/ -| #K1 #K #HK1 #_ * #L #T #HT1 #HT2 #HL2 -HT12 - lapply (llpx_cpxs_trans … HT1 … HK1) -HT1 #HT1 - lapply (cpxs_llpx_conf … HT1 … HK1) -HK1 #HK1 - elim (llpx_fquq_trans … HT2 … HK1) -K - /3 width=7 by llpxs_strap2, cpxs_strap1, ex3_2_intro/ -] -qed-. - -lemma llpxs_fqup_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃+ ⦃G2, L2, T2⦄ → - ∀K1. ⦃G1, K1⦄ ⊢ ➡*[h, g, T1, 0] L1 → - ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡*[h, g] T & ⦃G1, K1, T⦄ ⊃+ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡*[h, g, T2, 0] L2. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #HT12 #K1 #H @(llpxs_ind_dx … H) -K1 -[ /2 width=5 by ex3_2_intro/ -| #K1 #K #HK1 #_ * #L #T #HT1 #HT2 #HL2 -HT12 - lapply (llpx_cpxs_trans … HT1 … HK1) -HT1 #HT1 - lapply (cpxs_llpx_conf … HT1 … HK1) -HK1 #HK1 - elim (llpx_fqup_trans … HT2 … HK1) -K - /3 width=7 by llpxs_strap2, cpxs_trans, ex3_2_intro/ -] -qed-. - -lemma llpxs_fqus_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃* ⦃G2, L2, T2⦄ → - ∀K1. ⦃G1, K1⦄ ⊢ ➡*[h, g, T1, 0] L1 → - ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡*[h, g] T & ⦃G1, K1, T⦄ ⊃* ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡*[h, g, T2, 0] L2. -#h #g #G1 #G2 #L1 #L2 #T1 #T2 #HT12 #K1 #H @(llpxs_ind_dx … H) -K1 -[ /2 width=5 by ex3_2_intro/ -| #K1 #K #HK1 #_ * #L #T #HT1 #HT2 #HL2 -HT12 - lapply (llpx_cpxs_trans … HT1 … HK1) -HT1 #HT1 - lapply (cpxs_llpx_conf … HT1 … HK1) -HK1 #HK1 - elim (llpx_fqus_trans … HT2 … HK1) -K - /3 width=7 by llpxs_strap2, cpxs_trans, ex3_2_intro/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpxs_lleq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpxs_lleq.etc deleted file mode 100644 index a38ba395a..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpxs_lleq.etc +++ /dev/null @@ -1,66 +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/substitution/lleq_leq.ma". -include "basic_2/reduction/llpx_lleq.ma". -include "basic_2/computation/cpxs_lleq.ma". -include "basic_2/computation/llpxs_cpxs.ma". - -(* LAZY SN EXTENDED PARALLEL COMPUTATION FOR LOCAL ENVIRONMENTS *************) - -(* Properties on lazy equivalence for local environments ********************) - -lemma llpxs_lrefl: ∀h,g,G,L1,L2,T,d. L1 ⋕[T, d] L2 → ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2. -/3 width=1 by llpx_lrefl, llpx_llpxs/ qed-. - -lemma lleq_llpxs_trans: ∀h,g,G,L2,L,T,d. ⦃G, L2⦄ ⊢ ➡*[h, g, T, d] L → - ∀L1. L1 ⋕[T, d] L2 → ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L. -#h #g #G #L2 #L #T #d #H @(llpxs_ind … H) -L -/3 width=3 by llpxs_strap1, llpxs_lrefl/ -qed-. - -lemma lleq_llpxs_conf: ∀h,g,G,L1,L,T,d. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L → - ∀L2. L1 ⋕[T, d] L2 → ⦃G, L2⦄ ⊢ ➡*[h, g, T, d] L. -/3 width=3 by lleq_llpxs_trans, lleq_sym/ qed-. -(* -foct leq_lpxs_trans_lleq_aux: ∀h,g,G,L1,L0,d,e. L1 ≃[d, e] L0 → e = ∞ → - ∀L2. ⦃G, L0⦄ ⊢ ➡*[h, g] L2 → - ∃∃L. L ≃[d, e] L2 & ⦃G, L1⦄ ⊢ ➡*[h, g] L & - (∀T. L0 ⋕[T, d] L2 ↔ L1 ⋕[T, d] L). -#h #g #G #L1 #L0 #d #e #H elim H -L1 -L0 -d -e -[ #d #e #_ #L2 #H >(lpxs_inv_atom1 … H) -H - /3 width=5 by ex3_intro, conj/ -| #I1 #I0 #L1 #L0 #V1 #V0 #_ #_ #He destruct -| #I #L1 #L0 #V1 #e #HL10 #IHL10 #He #Y #H - elim (lpxs_inv_pair1 … H) -H #L2 #V2 #HL02 #HV02 #H destruct - lapply (ysucc_inv_Y_dx … He) -He #He - elim (IHL10 … HL02) // -IHL10 -HL02 #L #HL2 #HL1 #IH - @(ex3_intro … (L.ⓑ{I}V2)) /3 width=3 by lpxs_pair, leq_cpxs_trans, leq_pair/ - #T elim (IH T) #HL0dx #HL0sn - @conj #H @(lleq_leq_repl … H) -H /3 width=1 by leq_sym, leq_pair_O_Y/ -| #I1 #I0 #L1 #L0 #V1 #V0 #d #e #HL10 #IHL10 #He #Y #H - elim (lpxs_inv_pair1 … H) -H #L2 #V2 #HL02 #HV02 #H destruct - elim (IHL10 … HL02) // -IHL10 -HL02 #L #HL2 #HL1 #IH - @(ex3_intro … (L.ⓑ{I1}V1)) /3 width=1 by lpxs_pair, leq_succ/ - #T elim (IH T) #HL0dx #HL0sn - @conj #H @(lleq_leq_repl … H) -H /3 width=1 by leq_sym, leq_succ/ -] -qed-. - -lamma leq_lpxs_trans_lleq: ∀h,g,G,L1,L0,d. L1 ≃[d, ∞] L0 → - ∀L2. ⦃G, L0⦄ ⊢ ➡*[h, g] L2 → - ∃∃L. L ≃[d, ∞] L2 & ⦃G, L1⦄ ⊢ ➡*[h, g] L & - (∀T. L0 ⋕[T, d] L2 ↔ L1 ⋕[T, d] L). -/2 width=1 by leq_lpxs_trans_lleq_aux/ qed-. -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpxs_llpxs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpxs_llpxs.etc deleted file mode 100644 index d316c5207..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpxs_llpxs.etc +++ /dev/null @@ -1,22 +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/computation/llpxs.ma". - -(* LAZY SN EXTENDED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS **************) - -(* Main properties **********************************************************) - -theorem llpxs_trans: ∀h,g,G,T,d. Transitive … (llpxs h g G d T). -normalize /2 width=3 by trans_TC/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpxs_lprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpxs_lprs.etc deleted file mode 100644 index 32d7bbc38..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llpxs_lprs.etc +++ /dev/null @@ -1,25 +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/reduction/llpx_lpr.ma". -include "basic_2/computation/lprs.ma". -include "basic_2/computation/llpxs.ma". - -(* LAZY SN EXTENDED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS **************) - -(* Properties on sn parallel computation ************************************) - -(* Note: this should be moved *) -lemma lprs_llpxs: ∀h,g,G,L1,L2,T,d. ⦃G, L1⦄ ⊢ ➡* L2 → ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2. -normalize /3 width=3 by lpr_llpx, monotonic_TC/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llsx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llsx.etc deleted file mode 100644 index 286d0645f..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llsx.etc +++ /dev/null @@ -1,57 +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/notation/relations/lazysn_6.ma". -include "basic_2/substitution/lleq.ma". -include "basic_2/reduction/llpx.ma". - -(* LAZY SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS *****************) - -definition llsx: ∀h. sd h → relation4 ynat term genv lenv ≝ - λh,g,d,T,G. SN … (llpx h g G d T) (lleq d T). - -interpretation - "lazy extended strong normalization (local environment)" - 'LazySN h g d T G L = (llsx h g T d G L). - -(* Basic eliminators ********************************************************) - -lemma llsx_ind: ∀h,g,G,T,d. ∀R:predicate lenv. - (∀L1. G ⊢ ⋕⬊*[h, g, T, d] L1 → - (∀L2. ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → R L2) → - R L1 - ) → - ∀L. G ⊢ ⋕⬊*[h, g, T, d] L → R L. -#h #g #G #T #d #R #H0 #L1 #H elim H -L1 -/5 width=1 by lleq_sym, SN_intro/ -qed-. - -(* Basic properties *********************************************************) - -lemma llsx_intro: ∀h,g,G,L1,T,d. - (∀L2. ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → G ⊢ ⋕⬊*[h, g, T, d] L2) → - G ⊢ ⋕⬊*[h, g, T, d] L1. -/5 width=1 by lleq_sym, SN_intro/ qed. - -lemma llsx_sort: ∀h,g,G,L,d,k. G ⊢ ⋕⬊*[h, g, ⋆k, d] L. -#h #g #G #L1 #d #k @llsx_intro -#L2 #HL12 #H elim H -H -/3 width=6 by llpx_fwd_length, lleq_sort/ -qed. - -lemma llsx_gref: ∀h,g,G,L,d,p. G ⊢ ⋕⬊*[h, g, §p, d] L. -#h #g #G #L1 #d #p @llsx_intro -#L2 #HL12 #H elim H -H -/3 width=6 by llpx_fwd_length, lleq_gref/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llsx_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llsx_alt.etc deleted file mode 100644 index 0d23439b9..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llsx_alt.etc +++ /dev/null @@ -1,107 +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/notation/relations/lazysnalt_6.ma". -include "basic_2/substitution/lleq_lleq.ma". -include "basic_2/computation/llpxs_lleq.ma". -include "basic_2/computation/llsx.ma". - -(* SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS **********************) - -(* alternative definition of llsx *) -definition llsxa: ∀h. sd h → relation4 ynat term genv lenv ≝ - λh,g,d,T,G. SN … (llpxs h g G d T) (lleq d T). - -interpretation - "lazy extended strong normalization (local environment) alternative" - 'LazySNAlt h g d T G L = (llsxa h g T d G L). - -(* Basic eliminators ********************************************************) - -lemma llsxa_ind: ∀h,g,G,T,d. ∀R:predicate lenv. - (∀L1. G ⊢ ⋕⬊⬊*[h, g, T, d] L1 → - (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → R L2) → - R L1 - ) → - ∀L. G ⊢ ⋕⬊⬊*[h, g, T, d] L → R L. -#h #g #G #T #d #R #H0 #L1 #H elim H -L1 -/5 width=1 by lleq_sym, SN_intro/ -qed-. - -(* Basic properties *********************************************************) - -lemma llsxa_intro: ∀h,g,G,L1,T,d. - (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → G ⊢ ⋕⬊⬊*[h, g, T, d] L2) → - G ⊢ ⋕⬊⬊*[h, g, T, d] L1. -/5 width=1 by lleq_sym, SN_intro/ qed. - -fact llsxa_intro_aux: ∀h,g,G,L1,T,d. - (∀L,L2. ⦃G, L⦄ ⊢ ➡*[h, g, T, d] L2 → L1 ⋕[T, d] L → (L1 ⋕[T, d] L2 → ⊥) → G ⊢ ⋕⬊⬊*[h, g, T, d] L2) → - G ⊢ ⋕⬊⬊*[h, g, T, d] L1. -/4 width=3 by llsxa_intro/ qed-. - -lemma llsxa_llpxs_trans: ∀h,g,G,L1,T,d. G ⊢ ⋕⬊⬊*[h, g, T, d] L1 → - ∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → G ⊢ ⋕⬊⬊*[h, g, T, d] L2. -#h #g #G #L1 #T #d #H @(llsxa_ind … H) -L1 #L1 #HL1 #IHL1 #L2 #HL12 @llsxa_intro -elim (lleq_dec T L1 L2 d) /4 width=4 by lleq_llpxs_trans, lleq_canc_sn/ -qed-. - -lemma llsxa_intro_llpx: ∀h,g,G,L1,T,d. - (∀L2. ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → G ⊢ ⋕⬊⬊*[h, g, T, d] L2) → - G ⊢ ⋕⬊⬊*[h, g, T, d] L1. -#h #g #G #L1 #T #d #IH @llsxa_intro_aux -#L #L2 #H @(llpxs_ind_dx … H) -L -[ #H destruct #H elim H // -| #L0 #L elim (lleq_dec T L1 L d) - /4 width=3 by llsxa_llpxs_trans, lleq_llpx_trans/ -] -qed. - -(* Main properties **********************************************************) - -theorem llsx_llsxa: ∀h,g,G,L,T,d. G ⊢ ⋕⬊*[h, g, T, d] L → G ⊢ ⋕⬊⬊*[h, g, T, d] L. -#h #g #G #L #T #d #H @(llsx_ind … H) -L -/4 width=1 by llsxa_intro_llpx/ -qed. - -(* Main inversion lemmas ****************************************************) - -theorem llsxa_inv_llsx: ∀h,g,G,L,T,d. G ⊢ ⋕⬊⬊*[h, g, T, d] L → G ⊢ ⋕⬊*[h, g, T, d] L. -#h #g #G #L #T #d #H @(llsxa_ind … H) -L -/4 width=1 by llsx_intro, llpx_llpxs/ -qed-. - -(* Advanced properties ******************************************************) - -lemma llsx_intro_alt: ∀h,g,G,L1,T,d. - (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → G ⊢ ⋕⬊*[h, g, T, d] L2) → - G ⊢ ⋕⬊*[h, g, T, d] L1. -/6 width=1 by llsxa_inv_llsx, llsx_llsxa, llsxa_intro/ qed. - -lemma llsx_llpxs_trans: ∀h,g,G,L1,T,d. G ⊢ ⋕⬊*[h, g, T, d] L1 → - ∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → G ⊢ ⋕⬊*[h, g, T, d] L2. -/4 width=3 by llsxa_inv_llsx, llsx_llsxa, llsxa_llpxs_trans/ -qed-. - -(* Advanced eliminators *****************************************************) - -lemma llsx_ind_alt: ∀h,g,G,T,d. ∀R:predicate lenv. - (∀L1. G ⊢ ⋕⬊*[h, g, T, d] L1 → - (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → R L2) → - R L1 - ) → - ∀L. G ⊢ ⋕⬊*[h, g, T, d] L → R L. -#h #g #G #T #d #R #IH #L #H @(llsxa_ind h g G T d … L) -/4 width=1 by llsxa_inv_llsx, llsx_llsxa/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llsx_csx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llsx_csx.etc deleted file mode 100644 index 9c284732c..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llsx_csx.etc +++ /dev/null @@ -1,96 +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/computation/csx_lift.ma". -include "basic_2/computation/csx_llpxs.ma". -include "basic_2/computation/llsx_ldrop.ma". -include "basic_2/computation/llsx_llpx.ma". -include "basic_2/computation/llsx_llpxs.ma". -(* -axiom cpx_llpx_trans: ∀h,g,G,L1,T1,T2. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2 → - ∀L2. ⦃G, L1⦄⊢ ➡[h, g, T2, O] L2 → - ∃∃L. ⦃G, L1⦄⊢ ➡[h, g, T1, O] L & L ⋕[T2, 0] L2. -(* -fact llsx_cpx_trans_aux: ∀h,g,G,L0,T1,T2. ⦃G, L0⦄ ⊢ T1 ➡[h, g] T2 → - ∀L1,d. G ⊢ ⋕⬊*[h, g, T1, d] L1 → d = 0 → - L0 ⋕[T1, d] L1 → ∀L2. L1 ⋕[T2, d] L2 → - G ⊢ ⋕⬊*[h, g, T2, d] L2. -#h #g #G #L0 #T1 #T2 #HT12 #L1 #d #H @(llsx_ind … H) -L1 -#L1 #_ #IHL1 #Hd #He011 #L2 #He122 @llsx_intro -#L3 #Hx223 #Hn223 destruct -lapply (lleq_cpx_conf_sn … HT12 … He011) #He021 -lapply (lleq_cpx_conf … HT12 … He011) -HT12 #HT12 -lapply (lleq_llpx_trans … He122 … Hx223) -Hx223 #Hx123 -elim (cpx_llpx_trans … HT12 … Hx123) -Hx123 #L4 #Hx114 #He423 -(* lapply (lleq_cpx_conf … Hx114 … He011) #He120 *) -@(IHL1 … Hx114) // -IHL1 -[ #HL13 @HnL2 -HnL2 -*) - -fact llsx_cpx_trans_aux: ∀h,g,G,L1,T1,d. G ⊢ ⋕⬊*[h, g, T1, d] L1 → d = 0 → - ∀T2. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2 → - ∀L2. L1 ⋕[T1, d] L2 → G ⊢ ⋕⬊*[h, g, T2, 0] L2. -#h #g #G #L1 #T1 #d #H @(llsx_ind … H) -L1 -#L1 #_ #IHL1 #Hd #T2 #HT12 #L2 #He112 @llsx_intro -#L3 #Hx223 #Hn223 destruct -lapply (lleq_cpx_conf_sn … HT12 … He112) #He122 -lapply (lleq_cpx_conf … HT12 … He112) -HT12 #HT12 -elim (cpx_llpx_trans … HT12 … Hx223) #L4 #Hx214 #He423 -@(IHL1 … L4) // -*) -axiom llsx_cpx_trans_O: ∀h,g,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 → - G ⊢ ⋕⬊*[h, g, T1, 0] L → G ⊢ ⋕⬊*[h, g, T2, 0] L. - -(* LAZY SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS *****************) - -(* Advanced properties ******************************************************) - -lemma llsx_lref_be_lpxs: ∀h,g,I,G,K1,V,i,d. d ≤ yinj i → ⦃G, K1⦄ ⊢ ⬊*[h, g] V → - ∀K2. G ⊢ ⋕⬊*[h, g, V, 0] K2 → ⦃G, K1⦄ ⊢ ➡*[h, g, V, 0] K2 → - ∀L2. ⇩[i] L2 ≡ K2.ⓑ{I}V → G ⊢ ⋕⬊*[h, g, #i, d] L2. -#h #g #I #G #K1 #V #i #d #Hdi #H @(csx_ind_alt … H) -V -#V0 #_ #IHV0 #K2 #H @(llsx_ind … H) -K2 -#K0 #HK0 #IHK0 #HK10 #L0 #HLK0 @llsx_intro -#L2 #HL02 #HnL02 elim (llpx_inv_lref_ge_sn … HL02 … HLK0) // -HL02 -#K2 #V2 #HLK2 #HK02 #HV02 elim (eq_term_dec V0 V2) -#HnV02 destruct [ -IHV0 -HV02 -HK0 | -IHK0 -HnL02 -HLK0 ] -[ /4 width=7 by llpxs_strap1, lleq_lref/ -| lapply (llpx_cpx_conf … HV02 … HK02) -HK02 #HK02 - @(IHV0 … HnV02 … HLK2) -IHV0 -HnV02 -HLK2 - /3 width=3 by llsx_cpx_trans_O, llpxs_cpx_conf_dx, llsx_llpx_trans, llpxs_cpx_trans, llpxs_strap1/ -] -qed. - -lemma llsx_lref_be: ∀h,g,I,G,K,V,i,d. d ≤ yinj i → ⦃G, K⦄ ⊢ ⬊*[h, g] V → - G ⊢ ⋕⬊*[h, g, V, 0] K → - ∀L. ⇩[i] L ≡ K.ⓑ{I}V → G ⊢ ⋕⬊*[h, g, #i, d] L. -/2 width=8 by llsx_lref_be_lpxs/ qed. - -(* Main properties **********************************************************) - -theorem csx_llsx: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ ⬊*[h, g] T → ∀d. G ⊢ ⋕⬊*[h, g, T, d] L. -#h #g #G #L #T @(fqup_wf_ind_eq … G L T) -G -L -T -#Z #Y #X #IH #G #L * * // -[ #i #HG #HL #HT #H #d destruct - elim (lt_or_ge i (|L|)) /2 width=1 by llsx_lref_free/ - elim (ylt_split i d) /2 width=1 by llsx_lref_skip/ - #Hdi #Hi elim (ldrop_O1_lt … Hi) -Hi - #I #K #V #HLK lapply (csx_inv_lref_bind … HLK … H) -H - /4 width=6 by llsx_lref_be, fqup_lref/ -| #a #I #V #T #HG #HL #HT #H #d destruct - elim (csx_fwd_bind … H) -H /3 width=1 by llsx_bind/ -| #I #V #T #HG #HL #HT #H #d destruct - elim (csx_fwd_flat … H) -H /3 width=1 by llsx_flat/ -] -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llsx_ldrop.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llsx_ldrop.etc deleted file mode 100644 index 2d16e3240..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llsx_ldrop.etc +++ /dev/null @@ -1,32 +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/substitution/lleq_ldrop.ma". -include "basic_2/computation/llsx.ma". - -(* LAZY SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS *****************) - -(* Advanced properties ******************************************************) - -lemma llsx_lref_free: ∀h,g,G,L,d,i. |L| ≤ i → G ⊢ ⋕⬊*[h, g, #i, d] L. -#h #g #G #L1 #d #i #HL1 @llsx_intro -#L2 #HL12 #H elim H -H -/4 width=8 by llpx_fwd_length, lleq_free, le_repl_sn_conf_aux/ -qed. - -lemma llsx_lref_skip: ∀h,g,G,L,d,i. yinj i < d → G ⊢ ⋕⬊*[h, g, #i, d] L. -#h #g #G #L1 #d #i #HL1 @llsx_intro -#L2 #HL12 #H elim H -H -/3 width=6 by llpx_fwd_length, lleq_skip/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llsx_llpx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llsx_llpx.etc deleted file mode 100644 index 9392afba2..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llsx_llpx.etc +++ /dev/null @@ -1,27 +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/substitution/lleq_lleq.ma". -include "basic_2/reduction/llpx_lleq.ma". -include "basic_2/computation/llsx.ma". - -(* SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS **********************) - -(* Advanced properties ******************************************************) - -lemma llsx_llpx_trans: ∀h,g,G,L1,T,d. G ⊢ ⋕⬊*[h, g, T, d] L1 → - ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2 → G ⊢ ⋕⬊*[h, g, T, d] L2. -#h #g #G #L1 #T #d #H @(llsx_ind … H) -L1 #L1 #HL1 #IHL1 #L2 #HL12 @llsx_intro -elim (lleq_dec T L1 L2 d) /4 width=4 by lleq_llpx_trans, lleq_canc_sn/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llsx_llpxs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llsx_llpxs.etc deleted file mode 100644 index af37a372f..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx/llsx_llpxs.etc +++ /dev/null @@ -1,66 +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/computation/llpxs_llpxs.ma". -include "basic_2/computation/llsx_alt.ma". - -(* SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS **********************) - -(* Advanced properties ******************************************************) - -fact llsx_bind_llpxs_aux: ∀h,g,a,I,G,L1,V,d. G ⊢ ⋕⬊*[h, g, V, d] L1 → - ∀Y,T. G ⊢ ⋕⬊*[h, g, T, ⫯d] Y → - ∀L2. Y = L2.ⓑ{I}V → ⦃G, L1⦄ ⊢ ➡*[h, g, ⓑ{a,I}V.T, d] L2 → - G ⊢ ⋕⬊*[h, g, ⓑ{a,I}V.T, d] L2. -#h #g #a #I #G #L1 #V #d #H @(llsx_ind_alt … H) -L1 -#L1 #HL1 #IHL1 #Y #T #H @(llsx_ind_alt … H) -Y -#Y #HY #IHY #L2 #H #HL12 destruct @llsx_intro_alt -#L0 #HL20 lapply (llpxs_fwd_bind_dx … HL20) -lapply (llpxs_trans … HL12 … HL20) -#HL10 #HT #H elim (nlleq_inv_bind … H) -H [ -HL1 -IHY | -HY -IHL1 ] -[ #HnV elim (lleq_dec V L1 L2 d) - [ -HL20 #HV @(IHL1 … L0) - /3 width=4 by llsx_llpxs_trans, llpxs_fwd_bind_sn, lleq_canc_sn/ (**) (* full auto too slow *) - | -HnV -HL10 - /3 width=4 by llsx_llpxs_trans, llpxs_fwd_bind_sn/ - ] -| /3 width=4 by/ -] -qed-. - -lemma llsx_bind: ∀h,g,a,I,G,L,V,d. G ⊢ ⋕⬊*[h, g, V, d] L → - ∀T. G ⊢ ⋕⬊*[h, g, T, ⫯d] L.ⓑ{I}V → - G ⊢ ⋕⬊*[h, g, ⓑ{a,I}V.T, d] L. -/2 width=3 by llsx_bind_llpxs_aux/ qed. - -lemma llsx_flat_llpxs: ∀h,g,I,G,L1,V,d. G ⊢ ⋕⬊*[h, g, V, d] L1 → - ∀L2,T. G ⊢ ⋕⬊*[h, g, T, d] L2 → ⦃G, L1⦄ ⊢ ➡*[h, g, ⓕ{I}V.T, d] L2 → - G ⊢ ⋕⬊*[h, g, ⓕ{I}V.T, d] L2. -#h #g #I #G #L1 #V #d #H @(llsx_ind_alt … H) -L1 -#L1 #HL1 #IHL1 #L2 #T #H @(llsx_ind_alt … H) -L2 -#L2 #HL2 #IHL2 #HL12 @llsx_intro_alt -#L0 #HL20 lapply (llpxs_fwd_flat_dx … HL20) -lapply (llpxs_trans … HL12 … HL20) -#HL10 #HT #H elim (nlleq_inv_flat … H) -H [ -HL1 -IHL2 | -HL2 -IHL1 ] -[ #HnV elim (lleq_dec V L1 L2 d) - [ #HV @(IHL1 … L0) /3 width=3 by llsx_llpxs_trans, llpxs_fwd_flat_sn, lleq_canc_sn/ (**) (* full auto too slow: 47s *) - | -HnV -HL10 /3 width=4 by llsx_llpxs_trans, llpxs_fwd_flat_sn/ - ] -| /3 width=1 by/ -] -qed-. - -lemma llsx_flat: ∀h,g,I,G,L,V,d. G ⊢ ⋕⬊*[h, g, V, d] L → - ∀T. G ⊢ ⋕⬊*[h, g, T, d] L → G ⊢ ⋕⬊*[h, g, ⓕ{I}V.T, d] L. -/2 width=3 by llsx_flat_llpxs/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx_sn/llpx_sn_tc.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx_sn/llpx_sn_tc.etc deleted file mode 100644 index 682b48c68..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx_sn/llpx_sn_tc.etc +++ /dev/null @@ -1,160 +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/relocation/ldrop_leq.ma". -include "basic_2/relocation/llpx_sn.ma". - -(* LAZY SN POINTWISE EXTENSION OF A CONTEXT-SENSITIVE REALTION FOR TERMS ****) - -definition TC_llpx_sn_confluent1: relation (relation3 lenv term term) ≝ λS,R. - ∀Ls,T1,T2. S Ls T1 T2 → - ∀Ld. TC … (llpx_sn R 0 T1) Ls Ld → TC … (llpx_sn R 0 T2) Ls Ld. - -lemma TC_llpx_sn_s_confluent: ∀S,R. (llpx_sn_confluent1 S R) → TC_llpx_sn_confluent1 S R. -#S #R #HSR #Ls #T1 #T2 #HT12 #Ld #H -generalize in match HT12; -HT12 -@(TC_ind_dx … Ls H) -Ls -[ /3 width=3 by inj/ -| #Ls #L #HLs #_ #IHLd #HT12 - @(TC_strap … L) /2 width=3 by/ @IHLd -IHLd - -lemma TC_llpx_sn_lref_refl: ∀R. (∀L.reflexive … (R L)) → - ∀I,L1,K1,K2,V,d,i. d ≤ yinj i → ⇩[i] L1 ≡ K1.ⓑ{I}V → - TC lenv (llpx_sn R 0 V) K1 K2 → - ∀L2. ⇩[i] L2 ≡ K2.ⓑ{I}V → TC … (llpx_sn R d (#i)) L1 L2. -#R #HR #I #L1 #K1 #K2 #V #d #i #Hdi #HLK1 #H @(TC_star_ind … K2 H) -K2 -[ /2 width=1 by llpx_sn_refl/ -| /4 width=9 by llpx_sn_refl, llpx_sn_lref, inj/ -| #K #K2 #_ #HV #IHK1 #L2 #HLK2 lapply (ldrop_fwd_length … HLK2) - #H elim (ldrop_O1_ex (K.ⓑ{I}V) i L2) [2: normalize in H ⊢ %; >(llpx_sn_fwd_length … HV) ] - /4 width=11 by llpx_sn_lref, step/ -] -qed-. - -lemma TC_llpx_sn_lref: ∀R. (∀L.reflexive … (R L)) → (llpx_sn_confluent1 R R) → - ∀I,K1,V1,V2,d,i. d ≤ yinj i → LTC … R K1 V1 V2 → - ∀K2. TC lenv (llpx_sn R 0 V1) K1 K2 → ∀L1. ⇩[i] L1 ≡ K1.ⓑ{I}V1 → - ∀L2. ⇩[i] L2 ≡ K2.ⓑ{I}V2 → TC … (llpx_sn R d (#i)) L1 L2. -#R #H1R #H2R #I #K1 #V1 #V2 #d #i #Hdi #H @(TC_star_ind_dx … V1 H) -V1 -[ /2 width=1 by llpx_sn_refl/ -| /2 width=7 by TC_llpx_sn_lref_refl/ -| #V1 #V #HV1 #_ #IHV2 #K2 #HK12 #L1 #HLK1 #L2 #HLK2 - lapply (ldrop_fwd_length … HLK1) - #H elim (ldrop_O1_ex (K1.ⓑ{I}V) i L1) [2: normalize in H ⊢ %; // ] -H - #L #_ #HLK @(TC_strap … L) - [ @(llpx_sn_lref … HLK1 … HLK) /2 width=1 by llpx_sn_refl/ - | @(IHV2 … HLK … HLK2) - -HLK1 -HLK2 -HLK -IHV2 -Hdi @(TC_llpx_sn_s_confluent R R … HK12) // - ] -] - - -lemma llpx_sn_LTC_TC_llpx_sn: ∀R. (∀L. reflexive … (R L)) → - ∀L1,L2,T,d. llpx_sn (LTC … R) d T L1 L2 → - TC … (llpx_sn R d T) L1 L2. -#R #HR #L1 #L2 #T #d #H elim H -L1 -L2 -/3 width=3 by llpx_sn_gref, llpx_sn_free, llpx_sn_skip, llpx_sn_sort, inj/ -[ #I #L1 #L2 #K1 #K2 #V1 #V2 #d #i #Hdi #HLK1 #HLK2 #_ #HV12 #IHV1 - -(* Properties on transitive_closure *****************************************) - -lemma TC_lpx_sn_pair: ∀R. (∀L. reflexive … (R L)) → - ∀I,L1,L2. TC … (lpx_sn R) L1 L2 → - ∀V1,V2. LTC … R L1 V1 V2 → - TC … (lpx_sn R) (L1. ⓑ{I} V1) (L2. ⓑ{I} V2). -#R #HR #I #L1 #L2 #HL12 #V1 #V2 #H @(TC_star_ind_dx … V1 H) -V1 // -[ /2 width=1 by TC_lpx_sn_pair_refl/ -| /4 width=3 by TC_strap, lpx_sn_pair, lpx_sn_refl/ -] -qed-. - -lemma lpx_sn_LTC_TC_lpx_sn: ∀R. (∀L. reflexive … (R L)) → - ∀L1,L2. lpx_sn (LTC … R) L1 L2 → - TC … (lpx_sn R) L1 L2. -#R #HR #L1 #L2 #H elim H -L1 -L2 -/2 width=1 by TC_lpx_sn_pair, lpx_sn_atom, inj/ -qed-. - -(* Inversion lemmas on transitive closure ***********************************) - -lemma TC_lpx_sn_inv_atom2: ∀R,L1. TC … (lpx_sn R) L1 (⋆) → L1 = ⋆. -#R #L1 #H @(TC_ind_dx … L1 H) -L1 -[ /2 width=2 by lpx_sn_inv_atom2/ -| #L1 #L #HL1 #_ #IHL2 destruct /2 width=2 by lpx_sn_inv_atom2/ -] -qed-. - -lemma TC_lpx_sn_inv_pair2: ∀R. s_rs_trans … R (lpx_sn R) → - ∀I,L1,K2,V2. TC … (lpx_sn R) L1 (K2.ⓑ{I}V2) → - ∃∃K1,V1. TC … (lpx_sn R) K1 K2 & LTC … R K1 V1 V2 & L1 = K1. ⓑ{I} V1. -#R #HR #I #L1 #K2 #V2 #H @(TC_ind_dx … L1 H) -L1 -[ #L1 #H elim (lpx_sn_inv_pair2 … H) -H /3 width=5 by inj, ex3_2_intro/ -| #L1 #L #HL1 #_ * #K #V #HK2 #HV2 #H destruct - elim (lpx_sn_inv_pair2 … HL1) -HL1 #K1 #V1 #HK1 #HV1 #H destruct - lapply (HR … HV2 … HK1) -HR -HV2 /3 width=5 by TC_strap, ex3_2_intro/ -] -qed-. - -lemma TC_lpx_sn_ind: ∀R. s_rs_trans … R (lpx_sn R) → - ∀S:relation lenv. - S (⋆) (⋆) → ( - ∀I,K1,K2,V1,V2. - TC … (lpx_sn R) K1 K2 → LTC … R K1 V1 V2 → - S K1 K2 → S (K1.ⓑ{I}V1) (K2.ⓑ{I}V2) - ) → - ∀L2,L1. TC … (lpx_sn R) L1 L2 → S L1 L2. -#R #HR #S #IH1 #IH2 #L2 elim L2 -L2 -[ #X #H >(TC_lpx_sn_inv_atom2 … H) -X // -| #L2 #I #V2 #IHL2 #X #H - elim (TC_lpx_sn_inv_pair2 … H) // -H -HR - #L1 #V1 #HL12 #HV12 #H destruct /3 width=1 by/ -] -qed-. - -lemma TC_lpx_sn_inv_atom1: ∀R,L2. TC … (lpx_sn R) (⋆) L2 → L2 = ⋆. -#R #L2 #H elim H -L2 -[ /2 width=2 by lpx_sn_inv_atom1/ -| #L #L2 #_ #HL2 #IHL1 destruct /2 width=2 by lpx_sn_inv_atom1/ -] -qed-. - -fact TC_lpx_sn_inv_pair1_aux: ∀R. s_rs_trans … R (lpx_sn R) → - ∀L1,L2. TC … (lpx_sn R) L1 L2 → - ∀I,K1,V1. L1 = K1.ⓑ{I}V1 → - ∃∃K2,V2. TC … (lpx_sn R) K1 K2 & LTC … R K1 V1 V2 & L2 = K2. ⓑ{I} V2. -#R #HR #L1 #L2 #H @(TC_lpx_sn_ind … H) // -HR -L1 -L2 -[ #J #K #W #H destruct -| #I #L1 #L2 #V1 #V2 #HL12 #HV12 #_ #J #K #W #H destruct /2 width=5 by ex3_2_intro/ -] -qed-. - -lemma TC_lpx_sn_inv_pair1: ∀R. s_rs_trans … R (lpx_sn R) → - ∀I,K1,L2,V1. TC … (lpx_sn R) (K1.ⓑ{I}V1) L2 → - ∃∃K2,V2. TC … (lpx_sn R) K1 K2 & LTC … R K1 V1 V2 & L2 = K2. ⓑ{I} V2. -/2 width=3 by TC_lpx_sn_inv_pair1_aux/ qed-. - -lemma TC_lpx_sn_inv_lpx_sn_LTC: ∀R. s_rs_trans … R (lpx_sn R) → - ∀L1,L2. TC … (lpx_sn R) L1 L2 → - lpx_sn (LTC … R) L1 L2. -/3 width=4 by TC_lpx_sn_ind, lpx_sn_pair/ qed-. - -(* Forward lemmas on transitive closure *************************************) - -lemma TC_lpx_sn_fwd_length: ∀R,L1,L2. TC … (lpx_sn R) L1 L2 → |L1| = |L2|. -#R #L1 #L2 #H elim H -L2 -[ #L2 #HL12 >(lpx_sn_fwd_length … HL12) -HL12 // -| #L #L2 #_ #HL2 #IHL1 - >IHL1 -L1 >(lpx_sn_fwd_length … HL2) -HL2 // -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx_sn/lpx_conj.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/llpx_sn/lpx_conj.etc deleted file mode 100644 index 5950f1b92..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/llpx_sn/lpx_conj.etc +++ /dev/null @@ -1,120 +0,0 @@ -include "basic_2/relocation/lleq_alt.ma". -include "basic_2/reduction/cpx_lleq.ma". -include "basic_2/reduction/lpx_lleq.ma". - -lemma not_ex_to_all_not: ∀A:Type[0]. ∀R:predicate A. - ((∃a. R a)→⊥) → (∀a. R a → ⊥). -/3 width=2 by ex_intro/ qed-. - -lemma lt_repl_sn_trans_tw: ∀L1,L2,T1,T2. ♯{L1, T1} < ♯{L2, T2} → - ∀U1. ♯{U1} = ♯{T1} → ♯{L1, U1} < ♯{L2, T2}. -normalize in ⊢ (?→?→?→?→?%%→?→?→?%%); // -qed-. - -axiom cpx_fwd_lift1: ∀h,g,G,L,U1,U2. ⦃G, L⦄ ⊢ U1 ➡[h, g] U2 → - ∀T1,d,e. ⇧[d, e] T1 ≡ U1 → ∃T2. ⇧[d, e] T2 ≡ U2. -(* -#h #g #G #L #U1 #U2 #H elim H -G -L -U1 -U2 -[ * #i #G #L #T1 #d #e #H - [ lapply (lift_inv_sort2 … H) -H #H destruct /2 width=2 by ex_intro/ - | elim (lift_inv_lref2 … H) -H * #Hid #H destruct /3 width=2 by lift_lref_ge_minus, lift_lref_lt, ex_intro/ - | lapply (lift_inv_gref2 … H) -H #H destruct /2 width=2 by ex_intro/ - ] -| #G #L #k #l #Hkl #T1 #d #e #H - lapply (lift_inv_sort2 … H) -H #H destruct /3 width=3 by ex_intro/ -| #I #G #L #K #V1 #V2 #W2 #i #HLK #HV12 #HVW2 #IHV2 #T1 #d #e #H - elim (lift_inv_lref2 … H) -H * #Hid #H destruct - [ elim (ldrop_conf_lt … HLK … HLV) -L // #L #U #HKL #HLV #HUV - elim (IHV2 … HLV … HUV) -V #U2 #HUV2 #HU2 - elim (lift_trans_le … HUV2 … HVW2) -V2 // >minus_plus plus_minus // (length_inv_zero_dx … H) -Ys /2 width=3 by ex2_intro/ -| #Id #L1d #L2d #W1d #W2d #HL12d #HW12d #HY #Hd #U2 #HU12 destruct - elim (length_inv_pos_dx … H) -H #Is #L1s #W1s #_ #H destruct - elim (is_lift_dec U1 0 1) [ -IHU1 -HW12d | -HU1 ] - [ * #T1 #HTU1 lapply (lift_fwd_tw … HTU1) #H - lapply (lleq_inv_lift_le … HU1 L1s L1d … HTU1 ?) -HU1 /2 width=1 by ldrop_drop/ - #HT1 elim (cpx_inv_lift1 … HU12 L1d … HTU1) -HU12 -HTU1 /2 width=4 by ldrop_drop/ - #T2 #HTU2 #HT12 elim (IH … HT1 … HL12d … HT12) /2 width=3 by lt_repl_sn_trans_tw/ -IH -HT1 -HT12 -H - #L2s #HL12s #HT2 @(ex2_intro … (L2s.ⓑ{Is}W1s)) - /3 width=10 by lleq_lift_le, lpx_pair, ldrop_drop/ (**) (* full auto too slow *) - | #HnU1 lapply (not_ex_to_all_not … HnU1) -HnU1 #HnU1 - elim (IHU1 … HnU1) [2,3,4: // |5,6,7,8,9,10: skip ] -HnU1 #H1 #H2 #HW1s destruct - elim (IH … HW1s … HL12d … HW12d) // #L2s #HL12s #HW2d - @(ex2_intro … (L2s.ⓑ{Id}W2d)) /3 width=3 by lleq_cpx_trans, lpx_pair/ - lapply (lleq_fwd_length … HW2d) #HL2sd -HW12d -HW1s - @lleq_intro_alt [ normalize // ] -HL2sd - #I2s #I2d #K2s #K2d #V2s #V2d #i @(nat_ind_plus … i) -i - [ #_ #_ #HLK2s #HLK2d -IH -IHU1 -HU12 -HL12s -HL12d - lapply (ldrop_inv_O2 … HLK2s) -HLK2s #H destruct - lapply (ldrop_inv_O2 … HLK2d) -HLK2d #H destruct /2 width=1 by and3_intro/ - | #i #_ #_ #HnU2 #HLK2s #HLK2d - lapply (cpx_fwd_nlift2 … HU12 … HnU2) -HU12 -HnU2 #HnU1 - lapply (ldrop_inv_drop1 … HLK2s) -HLK2s #HLK2s - lapply (ldrop_inv_drop1 … HLK2d) -HLK2d #HLK2d - elim (lpx_ldrop_trans_O1 … HL12s … HLK2s) -L2s #Y #HLK1s #H - elim (lpx_inv_pair2 … H) -H #K1s #V1s #HK12s #HV12s #H destruct - elim (lpx_ldrop_trans_O1 … HL12d … HLK2d) -L2d #Y #HLK1d #H - elim (lpx_inv_pair2 … H) -H #K1d #V1d #HK12d #HV12d #H destruct - elim (IHU1 … HnU1) [2,3,4: /2 width=2 by ldrop_drop/ | 5,6,7,8,9,10: skip ] -IHU1 -HnU1 -HLK1d - #H1 #H2 #HV1d destruct - lapply (ldrop_fwd_rfw … HLK1s) -HLK1s #H - elim (IH … HV1d … HK12d … HV12d) // -IH -HV1d -HK12d -HV12d - [ #Y #H1Y #H2Y - - - diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpc.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpc.etc deleted file mode 100644 index b80b290b6..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpc.etc +++ /dev/null @@ -1,41 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( ⦃ term 46 L1 ⦄ ⬌ ⬌ break ⦃ term 46 L2 ⦄ )" - non associative with precedence 45 - for @{ 'FocalizedPConvAlt $L1 $L2 }. - -include "basic_2/reducibility/lfpr.ma". - -(* FOCALIZED PARALLEL CONVERSION ON LOCAL ENVIRONMENTS **********************) - -definition lfpc: relation lenv ≝ - λL1,L2. ⦃L1⦄ ➡ ⦃L2⦄ ∨ ⦃L2⦄ ➡ ⦃L1⦄. - -interpretation - "focalized parallel conversion (local environment)" - 'FocalizedPConv L1 L2 = (lfpc L1 L2). - -(* Basic properties *********************************************************) - -lemma lfpc_refl: ∀L. ⦃L⦄ ⬌ ⦃L⦄. -/2 width=1/ qed. - -lemma lfpc_sym: ∀L1,L2. ⦃L1⦄ ⬌ ⦃L2⦄ → ⦃L2⦄ ⬌ ⦃L1⦄. -#L1 #L2 * /2 width=1/ -qed. - -lemma lfpc_lfpr: ∀L1,L2. ⦃L1⦄ ⬌ ⦃L2⦄ → ∃∃L. ⦃L1⦄ ➡ ⦃L⦄ & ⦃L2⦄ ➡ ⦃L⦄. -#L1 #L2 * /2 width=3/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpc_lfpc.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpc_lfpc.etc deleted file mode 100644 index 69e444adb..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpc_lfpc.etc +++ /dev/null @@ -1,23 +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/conversion/lfpc.ma". - -(* FOCALIZED PARALLEL CONVERSION ON LOCAL ENVIRONMENTS **********************) - -(* Main properties **********************************************************) - -theorem lfpc_conf: ∀L0,L1,L2. ⦃L0⦄ ⬌ ⦃L1⦄ → ⦃L0⦄ ⬌ ⦃L2⦄ → - ∃∃L. ⦃L1⦄ ⬌ ⦃L⦄ & ⦃L2⦄ ⬌ ⦃L⦄. -/3 width=3/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpcs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpcs.etc deleted file mode 100644 index 3674637dd..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpcs.etc +++ /dev/null @@ -1,76 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( ⦃ term 46 L1 ⦄ ⬌ ⬌ * break ⦃ term 46 L2 ⦄ )" - non associative with precedence 45 - for @{ 'FocalizedPConvStarAlt $L1 $L2 }. - -include "basic_2/conversion/lfpc.ma". - -(* FOCALIZED PARALLEL EQUIVALENCE ON LOCAL ENVIRONMENTS *********************) - -definition lfpcs: relation lenv ≝ TC … lfpc. - -interpretation "focalized parallel equivalence (local environment)" - 'FocalizedPConvStar L1 L2 = (lfpcs L1 L2). - -(* Basic eliminators ********************************************************) - -lemma lfpcs_ind: ∀L1. ∀R:predicate lenv. R L1 → - (∀L,L2. ⦃L1⦄ ⬌* ⦃L⦄ → ⦃L⦄ ⬌ ⦃L2⦄ → R L → R L2) → - ∀L2. ⦃L1⦄ ⬌* ⦃L2⦄ → R L2. -#L1 #R #HL1 #IHL1 #L2 #HL12 @(TC_star_ind … HL1 IHL1 … HL12) // -qed-. - -lemma lfpcs_ind_dx: ∀L2. ∀R:predicate lenv. R L2 → - (∀L1,L. ⦃L1⦄ ⬌ ⦃L⦄ → ⦃L⦄ ⬌* ⦃L2⦄ → R L → R L1) → - ∀L1. ⦃L1⦄ ⬌* ⦃L2⦄ → R L1. -#L2 #R #HL2 #IHL2 #L1 #HL12 -@(TC_star_ind_dx … HL2 IHL2 … HL12) // -qed-. - -(* Basic properties *********************************************************) - -lemma lfpcs_refl: reflexive … lfpcs. -/2 width=1/ qed. - -lemma lfpcs_sym: symmetric … lfpcs. -/3 width=1/ qed. - -lemma lfpc_lfpcs: ∀L1,L2. ⦃L1⦄ ⬌ ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -/2 width=1/ qed. - -lemma lfpcs_strap1: ∀L1,L,L2. ⦃L1⦄ ⬌* ⦃L⦄ → ⦃L⦄ ⬌ ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -/2 width=3/ qed. - -lemma lfpcs_strap2: ∀L1,L,L2. ⦃L1⦄ ⬌ ⦃L⦄ → ⦃L⦄ ⬌* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -/2 width=3/ qed. - -lemma lfpcs_lfpr_dx: ∀L1,L2. ⦃L1⦄ ➡ ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -/3 width=1/ qed. - -lemma lfpcs_lfpr_sn: ∀L1,L2. ⦃L2⦄ ➡ ⦃L1⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -/3 width=1/ qed. - -lemma lfpcs_lfpr_strap1: ∀L1,L. ⦃L1⦄ ⬌* ⦃L⦄ → ∀L2. ⦃L⦄ ➡ ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -/3 width=3/ qed. - -lemma lfpcs_lfpr_strap2: ∀L1,L. ⦃L1⦄ ➡ ⦃L⦄ → ∀L2. ⦃L⦄ ⬌* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -/3 width=3/ qed. - -lemma lfpcs_lfpr_div: ∀L1,L. ⦃L1⦄ ⬌* ⦃L⦄ → ∀L2. ⦃L2⦄ ➡ ⦃L⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -/3 width=3/ qed. - -lemma lfpcs_lfpr_conf: ∀L1,L. ⦃L⦄ ➡ ⦃L1⦄ → ∀L2. ⦃L⦄ ⬌* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -/3 width=3/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpcs_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpcs_aaa.etc deleted file mode 100644 index b7cea0b7a..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpcs_aaa.etc +++ /dev/null @@ -1,30 +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/computation/lfprs_aaa.ma". -include "basic_2/equivalence/lfpcs_lfpcs.ma". - -(* FOCALIZED PARALLEL EQUIVALENCE ON LOCAL ENVIRONMENTS *********************) - -(* Main properties about atomic arity assignment on terms *******************) - -theorem aaa_lfpcs_mono: ∀L1,L2. ⦃L1⦄ ⬌* ⦃L2⦄ → - ∀T,A1. L1 ⊢ T ⁝ A1 → ∀A2. L2 ⊢ T ⁝ A2 → - A1 = A2. -#L1 #L2 #HL12 #T #A1 #HT1 #A2 #HT2 -elim (lfpcs_inv_lfprs … HL12) -HL12 #L #HL1 #HL2 -lapply (aaa_lfprs_conf … HT1 … HL1) -L1 #HT1 -lapply (aaa_lfprs_conf … HT2 … HL2) -L2 #HT2 -lapply (aaa_mono … HT1 … HT2) -L -T // -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpcs_fpcs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpcs_fpcs.etc deleted file mode 100644 index 8f3688890..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpcs_fpcs.etc +++ /dev/null @@ -1,52 +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/computation/fprs_cprs.ma". -include "basic_2/computation/lfprs_fprs.ma". -include "basic_2/equivalence/fpcs_fpcs.ma". -include "basic_2/equivalence/lfpcs_lfpcs.ma". - -(* FOCALIZED PARALLEL EQUIVALENCE ON LOCAL ENVIRONMENTS *********************) - -(* Inversion lemmas on context-free parallel equivalence for closures *******) - -lemma lfpcs_inv_fpcs: ∀L1,L2. ⦃L1⦄ ⬌* ⦃L2⦄ → ∀T. ⦃L1, T⦄ ⬌* ⦃L2, T⦄. -#L1 #L2 #HL12 #T -elim (lfpcs_inv_lfprs … HL12) -HL12 #L #HL1 #HL2 -lapply (lfprs_inv_fprs … HL1 T) -HL1 -lapply (lfprs_inv_fprs … HL2 T) -HL2 /2 width=4/ -qed-. - -(* Properties on context-free parallel equivalence for closures *************) - -lemma fpcs_lfpcs: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -#L1 #L2 #T1 #T2 #HT12 -elim (fpcs_inv_fprs … HT12) -HT12 /3 width=5 by fprs_lfprs, lfprs_div/ (**) (* auto too slow without trace *) -qed. - -lemma fpcs_lift: ∀K1,K2,T1,T2. ⦃K1, T1⦄ ⬌* ⦃K2, T2⦄ → - ∀L1,L2. ⦃L1⦄ ⬌* ⦃L2⦄ → - ∀d,e. ⇩[d, e] L1 ≡ K1 → ⇩[d, e] L2 ≡ K2 → - ∀U1,U2. ⇧[d, e] T1 ≡ U1 → ⇧[d, e] T2 ≡ U2 → - ⦃L1, U1⦄ ⬌* ⦃L2, U2⦄. -#K1 #K2 #T1 #T2 #HT12 #L1 #L2 #HL12 #d #e #HLK1 #HLK2 #U1 #U2 #HTU1 #HTU2 -elim (fpcs_inv_fprs … HT12) -HT12 #K #T #HT1 #HT2 -elim (lift_total T d e) #U #HTU -elim (fprs_lift … HT1 … HLK1 … HTU1 HTU) -K1 -T1 #K1 #HU1 #_ -elim (fprs_lift … HT2 … HLK2 … HTU2 HTU) -K2 -T2 -T #K2 #HU2 #_ -K -d -e -lapply (lfpcs_lfprs_conf K1 … HL12) -HL12 /2 width=3/ #H -lapply (lfpcs_lfprs_strap1 … H K2 ?) -H /2 width=3/ #HK12 -lapply (lfpcs_inv_fpcs … HK12 U) -HK12 #HU -/3 width=4 by fpcs_fprs_strap2, fpcs_fprs_div/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpcs_lfpcs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpcs_lfpcs.etc deleted file mode 100644 index 1e9521736..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpcs_lfpcs.etc +++ /dev/null @@ -1,50 +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/computation/lfprs_lfprs.ma". -include "basic_2/conversion/lfpc_lfpc.ma". -include "basic_2/equivalence/lfpcs_lfprs.ma". - -(* FOCALIZED PARALLEL EQUIVALENCE ON LOCAL ENVIRONMENTS *********************) - -(* Advanced inversion lemmas ************************************************) - -lemma lfpcs_inv_lfprs: ∀L1,L2. ⦃L1⦄ ⬌* ⦃L2⦄ → - ∃∃L. ⦃L1⦄ ➡* ⦃L⦄ & ⦃L2⦄ ➡* ⦃L⦄. -#L1 #L2 #H @(lfpcs_ind … H) -L2 -[ /3 width=3/ -| #L #L2 #_ #HL2 * #L0 #HL10 elim HL2 -HL2 #HL2 #HL0 - [ elim (lfprs_strip … HL0 … HL2) -L #L #HL0 #HL2 - lapply (lfprs_strap1 … HL10 … HL0) -L0 /2 width=3/ - | lapply (lfprs_strap2 … HL2 … HL0) -L /2 width=3/ - ] -] -qed-. - -(* Advanced properties ******************************************************) - -lemma lfpcs_strip: ∀L,L1. ⦃L⦄ ⬌* ⦃L1⦄ → ∀L2. ⦃L⦄ ⬌ ⦃L2⦄ → - ∃∃L0. ⦃L1⦄ ⬌ ⦃L0⦄ & ⦃L2⦄ ⬌* ⦃L0⦄. -/3 width=3/ qed. - -(* Main properties **********************************************************) - -theorem lfpcs_trans: ∀L1,L. ⦃L1⦄ ⬌* ⦃L⦄ → ∀L2. ⦃L⦄ ⬌* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -/2 width=3/ qed. - -theorem lfpcs_canc_sn: ∀L,L1,L2. ⦃L⦄ ⬌* ⦃L1⦄ → ⦃L⦄ ⬌* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -/3 width=3 by lfpcs_trans, lfpcs_sym/ qed. - -theorem lfpcs_canc_dx: ∀L,L1,L2. ⦃L1⦄ ⬌* ⦃L⦄ → ⦃L2⦄ ⬌* ⦃L⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -/3 width=3 by lfpcs_trans, lfpcs_sym/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpcs_lfprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpcs_lfprs.etc deleted file mode 100644 index baf2caf27..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lpc/lfpcs_lfprs.etc +++ /dev/null @@ -1,48 +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/computation/lfprs.ma". -include "basic_2/equivalence/lfpcs.ma". - -(* FOCALIZED PARALLEL EQUIVALENCE ON LOCAL ENVIRONMENTS *********************) - -(* Properties on focalized computation for local environments ***************) - -lemma lfpcs_lfprs_dx: ∀L1,L2. ⦃L1⦄ ➡* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -#L1 #L2 #H @(lfprs_ind … H) -L2 /width=1/ /3 width=3/ -qed. - -lemma lfpcs_lfprs_sn: ∀L1,L2. ⦃L2⦄ ➡* ⦃L1⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -#L1 #L2 #H @(lfprs_ind_dx … H) -L2 /width=1/ /3 width=3/ -qed. - -lemma lfpcs_lfprs_strap1: ∀L1,L. ⦃L1⦄ ⬌* ⦃L⦄ → ∀L2. ⦃L⦄ ➡* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -#L1 #L #HL1 #L2 #H @(lfprs_ind … H) -L2 /width=1/ /2 width=3/ -qed. - -lemma lfpcs_lfprs_strap2: ∀L1,L. ⦃L1⦄ ➡* ⦃L⦄ → ∀L2. ⦃L⦄ ⬌* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -#L1 #L #H #L2 #HL2 @(lfprs_ind_dx … H) -L1 /width=1/ /2 width=3/ -qed. - -lemma lfpcs_lfprs_div: ∀L1,L. ⦃L1⦄ ⬌* ⦃L⦄ → ∀L2. ⦃L2⦄ ➡* ⦃L⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -#L1 #L #HL1 #L2 #H @(lfprs_ind_dx … H) -L2 /width=1/ /2 width=3/ -qed. - -lemma lfpcs_lfprs_conf: ∀L1,L. ⦃L⦄ ➡* ⦃L1⦄ → ∀L2. ⦃L⦄ ⬌* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -#L1 #L #H #L2 #HL2 @(lfprs_ind … H) -L1 /width=1/ /2 width=3/ -qed. - -lemma lfprs_div: ∀L1,L. ⦃L1⦄ ➡* ⦃L⦄ → ∀L2. ⦃L2⦄ ➡* ⦃L⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. -#L1 #L #HL1 #L2 #H @(lfprs_ind_dx … H) -L2 /2 width=1/ /2 width=3/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/cpr_llpx_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/cpr_llpx_sn.etc deleted file mode 100644 index 4db858798..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/cpr_llpx_sn.etc +++ /dev/null @@ -1,49 +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/substitution/llpx_sn_ldrop.ma". -include "basic_2/reduction/cpr.ma". - -(* CONTEXT-SENSITIVE PARALLEL REDUCTION FOR TERMS ***************************) - -(* Properties on lazy sn pointwise extensions *******************************) - -lemma cpr_llpx_sn_conf: ∀R. (∀I,L.reflexive … (R I L)) → - (∀I.l_liftable (R I)) → - (∀I.l_deliftable_sn (R I)) → - ∀G. s_r_confluent1 … (cpr G) (llpx_sn R 0). -#R #H1R #H2R #H3R #G #Ls #T1 #T2 #H elim H -G -Ls -T1 -T2 -[ // -| #G #Ls #Ks #V1s #V2s #W2s #i #HLKs #_ #HVW2s #IHV12s #Ld #H elim (llpx_sn_inv_lref_ge_sn … H … HLKs) // -H - #Kd #V1d #HLKd #HV1s #HV1sd - lapply (ldrop_fwd_drop2 … HLKs) -HLKs #HLKs - lapply (ldrop_fwd_drop2 … HLKd) -HLKd #HLKd - @(llpx_sn_lift_le … HLKs HLKd … HVW2s) -HLKs -HLKd -HVW2s /2 width=1 by/ (**) (* full auto too slow *) -| #a #I #G #Ls #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #Ld #H elim (llpx_sn_inv_bind_O … H) -H - /4 width=5 by llpx_sn_bind_repl_SO, llpx_sn_bind/ -| #I #G #Ls #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H - /3 width=1 by llpx_sn_flat/ -| #G #Ls #V #T1 #T2 #T #_ #HT2 #IHT12 #Ld #H elim (llpx_sn_inv_bind_O … H) -H - /3 width=10 by llpx_sn_inv_lift_le, ldrop_drop/ -| #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H /2 width=1 by/ -| #a #G #Ls #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H - #HV1 #H elim (llpx_sn_inv_bind_O … H) -H - /4 width=5 by llpx_sn_bind_repl_SO, llpx_sn_flat, llpx_sn_bind/ -| #a #G #Ls #V1 #V2 #V #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV12 #IHW12 #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H - #HV1 #H elim (llpx_sn_inv_bind_O … H) -H // - #HW1 #HT1 @llpx_sn_bind_O /2 width=1 by/ @llpx_sn_flat (**) (* full auto too slow *) - [ /3 width=10 by llpx_sn_lift_le, ldrop_drop/ - | /3 width=4 by llpx_sn_bind_repl_O/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/cpx_llpx_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/cpx_llpx_sn.etc deleted file mode 100644 index 418106494..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/cpx_llpx_sn.etc +++ /dev/null @@ -1,52 +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/substitution/llpx_sn_ldrop.ma". -include "basic_2/reduction/cpx.ma". - -(* CONTEXT-SENSITIVE EXTENDED PARALLEL REDUCTION FOR TERMS ******************) - -(* Properties on lazy sn pointwise extensions *******************************) - -(* Note: lemma 1000 *) -lemma cpx_llpx_sn_conf: ∀R. (∀I,L.reflexive … (R I L)) → - (∀I.l_liftable (R I)) → - (∀I.l_deliftable_sn (R I)) → - ∀h,g,G. s_r_confluent1 … (cpx h g G) (llpx_sn R 0). -#R #H1R #H2R #H3R #h #g #G #Ls #T1 #T2 #H elim H -G -Ls -T1 -T2 -[ // -| /3 width=4 by llpx_sn_fwd_length, llpx_sn_sort/ -| #I #G #Ls #Ks #V1s #V2s #W2s #i #HLKs #_ #HVW2s #IHV12s #Ld #H elim (llpx_sn_inv_lref_ge_sn … H … HLKs) // -H - #Kd #V1d #HLKd #HV1s #HV1sd - lapply (ldrop_fwd_drop2 … HLKs) -HLKs #HLKs - lapply (ldrop_fwd_drop2 … HLKd) -HLKd #HLKd - @(llpx_sn_lift_le … HLKs HLKd … HVW2s) -HLKs -HLKd -HVW2s /2 width=1 by/ (**) (* full auto too slow *) -| #a #I #G #Ls #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #Ld #H elim (llpx_sn_inv_bind_O … H) -H - /4 width=5 by llpx_sn_bind_repl_SO, llpx_sn_bind/ -| #I #G #Ls #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H - /3 width=1 by llpx_sn_flat/ -| #G #Ls #V #T1 #T2 #T #_ #HT2 #IHT12 #Ld #H elim (llpx_sn_inv_bind_O … H) -H - /3 width=10 by llpx_sn_inv_lift_le, ldrop_drop/ -| #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H /2 width=1 by/ -| #G #Ls #V1 #V2 #T #_ #IHV12 #Ld #H elim (llpx_sn_inv_flat … H) -H /2 width=1 by/ -| #a #G #Ls #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H - #HV1 #H elim (llpx_sn_inv_bind_O … H) -H - /4 width=5 by llpx_sn_bind_repl_SO, llpx_sn_flat, llpx_sn_bind/ -| #a #G #Ls #V1 #V2 #V #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV12 #IHW12 #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H - #HV1 #H elim (llpx_sn_inv_bind_O … H) -H // - #HW1 #HT1 @llpx_sn_bind_O /2 width=1 by/ @llpx_sn_flat (**) (* full auto too slow *) - [ /3 width=10 by llpx_sn_lift_le, ldrop_drop/ - | /3 width=4 by llpx_sn_bind_repl_O/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/lleq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/lleq.etc deleted file mode 100644 index dc138a492..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/lleq.etc +++ /dev/null @@ -1,160 +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/notation/relations/lazyeq_4.ma". -include "basic_2/substitution/llpx_sn.ma". - -(* LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **********************************) - -definition ceq: relation4 bind2 lenv term term ≝ λI,L,T1,T2. T1 = T2. - -definition lleq: relation4 ynat term lenv lenv ≝ llpx_sn ceq. - -interpretation - "lazy equivalence (local environment)" - 'LazyEq T d L1 L2 = (lleq d T L1 L2). - -definition lleq_transitive: predicate (relation4 bind2 lenv term term) ≝ - λR. ∀I,L2,T1,T2. R I L2 T1 T2 → ∀L1. L1 ≡[T1, 0] L2 → R I L1 T1 T2. - -(* Basic inversion lemmas ***************************************************) - -lemma lleq_ind: ∀R:relation4 ynat term lenv lenv. ( - ∀L1,L2,d,k. |L1| = |L2| → R d (⋆k) L1 L2 - ) → ( - ∀L1,L2,d,i. |L1| = |L2| → yinj i < d → R d (#i) L1 L2 - ) → ( - ∀I,L1,L2,K1,K2,V,d,i. d ≤ yinj i → - ⇩[i] L1 ≡ K1.ⓑ{I}V → ⇩[i] L2 ≡ K2.ⓑ{I}V → - K1 ≡[V, yinj O] K2 → R (yinj O) V K1 K2 → R d (#i) L1 L2 - ) → ( - ∀L1,L2,d,i. |L1| = |L2| → |L1| ≤ i → |L2| ≤ i → R d (#i) L1 L2 - ) → ( - ∀L1,L2,d,p. |L1| = |L2| → R d (§p) L1 L2 - ) → ( - ∀a,I,L1,L2,V,T,d. - L1 ≡[V, d]L2 → L1.ⓑ{I}V ≡[T, ⫯d] L2.ⓑ{I}V → - R d V L1 L2 → R (⫯d) T (L1.ⓑ{I}V) (L2.ⓑ{I}V) → R d (ⓑ{a,I}V.T) L1 L2 - ) → ( - ∀I,L1,L2,V,T,d. - L1 ≡[V, d]L2 → L1 ≡[T, d] L2 → - R d V L1 L2 → R d T L1 L2 → R d (ⓕ{I}V.T) L1 L2 - ) → - ∀d,T,L1,L2. L1 ≡[T, d] L2 → R d T L1 L2. -#R #H1 #H2 #H3 #H4 #H5 #H6 #H7 #d #T #L1 #L2 #H elim H -L1 -L2 -T -d /2 width=8 by/ -qed-. - -lemma lleq_inv_bind: ∀a,I,L1,L2,V,T,d. L1 ≡[ⓑ{a,I}V.T, d] L2 → - L1 ≡[V, d] L2 ∧ L1.ⓑ{I}V ≡[T, ⫯d] L2.ⓑ{I}V. -/2 width=2 by llpx_sn_inv_bind/ qed-. - -lemma lleq_inv_flat: ∀I,L1,L2,V,T,d. L1 ≡[ⓕ{I}V.T, d] L2 → - L1 ≡[V, d] L2 ∧ L1 ≡[T, d] L2. -/2 width=2 by llpx_sn_inv_flat/ qed-. - -(* Basic forward lemmas *****************************************************) - -lemma lleq_fwd_length: ∀L1,L2,T,d. L1 ≡[T, d] L2 → |L1| = |L2|. -/2 width=4 by llpx_sn_fwd_length/ qed-. - -lemma lleq_fwd_lref: ∀L1,L2,d,i. L1 ≡[#i, d] L2 → - ∨∨ |L1| ≤ i ∧ |L2| ≤ i - | yinj i < d - | ∃∃I,K1,K2,V. ⇩[i] L1 ≡ K1.ⓑ{I}V & - ⇩[i] L2 ≡ K2.ⓑ{I}V & - K1 ≡[V, yinj 0] K2 & d ≤ yinj i. -#L1 #L2 #d #i #H elim (llpx_sn_fwd_lref … H) /2 width=1/ -* /3 width=7 by or3_intro2, ex4_4_intro/ -qed-. - -lemma lleq_fwd_ldrop_sn: ∀L1,L2,T,d. L1 ≡[d, T] L2 → ∀K1,i. ⇩[i] L1 ≡ K1 → - ∃K2. ⇩[i] L2 ≡ K2. -/2 width=7 by llpx_sn_fwd_ldrop_sn/ qed-. - -lemma lleq_fwd_ldrop_dx: ∀L1,L2,T,d. L1 ≡[d, T] L2 → ∀K2,i. ⇩[i] L2 ≡ K2 → - ∃K1. ⇩[i] L1 ≡ K1. -/2 width=7 by llpx_sn_fwd_ldrop_dx/ qed-. - -lemma lleq_fwd_bind_sn: ∀a,I,L1,L2,V,T,d. - L1 ≡[ⓑ{a,I}V.T, d] L2 → L1 ≡[V, d] L2. -/2 width=4 by llpx_sn_fwd_bind_sn/ qed-. - -lemma lleq_fwd_bind_dx: ∀a,I,L1,L2,V,T,d. - L1 ≡[ⓑ{a,I}V.T, d] L2 → L1.ⓑ{I}V ≡[T, ⫯d] L2.ⓑ{I}V. -/2 width=2 by llpx_sn_fwd_bind_dx/ qed-. - -lemma lleq_fwd_flat_sn: ∀I,L1,L2,V,T,d. - L1 ≡[ⓕ{I}V.T, d] L2 → L1 ≡[V, d] L2. -/2 width=3 by llpx_sn_fwd_flat_sn/ qed-. - -lemma lleq_fwd_flat_dx: ∀I,L1,L2,V,T,d. - L1 ≡[ⓕ{I}V.T, d] L2 → L1 ≡[T, d] L2. -/2 width=3 by llpx_sn_fwd_flat_dx/ qed-. - -(* Basic properties *********************************************************) - -lemma lleq_sort: ∀L1,L2,d,k. |L1| = |L2| → L1 ≡[⋆k, d] L2. -/2 width=1 by llpx_sn_sort/ qed. - -lemma lleq_skip: ∀L1,L2,d,i. yinj i < d → |L1| = |L2| → L1 ≡[#i, d] L2. -/2 width=1 by llpx_sn_skip/ qed. - -lemma lleq_lref: ∀I,L1,L2,K1,K2,V,d,i. d ≤ yinj i → - ⇩[i] L1 ≡ K1.ⓑ{I}V → ⇩[i] L2 ≡ K2.ⓑ{I}V → - K1 ≡[V, 0] K2 → L1 ≡[#i, d] L2. -/2 width=9 by llpx_sn_lref/ qed. - -lemma lleq_free: ∀L1,L2,d,i. |L1| ≤ i → |L2| ≤ i → |L1| = |L2| → L1 ≡[#i, d] L2. -/2 width=1 by llpx_sn_free/ qed. - -lemma lleq_gref: ∀L1,L2,d,p. |L1| = |L2| → L1 ≡[§p, d] L2. -/2 width=1 by llpx_sn_gref/ qed. - -lemma lleq_bind: ∀a,I,L1,L2,V,T,d. - L1 ≡[V, d] L2 → L1.ⓑ{I}V ≡[T, ⫯d] L2.ⓑ{I}V → - L1 ≡[ⓑ{a,I}V.T, d] L2. -/2 width=1 by llpx_sn_bind/ qed. - -lemma lleq_flat: ∀I,L1,L2,V,T,d. - L1 ≡[V, d] L2 → L1 ≡[T, d] L2 → L1 ≡[ⓕ{I}V.T, d] L2. -/2 width=1 by llpx_sn_flat/ qed. - -lemma lleq_refl: ∀d,T. reflexive … (lleq d T). -/2 width=1 by llpx_sn_refl/ qed. - -lemma lleq_Y: ∀L1,L2,T. |L1| = |L2| → L1 ≡[T, ∞] L2. -/2 width=1 by llpx_sn_Y/ qed. - -lemma lleq_sym: ∀d,T. symmetric … (lleq d T). -#d #T #L1 #L2 #H @(lleq_ind … H) -d -T -L1 -L2 -/2 width=7 by lleq_sort, lleq_skip, lleq_lref, lleq_free, lleq_gref, lleq_bind, lleq_flat/ -qed-. - -lemma lleq_ge_up: ∀L1,L2,U,dt. L1 ≡[U, dt] L2 → - ∀T,d,e. ⇧[d, e] T ≡ U → - dt ≤ d + e → L1 ≡[U, d] L2. -/2 width=6 by llpx_sn_ge_up/ qed-. - -lemma lleq_ge: ∀L1,L2,T,d1. L1 ≡[T, d1] L2 → ∀d2. d1 ≤ d2 → L1 ≡[T, d2] L2. -/2 width=3 by llpx_sn_ge/ qed-. - -lemma lleq_bind_O: ∀a,I,L1,L2,V,T. L1 ≡[V, 0] L2 → L1.ⓑ{I}V ≡[T, 0] L2.ⓑ{I}V → - L1 ≡[ⓑ{a,I}V.T, 0] L2. -/2 width=1 by llpx_sn_bind_O/ qed-. - -(* Advancded properties on lazy pointwise exyensions ************************) - -lemma llpx_sn_lrefl: ∀R. (∀I,L. reflexive … (R I L)) → - ∀L1,L2,T,d. L1 ≡[T, d] L2 → llpx_sn R d T L1 L2. -/2 width=3 by llpx_sn_co/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/llpx_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/llpx_sn.etc deleted file mode 100644 index 918b42605..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/llpx_sn.etc +++ /dev/null @@ -1,209 +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 "ground_2/ynat/ynat_plus.ma". -include "basic_2/relocation/ldrop.ma". - -(* LAZY SN POINTWISE EXTENSION OF A CONTEXT-SENSITIVE REALTION FOR TERMS ****) - -inductive llpx_sn (R:relation4 bind2 lenv term term): relation4 ynat term lenv lenv ≝ -| llpx_sn_sort: ∀L1,L2,d,k. |L1| = |L2| → llpx_sn R d (⋆k) L1 L2 -| llpx_sn_skip: ∀L1,L2,d,i. |L1| = |L2| → yinj i < d → llpx_sn R d (#i) L1 L2 -| llpx_sn_lref: ∀I,L1,L2,K1,K2,V1,V2,d,i. d ≤ yinj i → - ⇩[i] L1 ≡ K1.ⓑ{I}V1 → ⇩[i] L2 ≡ K2.ⓑ{I}V2 → - llpx_sn R (yinj 0) V1 K1 K2 → R I K1 V1 V2 → llpx_sn R d (#i) L1 L2 -| llpx_sn_free: ∀L1,L2,d,i. |L1| ≤ i → |L2| ≤ i → |L1| = |L2| → llpx_sn R d (#i) L1 L2 -| llpx_sn_gref: ∀L1,L2,d,p. |L1| = |L2| → llpx_sn R d (§p) L1 L2 -| llpx_sn_bind: ∀a,I,L1,L2,V,T,d. - llpx_sn R d V L1 L2 → llpx_sn R (⫯d) T (L1.ⓑ{I}V) (L2.ⓑ{I}V) → - llpx_sn R d (ⓑ{a,I}V.T) L1 L2 -| llpx_sn_flat: ∀I,L1,L2,V,T,d. - llpx_sn R d V L1 L2 → llpx_sn R d T L1 L2 → llpx_sn R d (ⓕ{I}V.T) L1 L2 -. - -(* Basic inversion lemmas ***************************************************) - -fact llpx_sn_inv_bind_aux: ∀R,L1,L2,X,d. llpx_sn R d X L1 L2 → - ∀a,I,V,T. X = ⓑ{a,I}V.T → - llpx_sn R d V L1 L2 ∧ llpx_sn R (⫯d) T (L1.ⓑ{I}V) (L2.ⓑ{I}V). -#R #L1 #L2 #X #d * -L1 -L2 -X -d -[ #L1 #L2 #d #k #_ #b #J #W #U #H destruct -| #L1 #L2 #d #i #_ #_ #b #J #W #U #H destruct -| #I #L1 #L2 #K1 #K2 #V1 #V2 #d #i #_ #_ #_ #_ #_ #b #J #W #U #H destruct -| #L1 #L2 #d #i #_ #_ #_ #b #J #W #U #H destruct -| #L1 #L2 #d #p #_ #b #J #W #U #H destruct -| #a #I #L1 #L2 #V #T #d #HV #HT #b #J #W #U #H destruct /2 width=1 by conj/ -| #I #L1 #L2 #V #T #d #_ #_ #b #J #W #U #H destruct -] -qed-. - -lemma llpx_sn_inv_bind: ∀R,a,I,L1,L2,V,T,d. llpx_sn R d (ⓑ{a,I}V.T) L1 L2 → - llpx_sn R d V L1 L2 ∧ llpx_sn R (⫯d) T (L1.ⓑ{I}V) (L2.ⓑ{I}V). -/2 width=4 by llpx_sn_inv_bind_aux/ qed-. - -fact llpx_sn_inv_flat_aux: ∀R,L1,L2,X,d. llpx_sn R d X L1 L2 → - ∀I,V,T. X = ⓕ{I}V.T → - llpx_sn R d V L1 L2 ∧ llpx_sn R d T L1 L2. -#R #L1 #L2 #X #d * -L1 -L2 -X -d -[ #L1 #L2 #d #k #_ #J #W #U #H destruct -| #L1 #L2 #d #i #_ #_ #J #W #U #H destruct -| #I #L1 #L2 #K1 #K2 #V1 #V2 #d #i #_ #_ #_ #_ #_ #J #W #U #H destruct -| #L1 #L2 #d #i #_ #_ #_ #J #W #U #H destruct -| #L1 #L2 #d #p #_ #J #W #U #H destruct -| #a #I #L1 #L2 #V #T #d #_ #_ #J #W #U #H destruct -| #I #L1 #L2 #V #T #d #HV #HT #J #W #U #H destruct /2 width=1 by conj/ -] -qed-. - -lemma llpx_sn_inv_flat: ∀R,I,L1,L2,V,T,d. llpx_sn R d (ⓕ{I}V.T) L1 L2 → - llpx_sn R d V L1 L2 ∧ llpx_sn R d T L1 L2. -/2 width=4 by llpx_sn_inv_flat_aux/ qed-. - -(* Basic forward lemmas *****************************************************) - -lemma llpx_sn_fwd_length: ∀R,L1,L2,T,d. llpx_sn R d T L1 L2 → |L1| = |L2|. -#R #L1 #L2 #T #d #H elim H -L1 -L2 -T -d // -#I #L1 #L2 #K1 #K2 #V1 #V2 #d #i #_ #HLK1 #HLK2 #_ #_ #HK12 -lapply (ldrop_fwd_length … HLK1) -HLK1 -lapply (ldrop_fwd_length … HLK2) -HLK2 -normalize // -qed-. - -lemma llpx_sn_fwd_ldrop_sn: ∀R,L1,L2,T,d. llpx_sn R d T L1 L2 → - ∀K1,i. ⇩[i] L1 ≡ K1 → ∃K2. ⇩[i] L2 ≡ K2. -#R #L1 #L2 #T #d #H #K1 #i #HLK1 lapply (llpx_sn_fwd_length … H) -H -#HL12 lapply (ldrop_fwd_length_le2 … HLK1) -HLK1 /2 width=1 by ldrop_O1_le/ -qed-. - -lemma llpx_sn_fwd_ldrop_dx: ∀R,L1,L2,T,d. llpx_sn R d T L1 L2 → - ∀K2,i. ⇩[i] L2 ≡ K2 → ∃K1. ⇩[i] L1 ≡ K1. -#R #L1 #L2 #T #d #H #K2 #i #HLK2 lapply (llpx_sn_fwd_length … H) -H -#HL12 lapply (ldrop_fwd_length_le2 … HLK2) -HLK2 /2 width=1 by ldrop_O1_le/ -qed-. - -fact llpx_sn_fwd_lref_aux: ∀R,L1,L2,X,d. llpx_sn R d X L1 L2 → ∀i. X = #i → - ∨∨ |L1| ≤ i ∧ |L2| ≤ i - | yinj i < d - | ∃∃I,K1,K2,V1,V2. ⇩[i] L1 ≡ K1.ⓑ{I}V1 & - ⇩[i] L2 ≡ K2.ⓑ{I}V2 & - llpx_sn R (yinj 0) V1 K1 K2 & - R I K1 V1 V2 & d ≤ yinj i. -#R #L1 #L2 #X #d * -L1 -L2 -X -d -[ #L1 #L2 #d #k #_ #j #H destruct -| #L1 #L2 #d #i #_ #Hid #j #H destruct /2 width=1 by or3_intro1/ -| #I #L1 #L2 #K1 #K2 #V1 #V2 #d #i #Hdi #HLK1 #HLK2 #HK12 #HV12 #j #H destruct - /3 width=9 by or3_intro2, ex5_5_intro/ -| #L1 #L2 #d #i #HL1 #HL2 #_ #j #H destruct /3 width=1 by or3_intro0, conj/ -| #L1 #L2 #d #p #_ #j #H destruct -| #a #I #L1 #L2 #V #T #d #_ #_ #j #H destruct -| #I #L1 #L2 #V #T #d #_ #_ #j #H destruct -] -qed-. - -lemma llpx_sn_fwd_lref: ∀R,L1,L2,d,i. llpx_sn R d (#i) L1 L2 → - ∨∨ |L1| ≤ i ∧ |L2| ≤ i - | yinj i < d - | ∃∃I,K1,K2,V1,V2. ⇩[i] L1 ≡ K1.ⓑ{I}V1 & - ⇩[i] L2 ≡ K2.ⓑ{I}V2 & - llpx_sn R (yinj 0) V1 K1 K2 & - R I K1 V1 V2 & d ≤ yinj i. -/2 width=3 by llpx_sn_fwd_lref_aux/ qed-. - -lemma llpx_sn_fwd_bind_sn: ∀R,a,I,L1,L2,V,T,d. llpx_sn R d (ⓑ{a,I}V.T) L1 L2 → - llpx_sn R d V L1 L2. -#R #a #I #L1 #L2 #V #T #d #H elim (llpx_sn_inv_bind … H) -H // -qed-. - -lemma llpx_sn_fwd_bind_dx: ∀R,a,I,L1,L2,V,T,d. llpx_sn R d (ⓑ{a,I}V.T) L1 L2 → - llpx_sn R (⫯d) T (L1.ⓑ{I}V) (L2.ⓑ{I}V). -#R #a #I #L1 #L2 #V #T #d #H elim (llpx_sn_inv_bind … H) -H // -qed-. - -lemma llpx_sn_fwd_flat_sn: ∀R,I,L1,L2,V,T,d. llpx_sn R d (ⓕ{I}V.T) L1 L2 → - llpx_sn R d V L1 L2. -#R #I #L1 #L2 #V #T #d #H elim (llpx_sn_inv_flat … H) -H // -qed-. - -lemma llpx_sn_fwd_flat_dx: ∀R,I,L1,L2,V,T,d. llpx_sn R d (ⓕ{I}V.T) L1 L2 → - llpx_sn R d T L1 L2. -#R #I #L1 #L2 #V #T #d #H elim (llpx_sn_inv_flat … H) -H // -qed-. - -lemma llpx_sn_fwd_pair_sn: ∀R,I,L1,L2,V,T,d. llpx_sn R d (②{I}V.T) L1 L2 → - llpx_sn R d V L1 L2. -#R * /2 width=4 by llpx_sn_fwd_flat_sn, llpx_sn_fwd_bind_sn/ -qed-. - -(* Basic_properties *********************************************************) - -lemma llpx_sn_refl: ∀R. (∀I,L. reflexive … (R I L)) → ∀T,L,d. llpx_sn R d T L L. -#R #HR #T #L @(f2_ind … rfw … L T) -L -T -#n #IH #L * * /3 width=1 by llpx_sn_sort, llpx_sn_gref, llpx_sn_bind, llpx_sn_flat/ -#i #Hn elim (lt_or_ge i (|L|)) /2 width=1 by llpx_sn_free/ -#HiL #d elim (ylt_split i d) /2 width=1 by llpx_sn_skip/ -elim (ldrop_O1_lt … HiL) -HiL destruct /4 width=9 by llpx_sn_lref, ldrop_fwd_rfw/ -qed-. - -lemma llpx_sn_Y: ∀R,T,L1,L2. |L1| = |L2| → llpx_sn R (∞) T L1 L2. -#R #T #L1 @(f2_ind … rfw … L1 T) -L1 -T -#n #IH #L1 * * /3 width=1 by llpx_sn_sort, llpx_sn_skip, llpx_sn_gref, llpx_sn_flat/ -#a #I #V1 #T1 #Hn #L2 #HL12 -@llpx_sn_bind /2 width=1/ (**) (* explicit constructor *) -@IH -IH // normalize /2 width=1 by eq_f2/ -qed-. - -lemma llpx_sn_ge_up: ∀R,L1,L2,U,dt. llpx_sn R dt U L1 L2 → ∀T,d,e. ⇧[d, e] T ≡ U → - dt ≤ d + e → llpx_sn R d U L1 L2. -#R #L1 #L2 #U #dt #H elim H -L1 -L2 -U -dt -[ #L1 #L2 #dt #k #HL12 #X #d #e #H #_ >(lift_inv_sort2 … H) -H /2 width=1 by llpx_sn_sort/ -| #L1 #L2 #dt #i #HL12 #Hidt #X #d #e #H #Hdtde - elim (lift_inv_lref2 … H) -H * #Hid #H destruct /3 width=1 by llpx_sn_skip, ylt_inj/ -HL12 - elim (ylt_yle_false … Hidt) -Hidt - @(yle_trans … Hdtde) /2 width=1 by yle_inj/ (**) (* full auto too slow 11s *) -| #I #L1 #L2 #K1 #K2 #W1 #W2 #dt #i #Hdti #HLK1 #HLK2 #HW1 #HW12 #_ #X #d #e #H #_ - elim (lift_inv_lref2 … H) -H * #Hid #H destruct - [ lapply (llpx_sn_fwd_length … HW1) -HW1 #HK12 - lapply (ldrop_fwd_length … HLK1) lapply (ldrop_fwd_length … HLK2) - normalize in ⊢ (%→%→?); -I -W1 -W2 -dt /3 width=1 by llpx_sn_skip, ylt_inj/ - | /4 width=9 by llpx_sn_lref, yle_inj, le_plus_b/ - ] -| /2 width=1 by llpx_sn_free/ -| #L1 #L2 #dt #p #HL12 #X #d #e #H #_ >(lift_inv_gref2 … H) -H /2 width=1 by llpx_sn_gref/ -| #a #I #L1 #L2 #W #U #dt #_ #_ #IHV #IHT #X #d #e #H #Hdtde destruct - elim (lift_inv_bind2 … H) -H #V #T #HVW >commutative_plus #HTU #H destruct - @(llpx_sn_bind) /2 width=4 by/ (**) (* full auto fails *) - @(IHT … HTU) /2 width=1 by yle_succ/ -| #I #L1 #L2 #W #U #dt #_ #_ #IHV #IHT #X #d #e #H #Hdtde destruct - elim (lift_inv_flat2 … H) -H #HVW #HTU #H destruct - /3 width=4 by llpx_sn_flat/ -] -qed-. - -(**) (* the minor premise comes first *) -lemma llpx_sn_ge: ∀R,L1,L2,T,d1,d2. d1 ≤ d2 → - llpx_sn R d1 T L1 L2 → llpx_sn R d2 T L1 L2. -#R #L1 #L2 #T #d1 #d2 * -d1 -d2 (**) (* destructed yle *) -/3 width=6 by llpx_sn_ge_up, llpx_sn_Y, llpx_sn_fwd_length, yle_inj/ -qed-. - -lemma llpx_sn_bind_O: ∀R,a,I,L1,L2,V,T. llpx_sn R 0 V L1 L2 → - llpx_sn R 0 T (L1.ⓑ{I}V) (L2.ⓑ{I}V) → - llpx_sn R 0 (ⓑ{a,I}V.T) L1 L2. -/3 width=3 by llpx_sn_ge, llpx_sn_bind/ qed-. - -lemma llpx_sn_co: ∀R1,R2. (∀I,L,T1,T2. R1 I L T1 T2 → R2 I L T1 T2) → - ∀L1,L2,T,d. llpx_sn R1 d T L1 L2 → llpx_sn R2 d T L1 L2. -#R1 #R2 #HR12 #L1 #L2 #T #d #H elim H -L1 -L2 -T -d -/3 width=9 by llpx_sn_sort, llpx_sn_skip, llpx_sn_lref, llpx_sn_free, llpx_sn_gref, llpx_sn_bind, llpx_sn_flat/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/llpx_sn_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/llpx_sn_alt.etc deleted file mode 100644 index 0916edb67..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/llpx_sn_alt.etc +++ /dev/null @@ -1,62 +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/substitution/cofrees_alt.ma". -include "basic_2/substitution/llpx_sn_alt_rec.ma". - -(* LAZY SN POINTWISE EXTENSION OF A CONTEXT-SENSITIVE REALTION FOR TERMS ****) - -(* alternative definition of llpx_sn (not recursive) *) -definition llpx_sn_alt: relation4 bind2 lenv term term → relation4 ynat term lenv lenv ≝ - λR,d,T,L1,L2. |L1| = |L2| ∧ - (∀I1,I2,K1,K2,V1,V2,i. d ≤ yinj i → (L1 ⊢ i ~ϵ 𝐅*[d]⦃T⦄ → ⊥) → - ⇩[i] L1 ≡ K1.ⓑ{I1}V1 → ⇩[i] L2 ≡ K2.ⓑ{I2}V2 → - I1 = I2 ∧ R I1 K1 V1 V2 - ). - -(* Main properties **********************************************************) - -theorem llpx_sn_llpx_sn_alt: ∀R,T,L1,L2,d. llpx_sn R d T L1 L2 → llpx_sn_alt R d T L1 L2. -#R #U #L1 @(f2_ind … rfw … L1 U) -L1 -U -#n #IHn #L1 #U #Hn #L2 #d #H elim (llpx_sn_inv_alt_r … H) -H -#HL12 #IHU @conj // -#I1 #I2 #K1 #K2 #V1 #V2 #i #Hdi #H #HLK1 #HLK2 elim (frees_inv_ge … H) -H // -[ -n #HnU elim (IHU … HnU HLK1 HLK2) -IHU -HnU -HLK1 -HLK2 /2 width=1 by conj/ -| * #J1 #K10 #W10 #j #Hdj #Hji #HLK10 #HnW10 #HnU destruct - lapply (ldrop_fwd_drop2 … HLK10) #H - lapply (ldrop_conf_ge … H … HLK1 ?) -H /2 width=1 by lt_to_le/ (minus_plus_m_m j (i+1)) in ⊢ (%→?); >commutative_plus (lift_inv_sort1 … H) -X - lapply (ldrop_fwd_length_eq2 … HLK1 HLK2 HK12) -K1 -K2 -d - /2 width=1 by llpx_sn_sort/ -| #K1 #K2 #d0 #i #HK12 #Hid0 #L1 #L2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_lref1 … H) -H - * #Hdi #H destruct - [ lapply (ldrop_fwd_length_eq2 … HLK1 HLK2 HK12) -K1 -K2 -d - /2 width=1 by llpx_sn_skip/ - | elim (ylt_yle_false … Hid0) -L1 -L2 -K1 -K2 -e -Hid0 - /3 width=3 by yle_trans, yle_inj/ - ] -| #I #K1 #K2 #K11 #K22 #V1 #V2 #d0 #i #Hid0 #HK11 #HK22 #HK12 #HV12 #IHK12 #L1 #L2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_lref1 … H) -H - * #Hdi #H destruct [ -HK12 | -IHK12 ] - [ elim (ldrop_trans_lt … HLK1 … HK11) // -K1 - elim (ldrop_trans_lt … HLK2 … HK22) // -Hdi -K2 - /3 width=18 by llpx_sn_lref/ - | lapply (ldrop_trans_ge_comm … HLK1 … HK11 ?) // -K1 - lapply (ldrop_trans_ge_comm … HLK2 … HK22 ?) // -Hdi -Hd0 -K2 - /3 width=9 by llpx_sn_lref, yle_plus_dx1_trans/ - ] -| #K1 #K2 #d0 #i #HK1 #HK2 #HK12 #L1 #L2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_lref1 … H) -H - * #Hid #H destruct - lapply (ldrop_fwd_length_eq2 … HLK1 HLK2 HK12) -HK12 - [ /3 width=7 by llpx_sn_free, ldrop_fwd_be/ - | lapply (ldrop_fwd_length … HLK1) -HLK1 #HLK1 - lapply (ldrop_fwd_length … HLK2) -HLK2 #HLK2 - @llpx_sn_free [ >HLK1 | >HLK2 ] -Hid -HLK1 -HLK2 /2 width=1 by monotonic_le_plus_r/ (**) (* explicit constructor *) - ] -| #K1 #K2 #d0 #p #HK12 #L1 #L2 #d #e #HLK1 #HLK2 #X #H #_ >(lift_inv_gref1 … H) -X - lapply (ldrop_fwd_length_eq2 … HLK1 HLK2 HK12) -K1 -K2 -d -e - /2 width=1 by llpx_sn_gref/ -| #a #I #K1 #K2 #V #T #d0 #_ #_ #IHV #IHT #L1 #L2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_bind1 … H) -H - #W #U #HVW #HTU #H destruct /4 width=6 by llpx_sn_bind, ldrop_skip, yle_succ/ -| #I #K1 #K2 #V #T #d0 #_ #_ #IHV #IHT #L1 #L2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_flat1 … H) -H - #W #U #HVW #HTU #H destruct /3 width=6 by llpx_sn_flat/ -] -qed-. - -lemma llpx_sn_lift_ge: ∀R,K1,K2,T,d0. llpx_sn R d0 T K1 K2 → - ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → - ∀U. ⇧[d, e] T ≡ U → d ≤ d0 → llpx_sn R (d0+e) U L1 L2. -#R #K1 #K2 #T #d0 #H elim H -K1 -K2 -T -d0 -[ #K1 #K2 #d0 #k #HK12 #L1 #L2 #d #e #HLK1 #HLK2 #X #H #_ >(lift_inv_sort1 … H) -X - lapply (ldrop_fwd_length_eq2 … HLK1 HLK2 HK12) -K1 -K2 -d - /2 width=1 by llpx_sn_sort/ -| #K1 #K2 #d0 #i #HK12 #Hid0 #L1 #L2 #d #e #HLK1 #HLK2 #X #H #_ elim (lift_inv_lref1 … H) -H - * #_ #H destruct - lapply (ldrop_fwd_length_eq2 … HLK1 HLK2 HK12) -K1 -K2 - [ /3 width=3 by llpx_sn_skip, ylt_plus_dx2_trans/ - | /3 width=3 by llpx_sn_skip, monotonic_ylt_plus_dx/ - ] -| #I #K1 #K2 #K11 #K22 #V1 #V2 #d0 #i #Hid0 #HK11 #HK22 #HK12 #HV12 #_ #L1 #L2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_lref1 … H) -H - * #Hid #H destruct - [ elim (ylt_yle_false … Hid0) -I -L1 -L2 -K1 -K2 -K11 -K22 -V1 -V2 -e -Hid0 - /3 width=3 by ylt_yle_trans, ylt_inj/ - | lapply (ldrop_trans_ge_comm … HLK1 … HK11 ?) // -K1 - lapply (ldrop_trans_ge_comm … HLK2 … HK22 ?) // -Hid -Hd0 -K2 - /3 width=9 by llpx_sn_lref, monotonic_yle_plus_dx/ - ] -| #K1 #K2 #d0 #i #HK1 #HK2 #HK12 #L1 #L2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_lref1 … H) -H - * #Hid #H destruct - lapply (ldrop_fwd_length_eq2 … HLK1 HLK2 HK12) -HK12 - [ /3 width=7 by llpx_sn_free, ldrop_fwd_be/ - | lapply (ldrop_fwd_length … HLK1) -HLK1 #HLK1 - lapply (ldrop_fwd_length … HLK2) -HLK2 #HLK2 - @llpx_sn_free [ >HLK1 | >HLK2 ] -Hid -HLK1 -HLK2 /2 width=1 by monotonic_le_plus_r/ (**) (* explicit constructor *) - ] -| #K1 #K2 #d0 #p #HK12 #L1 #L2 #d #e #HLK1 #HLK2 #X #H #_ >(lift_inv_gref1 … H) -X - lapply (ldrop_fwd_length_eq2 … HLK1 HLK2 HK12) -K1 -K2 -d - /2 width=1 by llpx_sn_gref/ -| #a #I #K1 #K2 #V #T #d0 #_ #_ #IHV #IHT #L1 #L2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_bind1 … H) -H - #W #U #HVW #HTU #H destruct /4 width=5 by llpx_sn_bind, ldrop_skip, yle_succ/ -| #I #K1 #K2 #V #T #d0 #_ #_ #IHV #IHT #L1 #L2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_flat1 … H) -H - #W #U #HVW #HTU #H destruct /3 width=5 by llpx_sn_flat/ -] -qed-. - -(* Inversion lemmas on relocation *******************************************) - -lemma llpx_sn_inv_lift_le: ∀R. (∀I. l_deliftable_sn (R I)) → - ∀L1,L2,U,d0. llpx_sn R d0 U L1 L2 → - ∀K1,K2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → - ∀T. ⇧[d, e] T ≡ U → d0 ≤ d → llpx_sn R d0 T K1 K2. -#R #HR #L1 #L2 #U #d0 #H elim H -L1 -L2 -U -d0 -[ #L1 #L2 #d0 #k #HL12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #_ >(lift_inv_sort2 … H) -X - lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) -L1 -L2 -d -e - /2 width=1 by llpx_sn_sort/ -| #L1 #L2 #d0 #i #HL12 #Hid0 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #_ elim (lift_inv_lref2 … H) -H - * #_ #H destruct - lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) -L1 -L2 - [ /2 width=1 by llpx_sn_skip/ - | /3 width=3 by llpx_sn_skip, yle_ylt_trans/ - ] -| #I #L1 #L2 #K11 #K22 #W1 #W2 #d0 #i #Hid0 #HLK11 #HLK22 #HK12 #HW12 #IHK12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_lref2 … H) -H - * #Hid #H destruct [ -HK12 | -IHK12 ] - [ elim (ldrop_conf_lt … HLK1 … HLK11) // -L1 #L1 #V1 #HKL1 #HKL11 #HVW1 - elim (ldrop_conf_lt … HLK2 … HLK22) // -Hid -L2 #L2 #V2 #HKL2 #HKL22 #HVW2 - elim (HR … HW12 … HKL11 … HVW1) -HR #V0 #HV0 #HV12 - lapply (lift_inj … HV0 … HVW2) -HV0 -HVW2 #H destruct - /3 width=10 by llpx_sn_lref/ - | lapply (ldrop_conf_ge … HLK1 … HLK11 ?) // -L1 - lapply (ldrop_conf_ge … HLK2 … HLK22 ?) // -L2 -Hid0 - elim (le_inv_plus_l … Hid) -Hid /4 width=9 by llpx_sn_lref, yle_trans, yle_inj/ (**) (* slow *) - ] -| #L1 #L2 #d0 #i #HL1 #HL2 #HL12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_lref2 … H) -H - * #_ #H destruct - lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) - [ lapply (ldrop_fwd_length_le4 … HLK1) -HLK1 - lapply (ldrop_fwd_length_le4 … HLK2) -HLK2 - #HKL2 #HKL1 #HK12 @llpx_sn_free // /2 width=3 by transitive_le/ (**) (* full auto too slow *) - | lapply (ldrop_fwd_length … HLK1) -HLK1 #H >H in HL1; -H - lapply (ldrop_fwd_length … HLK2) -HLK2 #H >H in HL2; -H - /3 width=1 by llpx_sn_free, le_plus_to_minus_r/ - ] -| #L1 #L2 #d0 #p #HL12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #_ >(lift_inv_gref2 … H) -X - lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) -L1 -L2 -d -e - /2 width=1 by llpx_sn_gref/ -| #a #I #L1 #L2 #W #U #d0 #_ #_ #IHW #IHU #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_bind2 … H) -H - #V #T #HVW #HTU #H destruct /4 width=6 by llpx_sn_bind, ldrop_skip, yle_succ/ -| #I #L1 #L2 #W #U #d0 #_ #_ #IHW #IHU #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_flat2 … H) -H - #V #T #HVW #HTU #H destruct /3 width=6 by llpx_sn_flat/ -] -qed-. - -lemma llpx_sn_inv_lift_be: ∀R,L1,L2,U,d0. llpx_sn R d0 U L1 L2 → - ∀K1,K2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → - ∀T. ⇧[d, e] T ≡ U → d ≤ d0 → d0 ≤ yinj d + e → llpx_sn R d T K1 K2. -#R #L1 #L2 #U #d0 #H elim H -L1 -L2 -U -d0 -[ #L1 #L2 #d0 #k #HL12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #_ #_ >(lift_inv_sort2 … H) -X - lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) -L1 -L2 -d0 -e - /2 width=1 by llpx_sn_sort/ -| #L1 #L2 #d0 #i #HL12 #Hid0 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hd0 #Hd0e elim (lift_inv_lref2 … H) -H - * #Hid #H destruct - [ lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) -L1 -L2 - -Hid0 /3 width=1 by llpx_sn_skip, ylt_inj/ - | elim (ylt_yle_false … Hid0) -L1 -L2 -Hd0 -Hid0 - /3 width=3 by yle_trans, yle_inj/ (**) (* slow *) - ] -| #I #L1 #L2 #K11 #K22 #W1 #W2 #d0 #i #Hid0 #HLK11 #HLK22 #HK12 #HW12 #_ #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hd0 #Hd0e elim (lift_inv_lref2 … H) -H - * #Hid #H destruct - [ elim (ylt_yle_false … Hid0) -I -L1 -L2 -K11 -K22 -W1 -W2 -Hd0e -Hid0 - /3 width=3 by ylt_yle_trans, ylt_inj/ - | lapply (ldrop_conf_ge … HLK1 … HLK11 ?) // -L1 - lapply (ldrop_conf_ge … HLK2 … HLK22 ?) // -L2 -Hid0 -Hd0 -Hd0e - elim (le_inv_plus_l … Hid) -Hid /3 width=9 by llpx_sn_lref, yle_inj/ - ] -| #L1 #L2 #d0 #i #HL1 #HL2 #HL12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hd0 #Hd0e elim (lift_inv_lref2 … H) -H - * #_ #H destruct - lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) - [ lapply (ldrop_fwd_length_le4 … HLK1) -HLK1 - lapply (ldrop_fwd_length_le4 … HLK2) -HLK2 - #HKL2 #HKL1 #HK12 @llpx_sn_free // /2 width=3 by transitive_le/ (**) (* full auto too slow *) - | lapply (ldrop_fwd_length … HLK1) -HLK1 #H >H in HL1; -H - lapply (ldrop_fwd_length … HLK2) -HLK2 #H >H in HL2; -H - /3 width=1 by llpx_sn_free, le_plus_to_minus_r/ - ] -| #L1 #L2 #d0 #p #HL12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #_ #_ >(lift_inv_gref2 … H) -X - lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) -L1 -L2 -d0 -e - /2 width=1 by llpx_sn_gref/ -| #a #I #L1 #L2 #W #U #d0 #_ #_ #IHW #IHU #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hd0 #Hd0e elim (lift_inv_bind2 … H) -H - >commutative_plus #V #T #HVW #HTU #H destruct - @llpx_sn_bind [ /2 width=5 by/ ] -IHW (**) (* explicit constructor *) - @(IHU … HTU) -IHU -HTU /2 width=1 by ldrop_skip, yle_succ/ -| #I #L1 #L2 #W #U #d0 #_ #_ #IHW #IHU #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hd0 #Hd0e elim (lift_inv_flat2 … H) -H - #V #T #HVW #HTU #H destruct /3 width=6 by llpx_sn_flat/ -] -qed-. - -lemma llpx_sn_inv_lift_ge: ∀R,L1,L2,U,d0. llpx_sn R d0 U L1 L2 → - ∀K1,K2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → - ∀T. ⇧[d, e] T ≡ U → yinj d + e ≤ d0 → llpx_sn R (d0-e) T K1 K2. -#R #L1 #L2 #U #d0 #H elim H -L1 -L2 -U -d0 -[ #L1 #L2 #d0 #k #HL12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #_ >(lift_inv_sort2 … H) -X - lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) -L1 -L2 -d - /2 width=1 by llpx_sn_sort/ -| #L1 #L2 #d0 #i #HL12 #Hid0 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hded0 elim (lift_inv_lref2 … H) -H - * #Hid #H destruct [ -Hid0 | -Hded0 ] - lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) -L1 -L2 - [ /4 width=3 by llpx_sn_skip, yle_plus_to_minus_inj2, ylt_yle_trans, ylt_inj/ - | elim (le_inv_plus_l … Hid) -Hid #_ - /4 width=1 by llpx_sn_skip, monotonic_ylt_minus_dx, yle_inj/ - ] -| #I #L1 #L2 #K11 #K22 #W1 #W2 #d0 #i #Hid0 #HLK11 #HLK22 #HK12 #HW12 #_ #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hded0 elim (lift_inv_lref2 … H) -H - * #Hid #H destruct - [ elim (ylt_yle_false … Hid0) -I -L1 -L2 -K11 -K22 -W1 -W2 -Hid0 - /3 width=3 by yle_fwd_plus_sn1, ylt_yle_trans, ylt_inj/ - | lapply (ldrop_conf_ge … HLK1 … HLK11 ?) // -L1 - lapply (ldrop_conf_ge … HLK2 … HLK22 ?) // -L2 -Hded0 -Hid - /3 width=9 by llpx_sn_lref, monotonic_yle_minus_dx/ - ] -| #L1 #L2 #d0 #i #HL1 #HL2 #HL12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hded0 elim (lift_inv_lref2 … H) -H - * #_ #H destruct - lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) - [ lapply (ldrop_fwd_length_le4 … HLK1) -HLK1 - lapply (ldrop_fwd_length_le4 … HLK2) -HLK2 - #HKL2 #HKL1 #HK12 @llpx_sn_free // /2 width=3 by transitive_le/ (**) (* full auto too slow *) - | lapply (ldrop_fwd_length … HLK1) -HLK1 #H >H in HL1; -H - lapply (ldrop_fwd_length … HLK2) -HLK2 #H >H in HL2; -H - /3 width=1 by llpx_sn_free, le_plus_to_minus_r/ - ] -| #L1 #L2 #d0 #p #HL12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #_ >(lift_inv_gref2 … H) -X - lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) -L1 -L2 -d - /2 width=1 by llpx_sn_gref/ -| #a #I #L1 #L2 #W #U #d0 #_ #_ #IHW #IHU #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hded0 elim (lift_inv_bind2 … H) -H - #V #T #HVW #HTU #H destruct - @llpx_sn_bind [ /2 width=5 by/ ] -IHW (**) (* explicit constructor *) - (lpx_sn_inv_atom1 … H) -H - /4 width=3 by ldrop_atom, lpx_sn_atom, ex2_intro/ -| #I #K1 #V1 #X #H elim (lpx_sn_inv_pair1 … H) -H - #L2 #V2 #HL12 #HV12 #H destruct - /3 width=5 by ldrop_pair, lpx_sn_pair, ex2_intro/ -| #I #L1 #K1 #V1 #e #_ #IHLK1 #X #H elim (lpx_sn_inv_pair1 … H) -H - #L2 #V2 #HL12 #HV12 #H destruct - elim (IHLK1 … HL12) -L1 /3 width=3 by ldrop_drop, ex2_intro/ -| #I #L1 #K1 #V1 #W1 #d #e #HLK1 #HWV1 #IHLK1 #X #H - elim (lpx_sn_inv_pair1 … H) -H #L2 #V2 #HL12 #HV12 #H destruct - elim (HR … HV12 … HLK1 … HWV1) -V1 - elim (IHLK1 … HL12) -L1 /3 width=5 by ldrop_skip, lpx_sn_pair, ex2_intro/ -] -qed-. - -lemma lpx_sn_liftable_dedropable: ∀R. (∀I,L. reflexive ? (R I L)) → - (∀I. l_liftable (R I)) → dedropable_sn (lpx_sn R). -#R #H1R #H2R #L1 #K1 #s #d #e #H elim H -L1 -K1 -d -e -[ #d #e #He #X #H >(lpx_sn_inv_atom1 … H) -H - /4 width=4 by ldrop_atom, lpx_sn_atom, ex3_intro/ -| #I #K1 #V1 #X #H elim (lpx_sn_inv_pair1 … H) -H - #K2 #V2 #HK12 #HV12 #H destruct - lapply (lpx_sn_fwd_length … HK12) - #H @(ex3_intro … (K2.ⓑ{I}V2)) (**) (* explicit constructor *) - /3 width=1 by lpx_sn_pair, monotonic_le_plus_l/ - @leq_O2 normalize // -| #I #L1 #K1 #V1 #e #_ #IHLK1 #K2 #HK12 elim (IHLK1 … HK12) -K1 - /3 width=5 by ldrop_drop, leq_pair, lpx_sn_pair, ex3_intro/ -| #I #L1 #K1 #V1 #W1 #d #e #HLK1 #HWV1 #IHLK1 #X #H - elim (lpx_sn_inv_pair1 … H) -H #K2 #W2 #HK12 #HW12 #H destruct - elim (lift_total W2 d e) #V2 #HWV2 - lapply (H2R … HW12 … HLK1 … HWV1 … HWV2) -W1 - elim (IHLK1 … HK12) -K1 - /3 width=6 by ldrop_skip, leq_succ, lpx_sn_pair, ex3_intro/ -] -qed-. - -fact lpx_sn_dropable_aux: ∀R,L2,K2,s,d,e. ⇩[s, d, e] L2 ≡ K2 → ∀L1. lpx_sn R L1 L2 → - d = 0 → ∃∃K1. ⇩[s, 0, e] L1 ≡ K1 & lpx_sn R K1 K2. -#R #L2 #K2 #s #d #e #H elim H -L2 -K2 -d -e -[ #d #e #He #X #H >(lpx_sn_inv_atom2 … H) -H - /4 width=3 by ldrop_atom, lpx_sn_atom, ex2_intro/ -| #I #K2 #V2 #X #H elim (lpx_sn_inv_pair2 … H) -H - #K1 #V1 #HK12 #HV12 #H destruct - /3 width=5 by ldrop_pair, lpx_sn_pair, ex2_intro/ -| #I #L2 #K2 #V2 #e #_ #IHLK2 #X #H #_ elim (lpx_sn_inv_pair2 … H) -H - #L1 #V1 #HL12 #HV12 #H destruct - elim (IHLK2 … HL12) -L2 /3 width=3 by ldrop_drop, ex2_intro/ -| #I #L2 #K2 #V2 #W2 #d #e #_ #_ #_ #L1 #_ - (lpx_sn_inv_atom1 … H1) -X1 - >(lpx_sn_inv_atom1 … H2) -X2 /2 width=3 by lpx_sn_atom, ex2_intro/ -| #L0 #I #V0 #Hn #X1 #H1 #X2 #H2 destruct - elim (lpx_sn_inv_pair1 … H1) -H1 #L1 #V1 #HL01 #HV01 #H destruct - elim (lpx_sn_inv_pair1 … H2) -H2 #L2 #V2 #HL02 #HV02 #H destruct - elim (IH … HL01 … HL02) -IH normalize // #L #HL1 #HL2 - elim (HR12 … HV01 … HV02 … HL01 … HL02) -L0 -V0 /3 width=5 by lpx_sn_pair, ex2_intro/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/lpx_sn_tc.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/lpx_sn_tc.etc deleted file mode 100644 index 2a3a87cf4..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/lpx_sn_tc.etc +++ /dev/null @@ -1,119 +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/relocation/lpx_sn.ma". - -(* SN POINTWISE EXTENSION OF A CONTEXT-SENSITIVE REALTION FOR TERMS *********) - -(* Properties on transitive_closure *****************************************) - -lemma TC_lpx_sn_pair_refl: ∀R. (∀I,L. reflexive … (R I L)) → - ∀L1,L2. TC … (lpx_sn R) L1 L2 → - ∀I,V. TC … (lpx_sn R) (L1.ⓑ{I}V) (L2. ⓑ{I}V). -#R #HR #L1 #L2 #H @(TC_star_ind … L2 H) -L2 -[ /2 width=1 by lpx_sn_refl/ -| /3 width=1 by TC_reflexive, lpx_sn_refl/ -| /3 width=5 by lpx_sn_pair, step/ -] -qed-. - -lemma TC_lpx_sn_pair: ∀R. (∀I,L. reflexive … (R I L)) → - ∀I,L1,L2. TC … (lpx_sn R) L1 L2 → - ∀V1,V2. LTC … (R I) L1 V1 V2 → - TC … (lpx_sn R) (L1.ⓑ{I}V1) (L2. ⓑ{I}V2). -#R #HR #I #L1 #L2 #HL12 #V1 #V2 #H @(TC_star_ind_dx … V1 H) -V1 // -[ /2 width=1 by TC_lpx_sn_pair_refl/ -| /4 width=3 by TC_strap, lpx_sn_pair, lpx_sn_refl/ -] -qed-. - -lemma lpx_sn_LTC_TC_lpx_sn: ∀R. (∀I,L. reflexive … (R I L)) → - ∀L1,L2. lpx_sn (λI.LTC … (R I)) L1 L2 → - TC … (lpx_sn R) L1 L2. -#R #HR #L1 #L2 #H elim H -L1 -L2 -/2 width=1 by TC_lpx_sn_pair, lpx_sn_atom, inj/ -qed-. - -(* Inversion lemmas on transitive closure ***********************************) - -lemma TC_lpx_sn_inv_atom2: ∀R,L1. TC … (lpx_sn R) L1 (⋆) → L1 = ⋆. -#R #L1 #H @(TC_ind_dx … L1 H) -L1 -[ /2 width=2 by lpx_sn_inv_atom2/ -| #L1 #L #HL1 #_ #IHL2 destruct /2 width=2 by lpx_sn_inv_atom2/ -] -qed-. - -lemma TC_lpx_sn_inv_pair2: ∀R. (∀I.s_rs_transitive … (R I) (λ_.lpx_sn R)) → - ∀I,L1,K2,V2. TC … (lpx_sn R) L1 (K2.ⓑ{I}V2) → - ∃∃K1,V1. TC … (lpx_sn R) K1 K2 & LTC … (R I) K1 V1 V2 & L1 = K1.ⓑ{I}V1. -#R #HR #I #L1 #K2 #V2 #H @(TC_ind_dx … L1 H) -L1 -[ #L1 #H elim (lpx_sn_inv_pair2 … H) -H /3 width=5 by inj, ex3_2_intro/ -| #L1 #L #HL1 #_ * #K #V #HK2 #HV2 #H destruct - elim (lpx_sn_inv_pair2 … HL1) -HL1 #K1 #V1 #HK1 #HV1 #H destruct - lapply (HR … HV2 … HK1) -HR -HV2 /3 width=5 by TC_strap, ex3_2_intro/ -] -qed-. - -lemma TC_lpx_sn_ind: ∀R. (∀I.s_rs_transitive … (R I) (λ_.lpx_sn R)) → - ∀S:relation lenv. - S (⋆) (⋆) → ( - ∀I,K1,K2,V1,V2. - TC … (lpx_sn R) K1 K2 → LTC … (R I) K1 V1 V2 → - S K1 K2 → S (K1.ⓑ{I}V1) (K2.ⓑ{I}V2) - ) → - ∀L2,L1. TC … (lpx_sn R) L1 L2 → S L1 L2. -#R #HR #S #IH1 #IH2 #L2 elim L2 -L2 -[ #X #H >(TC_lpx_sn_inv_atom2 … H) -X // -| #L2 #I #V2 #IHL2 #X #H - elim (TC_lpx_sn_inv_pair2 … H) // -H -HR - #L1 #V1 #HL12 #HV12 #H destruct /3 width=1 by/ -] -qed-. - -lemma TC_lpx_sn_inv_atom1: ∀R,L2. TC … (lpx_sn R) (⋆) L2 → L2 = ⋆. -#R #L2 #H elim H -L2 -[ /2 width=2 by lpx_sn_inv_atom1/ -| #L #L2 #_ #HL2 #IHL1 destruct /2 width=2 by lpx_sn_inv_atom1/ -] -qed-. - -fact TC_lpx_sn_inv_pair1_aux: ∀R. (∀I.s_rs_transitive … (R I) (λ_.lpx_sn R)) → - ∀L1,L2. TC … (lpx_sn R) L1 L2 → - ∀I,K1,V1. L1 = K1.ⓑ{I}V1 → - ∃∃K2,V2. TC … (lpx_sn R) K1 K2 & LTC … (R I) K1 V1 V2 & L2 = K2. ⓑ{I} V2. -#R #HR #L1 #L2 #H @(TC_lpx_sn_ind … H) // -HR -L1 -L2 -[ #J #K #W #H destruct -| #I #L1 #L2 #V1 #V2 #HL12 #HV12 #_ #J #K #W #H destruct /2 width=5 by ex3_2_intro/ -] -qed-. - -lemma TC_lpx_sn_inv_pair1: ∀R. (∀I.s_rs_transitive … (R I) (λ_.lpx_sn R)) → - ∀I,K1,L2,V1. TC … (lpx_sn R) (K1.ⓑ{I}V1) L2 → - ∃∃K2,V2. TC … (lpx_sn R) K1 K2 & LTC … (R I) K1 V1 V2 & L2 = K2. ⓑ{I} V2. -/2 width=3 by TC_lpx_sn_inv_pair1_aux/ qed-. - -lemma TC_lpx_sn_inv_lpx_sn_LTC: ∀R. (∀I.s_rs_transitive … (R I) (λ_.lpx_sn R)) → - ∀L1,L2. TC … (lpx_sn R) L1 L2 → - lpx_sn (λI.LTC … (R I)) L1 L2. -/3 width=4 by TC_lpx_sn_ind, lpx_sn_pair/ qed-. - -(* Forward lemmas on transitive closure *************************************) - -lemma TC_lpx_sn_fwd_length: ∀R,L1,L2. TC … (lpx_sn R) L1 L2 → |L1| = |L2|. -#R #L1 #L2 #H elim H -L2 -[ #L2 #HL12 >(lpx_sn_fwd_length … HL12) -HL12 // -| #L #L2 #_ #HL2 #IHL1 - >IHL1 -L1 >(lpx_sn_fwd_length … HL2) -HL2 // -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/ssta_llpx_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/ssta_llpx_sn.etc deleted file mode 100644 index 3b1db6a9a..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lpx_sn/ssta_llpx_sn.etc +++ /dev/null @@ -1,44 +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/substitution/llpx_sn_ldrop.ma". -include "basic_2/static/ssta.ma". - -(* STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS ******************************) - -(* Properties on lazy sn pointwise extensions *******************************) - -lemma ssta_llpx_sn_conf: ∀R. (∀I,L.reflexive … (R I L)) → - (∀I.l_liftable (R I)) → - ∀h,g,G. s_r_confluent1 … (ssta h g G) (llpx_sn R 0). -#R #H1R #H2R #h #g #G #Ls #T1 #T2 #H elim H -G -Ls -T1 -T2 -[ /3 width=4 by llpx_sn_fwd_length, llpx_sn_sort/ -| #G #Ls #Ks #V1s #W2s #V2s #i #HLKs #_ #HVW2s #IHV12s #Ld #H elim (llpx_sn_inv_lref_ge_sn … H … HLKs) // -H - #Kd #V1d #HLKd #HV1s #HV1sd - lapply (ldrop_fwd_drop2 … HLKs) -HLKs #HLKs - lapply (ldrop_fwd_drop2 … HLKd) -HLKd #HLKd - @(llpx_sn_lift_le … HLKs HLKd … HVW2s) -HLKs -HLKd -HVW2s /2 width=1 by/ (**) (* full auto too slow *) -| #G #Ls #Ks #V1s #W1s #l #i #HLKs #Hl #HVW1s #Ld #H elim (llpx_sn_inv_lref_ge_sn … H … HLKs) // -H - #Kd #V1d #HLKd #HV1s #HV1sd - lapply (ldrop_fwd_drop2 … HLKs) -HLKs #HLKs - lapply (ldrop_fwd_drop2 … HLKd) -HLKd #HLKd - @(llpx_sn_lift_le … HLKs HLKd … HVW1s) -HLKs -HLKd -HVW1s /2 width=1 by/ (**) (* full auto too slow *) -| #a #I #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_bind_O … H) -H - /4 width=5 by llpx_sn_bind_repl_SO, llpx_sn_bind/ -| #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H - /3 width=1 by llpx_sn_flat/ -| #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H - /3 width=1 by llpx_sn_flat/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lsubn/lsubn_lsubn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lsubn/lsubn_lsubn.etc deleted file mode 100644 index 9ef3dda88..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lsubn/lsubn_lsubn.etc +++ /dev/null @@ -1,36 +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/dynamic/lsubn_nta.ma". - -(* LOCAL ENVIRONMENT REFINEMENT FOR NATIVE TYPE ASSIGNMENT ******************) - -(* Main properties **********************************************************) - -(* Note: new property *) -theorem lsubn_trans: ∀h,L1,L. h ⊢ L1 :⊑ L → ∀L2. h ⊢ L :⊑ L2 → h ⊢ L1 :⊑ L2. -#h #L1 #L #H elim H -L1 -L -[ #X #H >(lsubn_inv_atom1 … H) -H // -| #I #L1 #L #V #HL1 #H1W #IHL1 #X #H - elim (lsubn_inv_pair1 … H) -H * #L2 - [ #HL2 #H #H2W destruct /4 width=1/ - | #W #H1VW #H2VW #HL2 #H1 #H2 destruct /3 width=3/ - ] -| #L1 #L #V1 #W1 #H1VW1 #H2VW1 #HL1 #IHL1 #X #H - elim (lsubn_inv_pair1 … H) -H * #L2 - [ #HL2 #H #HW destruct /3 width=1/ - | #V #_ #_ #_ #_ #H destruct - ] -] -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/aaa_lpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/aaa_lpss.etc deleted file mode 100644 index e930823ad..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/aaa_lpss.etc +++ /dev/null @@ -1,54 +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/substitution/lpss_ldrop.ma". -include "basic_2/static/aaa_lift.ma". - -(* ATONIC ARITY ASSIGNMENT ON TERMS *****************************************) - -(* Properties about sn parallel substitution ********************************) - -(* Note: lemma 500 *) -lemma aaa_cpss_lpss_conf: ∀L1,T1,A. L1 ⊢ T1 ⁝ A → ∀T2. L1 ⊢ T1 ▶* T2 → - ∀L2. L1 ⊢ ▶* L2 → L2 ⊢ T2 ⁝ A. -#L1 #T1 #A #H elim H -L1 -T1 -A -[ #L1 #k #X #H - >(cpss_inv_sort1 … H) -H // -| #I #L1 #K1 #V1 #B #i #HLK1 #_ #IHV1 #X #H #L2 #HL12 - elim (cpss_inv_lref1 … H) -H - [ #H destruct - elim (lpss_ldrop_conf … HLK1 … HL12) -L1 #X #H #HLK2 - elim (lpss_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct /3 width=6/ - | * #Y #Z #V2 #H #HV12 #HV2 - lapply (ldrop_mono … H … HLK1) -H #H destruct - elim (lpss_ldrop_conf … HLK1 … HL12) -L1 #Z #H #HLK2 - elim (lpss_inv_pair1 … H) -H #K2 #V0 #HK12 #_ #H destruct - lapply (ldrop_fwd_ldrop2 … HLK2) -V0 /3 width=7/ - ] -| #a #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12 - elim (cpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct /4 width=2/ -| #a #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12 - elim (cpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct /4 width=1/ -| #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12 - elim (cpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct /3 width=3/ -| #L1 #V1 #T1 #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12 - elim (cpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct /3 width=1/ -] -qed-. - -lemma aaa_cpss_conf: ∀L,T1,A. L ⊢ T1 ⁝ A → ∀T2. L ⊢ T1 ▶* T2 → L ⊢ T2 ⁝ A. -/2 width=5 by aaa_cpss_lpss_conf/ qed-. - -lemma aaa_lpss_conf: ∀L1,T,A. L1 ⊢ T ⁝ A → ∀L2. L1 ⊢ ▶* L2 → L2 ⊢ T ⁝ A. -/2 width=5 by aaa_cpss_lpss_conf/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/cpcs_lpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/cpcs_lpss.etc deleted file mode 100644 index 09d29754f..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/cpcs_lpss.etc +++ /dev/null @@ -1,50 +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/computation/cprs_lpss.ma". -include "basic_2/equivalence/cpcs_cpcs.ma". - -(* CONTEXT-SENSITIVE PARALLEL EQUIVALENCE ON TERMS **************************) - -(* Properties on sn parallel substitution for local environments ************) - -lemma cpcs_lpss_conf: ∀L1,T1,T2. L1 ⊢ T1 ⬌* T2 → - ∀L2. L1 ⊢ ▶* L2 → L2 ⊢ T1 ⬌* T2. -#L1 #T1 #T2 #H #L2 #HL12 -elim (cpcs_inv_cprs … H) -H #T #HT1 #HT2 -elim (cprs_lpss_conf_dx … HT1 … HL12) -HT1 #U1 #H1 #HTU1 -elim (cprs_lpss_conf_dx … HT2 … HL12) -L1 #U2 #H2 #HTU2 -elim (cpss_conf … H1 … H2) -T #U #HU1 #HU2 -lapply (cprs_cpss_trans … HTU1 … HU1) -U1 -lapply (cprs_cpss_trans … HTU2 … HU2) -U2 /2 width=3/ -qed-. - -lemma cpcs_cpss_lpss_conf: ∀L1,T,T2. L1 ⊢ T ⬌* T2 → ∀T1. L1 ⊢ T ▶* T1 → - ∀L2. L1 ⊢ ▶* L2 → L2 ⊢ T1 ⬌* T2. -#L1 #T #T2 #HT2 #T1 #HT1 #L2 #HL12 -lapply (cpcs_lpss_conf … HT2 … HL12) -HT2 #HT2 -elim (lpss_cpss_conf_dx … HT1 … HL12) -L1 #T0 #HT0 #HT10 -lapply (cpcs_cpss_conf … HT0 … HT2) -T #HT02 -lapply (cpcs_cpss_strap2 … HT10 … HT02) -T0 // -qed-. - -lemma cpcs_cpss2_lpss_conf: ∀L1,T1,T2. L1 ⊢ T1 ⬌* T2 → - ∀T3. L1 ⊢ T1 ▶* T3 → ∀T4. L1 ⊢ T2 ▶* T4 → - ∀L2. L1 ⊢ ▶* L2 → L2 ⊢ T3 ⬌* T4. -#L1 #T1 #T2 #HT12 #T3 #HT13 #T4 #HT24 #L2 #HL12 -lapply (cpcs_cpss_lpss_conf … HT12 … HT13 … HL12) -T1 #HT32 -elim (lpss_cpss_conf_dx … HT24 … HL12) -L1 #T #HT2 #HT4 -lapply (cpcs_cpss_strap1 … HT32 … HT2) -T2 #HT3 -lapply (cpcs_cpss_div … HT3 … HT4) -T // -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/cpqs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/cpqs.etc deleted file mode 100644 index 41120361a..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/cpqs.etc +++ /dev/null @@ -1,227 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( L ⊢ break term 46 T1 ➤ * break term 46 T2 )" - non associative with precedence 45 - for @{ 'PRestStar $L $T1 $T2 }. - -include "basic_2/substitution/cpss.ma". - -(* CONTEXT-SENSITIVE RESTRICTED PARALLEL COMPUTATION FOR TERMS **************) - -inductive cpqs: lenv → relation term ≝ -| cpqs_atom : ∀I,L. cpqs L (⓪{I}) (⓪{I}) -| cpqs_delta: ∀L,K,V,V2,W2,i. - ⇩[0, i] L ≡ K. ⓓV → cpqs K V V2 → - ⇧[0, i + 1] V2 ≡ W2 → cpqs L (#i) W2 -| cpqs_bind : ∀a,I,L,V1,V2,T1,T2. - cpqs L V1 V2 → cpqs (L. ⓑ{I} V1) T1 T2 → - cpqs L (ⓑ{a,I} V1. T1) (ⓑ{a,I} V2. T2) -| cpqs_flat : ∀I,L,V1,V2,T1,T2. - cpqs L V1 V2 → cpqs L T1 T2 → - cpqs L (ⓕ{I} V1. T1) (ⓕ{I} V2. T2) -| cpqs_zeta : ∀L,V,T1,T,T2. cpqs (L.ⓓV) T1 T → - ⇧[0, 1] T2 ≡ T → cpqs L (+ⓓV. T1) T2 -| cpqs_tau : ∀L,V,T1,T2. cpqs L T1 T2 → cpqs L (ⓝV. T1) T2 -. - -interpretation "context-sensitive restricted parallel computation (term)" - 'PRestStar L T1 T2 = (cpqs L T1 T2). - -(* Basic properties *********************************************************) - -lemma cpqs_lsubr_trans: lsub_trans … cpqs lsubr. -#L1 #T1 #T2 #H elim H -L1 -T1 -T2 -[ // -| #L1 #K1 #V1 #V2 #W2 #i #HLK1 #_ #HVW2 #IHV12 #L2 #HL12 - elim (lsubr_fwd_ldrop2_abbr … HL12 … HLK1) -HL12 -HLK1 /3 width=6/ -| /4 width=1/ -|4,6: /3 width=1/ -| /4 width=3/ -] -qed-. - -lemma cpss_cpqs: ∀L,T1,T2. L ⊢ T1 ▶* T2 → L ⊢ T1 ➤* T2. -#L #T1 #T2 #H elim H -L -T1 -T2 // /2 width=1/ /2 width=6/ -qed. - -lemma cpqs_refl: ∀T,L. L ⊢ T ➤* T. -/2 width=1/ qed. - -lemma cpqs_delift: ∀L,K,V,T1,d. ⇩[0, d] L ≡ (K. ⓓV) → - ∃∃T2,T. L ⊢ T1 ➤* T2 & ⇧[d, 1] T ≡ T2. -#L #K #V #T1 #d #HLK -elim (cpss_delift … T1 … HLK) -HLK /3 width=4/ -qed-. - -lemma cpqs_append: l_appendable_sn … cpqs. -#K #T1 #T2 #H elim H -K -T1 -T2 // /2 width=1/ /2 width=3/ -#K #K0 #V1 #V2 #W2 #i #HK0 #_ #HVW2 #IHV12 #L -lapply (ldrop_fwd_length_lt2 … HK0) #H -@(cpqs_delta … (L@@K0) V1 … HVW2) // -@(ldrop_O1_append_sn_le … HK0) /2 width=2/ (**) (* /3/ does not work *) -qed. - -(* Basic inversion lemmas ***************************************************) - -fact cpqs_inv_atom1_aux: ∀L,T1,T2. L ⊢ T1 ➤* T2 → ∀I. T1 = ⓪{I} → - T2 = ⓪{I} ∨ - ∃∃K,V,V2,i. ⇩[O, i] L ≡ K. ⓓV & - K ⊢ V ➤* V2 & - ⇧[O, i + 1] V2 ≡ T2 & - I = LRef i. -#L #T1 #T2 * -L -T1 -T2 -[ #I #L #J #H destruct /2 width=1/ -| #L #K #V #V2 #T2 #i #HLK #HV2 #HVT2 #J #H destruct /3 width=8/ -| #a #I #L #V1 #V2 #T1 #T2 #_ #_ #J #H destruct -| #I #L #V1 #V2 #T1 #T2 #_ #_ #J #H destruct -| #L #V #T1 #T #T2 #_ #_ #J #H destruct -| #L #V #T1 #T2 #_ #J #H destruct -] -qed-. - -lemma cpqs_inv_atom1: ∀I,L,T2. L ⊢ ⓪{I} ➤* T2 → - T2 = ⓪{I} ∨ - ∃∃K,V,V2,i. ⇩[O, i] L ≡ K. ⓓV & - K ⊢ V ➤* V2 & - ⇧[O, i + 1] V2 ≡ T2 & - I = LRef i. -/2 width=3 by cpqs_inv_atom1_aux/ qed-. - -lemma cpqs_inv_sort1: ∀L,T2,k. L ⊢ ⋆k ➤* T2 → T2 = ⋆k. -#L #T2 #k #H -elim (cpqs_inv_atom1 … H) -H // -* #K #V #V2 #i #_ #_ #_ #H destruct -qed-. - -lemma cpqs_inv_lref1: ∀L,T2,i. L ⊢ #i ➤* T2 → - T2 = #i ∨ - ∃∃K,V,V2. ⇩[O, i] L ≡ K. ⓓV & - K ⊢ V ➤* V2 & - ⇧[O, i + 1] V2 ≡ T2. -#L #T2 #i #H -elim (cpqs_inv_atom1 … H) -H /2 width=1/ -* #K #V #V2 #j #HLK #HV2 #HVT2 #H destruct /3 width=6/ -qed-. - -lemma cpqs_inv_gref1: ∀L,T2,p. L ⊢ §p ➤* T2 → T2 = §p. -#L #T2 #p #H -elim (cpqs_inv_atom1 … H) -H // -* #K #V #V2 #i #_ #_ #_ #H destruct -qed-. - -fact cpqs_inv_bind1_aux: ∀L,U1,U2. L ⊢ U1 ➤* U2 → - ∀a,I,V1,T1. U1 = ⓑ{a,I} V1. T1 → ( - ∃∃V2,T2. L ⊢ V1 ➤* V2 & - L. ⓑ{I} V1 ⊢ T1 ➤* T2 & - U2 = ⓑ{a,I} V2. T2 - ) ∨ - ∃∃T. L.ⓓV1 ⊢ T1 ➤* T & ⇧[0, 1] U2 ≡ T & a = true & I = Abbr. -#L #U1 #U2 * -L -U1 -U2 -[ #I #L #b #J #W1 #U1 #H destruct -| #L #K #V #V2 #W2 #i #_ #_ #_ #b #J #W1 #U1 #H destruct -| #a #I #L #V1 #V2 #T1 #T2 #HV12 #HT12 #b #J #W1 #U1 #H destruct /3 width=5/ -| #I #L #V1 #V2 #T1 #T2 #_ #_ #b #J #W1 #U1 #H destruct -| #L #V #T1 #T #T2 #HT1 #HT2 #b #J #W1 #U1 #H destruct /3 width=3/ -| #L #V #T1 #T2 #_ #b #J #W1 #U1 #H destruct -] -qed-. - -lemma cpqs_inv_bind1: ∀a,I,L,V1,T1,U2. L ⊢ ⓑ{a,I} V1. T1 ➤* U2 → ( - ∃∃V2,T2. L ⊢ V1 ➤* V2 & - L. ⓑ{I} V1 ⊢ T1 ➤* T2 & - U2 = ⓑ{a,I} V2. T2 - ) ∨ - ∃∃T. L.ⓓV1 ⊢ T1 ➤* T & ⇧[0, 1] U2 ≡ T & a = true & I = Abbr. -/2 width=3 by cpqs_inv_bind1_aux/ qed-. - -lemma cpqs_inv_abbr1: ∀a,L,V1,T1,U2. L ⊢ ⓓ{a} V1. T1 ➤* U2 → ( - ∃∃V2,T2. L ⊢ V1 ➤* V2 & - L. ⓓ V1 ⊢ T1 ➤* T2 & - U2 = ⓓ{a} V2. T2 - ) ∨ - ∃∃T. L.ⓓV1 ⊢ T1 ➤* T & ⇧[0, 1] U2 ≡ T & a = true. -#a #L #V1 #T1 #U2 #H -elim (cpqs_inv_bind1 … H) -H * /3 width=3/ /3 width=5/ -qed-. - -lemma cpqs_inv_abst1: ∀a,L,V1,T1,U2. L ⊢ ⓛ{a} V1. T1 ➤* U2 → - ∃∃V2,T2. L ⊢ V1 ➤* V2 & - L. ⓛ V1 ⊢ T1 ➤* T2 & - U2 = ⓛ{a} V2. T2. -#a #L #V1 #T1 #U2 #H -elim (cpqs_inv_bind1 … H) -H * -[ /3 width=5/ -| #T #_ #_ #_ #H destruct -] -qed-. - -fact cpqs_inv_flat1_aux: ∀L,U1,U2. L ⊢ U1 ➤* U2 → - ∀I,V1,T1. U1 = ⓕ{I} V1. T1 → ( - ∃∃V2,T2. L ⊢ V1 ➤* V2 & L ⊢ T1 ➤* T2 & - U2 = ⓕ{I} V2. T2 - ) ∨ - (L ⊢ T1 ➤* U2 ∧ I = Cast). -#L #U1 #U2 * -L -U1 -U2 -[ #I #L #J #W1 #U1 #H destruct -| #L #K #V #V2 #W2 #i #_ #_ #_ #J #W1 #U1 #H destruct -| #a #I #L #V1 #V2 #T1 #T2 #_ #_ #J #W1 #U1 #H destruct -| #I #L #V1 #V2 #T1 #T2 #HV12 #HT12 #J #W1 #U1 #H destruct /3 width=5/ -| #L #V #T1 #T #T2 #_ #_ #J #W1 #U1 #H destruct -| #L #V #T1 #T2 #HT12 #J #W1 #U1 #H destruct /3 width=1/ -] -qed-. - -lemma cpqs_inv_flat1: ∀I,L,V1,T1,U2. L ⊢ ⓕ{I} V1. T1 ➤* U2 → ( - ∃∃V2,T2. L ⊢ V1 ➤* V2 & L ⊢ T1 ➤* T2 & - U2 = ⓕ{I} V2. T2 - ) ∨ - (L ⊢ T1 ➤* U2 ∧ I = Cast). -/2 width=3 by cpqs_inv_flat1_aux/ qed-. - -lemma cpqs_inv_appl1: ∀L,V1,T1,U2. L ⊢ ⓐ V1. T1 ➤* U2 → - ∃∃V2,T2. L ⊢ V1 ➤* V2 & L ⊢ T1 ➤* T2 & - U2 = ⓐ V2. T2. -#L #V1 #T1 #U2 #H elim (cpqs_inv_flat1 … H) -H * -[ /3 width=5/ -| #_ #H destruct -] -qed-. - -lemma cpqs_inv_cast1: ∀L,V1,T1,U2. L ⊢ ⓝ V1. T1 ➤* U2 → ( - ∃∃V2,T2. L ⊢ V1 ➤* V2 & L ⊢ T1 ➤* T2 & - U2 = ⓝ V2. T2 - ) ∨ - L ⊢ T1 ➤* U2. -#L #V1 #T1 #U2 #H elim (cpqs_inv_flat1 … H) -H * /2 width=1/ /3 width=5/ -qed-. - -(* Basic forward lemmas *****************************************************) - -lemma cpqs_fwd_shift1: ∀L1,L,T1,T. L ⊢ L1 @@ T1 ➤* T → - ∃∃L2,T2. |L1| = |L2| & T = L2 @@ T2. -#L1 @(lenv_ind_dx … L1) -L1 normalize -[ #L #T1 #T #HT1 - @(ex2_2_intro … (⋆)) // (**) (* explicit constructor *) -| #I #L1 #V1 #IH #L #T1 #X - >shift_append_assoc normalize #H - elim (cpqs_inv_bind1 … H) -H * - [ #V0 #T0 #_ #HT10 #H destruct - elim (IH … HT10) -IH -HT10 #L2 #T2 #HL12 #H destruct - >append_length >HL12 -HL12 - @(ex2_2_intro … (⋆.ⓑ{I}V0@@L2) T2) [ >append_length ] // /2 width=3/ (**) (* explicit constructor *) - | #T #_ #_ #H destruct - ] -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/cpqs_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/cpqs_lift.etc deleted file mode 100644 index 78529b6b1..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/cpqs_lift.etc +++ /dev/null @@ -1,81 +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/relocation/ldrop_ldrop.ma". -include "basic_2/unfold/cpqs.ma". - -(* CONTEXT-SENSITIVE RESTRICTED PARALLEL COMPUTATION FOR TERMS **************) - -(* Relocation properties ****************************************************) - -lemma cpqs_lift: l_liftable cpqs. -#K #T1 #T2 #H elim H -K -T1 -T2 -[ #I #K #L #d #e #_ #U1 #H1 #U2 #H2 - >(lift_mono … H1 … H2) -H1 -H2 // -| #K #KV #V #V2 #W2 #i #HKV #HV2 #HVW2 #IHV2 #L #d #e #HLK #U1 #H #U2 #HWU2 - elim (lift_inv_lref1 … H) * #Hid #H destruct - [ elim (lift_trans_ge … HVW2 … HWU2) -W2 // plus_plus_comm_23 #HVU2 - lapply (ldrop_trans_ge_comm … HLK … HKV ?) -K // -Hid /3 width=6/ - ] -| #a #I #K #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #d #e #HLK #U1 #H1 #U2 #H2 - elim (lift_inv_bind1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 destruct - elim (lift_inv_bind1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /4 width=5/ -| #I #K #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #d #e #HLK #U1 #H1 #U2 #H2 - elim (lift_inv_flat1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 destruct - elim (lift_inv_flat1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /3 width=6/ -| #K #V #T1 #T #T2 #_ #HT2 #IHT1 #L #d #e #HLK #U1 #H #U2 #HTU2 - elim (lift_inv_bind1 … H) -H #VV1 #TT1 #HVV1 #HTT1 #H destruct - elim (lift_conf_O1 … HTU2 … HT2) -T2 /4 width=5/ -| #K #V #T1 #T2 #_ #IHT12 #L #d #e #HLK #U1 #H #U2 #HTU2 - elim (lift_inv_flat1 … H) -H #VV1 #TT1 #HVV1 #HTT1 #H destruct /3 width=5/ -] -qed. - -lemma cpqs_inv_lift1: l_deliftable_sn cpqs. -#L #U1 #U2 #H elim H -L -U1 -U2 -[ * #L #i #K #d #e #_ #T1 #H - [ lapply (lift_inv_sort2 … H) -H #H destruct /2 width=3/ - | elim (lift_inv_lref2 … H) -H * #Hid #H destruct /3 width=3/ - | lapply (lift_inv_gref2 … H) -H #H destruct /2 width=3/ - ] -| #L #LV #V #V2 #W2 #i #HLV #HV2 #HVW2 #IHV2 #K #d #e #HLK #T1 #H - elim (lift_inv_lref2 … H) -H * #Hid #H destruct - [ elim (ldrop_conf_lt … HLK … HLV) -L // #L #U #HKL #HLV #HUV - elim (IHV2 … HLV … HUV) -V #U2 #HUV2 #HU2 - elim (lift_trans_le … HUV2 … HVW2) -V2 // >minus_plus plus_minus // shift_append_assoc normalize #H - elim (cpss_inv_bind1 … H) -H - #V0 #T0 #_ #HT10 #H destruct - elim (IH … HT10) -IH -HT10 #L2 #T2 #HL12 #H destruct - >append_length >HL12 -HL12 - @(ex2_2_intro … (⋆.ⓑ{I}V0@@L2) T2) [ >append_length ] // /2 width=3/ (**) (* explicit constructor *) -] -qed-. - -(* Basic_1: removed theorems 27: - subst0_gen_sort subst0_gen_lref subst0_gen_head subst0_gen_lift_lt - subst0_gen_lift_false subst0_gen_lift_ge subst0_refl subst0_trans - subst0_lift_lt subst0_lift_ge subst0_lift_ge_S subst0_lift_ge_s - subst0_subst0 subst0_subst0_back subst0_weight_le subst0_weight_lt - subst0_confluence_neq subst0_confluence_eq subst0_tlt_head - subst0_confluence_lift subst0_tlt - subst1_head subst1_gen_head subst1_lift_S subst1_confluence_lift - subst1_gen_lift_eq subst1_confluence_neq -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/cpss_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/cpss_lift.etc deleted file mode 100644 index 9745b6cde..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/cpss_lift.etc +++ /dev/null @@ -1,71 +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/relocation/ldrop_ldrop.ma". -include "basic_2/substitution/cpss.ma". - -(* CONTEXT-SENSITIVE PARALLEL SUBSTITUTION FOR TERMS ************************) - -(* Relocation properties ****************************************************) - -(* Basic_1: was only: subst1_lift_lt subst1_lift_ge *) -lemma cpss_lift: l_liftable cpss. -#K #T1 #T2 #H elim H -K -T1 -T2 -[ #I #K #L #d #e #_ #U1 #H1 #U2 #H2 - >(lift_mono … H1 … H2) -H1 -H2 // -| #K #KV #V #V2 #W2 #i #HKV #HV2 #HVW2 #IHV2 #L #d #e #HLK #U1 #H #U2 #HWU2 - elim (lift_inv_lref1 … H) * #Hid #H destruct - [ elim (lift_trans_ge … HVW2 … HWU2) -W2 // plus_plus_comm_23 #HVU2 - lapply (ldrop_trans_ge_comm … HLK … HKV ?) -K // -Hid /3 width=6/ - ] -| #a #I #K #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #d #e #HLK #U1 #H1 #U2 #H2 - elim (lift_inv_bind1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 destruct - elim (lift_inv_bind1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /4 width=5/ -| #I #K #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #d #e #HLK #U1 #H1 #U2 #H2 - elim (lift_inv_flat1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 destruct - elim (lift_inv_flat1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /3 width=6/ -] -qed. - -(* Basic_1: was only: subst1_gen_lift_lt subst1_gen_lift_ge *) -lemma cpss_inv_lift1: l_deliftable_sn cpss. -#L #U1 #U2 #H elim H -L -U1 -U2 -[ * #L #i #K #d #e #_ #T1 #H - [ lapply (lift_inv_sort2 … H) -H #H destruct /2 width=3/ - | elim (lift_inv_lref2 … H) -H * #Hid #H destruct /3 width=3/ - | lapply (lift_inv_gref2 … H) -H #H destruct /2 width=3/ - ] -| #L #LV #V #V2 #W2 #i #HLV #HV2 #HVW2 #IHV2 #K #d #e #HLK #T1 #H - elim (lift_inv_lref2 … H) -H * #Hid #H destruct - [ elim (ldrop_conf_lt … HLK … HLV) -L // #L #U #HKL #HLV #HUV - elim (IHV2 … HLV … HUV) -V #U2 #HUV2 #HU2 - elim (lift_trans_le … HUV2 … HVW2) -V2 // >minus_plus plus_minus // shift_append_assoc #H shift_append_assoc #H (cpss_inv_sort1 … H) -X // -| #I #L1 #K1 #V1 #i #HLK1 #_ #IHV1 #W2 #H #L2 #HL12 - elim (cpss_inv_lref1 … H) -H - [ #H destruct - elim (lpss_ldrop_conf … HLK1 … HL12) -L1 #X #H #HLK2 - elim (lpss_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct - lapply (IHV1 … HV12 … HK12) -IHV1 -HV12 -HK12 /2 width=5/ - | * #K0 #V0 #V2 #HLK0 #HV12 #HVW2 - lapply (ldrop_mono … HLK0 … HLK1) -HLK0 #H destruct - elim (lpss_ldrop_conf … HLK1 … HL12) -L1 #X #H #HLK2 - elim (lpss_inv_pair1 … H) -H #K2 #V #HK12 #_ #H destruct - lapply (ldrop_fwd_ldrop2 … HLK2) -V #HLK2 - lapply (IHV1 … HV12 … HK12) -IHV1 -HV12 -HK12 /2 width=7/ - ] -| #a #I #L1 #V1 #T1 #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12 - elim (cpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct - lapply (IHV1 … HV12 … HL12) -IHV1 #HV2 - lapply (IHT1 … HT12 (L2.ⓑ{I}V2) ?) -IHT1 -HT12 /2 width=1/ -| #a #L1 #V1 #W1 #W0 #T1 #U1 #l #_ #_ #HVW1 #HW10 #HTU1 #IHV1 #IHT1 #X #H #L2 #HL12 - elim (cpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct - lapply (IHV1 … HV12 … HL12) -IHV1 #HV2 - lapply (IHT1 … HT12 … HL12) -IHT1 #HT2 - elim (ssta_cpss_lpss_conf … HVW1 … HV12 … HL12) -V1 #W2 #HVW2 #HW12 - elim (dxprs_cpss_lpss_conf … HTU1 … HT12 … HL12) -T1 #X #HTU2 #H - elim (cpss_inv_bind1 … H) -H #W #U2 #HW0 #_ #H -U1 destruct - elim (cprs_cpss2_lpss_conf_dx … HW10 … HW12 … HW0 … HL12) -L1 -W1 -W0 #W0 #HW20 #HW0 - lapply (dxprs_strap1 … (ⓛ{a}W0.U2) HTU2 ?) -HTU2 /3 width=3/ -HW0 /2 width=8/ -| #L1 #W1 #T1 #U1 #l #_ #_ #HTU1 #HUW1 #IHW1 #IHT1 #X #H #L2 #HL12 - elim (cpss_inv_flat1 … H) -H #W2 #T2 #HW12 #HT12 #H destruct - lapply (IHW1 … HW12 … HL12) -IHW1 #HW2 - lapply (IHT1 … HT12 … HL12) -IHT1 #HT2 - elim (ssta_cpss_lpss_conf … HTU1 … HT12 … HL12) -T1 #U2 #HTU2 #HU12 - lapply (cpcs_cpss2_lpss_conf … HUW1 … HU12 … HW12 … HL12) -L1 -W1 -U1 /2 width=4/ -] -qed-. - -lemma snv_lpss_conf: ∀h,g,L1,T. ⦃h, L1⦄ ⊢ T ¡[g] → - ∀L2. L1 ⊢ ▶* L2 → ⦃h, L2⦄ ⊢ T ¡[g]. -#h #g #L1 #T #HT #L2 #HL12 -@(snv_cpss_lpss_conf … HT … HL12) // -qed-. - -lemma snv_cpss_conf: ∀h,g,L,T1. ⦃h, L⦄ ⊢ T1 ¡[g] → - ∀T2. L ⊢ T1 ▶* T2 → ⦃h, L⦄ ⊢ T2 ¡[g]. -#h #g #L #T1 #HT1 #T2 #HT12 -@(snv_cpss_lpss_conf … HT1 … HT12) // -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/ssta_lpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/ssta_lpss.etc deleted file mode 100644 index 7471b2304..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/ssta_lpss.etc +++ /dev/null @@ -1,81 +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/substitution/lpss_ldrop.ma". -include "basic_2/static/ssta_lift.ma". - -(* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************) - -(* Properties about sn parallel substitution ********************************) - -(* Note: apparently this was missing in basic_1 *) -lemma ssta_cpss_lpss_conf: ∀h,g,L1,T1,U1,l. ⦃h, L1⦄ ⊢ T1 •[g] ⦃l, U1⦄ → - ∀T2. L1 ⊢ T1 ▶* T2 → ∀L2. L1 ⊢ ▶* L2 → - ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g] ⦃l, U2⦄ & L1 ⊢ U1 ▶* U2. -#h #g #L1 #T1 #U1 #l #H elim H -L1 -T1 -U1 -l -[ #L1 #k1 #l1 #Hkl1 #X #H - >(cpss_inv_sort1 … H) -H /3 width=3/ -| #L1 #K1 #V1 #W1 #U1 #i #l #HLK1 #_ #HWU1 #IHVW1 #X #H #L2 #HL12 - elim (cpss_inv_lref1 … H) -H - [ #H destruct - elim (lpss_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2 - elim (lpss_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct - lapply (ldrop_fwd_ldrop2 … HLK1) -HLK1 #HLK1 - elim (IHVW1 … HV12 … HK12) -IHVW1 -HV12 -HK12 #W2 #HVW2 #HW12 - elim (lift_total W2 0 (i+1)) #U2 #HWU2 - lapply (cpss_lift … HW12 … HLK1 … HWU1 … HWU2) -HW12 -HLK1 -HWU1 /3 width=6/ - | * #Y #Z #V2 #H #HV12 #HV2 - lapply (ldrop_mono … H … HLK1) -H #H destruct - elim (lpss_ldrop_conf … HLK1 … HL12) -HL12 #Z #H #HLK2 - elim (lpss_inv_pair1 … H) -H #K2 #V0 #HK12 #_ #H destruct - lapply (ldrop_fwd_ldrop2 … HLK2) -V0 #HLK2 - lapply (ldrop_fwd_ldrop2 … HLK1) -HLK1 #HLK1 - elim (IHVW1 … HV12 … HK12) -IHVW1 -HK12 -HV12 #W2 #HVW2 #HW12 - elim (lift_total W2 0 (i+1)) #U2 #HWU2 - lapply (ssta_lift … HVW2 … HLK2 … HV2 … HWU2) -HVW2 -HLK2 -HV2 - lapply (cpss_lift … HW12 … HLK1 … HWU1 … HWU2) -HW12 -HLK1 -HWU1 -HWU2 /3 width=3/ - ] -| #L1 #K1 #W1 #V1 #U1 #i #l #HLK1 #_ #HWU1 #IHWV1 #X #H #L2 #HL12 - elim (cpss_inv_lref1 … H) -H [ | -IHWV1 -HWU1 -HL12 ] - [ #H destruct - elim (lpss_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2 - elim (lpss_inv_pair1 … H) -H #K2 #W2 #HK12 #HW12 #H destruct - lapply (ldrop_fwd_ldrop2 … HLK1) -HLK1 #HLK1 - elim (IHWV1 … HW12 … HK12) -IHWV1 -HK12 #V2 #HWV2 #_ - elim (lift_total W2 0 (i+1)) #U2 #HWU2 - lapply (cpss_lift … HW12 … HLK1 … HWU1 … HWU2) -HW12 -HLK1 -HWU1 /3 width=6/ - | * #K2 #V2 #W2 #HLK2 #_ #_ - lapply (ldrop_mono … HLK2 … HLK1) -HLK1 -HLK2 #H destruct - ] -| #a #I #L1 #V1 #T1 #U1 #l #_ #IHTU1 #X #H #L2 #HL12 - elim (cpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct - elim (IHTU1 … HT12 (L2.ⓑ{I}V2)) -IHTU1 -HT12 /2 width=1/ -HL12 /3 width=5/ -| #L1 #V1 #T1 #U1 #l #_ #IHTU1 #X #H #L2 #HL12 - elim (cpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct - elim (IHTU1 … HT12 … HL12) -IHTU1 -HT12 -HL12 /3 width=5/ -| #L1 #W1 #T1 #U1 #l #_ #IHTU1 #X #H #L2 #HL12 - elim (cpss_inv_flat1 … H) -H #W2 #T2 #HW12 #HT12 #H destruct - elim (IHTU1 … HT12 … HL12) -IHTU1 -HT12 -HL12 /3 width=3/ -] -qed-. - -lemma ssta_cpss_conf: ∀h,g,L,T1,U1,l. ⦃h, L⦄ ⊢ T1 •[g] ⦃l, U1⦄ → - ∀T2. L ⊢ T1 ▶* T2 → - ∃∃U2. ⦃h, L⦄ ⊢ T2 •[g] ⦃l, U2⦄ & L ⊢ U1 ▶* U2. -/2 width=3 by ssta_cpss_lpss_conf/ qed-. - -lemma ssta_lpss_conf: ∀h,g,L1,T,U1,l. ⦃h, L1⦄ ⊢ T •[g] ⦃l, U1⦄ → - ∀L2. L1 ⊢ ▶* L2 → - ∃∃U2. ⦃h, L2⦄ ⊢ T •[g] ⦃l, U2⦄ & L1 ⊢ U1 ▶* U2. -/2 width=3 by ssta_cpss_lpss_conf/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/sstas_lpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/sstas_lpss.etc deleted file mode 100644 index 3ecbc2256..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/sstas_lpss.etc +++ /dev/null @@ -1,39 +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/static/ssta_lpss.ma". -include "basic_2/unfold/sstas.ma". - -(* ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *********************) - -(* Properties about sn parallel substitution for local environments *********) - -lemma sstas_cpss_lpss_conf: ∀h,g,L1,T1,U1. ⦃h, L1⦄ ⊢ T1 •*[g] U1 → - ∀T2. L1 ⊢ T1 ▶* T2 → ∀L2. L1 ⊢ ▶* L2 → - ∃∃U2. ⦃h, L2⦄ ⊢ T2 •*[g] U2 & L1 ⊢ U1 ▶* U2. -#h #g #L1 #T1 #U1 #H @(sstas_ind_dx … H) -T1 /2 width=3/ -#T0 #U0 #l0 #HTU0 #_ #IHU01 #T #HT0 #L2 #HL12 -elim (ssta_cpss_lpss_conf … HTU0 … HT0 … HL12) -HTU0 -HT0 #U #HTU #HU0 -elim (IHU01 … HU0 … HL12) -IHU01 -U0 -HL12 /3 width=4/ -qed-. - -lemma sstas_cpss_conf: ∀h,g,L,T1,U1. ⦃h, L⦄ ⊢ T1 •*[g] U1 → - ∀T2. L ⊢ T1 ▶* T2 → - ∃∃U2. ⦃h, L⦄ ⊢ T2 •*[g] U2 & L ⊢ U1 ▶* U2. -/2 width=3 by sstas_cpss_lpss_conf/ qed-. - -lemma sstas_lpss_conf: ∀h,g,L1,T,U1. ⦃h, L1⦄ ⊢ T •*[g] U1 → - ∀L2. L1 ⊢ ▶* L2 → - ∃∃U2. ⦃h, L2⦄ ⊢ T •*[g] U2 & L1 ⊢ U1 ▶* U2. -/2 width=3 by sstas_cpss_lpss_conf/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/lsubn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/nta/lsubn.etc deleted file mode 100644 index c4359c35f..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/lsubn.etc +++ /dev/null @@ -1,118 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( h ⊢ break term 46 L1 : ⊑ break term 46 L2 )" - non associative with precedence 45 - for @{ 'CrSubEqN $h $L1 $L2 }. - -notation "hvbox( h ⊢ break term 46 L1 : : ⊑ break term 46 L2 )" - non associative with precedence 45 - for @{ 'CrSubEqNAlt $h $L1 $L2 }. - -include "basic_2/dynamic/nta.ma". - -(* LOCAL ENVIRONMENT REFINEMENT FOR NATIVE TYPE ASSIGNMENT ******************) - -(* Note: may not be transitive *) -inductive lsubn (h:sh): relation lenv ≝ -| lsubn_atom: lsubn h (⋆) (⋆) -| lsubn_pair: ∀I,L1,L2,W. lsubn h L1 L2 → lsubn h (L1. ⓑ{I} W) (L2. ⓑ{I} W) -| lsubn_abbr: ∀L1,L2,V,W. ⦃h, L1⦄ ⊢ V : W → ⦃h, L2⦄ ⊢ V : W → - lsubn h L1 L2 → lsubn h (L1. ⓓV) (L2. ⓛW) -. - -interpretation - "local environment refinement (native type assigment)" - 'CrSubEqN h L1 L2 = (lsubn h L1 L2). - -(* Basic inversion lemmas ***************************************************) - -fact lsubn_inv_atom1_aux: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → L1 = ⋆ → L2 = ⋆. -#h #L1 #L2 * -L1 -L2 -[ // -| #I #L1 #L2 #V #_ #H destruct -| #L1 #L2 #V #W #_ #_ #_ #H destruct -] -qed. - -lemma lsubn_inv_atom1: ∀h,L2. h ⊢ ⋆ :⊑ L2 → L2 = ⋆. -/2 width=4/ qed-. - -fact lsubn_inv_pair1_aux: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → ∀I,K1,V. L1 = K1. ⓑ{I} V → - (∃∃K2. h ⊢ K1 :⊑ K2 & L2 = K2. ⓑ{I} V) ∨ - ∃∃K2,W. ⦃h, K1⦄ ⊢ V : W & ⦃h, K2⦄ ⊢ V : W & - h ⊢ K1 :⊑ K2 & L2 = K2. ⓛW & I = Abbr. -#h #L1 #L2 * -L1 -L2 -[ #I #K1 #V #H destruct -| #J #L1 #L2 #V #HL12 #I #K1 #W #H destruct /3 width=3/ -| #L1 #L2 #V #W #H1VW #H2VW #HL12 #I #K1 #V1 #H destruct /3 width=7/ -] -qed. - -lemma lsubn_inv_pair1: ∀h,I,K1,L2,V. h ⊢ K1. ⓑ{I} V :⊑ L2 → - (∃∃K2. h ⊢ K1 :⊑ K2 & L2 = K2. ⓑ{I} V) ∨ - ∃∃K2,W. ⦃h, K1⦄ ⊢ V : W & ⦃h, K2⦄ ⊢ V : W & - h ⊢ K1 :⊑ K2 & L2 = K2. ⓛW & I = Abbr. -/2 width=3/ qed-. - -fact lsubn_inv_atom2_aux: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → L2 = ⋆ → L1 = ⋆. -#h #L1 #L2 * -L1 -L2 -[ // -| #I #L1 #L2 #V #_ #H destruct -| #L1 #L2 #V #W #_ #_ #_ #H destruct -] -qed. - -lemma lsubc_inv_atom2: ∀h,L1. h ⊢ L1 :⊑ ⋆ → L1 = ⋆. -/2 width=4/ qed-. - -fact lsubn_inv_pair2_aux: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → ∀I,K2,W. L2 = K2. ⓑ{I} W → - (∃∃K1. h ⊢ K1 :⊑ K2 & L1 = K1. ⓑ{I} W) ∨ - ∃∃K1,V. ⦃h, K1⦄ ⊢ V : W & ⦃h, K2⦄ ⊢ V : W & - h ⊢ K1 :⊑ K2 & L1 = K1. ⓓV & I = Abst. -#h #L1 #L2 * -L1 -L2 -[ #I #K2 #W #H destruct -| #J #L1 #L2 #V #HL12 #I #K2 #W #H destruct /3 width=3/ -| #L1 #L2 #V #W #H1VW #H2VW #HL12 #I #K2 #W2 #H destruct /3 width=7/ -] -qed. - -(* Basic_1: was: csubt_gen_bind *) -lemma lsubn_inv_pair2: ∀h,I,L1,K2,W. h ⊢ L1 :⊑ K2. ⓑ{I} W → - (∃∃K1. h ⊢ K1 :⊑ K2 & L1 = K1. ⓑ{I} W) ∨ - ∃∃K1,V. ⦃h, K1⦄ ⊢ V : W & ⦃h, K2⦄ ⊢ V : W & - h ⊢ K1 :⊑ K2 & L1 = K1. ⓓV & I = Abst. -/2 width=3/ qed-. - -(* Basic_forward lemmas *****************************************************) - -lemma lsubn_fwd_lsubs1: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → L1 ≼[0, |L1|] L2. -#h #L1 #L2 #H elim H -L1 -L2 // /2 width=1/ -qed-. - -lemma lsubn_fwd_lsubs2: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → L1 ≼[0, |L2|] L2. -#h #L1 #L2 #H elim H -L1 -L2 // /2 width=1/ -qed-. - -(* Basic properties *********************************************************) - -(* Basic_1: was: csubt_refl *) -lemma lsubn_refl: ∀h,L. h ⊢ L :⊑ L. -#h #L elim L -L // /2 width=1/ -qed. - -(* Basic_1: removed theorems 6: - csubt_gen_flat csubt_drop_flat csubt_clear_conf - csubt_getl_abbr csubt_getl_abst csubt_ty3_ld -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/lsubn_cpcs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/nta/lsubn_cpcs.etc deleted file mode 100644 index 5f610bc96..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/lsubn_cpcs.etc +++ /dev/null @@ -1,34 +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/equivalence/cpcs_cpcs.ma". -include "basic_2/dynamic/lsubn.ma". - -(* LOCAL ENVIRONMENT REFINEMENT FOR NATIVE TYPE ASSIGNMENT ******************) - -(* Properties on context-sensitive parallel equivalence for terms ***********) - -(* Basic_1: was: csubt_pr2 *) -lemma cpr_lsubn_trans: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → - ∀T1,T2. L2 ⊢ T1 ➡ T2 → L1 ⊢ T1 ➡ T2. -/3 width=4 by lsubn_fwd_lsubs2, cpr_lsubs_trans/ qed. - -lemma cprs_lsubn_trans: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → - ∀T1,T2. L2 ⊢ T1 ➡* T2 → L1 ⊢ T1 ➡* T2. -/3 width=4 by lsubn_fwd_lsubs2, cprs_lsubs_trans/ qed. - -(* Basic_1: was: csubt_pc3 *) -lemma cpcs_lsubn_trans: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → - ∀T1,T2. L2 ⊢ T1 ⬌* T2 → L1 ⊢ T1 ⬌* T2. -/3 width=4 by lsubn_fwd_lsubs2, cpcs_lsubs_trans/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/lsubn_ldrop.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/nta/lsubn_ldrop.etc deleted file mode 100644 index a16fff618..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/lsubn_ldrop.etc +++ /dev/null @@ -1,64 +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/dynamic/lsubn.ma". - -(* LOCAL ENVIRONMENT REFINEMENT FOR NATIVE TYPE ASSIGNMENT ******************) - -(* Properties concerning basic local environment slicing ********************) - -(* Note: the constant 0 cannot be generalized *) -lemma lsubn_ldrop_O1_conf: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → ∀K1,e. ⇩[0, e] L1 ≡ K1 → - ∃∃K2. h ⊢ K1 :⊑ K2 & ⇩[0, e] L2 ≡ K2. -#h #L1 #L2 #H elim H -L1 -L2 -[ /2 width=3/ -| #I #L1 #L2 #V #_ #IHL12 #K1 #e #H - elim (ldrop_inv_O1 … H) -H * #He #HLK1 - [ destruct - elim (IHL12 L1 0 ?) -IHL12 // #X #HL12 #H - <(ldrop_inv_refl … H) in HL12; -H /3 width=3/ - | elim (IHL12 … HLK1) -L1 /3 width=3/ - ] -| #L1 #L2 #V #W #H1VW #H2VW #_ #IHL12 #K1 #e #H - elim (ldrop_inv_O1 … H) -H * #He #HLK1 - [ destruct - elim (IHL12 L1 0 ?) -IHL12 // #X #HL12 #H - <(ldrop_inv_refl … H) in HL12; -H /3 width=3/ - | elim (IHL12 … HLK1) -L1 /3 width=3/ - ] -] -qed. - -(* Note: the constant 0 cannot be generalized *) -(* Basic_1: was only: csubt_drop_abbr csubt_drop_abst *) -lemma lsubn_ldrop_O1_trans: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → ∀K2,e. ⇩[0, e] L2 ≡ K2 → - ∃∃K1. h ⊢ K1 :⊑ K2 & ⇩[0, e] L1 ≡ K1. -#h #L1 #L2 #H elim H -L1 -L2 -[ /2 width=3/ -| #I #L1 #L2 #V #_ #IHL12 #K2 #e #H - elim (ldrop_inv_O1 … H) -H * #He #HLK2 - [ destruct - elim (IHL12 L2 0 ?) -IHL12 // #X #HL12 #H - <(ldrop_inv_refl … H) in HL12; -H /3 width=3/ - | elim (IHL12 … HLK2) -L2 /3 width=3/ - ] -| #L1 #L2 #V #W #H1VW #H2VW #_ #IHL12 #K2 #e #H - elim (ldrop_inv_O1 … H) -H * #He #HLK2 - [ destruct - elim (IHL12 L2 0 ?) -IHL12 // #X #HL12 #H - <(ldrop_inv_refl … H) in HL12; -H /3 width=3/ - | elim (IHL12 … HLK2) -L2 /3 width=3/ - ] -] -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/lsubn_nta.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/nta/lsubn_nta.etc deleted file mode 100644 index 5832b00b6..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/lsubn_nta.etc +++ /dev/null @@ -1,47 +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/dynamic/nta_nta.ma". -include "basic_2/dynamic/lsubn_ldrop.ma". -include "basic_2/dynamic/lsubn_cpcs.ma". - -(* LOCAL ENVIRONMENT REFINEMENT FOR NATIVE TYPE ASSIGNMENT ******************) - -(* Properties concerning atomic arity assignment ****************************) - -(* Note: the corresponding confluence property does not hold *) -(* Basic_1: was: csubt_ty3 *) -lemma lsubn_nta_trans: ∀h,L2,T,U. ⦃h, L2⦄ ⊢ T : U → ∀L1. h ⊢ L1 :⊑ L2 → - ⦃h, L1⦄ ⊢ T : U. -#h #L2 #T #U #H elim H -L2 -T -U -[ // -| #L2 #K2 #V2 #W2 #U2 #i #HLK2 #_ #WU2 #IHVW2 #L1 #HL12 - elim (lsubn_ldrop_O1_trans … HL12 … HLK2) -L2 #X #H #HLK1 - elim (lsubn_inv_pair2 … H) -H * #K1 - [ #HK12 #H destruct /3 width=6/ - | #V1 #_ #_ #_ #_ #H destruct - ] -| #L2 #K2 #W2 #V2 #U2 #i #HLK2 #_ #HWU2 #IHWV2 #L1 #HL12 - elim (lsubn_ldrop_O1_trans … HL12 … HLK2) -L2 #X #H #HLK1 - elim (lsubn_inv_pair2 … H) -H * #K1 [ | -IHWV2 ] - [ #HK12 #H destruct /3 width=6/ - | #V1 #H1V1W2 #_ #_ #H #_ destruct /2 width=6/ - ] -| /4 width=2/ -| /3 width=1/ -| /3 width=2/ -| /3 width=1/ -| /4 width=6/ -] -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta.etc deleted file mode 100644 index fa4a8ed8f..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta.etc +++ /dev/null @@ -1,53 +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/static/sh.ma". -include "basic_2/equivalence/cpcs.ma". - -(* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************) - -inductive nta (h:sh): lenv → relation term ≝ -| nta_sort: ∀L,k. nta h L (⋆k) (⋆(next h k)) -| nta_ldef: ∀L,K,V,W,U,i. ⇩[0, i] L ≡ K. ⓓV → nta h K V W → - ⇧[0, i + 1] W ≡ U → nta h L (#i) U -| nta_ldec: ∀L,K,W,V,U,i. ⇩[0, i] L ≡ K. ⓛW → nta h K W V → - ⇧[0, i + 1] W ≡ U → nta h L (#i) U -| nta_bind: ∀I,L,V,W,T,U. nta h L V W → nta h (L. ⓑ{I} V) T U → - nta h L (ⓑ{I}V.T) (ⓑ{I}V.U) -| nta_appl: ∀L,V,W,T,U. nta h L V W → nta h L (ⓛW.T) (ⓛW.U) → - nta h L (ⓐV.ⓛW.T) (ⓐV.ⓛW.U) -| nta_pure: ∀L,V,W,T,U. nta h L T U → nta h L (ⓐV.U) W → - nta h L (ⓐV.T) (ⓐV.U) -| nta_cast: ∀L,T,U. nta h L T U → nta h L (ⓝU. T) U -| nta_conv: ∀L,T,U1,U2,V2. nta h L T U1 → L ⊢ U1 ⬌* U2 → nta h L U2 V2 → - nta h L T U2 -. - -interpretation "native type assignment (term)" - 'NativeType h L T U = (nta h L T U). - -(* Basic properties *********************************************************) - -(* Basic_1: was: ty3_cast *) -lemma nta_cast_old: ∀h,L,W,T,U. - ⦃h, L⦄ ⊢ T : U → ⦃h, L⦄ ⊢ U : W → ⦃h, L⦄ ⊢ ⓝU.T : ⓝW.U. -/4 width=3/ qed. - -(* Basic_1: was: ty3_typecheck *) -lemma nta_typecheck: ∀h,L,T,U. ⦃h, L⦄ ⊢ T : U → ∃T0. ⦃h, L⦄ ⊢ ⓝU.T : T0. -/3 width=2/ qed. - -(* Basic_1: removed theorems 4: - ty3_getl_subst0 ty3_fsubst0 ty3_csubst0 ty3_subst0 -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_aaa.etc deleted file mode 100644 index 962856983..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_aaa.etc +++ /dev/null @@ -1,49 +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/computation/csn_aaa.ma". -include "basic_2/equivalence/lcpcs_aaa.ma". -include "basic_2/dynamic/nta.ma". - -(* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************) - -(* Forward lemmas on atomic arity assignment for terms **********************) - -lemma nta_fwd_aaa: ∀h,L,T,U. ⦃h, L⦄ ⊢ T : U → ∃∃A. L ⊢ T ⁝ A & L ⊢ U ⁝ A. -#h #L #T #U #H elim H -L -T -U -[ /2 width=3/ -| #L #K #V #W #U #i #HLK #_ #HWU * #B #HV #HW - lapply (ldrop_fwd_ldrop2 … HLK) /3 width=9/ -| #L #K #W #V #U #i #HLK #_ #HWU * #B #HW #_ -V - lapply (ldrop_fwd_ldrop2 … HLK) /3 width=9/ -| * #L #V #W #T #U #_ #_ * #B #HV #HW * #A #HT #HU - [ /3 width=3/ | /3 width=5/ ] -| #L #V #W #T #U #_ #_ * #B #HV #HW * #X #H1 #H2 - elim (aaa_inv_abst … H1) -H1 #B1 #A1 #HW1 #HT #H destruct - elim (aaa_inv_abst … H2) -H2 #B2 #A #_ #HU #H destruct - lapply (aaa_mono … HW1 … HW) -HW1 #H destruct /4 width=5/ -| #L #V #W #T #U #_ #_ * #X #HT #HUX * #A #H #_ -W - elim (aaa_inv_appl … H) -H #B #HV #HUA - lapply (aaa_mono … HUA … HUX) -HUX #H destruct /3 width=5/ -| #L #T #U #_ * #A #HT #HU /3 width=3/ -| #L #T #U1 #U2 #V2 #_ #HU12 #_ * #X #HT #HU1 * #A #HU2 #_ - lapply (aaa_cpcs_mono … HU12 … HU1 … HU2) -U1 #H destruct /2 width=3/ -] -qed-. - -(* Note: this is the stong normalization property *) -(* Basic_1: was only: ty3_sn3 *) -theorem nta_fwd_csn: ∀h,L,T,U. ⦃h, L⦄ ⊢ T : U → L ⊢ ⬇* T ∧ L ⊢ ⬇* U. -#h #L #T #U #H elim (nta_fwd_aaa … H) -H /3 width=2/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_alt.etc deleted file mode 100644 index 8cbd59518..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_alt.etc +++ /dev/null @@ -1,190 +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/equivalence/cpcs_cpcs.ma". -include "basic_2/dynamic/nta.ma". - -(* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************) - -(* alternative definition of nta *) -inductive ntaa (h:sh): lenv → relation term ≝ -| ntaa_sort: ∀L,k. ntaa h L (⋆k) (⋆(next h k)) -| ntaa_ldef: ∀L,K,V,W,U,i. ⇩[0, i] L ≡ K. ⓓV → ntaa h K V W → - ⇧[0, i + 1] W ≡ U → ntaa h L (#i) U -| ntaa_ldec: ∀L,K,W,V,U,i. ⇩[0, i] L ≡ K. ⓛW → ntaa h K W V → - ⇧[0, i + 1] W ≡ U → ntaa h L (#i) U -| ntaa_bind: ∀I,L,V,W,T,U. ntaa h L V W → ntaa h (L. ⓑ{I} V) T U → - ntaa h L (ⓑ{I}V.T) (ⓑ{I}V.U) -| ntaa_appl: ∀L,V,W,T,U. ntaa h L V W → ntaa h L (ⓛW.T) (ⓛW.U) → - ntaa h L (ⓐV.ⓛW.T) (ⓐV.ⓛW.U) -| ntaa_pure: ∀L,V,W,T,U. ntaa h L T U → ntaa h L (ⓐV.U) W → - ntaa h L (ⓐV.T) (ⓐV.U) -| ntaa_cast: ∀L,T,U,W. ntaa h L T U → ntaa h L U W → ntaa h L (ⓝU. T) U -| ntaa_conv: ∀L,T,U1,U2,V2. ntaa h L T U1 → L ⊢ U1 ⬌* U2 → ntaa h L U2 V2 → - ntaa h L T U2 -. - -interpretation "native type assignment (term) alternative" - 'NativeTypeAlt h L T U = (ntaa h L T U). - -(* Advanced inversion lemmas ************************************************) - -fact ntaa_inv_bind1_aux: ∀h,L,T,U. ⦃h, L⦄ ⊢ T :: U → ∀J,X,Y. T = ⓑ{J}Y.X → - ∃∃Z1,Z2. ⦃h, L⦄ ⊢ Y :: Z1 & ⦃h, L.ⓑ{J}Y⦄ ⊢ X :: Z2 & - L ⊢ ⓑ{J}Y.Z2 ⬌* U. -#h #L #T #U #H elim H -L -T -U -[ #L #k #J #X #Y #H destruct -| #L #K #V #W #U #i #_ #_ #_ #_ #J #X #Y #H destruct -| #L #K #W #V #U #i #_ #_ #_ #_ #J #X #Y #H destruct -| #I #L #V #W #T #U #HVW #HTU #_ #_ #J #X #Y #H destruct /2 width=3/ -| #L #V #W #T #U #_ #_ #_ #_ #J #X #Y #H destruct -| #L #V #W #T #U #_ #_ #_ #_ #J #X #Y #H destruct -| #L #T #U #W #_ #_ #_ #_ #J #X #Y #H destruct -| #L #T #U1 #U2 #V2 #_ #HU12 #_ #IHTU1 #_ #J #X #Y #H destruct - elim (IHTU1 ????) -IHTU1 [5: // |2,3,4: skip ] #Z1 #Z2 #HZ1 #HZ2 #HU1 - lapply (cpcs_trans … HU1 … HU12) -U1 /2 width=3/ -] -qed. - -lemma ntaa_inv_bind1: ∀h,J,L,Y,X,U. ⦃h, L⦄ ⊢ ⓑ{J}Y.X :: U → - ∃∃Z1,Z2. ⦃h, L⦄ ⊢ Y :: Z1 & ⦃h, L.ⓑ{J}Y⦄ ⊢ X :: Z2 & - L ⊢ ⓑ{J}Y.Z2 ⬌* U. -/2 width=3/ qed-. - -lemma ntaa_nta: ∀h,L,T,U. ⦃h, L⦄ ⊢ T :: U → ⦃h, L⦄ ⊢ T : U. -#h #L #T #U #H elim H -L -T -U -// /2 width=1/ /2 width=2/ /2 width=3/ /2 width=6/ -qed-. - -(* Properties on relocation *************************************************) - -lemma ntaa_lift: ∀h,L1,T1,U1. ⦃h, L1⦄ ⊢ T1 :: U1 → ∀L2,d,e. ⇩[d, e] L2 ≡ L1 → - ∀T2. ⇧[d, e] T1 ≡ T2 → ∀U2. ⇧[d, e] U1 ≡ U2 → ⦃h, L2⦄ ⊢ T2 :: U2. -#h #L1 #T1 #U1 #H elim H -L1 -T1 -U1 -[ #L1 #k #L2 #d #e #HL21 #X1 #H1 #X2 #H2 - >(lift_inv_sort1 … H1) -X1 - >(lift_inv_sort1 … H2) -X2 // -| #L1 #K1 #V1 #W1 #W #i #HLK1 #_ #HW1 #IHVW1 #L2 #d #e #HL21 #X #H #U2 #HWU2 - elim (lift_inv_lref1 … H) * #Hid #H destruct - [ elim (lift_trans_ge … HW1 … HWU2 ?) -W // #W2 #HW12 #HWU2 - elim (ldrop_trans_le … HL21 … HLK1 ?) -L1 /2 width=2/ #X #HLK2 #H - elim (ldrop_inv_skip2 … H ?) -H /2 width=1/ -Hid #K2 #V2 #HK21 #HV12 #H destruct - /3 width=8/ - | lapply (lift_trans_be … HW1 … HWU2 ? ?) -W // /2 width=1/ #HW1U2 - lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 // -Hid /3 width=8/ - ] -| #L1 #K1 #W1 #V1 #W #i #HLK1 #_ #HW1 #IHWV1 #L2 #d #e #HL21 #X #H #U2 #HWU2 - elim (lift_inv_lref1 … H) * #Hid #H destruct - [ elim (lift_trans_ge … HW1 … HWU2 ?) -W // (cprs_inv_sort1 … H) -H // -| -| -| -| -| #L1 #V1 #W1 #T1 #U1 #_ #_ #IHTU1 #IHUW1 #L2 #HL12 #T2 #H - elim (cprs_inv_appl1 … H) -H * - [ #V2 #T0 #HV12 #HT10 #H destruct - elim (nta_fwd_correct h L2 (ⓐV1.T1) (ⓐV1.U1) ?) [2: /3 width=2/ ] #U - @(nta_conv … (ⓐV2.U1)) (* /2 width=1/*) [ /4 width=2/] (**) (* explicit constructor, /5 width=5/ is too slow *) - | #V2 #W2 #T0 #HV12 #HT10 #HT02 - lapply (IHTU1 … HL12 (ⓛW2.T0) ?) -IHTU1 /2 width=1/ -HT10 #H - elim (nta_inv_bind1 … H) -H #W #U0 #HW2 #HTU0 #HU01 - elim (cpcs_inv_abst1 … HU01) -HU01 #W #U #HU1 #HU0 - lapply (IHUW1 … HL12 (ⓐV2.ⓛW.U) ?) -IHUW1 -HL12 /2 width=1/ -HV12 #H - - - - elim (nta_fwd_pure1 … H) -H #W0 #U2 #HVU2 #H #HW01 - elim (nta_inv_bind1 … H) -H #W3 #U3 #HW3 #HU3 #H - elim (cpcs_inv_abst1 … H) -H #W4 #U4 -*) -(* -axiom nta_ltpr_tpr_conf: ∀h,L1,T1,U. ⦃h, L1⦄ ⊢ T1 : U → ∀L2. L1 ➡ L2 → - ∀T2. T1 ➡ T2 → ⦃h, L2⦄ ⊢ T2 : U. -#h #L1 #T1 #U #H @(nta_ind_alt … H) -L1 -T1 -U -[ #L1 #k #L2 #_ #T2 #H - >(tpr_inv_atom1 … H) -H // -| #L1 #K1 #V1 #W #U #i #HLK1 #_ #HWU #IHV1 #L2 #HL12 #T2 #H - >(tpr_inv_atom1 … H) -T2 - elim (ltpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #HLK2 #H - elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct /3 width=6/ -| #L1 #K1 #W1 #V1 #U1 #i #HLK1 #HWV1 #HWU1 #IHWV1 #L2 #HL12 #T2 #H - >(tpr_inv_atom1 … H) -T2 - elim (ltpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #HLK2 #H - elim (ltpr_inv_pair1 … H) -H #K2 #W2 #HK12 #HW12 #H destruct - lapply (ldrop_fwd_ldrop2 … HLK2) #HLK - elim (lift_total V1 0 (i+1)) #W #HW - lapply (nta_lift h … HLK … HWU1 … HW) /2 width=1/ -HLK -HW - elim (lift_total W2 0 (i+1)) #U2 #HWU2 - lapply (tpr_lift … HW12 … HWU1 … HWU2) -HWU1 #HU12 - @(nta_conv … U2) /2 width=1/ /3 width=6/ (**) (* explicit constructor, /3 width=6/ is too slow *) -| #I #L1 #V1 #W1 #T1 #U1 #_ #_ #IHVW1 #IHTU1 #L2 #HL12 #X #H - elim (tpr_inv_bind1 … H) -H * - [ #V2 #T0 #T2 #HV12 #HT10 #HT02 #H destruct - lapply (IHVW1 … HL12 … HV12) #HV2W1 - lapply (IHVW1 L2 … V1 ?) // -IHVW1 #HWV1 - lapply (IHTU1 (L2.ⓑ{I}V2) … HT10) -HT10 /2 width=1/ #HT0U1 - lapply (IHTU1 (L2.ⓑ{I}V1) ? T1 ?) -IHTU1 // /2 width=1/ -HL12 #H - lapply (tps_lsubs_trans … HT02 (L2.ⓑ{I}V2) ?) -HT02 /2 width=1/ #HT02 - lapply (nta_tps_conf … HT0U1 … HT02) -T0 #HT2U1 - elim (nta_fwd_correct … H) -H #U2 #HU12 - @(nta_conv … (ⓑ{I}V2.U1)) /2 width=2/ /3 width=1/ (**) (* explicit constructor, /4 width=6/ is too slow *) - | #T #HT1 #HTX #H destruct - lapply (IHVW1 … HL12 V1 ?) -IHVW1 // #HVW1 - elim (lift_total X 0 1) #Y #HXY - lapply (tpr_lift … HTX … HT1 … HXY) -T #H - lapply (IHTU1 (L2.ⓓV1) … H) -T1 /2 width=1/ -L1 #H - elim (nta_fwd_correct … H) #T1 #HUT1 - elim (nta_thin_conf … H L2 0 (0+1) ? ?) -H /2 width=1/ /3 width=1/ #T #U #HTU #H - normalize in ⊢ (??%??? → ?); #HU1 - lapply (delift_inv_lift1_eq … H L2 … HXY) -Y /2 width=1/ #H destruct - @(nta_conv … U) // /2 width=2/ - ] -| #L1 #V1 #W1 #T1 #U1 #_ #_ #IHVW1 #IHTU1 #L2 #HL12 #X #H - elim (tpr_inv_appl1 … H) -H * - [ #V2 #Y #HV12 #HY #H destruct - elim (tpr_inv_abst1 … HY) -HY #W2 #T2 #HW12 #HT12 #H destruct - lapply (IHTU1 L2 ? (ⓛW1.T1) ?) // #H - elim (nta_fwd_correct … H) -H #X #H - elim (nta_inv_bind1 … H) -H #W #U #HW #HU #_ - @(nta_conv … (ⓐV2.ⓛW1.U1)) /4 width=2/ (**) (* explicit constructor, /5 width=5/ is too slow *) - | #V2 #W2 #T0 #T2 #HV12 #HT02 #H1 #H2 destruct - lapply (IHVW1 … HL12 … HV12) #HVW2 - lapply (IHVW1 … HL12 V1 ?) -IHVW1 // #HV1W2 - lapply (IHTU1 … HL12 (ⓛW2.T2) ?) -IHTU1 -HL12 /2 width=1/ -HT02 #H1 - elim (nta_fwd_correct … H1) #T #H2 - elim (nta_inv_bind1 … H1) -H1 #W #U2 #HW2 #HTU2 #H - elim (cpcs_inv_abst … H Abst W2) -H #_ #HU21 - elim (nta_inv_bind1 … H2) -H2 #W0 #U0 #_ #H #_ -T -W0 - lapply (lsubn_nta_trans … HTU2 (L2.ⓓV2) ?) -HTU2 /2 width=1/ #HTU2 - @(nta_conv … (ⓓV2.U2)) /2 width=2/ /3 width=2/ (**) (* explicit constructor, /4 width=5/ is too slow *) - | #V0 #V2 #W0 #W2 #T0 #T2 #_ #_ #_ #_ #H destruct - ] -| #L1 #V1 #W1 #T1 #U1 #_ #_ #IHTU1 #IHUW1 #L2 #HL12 #X #H - elim (tpr_inv_appl1 … H) -H * - [ #V2 #T2 #HV12 #HT12 #H destruct - elim (nta_fwd_correct h L2 (ⓐV1.T1) (ⓐV1.U1) ?) [2: /3 width=2/ ] #U - @(nta_conv … (ⓐV2.U1)) /2 width=1/ /4 width=2/ (**) (* explicit constructor, /5 width=5/ is too slow *) - | #V2 #W2 #T0 #T2 #HV12 #HT02 #H1 #H2 destruct - lapply (IHTU1 … HL12 (ⓛW2.T2) ?) -IHTU1 /2 width=1/ -T0 #H - elim (nta_inv_bind1 … H) -H #W #U2 #HW2 #HTU2 #HU21 - lapply (IHUW1 … HL12 (ⓐV2.U1) ?) -IHUW1 -HL12 /2 width=1/ #H - elim (nta_inv_pure1 … H) -H #V0 #U0 #U #HV20 #HU10 #HU0W1 #HU0 - @(nta_conv … (ⓓV2.U2)) - [2: @nta_bind // - @(lsubn_nta_trans … HTU2) @lsubn_abbr // -(* - lapply (IH … HV1 … HL12 … HV12) -HV1 -HV12 /width=5/ #HB - lapply (IH … HB0 … HL12 W2 ?) -HB0 /width=5/ #HB0 - lapply (IH … HA0 … (L2.ⓛW2) … HT02) -IH -HA0 -HT02 /width=5/ -T0 /2 width=1/ -L1 -V1 /4 width=7/ -*) -*) -(* -axiom pippo: ⦃h, L⦄ ⊢ ⓐV.X : Y → - ∃∃W,T. L ⊢ X ➡* ⓛW.T & ⦃h, L⦄ ⊢ ⓐV : W. - -*) -(* SEGMENT 2 -| #L1 #T1 #U1 #W1 #_ #_ #IHTU1 #IHUW1 #L2 #d #e #HL12 #X #H - elim (tpss_inv_flat1 … H) -H #U2 #T2 #HU12 #HT12 #H destruct - lapply (cpr_tpss … HU12) /4 width=4/ -| #L1 #T1 #U11 #U12 #U #_ #HU112 #_ #IHTU11 #IHU12 #L2 #d #e #HL12 #T2 #HT12 - @(nta_conv … U11) /2 width=5/ (**) (* explicot constructor, /3 width=7/ is too slow *) -] -qed. -*) - -(* SEGMENT 3 -fact nta_ltpr_tpr_conf_aux: ∀h,L,T,L1,T1,U. ⦃h, L1⦄ ⊢ T1 : U → L = L1 → T = T1 → - ∀L2. L1 ➡ L2 → ∀T2. T1 ➡ T2 → ⦃h, L2⦄ ⊢ T2 : U. - - - | #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HW02 #HT02 #HV02 #H1 #H2 destruct - elim (nta_inv_abbr … HT1) -HT1 #B0 #HW0 #HT0 - lapply (IH … HW0 … HL12 … HW02) -HW0 /width=5/ #HW2 - lapply (IH … HV1 … HL12 … HV10) -HV1 -HV10 /width=5/ #HV0 - lapply (IH … HT0 … (L2.ⓓW2) … HT02) -IH -HT0 -HT02 /width=5/ -V1 -T0 /2 width=1/ -L1 -W0 #HT2 - @(nta_abbr … HW2) -HW2 - @(nta_appl … HT2) -HT2 /3 width=7/ (**) (* explict constructors, /5 width=7/ is too slow *) - ] -| #L1 #V1 #T1 #A #HV1 #HT1 #H1 #H2 #L2 #HL12 #X #H destruct - elim (tpr_inv_cast1 … H) -H - [ * #V2 #T2 #HV12 #HT12 #H destruct - lapply (IH … HV1 … HL12 … HV12) -HV1 -HV12 /width=5/ #HV2 - lapply (IH … HT1 … HL12 … HT12) -IH -HT1 -HL12 -HT12 /width=5/ -L1 -V1 -T1 /2 width=1/ - | -HV1 #HT1X - lapply (IH … HT1 … HL12 … HT1X) -IH -HT1 -HL12 -HT1X /width=5/ - ] -] -qed. - -/2 width=9/ qed. - -axiom nta_ltpr_conf: ∀L1,T,A. L1 ⊢ T : A → ∀L2. L1 ➡ L2 → L2 ⊢ T : A. -/2 width=5/ qed. - -axiom nta_tpr_conf: ∀L,T1,A. L ⊢ T1 : A → ∀T2. T1 ➡ T2 → L ⊢ T2 : A. -/2 width=5/ qed. -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_ltpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_ltpss.etc deleted file mode 100644 index 828fd82e0..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_ltpss.etc +++ /dev/null @@ -1,121 +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/equivalence/cpcs_ltpss.ma". -include "basic_2/dynamic/nta_nta.ma". - -(* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************) - -(* Properties about parallel unfold *****************************************) - -lemma nta_ltpss_tpss_conf: ∀h,L1,T1,U. ⦃h, L1⦄ ⊢ T1 : U → - ∀L2,d,e. L1 ▶* [d, e] L2 → - ∀T2. L2 ⊢ T1 ▶* [d, e] T2 → ⦃h, L2⦄ ⊢ T2 : U. -#h #L1 #T1 #U #H @(nta_ind_alt … H) -L1 -T1 -U -[ #L1 #k #L2 #d #e #_ #T2 #H - >(tpss_inv_sort1 … H) -H // -| #L1 #K1 #V1 #W #U #i #HLK1 #_ #HWU #IHV1 #L2 #d #e #HL12 #T2 #H - elim (tpss_inv_lref1 … H) -H - [ #H destruct - elim (lt_or_ge i d) #Hdi - [ elim (ltpss_ldrop_conf_le … HL12 … HLK1 ?) -L1 /2 width=2/ #X #H #HLK2 - elim (ltpss_inv_tpss11 … H ?) -H /2 width=1/ -Hdi #K2 #V2 #HK12 #HV12 #H destruct - /3 width=7/ - | elim (lt_or_ge i (d + e)) #Hide [ | -Hdi ] - [ elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HLK2 - elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K2 #V2 #HK12 #HV12 #H destruct - /3 width=7/ - | lapply (ltpss_ldrop_conf_ge … HL12 … HLK1 ?) -L1 // -Hide /3 width=7/ - ] - ] - | * #K2 #V2 #W2 #Hdi #Hide #HLK2 #HVW2 #HWT2 - elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HL2K0 - elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K0 #V0 #HK12 #HV12 #H destruct - lapply (ldrop_mono … HL2K0 … HLK2) -HL2K0 #H destruct - lapply (ldrop_fwd_ldrop2 … HLK2) -HLK2 #HLK2 - lapply (tpss_trans_eq … HV12 HVW2) -V2 /3 width=9/ - ] -| #L1 #K1 #W1 #V1 #U1 #i #HLK1 #HWV1 #HWU1 #IHWV1 #L2 #d #e #HL12 #T2 #H - elim (tpss_inv_lref1 … H) -H [ | -HWV1 -HWU1 -IHWV1 ] - [ #H destruct - elim (lift_total V1 0 (i+1)) #W #HW - elim (lt_or_ge i d) #Hdi [ -HWV1 ] - [ elim (ltpss_ldrop_conf_le … HL12 … HLK1 ?) -L1 /2 width=2/ #X #H #HLK2 - elim (ltpss_inv_tpss11 … H ?) -H /2 width=1/ -Hdi #K2 #W2 #HK12 #HW12 #H destruct - lapply (ldrop_fwd_ldrop2 … HLK2) #HLK - lapply (nta_lift h … HLK … HWU1 … HW) /2 width=4/ -HW - elim (lift_total W2 0 (i+1)) #U2 #HWU2 - lapply (tpss_lift_ge … HW12 … HLK … HWU1 … HWU2) -HLK -HWU1 // #HU12 - lapply (cpr_tpss … HU12) -HU12 #HU12 - @(nta_conv … U2) /2 width=1/ /3 width=6/ (**) (* explicit constructor, /4 width=6/ is too slow *) - | elim (lt_or_ge i (d + e)) #Hide [ -HWV1 | -IHWV1 -HW -Hdi ] - [ elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HLK2 - elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K2 #W2 #HK12 #HW12 #H destruct - lapply (ldrop_fwd_ldrop2 … HLK2) #HLK - lapply (nta_lift h … HLK … HWU1 … HW) /2 width=4/ -HW - elim (lift_total W2 0 (i+1)) #U2 #HWU2 - lapply (tpss_lift_ge … HW12 … HLK … HWU1 … HWU2) -HLK -HWU1 // #HU12 - lapply (cpr_tpss … HU12) -HU12 #HU12 - @(nta_conv … U2) /2 width=1/ /3 width=6/ (**) (* explicit constructor, /4 width=6/ is too slow *) - | lapply (ltpss_ldrop_conf_ge … HL12 … HLK1 ?) -L1 // -Hide /2 width=6/ - ] - ] - | * #K2 #V2 #W2 #Hdi #Hide #HLK2 #_ #_ - elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HL2K0 - elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K0 #V0 #_ #_ #H destruct - lapply (ldrop_mono … HL2K0 … HLK2) -HL2K0 -HLK2 #H destruct - ] -| #I #L1 #V1 #W1 #T1 #U1 #_ #_ #IHVW1 #IHTU1 #L2 #d #e #HL12 #X #H - elim (tpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct - lapply (cpr_tpss … HV12) #HV - lapply (IHTU1 (L2.ⓑ{I}V1) (d+1) e ? T1 ?) // /2 width=1/ #H - elim (nta_fwd_correct … H) -H #U2 #HU12 - @(nta_conv … (ⓑ{I}V2.U1)) /3 width=2/ /3 width=4/ /4 width=4/ (**) (* explicit constructor, /5 width=6/ is too slow *) -| #L1 #V1 #W1 #T1 #U1 #_ #_ #IHVW1 #IHTU1 #L2 #d #e #HL12 #X #H - elim (tpss_inv_flat1 … H) -H #V2 #Y #HV12 #HY #H destruct - elim (tpss_inv_bind1 … HY) -HY #W2 #T2 #HW12 #HT12 #H destruct - lapply (cpr_tpss … HV12) #HV - lapply (IHTU1 L2 d e ? (ⓛW1.T1) ?) // #H - elim (nta_fwd_correct … H) -H #X #H - elim (nta_inv_bind1 … H) -H #W #U #HW #HU #_ - @(nta_conv … (ⓐV2.ⓛW1.U1)) /3 width=2/ /3 width=4/ /4 width=5/ (**) (* explicit constructor, /5 width=5/ is too slow *) -| #L1 #V1 #W1 #T1 #U1 #_ #_ #IHTU1 #IHUW1 #L2 #d #e #HL12 #X #H - elim (tpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct - lapply (cpr_tpss … HV12) #HV - elim (nta_fwd_correct h L2 (ⓐV1.T1) (ⓐV1.U1) ?) [2: /3 width=4/ ] #U #HU - @(nta_conv … (ⓐV2.U1)) // /3 width=1/ /4 width=5/ (**) (* explicit constructor, /5 width=5/ is too slow *) -| #L1 #T1 #U1 #W1 #_ #_ #IHTU1 #IHUW1 #L2 #d #e #HL12 #X #H - elim (tpss_inv_flat1 … H) -H #U2 #T2 #HU12 #HT12 #H destruct - lapply (cpr_tpss … HU12) /4 width=4/ -| #L1 #T1 #U11 #U12 #U #_ #HU112 #_ #IHTU11 #IHU12 #L2 #d #e #HL12 #T2 #HT12 - @(nta_conv … U11) /2 width=5/ (**) (* explicot constructor, /3 width=7/ is too slow *) -] -qed. - -lemma nta_ltpss_tps_conf: ∀h,L1,T1,U. ⦃h, L1⦄ ⊢ T1 : U → - ∀L2,d,e. L1 ▶* [d, e] L2 → - ∀T2. L2 ⊢ T1 ▶ [d, e] T2 → ⦃h, L2⦄ ⊢ T2 : U. -/3 width=7/ qed. - -lemma nta_ltpss_conf: ∀h,L1,T,U. ⦃h, L1⦄ ⊢ T : U → - ∀L2,d,e. L1 ▶* [d, e] L2 → ⦃h, L2⦄ ⊢ T : U. -/2 width=7/ qed. - -lemma nta_tpss_conf: ∀h,L,T1,U. ⦃h, L⦄ ⊢ T1 : U → - ∀T2,d,e. L ⊢ T1 ▶* [d, e] T2 → ⦃h, L⦄ ⊢ T2 : U. -/2 width=7/ qed. - -lemma nta_tps_conf: ∀h,L,T1,U. ⦃h, L⦄ ⊢ T1 : U → - ∀T2,d,e. L ⊢ T1 ▶ [d, e] T2 → ⦃h, L⦄ ⊢ T2 : U. -/2 width=7/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_nta.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_nta.etc deleted file mode 100644 index 05eb6c55d..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_nta.etc +++ /dev/null @@ -1,59 +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/dynamic/nta_lift.ma". - -(* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************) - -(* Main properties **********************************************************) - -(* Basic_1: was: ty3_unique *) -theorem nta_mono: ∀h,L,T,U1. ⦃h, L⦄ ⊢ T : U1 → ∀U2. ⦃h, L⦄ ⊢ T : U2 → - L ⊢ U1 ⬌* U2. -#h #L #T #U1 #H elim H -L -T -U1 -[ #L #k #X #H - lapply (nta_inv_sort1 … H) -H // -| #L #K #V #W11 #W12 #i #HLK #_ #HW112 #IHVW11 #X #H - elim (nta_inv_lref1 … H) -H * #K0 #V0 #W21 #W22 #HLK0 #HVW21 #HW212 #HX - lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct - lapply (ldrop_fwd_ldrop2 … HLK) -HLK #HLK - @(cpcs_trans … HX) -X /3 width=9 by cpcs_lift/ (**) (* to slow without trace *) -| #L #K #W #V1 #V #i #HLK #_ #HWV #_ #X #H - elim (nta_inv_lref1 … H) -H * #K0 #W0 #V2 #V0 #HLK0 #_ #HWV0 #HX - lapply (ldrop_mono … HLK0 … HLK) -HLK0 -HLK #H destruct - lapply (lift_mono … HWV0 … HWV) -HWV0 -HWV #H destruct // -| #I #L #V #W1 #T #U1 #_ #_ #_ #IHTU1 #X #H - elim (nta_inv_bind1 … H) -H #W2 #U2 #_ #HTU2 #H - @(cpcs_trans … H) -X /3 width=1/ -| #L #V #W1 #T #U1 #_ #_ #_ #IHTU1 #X #H - elim (nta_fwd_pure1 … H) -H #U2 #W2 #_ #HTU2 #H - @(cpcs_trans … H) -X /3 width=1/ -| #L #V #W1 #T #U1 #_ #_ #IHTU1 #_ #X #H - elim (nta_fwd_pure1 … H) -H #U2 #W2 #_ #HTU2 #H - @(cpcs_trans … H) -X /3 width=1/ -| #L #T #U1 #_ #_ #X #H - elim (nta_inv_cast1 … H) -H // -| #L #T #U11 #U12 #V12 #_ #HU112 #_ #IHTU11 #_ #U2 #HTU2 - @(cpcs_canc_sn … HU112) -U12 /2 width=1/ -] -qed-. - -(* Advanced properties ******************************************************) - -lemma nta_cast_alt: ∀h,L,T,W,U. ⦃h, L⦄ ⊢ T : W → ⦃h, L⦄ ⊢ T : U → - ⦃h, L⦄ ⊢ ⓝW.T : U. -#h #L #T #W #U #HTW #HTU -lapply (nta_mono … HTW … HTU) #HWU -elim (nta_fwd_correct … HTU) -HTU /3 width=3/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_sta.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_sta.etc deleted file mode 100644 index 6268b98b1..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_sta.etc +++ /dev/null @@ -1,42 +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/static/sta.ma". -include "basic_2/equivalence/cpcs_cpcs.ma". -include "basic_2/dynamic/nta.ma". - -(* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************) - -(* Properties on static type assignment *************************************) - -lemma nta_fwd_sta: ∀h,L,T,U. ⦃h, L⦄ ⊢ T : U → - ∃∃U0. ⦃h, L⦄ ⊢ T • U0 & L ⊢ U0 ⬌* U. -#h #L #T #U #H elim H -L -T -U -[ /2 width=3/ -| #L #K #V #W1 #V1 #i #HLK #_ #HWV1 * #W0 #HVW0 #HW01 - elim (lift_total W0 0 (i+1)) #V0 #HWV0 - lapply (ldrop_fwd_ldrop2 … HLK) #HLK0 - lapply (cpcs_lift … HLK0 … HWV0 … HWV1 HW01) -HLK0 -HWV1 -HW01 /3 width=6/ -| #L #K #W #V1 #W1 #i #HLK #HWV1 #HW1 * /3 width=6/ -| #I #L #V #W #T #U #_ #_ * #W0 #_ #_ * /3 width=3/ -| #L #V #W #T #U #_ #_ * #W0 #_ #HW0 * #X #H #HX - elim (sta_inv_bind1 … H) -H #U0 #HTU0 #H destruct - @(ex2_1_intro … (ⓐV.ⓛW.U0)) /2 width=1/ /3 width=1/ -| #L #V #W #T #U #_ #_ * #U0 #HTU0 #HU0 #_ -W - @(ex2_1_intro … (ⓐV.U0)) /2 width=1/ -| #L #T #U #HTU * #U0 #HTU0 #HU0 /3 width=3/ -| #L #T #U1 #U2 #V2 #_ #HU12 #_ * #U0 #HTU0 #HU01 #_ - lapply (cpcs_trans … HU01 … HU12) -U1 /2 width=3/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_thin.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_thin.etc deleted file mode 100644 index f927f841a..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/nta/nta_thin.etc +++ /dev/null @@ -1,116 +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/unfold/thin_ldrop.ma". -include "basic_2/equivalence/cpcs_delift.ma". -include "basic_2/dynamic/nta_lift.ma". - -(* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************) - -(* Properties on basic local environment thinning ***************************) - -(* Note: this is known as the substitution lemma *) -(* Basic_1: was only: ty3_gen_cabbr *) -lemma nta_thin_conf: ∀h,L1,T1,U1. ⦃h, L1⦄ ⊢ T1 : U1 → - ∀L2,d,e. ≽ [d, e] L1 → L1 ▼*[d, e] ≡ L2 → - ∃∃T2,U2. ⦃h, L2⦄ ⊢ T2 : U2 & - L1 ⊢ T1 ▼*[d, e] ≡ T2 & L1 ⊢ U1 ▼*[d, e] ≡ U2. -#h #L1 #T1 #U1 #H elim H -L1 -T1 -U1 -[ /2 width=5/ -| #L1 #K1 #V1 #W1 #U1 #i #HLK1 #HVW1 #HWU1 #IHVW1 #L2 #d #e #HL1 #HL12 - elim (lt_or_ge i d) #Hdi [ -HVW1 ] - [ lapply (sfr_ldrop_trans_ge … HLK1 … HL1 ?) -HL1 /2 width=2/ #H - lapply (sfr_inv_skip … H ?) -H /2 width=1/ #HK1 - elim (thin_ldrop_conf_le … HL12 … HLK1 ?) -HL12 /2 width=2/ #X #H #HLK2 - elim (thin_inv_delift1 … H ?) -H /2 width=1/ #K2 #V2 #HK12 #HV12 #H destruct - elim (IHVW1 … HK1 HK12) -IHVW1 -HK1 -HK12 #X2 #W2 #HVW2 #H #HW12 - lapply (delift_mono … H … HV12) -H -HV12 #H destruct - elim (lift_total W2 0 (i+1)) #U2 #HWU2 - lapply (ldrop_fwd_ldrop2 … HLK1) -V1 #HLK1 - lapply (delift_lift_ge … HW12 … HLK1 HWU1 … HWU2) -HW12 -HLK1 -HWU1 // - >minus_plus minus_plus #HU1 - lapply (lift_conf_be … HWU2 … HW2U ?) -W2 /2 width=1/ #HU2 - lapply (delift_lift_div_be … HU1 … HU2 ? ?) -U // /2 width=1/ /3 width=8/ - | lapply (transitive_le … (i+1) Hide ?) /2 width=1/ #Hdei - lapply (thin_ldrop_conf_ge … HL12 … HLK1 ?) -HL12 -HLK1 // #HL2K1 - elim (lift_split … HWU1 d (i+1-e) ? ? ?) -HWU1 // /2 width=1/ #W - commutative_plus minus_plus commutative_plus 0 & L ⊢ U0 ⬌* U - ). -#h #L #T #U #l #H elim H -L -T -U -l -[ #L #k #j #H destruct -| #L #K #V #W #U #i #l #HLK #HVW #HWU #_ #j #H destruct /3 width=8/ -| #L #K #W #V #U #i #l #HLK #HWV #HWU #_ #j #H destruct /3 width=8/ -| #I #L #V #W #T #U #l1 #l2 #_ #_ #_ #_ #j #H destruct -| #L #V #W1 #W2 #T #U #l1 #l2 #_ #_ #_ #_ #j #H destruct -| #L #V #T #U #W #l #_ #_ #_ #_ #j #H destruct -| #L #T #U #W #l1 #l2 #_ #_ #_ #_ #j #H destruct -| #L #T #U1 #U2 #V2 #l #_ #HU12 #_ #IHTU1 #_ #j #H destruct - elim (IHTU1 ??) -IHTU1 [4: // |2: skip ] * #K #V #W #U0 #HLK #HVW #HWU0 [2: #H ] #HU01 - lapply (cpcs_trans … HU01 … HU12) -U1 /3 width=8/ -] -qed. - -lemma snta_inv_lref1: ∀h,L,U,i,l. ⦃h, L⦄ ⊢ #i :[l] U → - (∃∃K,V,W,U0. ⇩[0, i] L ≡ K. ⓓV & ⦃h, K⦄ ⊢ V :[l] W & - ⇧[0, i + 1] W ≡ U0 & L ⊢ U0 ⬌* U - ) ∨ - (∃∃K,W,V,U0. ⇩[0, i] L ≡ K. ⓛW & ⦃h, K⦄ ⊢ W :[l-1] V & - ⇧[0, i + 1] W ≡ U0 & l > 0 & L ⊢ U0 ⬌* U - ). -/2 width=3/ qed-. - -fact snta_inv_bind1_aux: ∀h,L,T,U,l. ⦃h, L⦄ ⊢ T :[l] U → ∀J,X,Y. T = ⓑ{J}Y.X → - ∃∃Z1,Z2,l0. ⦃h, L⦄ ⊢ Y :[l0] Z1 & - ⦃h, L.ⓑ{J}Y⦄ ⊢ X :[l] Z2 & - L ⊢ ⓑ{J}Y.Z2 ⬌* U. -#h #L #T #U #l #H elim H -L -T -U -l -[ #L #k #J #X #Y #H destruct -| #L #K #V #W #U #i #l #_ #_ #_ #_ #J #X #Y #H destruct -| #L #K #W #V #U #i #l #_ #_ #_ #_ #J #X #Y #H destruct -| #I #L #V #W #T #U #l1 #l2 #HVW #HTU #_ #_ #J #X #Y #H destruct /2 width=3/ -| #L #V #W1 #W2 #T #U #l1 #l2 #_ #_ #_ #_ #J #X #Y #H destruct -| #L #V #T #U #W #l #_ #_ #_ #_ #J #X #Y #H destruct -| #L #T #U #W #l1 #l2 #_ #_ #_ #_ #J #X #Y #H destruct -| #L #T #U1 #U2 #V2 #l #_ #HU12 #_ #IHTU1 #_ #J #X #Y #H destruct - elim (IHTU1 ????) -IHTU1 [5: // |2,3,4: skip ] #Z1 #Z2 #l0 #HZ1 #HZ2 #HU1 - lapply (cpcs_trans … HU1 … HU12) -U1 /2 width=3/ -] -qed. - -lemma snta_inv_bind1: ∀h,J,L,Y,X,U,l. ⦃h, L⦄ ⊢ ⓑ{J}Y.X :[l] U → - ∃∃Z1,Z2,l0. ⦃h, L⦄ ⊢ Y :[l0] Z1 & ⦃h, L.ⓑ{J}Y⦄ ⊢ X :[l] Z2 & - L ⊢ ⓑ{J}Y.Z2 ⬌* U. -/2 width=3/ qed-. - -fact snta_inv_cast1_aux: ∀h,L,T,U,l. ⦃h, L⦄ ⊢ T :[l] U → ∀X,Y. T = ⓝY.X → - ⦃h, L⦄ ⊢ X :[l] Y ∧ L ⊢ Y ⬌* U. -#h #L #T #U #l #H elim H -L -T -U -l -[ #L #k #X #Y #H destruct -| #L #K #V #W #U #i #l #_ #_ #_ #_ #X #Y #H destruct -| #L #K #W #V #U #i #l #_ #_ #_ #_ #X #Y #H destruct -| #I #L #V #W #T #U #l1 #l2 #_ #_ #_ #_ #X #Y #H destruct -| #L #V #W1 #W2 #T #U #l1 #l2 #_ #_ #_ #_ #X #Y #H destruct -| #L #V #T #U #W #l #_ #_ #_ #_ #X #Y #H destruct -| #L #T #U #W #l1 #l2 #HTU #_ #_ #_ #X #Y #H destruct /2 width=1/ -| #L #T #U1 #U2 #V2 #l #_ #HU12 #_ #IHTU1 #_ #X #Y #H destruct - elim (IHTU1 ???) -IHTU1 [4: // |2,3: skip ] #HXY #HU1 - lapply (cpcs_trans … HU1 … HU12) -U1 /2 width=1/ -] -qed. - -lemma snta_inv_cast1: ∀h,L,X,Y,U,l. ⦃h, L⦄ ⊢ ⓝY.X :[l] U → - ⦃h, L⦄ ⊢ X :[l] Y ∧ L ⊢ Y ⬌* U. -/2 width=3/ qed-. - -(* Properties on relocation *************************************************) - -lemma snta_lift: ∀h,L1,T1,U1,l. ⦃h, L1⦄ ⊢ T1 :[l] U1 → - ∀L2,d,e. ⇩[d, e] L2 ≡ L1 → - ∀T2. ⇧[d, e] T1 ≡ T2 → ∀U2. ⇧[d, e] U1 ≡ U2 → - ⦃h, L2⦄ ⊢ T2 :[l] U2. -#h #L1 #T1 #U1 #l #H elim H -L1 -T1 -U1 -l -[ #L1 #k #L2 #d #e #HL21 #X1 #H1 #X2 #H2 - >(lift_inv_sort1 … H1) -X1 - >(lift_inv_sort1 … H2) -X2 // -| #L1 #K1 #V1 #W1 #W #i #l #HLK1 #_ #HW1 #IHVW1 #L2 #d #e #HL21 #X #H #U2 #HWU2 - elim (lift_inv_lref1 … H) * #Hid #H destruct - [ elim (lift_trans_ge … HW1 … HWU2 ?) -W // #W2 #HW12 #HWU2 - elim (ldrop_trans_le … HL21 … HLK1 ?) -L1 /2 width=2/ #X #HLK2 #H - elim (ldrop_inv_skip2 … H ?) -H /2 width=1/ -Hid #K2 #V2 #HK21 #HV12 #H destruct - /3 width=8/ - | lapply (lift_trans_be … HW1 … HWU2 ? ?) -W // /2 width=1/ #HW1U2 - lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 // -Hid /3 width=8/ - ] -| #L1 #K1 #W1 #V1 #W #i #l #HLK1 #_ #HW1 #IHWV1 #L2 #d #e #HL21 #X #H #U2 #HWU2 - elim (lift_inv_lref1 … H) * #Hid #H destruct - [ elim (lift_trans_ge … HW1 … HWU2 ?) -W // (tpr_inv_atom1 … H) -H // -| #L1 #K1 #V1 #W #U #i1 #l #HLK1 #_ #HWU #IHV1 #L2 #HL12 #T2 #H #Hl -IH - >(tpr_inv_atom1 … H) -T2 - elim (ltpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #HLK2 #H - elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct /3 width=6/ -| #L1 #K1 #W1 #V1 #U1 #i1 #l #HLK1 #HWV1 #HWU1 #IHWV1 #L2 #HL12 #T2 #H #Hl -IH -(* - >(tpr_inv_atom1 … H) -T2 - elim (ltpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #HLK2 #H - elim (ltpr_inv_pair1 … H) -H #K2 #W2 #HK12 #HW12 #H destruct - lapply (ldrop_fwd_ldrop2 … HLK2) #HLK - elim (lift_total V1 0 (i+1)) #W #HW - lapply (snta_lift h … HLK … HWU1 … HW) /2 width=1/ -HLK -HW - elim (lift_total W2 0 (i+1)) #U2 #HWU2 - lapply (tpr_lift … HW12 … HWU1 … HWU2) -HWU1 #HU12 - @(snta_conv … U2) /2 width=1/ /3 width=6/ (**) (* explicit constructor, /3 width=6/ is too slow *) -*) -| #I #L1 #V1 #W1 #T1 #U1 #l1 #l2 #_ #_ #IHVW1 #IHTU1 #L2 #HL12 #X #H #Hl -IH -(* - elim (tpr_inv_bind1 … H) -H * - [ #V2 #T #T2 #HV12 #HT1 #HT2 #H destruct - lapply (IHVW1 … HL12 … HV12) #HV2W1 - lapply (IHVW1 L2 … V1 ?) // -IHVW1 #HWV1 - lapply (IHTU1 (L2.ⓑ{I}V2) … HT1) -HT1 /2 width=1/ #HTU1 - lapply (IHTU1 (L2.ⓑ{I}V1) ? T1 ?) -IHTU1 // /2 width=1/ -HL12 #H - lapply (tps_lsubs_trans … HT2 (L2.ⓑ{I}V2) ?) -HT2 /2 width=1/ #HT2 - lapply (snta_tps_conf … HTU1 … HT2) -T #HT2U1 - elim (snta_fwd_correct … H) -H #U2 #HU12 - @(snta_conv … (ⓑ{I}V2.U1)) /2 width=2/ /3 width=1/ (**) (* explicit constructor, /4 width=6/ is too slow *) - | #T #HT1 #HTX #H destruct - lapply (IHVW1 … HL12 V1 ?) -IHVW1 // #HVW1 - lapply (IHTU1 (L2.ⓓV1) … HT1) -T1 /2 width=1/ -L1 #H - elim (snta_fwd_correct … H) #T1 #HUT1 - elim (snta_ldrop_conf … H L2 0 1 ? ?) -H // /2 width=1/ #T0 #U0 #HTU0 #H #HU10 - lapply (delift_inv_lift1_eq … H L2 … HTX) -H -HTX /2 width=1/ #H destruct - @(snta_conv … HTU0) /2 width=2/ - ] -*) -| #L1 #V1 #W11 #W2 #T1 #U1 #l1 #l2 #_ #_ #IHVW1 #IHTU1 #L2 #HL12 #X #H #Hl -IH -(* - elim (tpr_inv_appl1 … H) -H * - [ #V2 #Y #HV12 #HY #H destruct - elim (tpr_inv_abst1 … HY) -HY #W2 #T2 #HW12 #HT12 #H destruct - lapply (IHTU1 L2 ? (ⓛW1.T1) ?) // #H - elim (snta_fwd_correct … H) -H #X #H - elim (snta_inv_bind1 … H) -H #W #U #HW #HU #_ - @(snta_conv … (ⓐV2.ⓛW1.U1)) /4 width=2/ (**) (* explicit constructor, /5 width=5/ is too slow *) - | #V2 #W2 #T0 #T2 #HV12 #HT02 #H1 #H2 destruct - lapply (IHVW1 … HL12 … HV12) #HVW2 - lapply (IHVW1 … HL12 V1 ?) -IHVW1 // #HV1W2 - lapply (IHTU1 … HL12 (ⓛW2.T2) ?) -IHTU1 -HL12 /2 width=1/ -HT02 #H1 - elim (snta_fwd_correct … H1) #T #H2 - elim (snta_inv_bind1 … H1) -H1 #W #U2 #HW2 #HTU2 #H - elim (cpcs_inv_abst … H Abst W2) -H #_ #HU21 - elim (snta_inv_bind1 … H2) -H2 #W0 #U0 #_ #H #_ -T -W0 - lapply (lsubsn_snta_trans … HTU2 (L2.ⓓV2) ?) -HTU2 /2 width=1/ #HTU2 - @(snta_conv … (ⓓV2.U2)) /2 width=2/ /3 width=2/ (**) (* explicit constructor, /4 width=5/ is too slow *) - | #V0 #V2 #W0 #W2 #T0 #T2 #_ #_ #_ #_ #H destruct - ] -*) -| #L1 #V1 #T1 #U1 #W1 #l #_ #HUW1 #IHTU1 #_ #L2 #HL12 #X #H #Hl - elim (tpr_inv_appl1 … H) -H * - [ #V2 #T2 #HV12 #HT12 #H destruct - lapply (cpr_tpr … HV12 L2) #HV - elim (snta_fwd_correct h L2 (ⓐV1.T1) (ⓐV1.U1) (l+1) ?) [2: /3 width=6/ ] #U - @(snta_conv … (ⓐV2.U1)) /2 width=1/ -HV12 /4 width=8 by snta_pure, cprs_flat_dx/ (**) (* explicit constructor, /4 width=8/ is too slow without trace *) - | #V2 #W0 #T0 #T2 #HV12 #HT02 #H1 #H2 destruct - lapply (IHTU1 … HL12 (ⓛW0.T2) ? ?) -IHTU1 // /2 width=1/ -T0 #H1 - lapply (IH … (ⓐV2.U1) … HUW1 HL12 ?) // /3 width=1/ #H2 - lapply (snta_pure … H1 H2) -H2 #H - elim (snta_inv_bind1 … H1) -H1 #V0 #U2 #l1 #HWV0 #HTU2 #HU21 - @(snta_conv … (ⓓV2.U2)) (**) (* explicit constructor *) - [2: -(* - @snta_bind /3 width=2/ /3 width=6/ (**) (* /4 width=6/ is a bit slow *) -*) - |3: @(cpcs_cpr_conf … (ⓐV1.ⓛW0.U2)) /2 width=1/ - |4: /2 width=5/ - | skip - ] -(* - elim (snta_fwd_pure1 … H) -H #T1 #W2 #HVW2 #HUT1 #HTW1 - - elim (cpcs_inv_abst1 … HU21) #W3 #U3 #HU13 #H - elim (cprs_inv_abst … H Abst W0) -H #HW03 #_ - elim (pippo … IH … HUW1 ? V2 W3 U3 HL12 ? ?) -IH -HUW1 -HL12 // /3 width=1/ -HU13 #l2 #HV2W3 - lapply (snta_conv h L2 V2 W3 W0 V0 (l1+1) ? ? ?) /2 width=1/ -HV2W3 -HW03 -HWV0 #HV2W0 -*) -(* SEGMENT 1.5 - lapply (IH … HV1 … HL12 … HV12) -HV1 -HV12 /width=5/ #HB - lapply (IH … HB0 … HL12 W2 ?) -HB0 /width=5/ #HB0 - lapply (IH … HA0 … (L2.ⓛW2) … HT02) -IH -HA0 -HT02 /width=5/ -T0 /2 width=1/ -L1 -V1 /4 width=7/ - -axiom pippo: ⦃h, L⦄ ⊢ ⓐV.X : Y → - ∃∃W,T. L ⊢ X ➡* ⓛW.T & ⦃h, L⦄ ⊢ ⓐV : W. - -*) -(* SEGMENT 2 -| #L1 #T1 #U1 #W1 #_ #_ #IHTU1 #IHUW1 #L2 #d #e #HL12 #X #H - elim (tpss_inv_flat1 … H) -H #U2 #T2 #HU12 #HT12 #H destruct - lapply (cpr_tpss … HU12) /4 width=4/ -| #L1 #T1 #U11 #U12 #U #_ #HU112 #_ #IHTU11 #IHU12 #L2 #d #e #HL12 #T2 #HT12 - @(snta_conv … U11) /2 width=5/ (**) (* explicot constructor, /3 width=7/ is too slow *) -] -qed. -*) - -(* SEGMENT 3 -fact snta_ltpr_tpr_conf_aux: ∀h,L,T,L1,T1,U. ⦃h, L1⦄ ⊢ T1 : U → L = L1 → T = T1 → - ∀L2. L1 ➡ L2 → ∀T2. T1 ➡ T2 → ⦃h, L2⦄ ⊢ T2 : U. - - - | #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HW02 #HT02 #HV02 #H1 #H2 destruct - elim (snta_inv_abbr … HT1) -HT1 #B0 #HW0 #HT0 - lapply (IH … HW0 … HL12 … HW02) -HW0 /width=5/ #HW2 - lapply (IH … HV1 … HL12 … HV10) -HV1 -HV10 /width=5/ #HV0 - lapply (IH … HT0 … (L2.ⓓW2) … HT02) -IH -HT0 -HT02 /width=5/ -V1 -T0 /2 width=1/ -L1 -W0 #HT2 - @(snta_abbr … HW2) -HW2 - @(snta_appl … HT2) -HT2 /3 width=7/ (**) (* explict constructors, /5 width=7/ is too slow *) - ] -| #L1 #V1 #T1 #A #HV1 #HT1 #H1 #H2 #L2 #HL12 #X #H destruct - elim (tpr_inv_cast1 … H) -H - [ * #V2 #T2 #HV12 #HT12 #H destruct - lapply (IH … HV1 … HL12 … HV12) -HV1 -HV12 /width=5/ #HV2 - lapply (IH … HT1 … HL12 … HT12) -IH -HT1 -HL12 -HT12 /width=5/ -L1 -V1 -T1 /2 width=1/ - | -HV1 #HT1X - lapply (IH … HT1 … HL12 … HT1X) -IH -HT1 -HL12 -HT1X /width=5/ - ] -] -qed. - -lemma snta_ltpr_tpr_conf: ∀h,L1,T1,U. ⦃h, L1⦄ ⊢ T1 : U → ∀L2. L1 ➡ L2 → - ∀T2. T1 ➡ T2 → ⦃h, L2⦄ ⊢ T2 : U. - -/2 width=9/ qed. - -axiom snta_ltpr_conf: ∀L1,T,A. L1 ⊢ T : A → ∀L2. L1 ➡ L2 → L2 ⊢ T : A. -/2 width=5/ qed. - -axiom snta_tpr_conf: ∀L,T1,A. L ⊢ T1 : A → ∀T2. T1 ➡ T2 → L ⊢ T2 : A. -/2 width=5/ qed. -*) -*)*) \ No newline at end of file diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/snta/snta_ltpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/snta/snta_ltpss.etc deleted file mode 100644 index 0e5f3930e..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/snta/snta_ltpss.etc +++ /dev/null @@ -1,123 +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/equivalence/cpcs_ltpss.ma". -include "basic_2/dynamic/snta_snta.ma". - -(* STRATIFIED NATIVE TYPE ASSIGNMENT ON TERMS *******************************) - -(* Properties about parallel unfold *****************************************) - -lemma snta_ltpss_tpss_conf: ∀h,L1,T1,U,l. ⦃h, L1⦄ ⊢ T1 :[l] U → - ∀L2,d,e. L1 ▶* [d, e] L2 → - ∀T2. L2 ⊢ T1 ▶* [d, e] T2 → ⦃h, L2⦄ ⊢ T2 :[l] U. -#h #L1 #T1 #U #l #H elim H -L1 -T1 -U -l -[ #L1 #k #L2 #d #e #_ #T2 #H - >(tpss_inv_sort1 … H) -H // -| #L1 #K1 #V1 #W #U #i #l #HLK1 #_ #HWU #IHV1 #L2 #d #e #HL12 #T2 #H - elim (tpss_inv_lref1 … H) -H - [ #H destruct - elim (lt_or_ge i d) #Hdi - [ elim (ltpss_ldrop_conf_le … HL12 … HLK1 ?) -L1 /2 width=2/ #X #H #HLK2 - elim (ltpss_inv_tpss11 … H ?) -H /2 width=1/ -Hdi #K2 #V2 #HK12 #HV12 #H destruct - /3 width=7/ - | elim (lt_or_ge i (d + e)) #Hide [ | -Hdi ] - [ elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HLK2 - elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K2 #V2 #HK12 #HV12 #H destruct - /3 width=7/ - | lapply (ltpss_ldrop_conf_ge … HL12 … HLK1 ?) -L1 // -Hide /3 width=7/ - ] - ] - | * #K2 #V2 #W2 #Hdi #Hide #HLK2 #HVW2 #HWT2 - elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HL2K0 - elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K0 #V0 #HK12 #HV12 #H destruct - lapply (ldrop_mono … HL2K0 … HLK2) -HL2K0 #H destruct - lapply (ldrop_fwd_ldrop2 … HLK2) -HLK2 #HLK2 - lapply (tpss_trans_eq … HV12 HVW2) -V2 /3 width=9/ - ] -| #L1 #K1 #W1 #V1 #U1 #i #l #HLK1 #HWV1 #HWU1 #IHWV1 #L2 #d #e #HL12 #T2 #H - elim (tpss_inv_lref1 … H) -H [ | -HWV1 -HWU1 -IHWV1 ] - [ #H destruct - elim (lift_total V1 0 (i+1)) #W #HW - elim (lt_or_ge i d) #Hdi [ -HWV1 ] - [ elim (ltpss_ldrop_conf_le … HL12 … HLK1 ?) -L1 /2 width=2/ #X #H #HLK2 - elim (ltpss_inv_tpss11 … H ?) -H /2 width=1/ -Hdi #K2 #W2 #HK12 #HW12 #H destruct - lapply (ldrop_fwd_ldrop2 … HLK2) #HLK - lapply (snta_lift h … HLK … HWU1 … HW) [ /2 width=4/ | skip ] -HW #H - elim (lift_total W2 0 (i+1)) #U2 #HWU2 - lapply (tpss_lift_ge … HW12 … HLK … HWU1 … HWU2) -HLK -HWU1 // #HU12 - lapply (cpr_tpss … HU12) -HU12 #HU12 - @(snta_conv … U2) // /2 width=1/ /3 width=6/ (**) (* explicit constructor, /4 width=6/ is too slow *) - | elim (lt_or_ge i (d + e)) #Hide [ -HWV1 | -IHWV1 -HW -Hdi ] - [ elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HLK2 - elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K2 #W2 #HK12 #HW12 #H destruct - lapply (ldrop_fwd_ldrop2 … HLK2) #HLK - lapply (snta_lift h … HLK … HWU1 … HW) [ /2 width=4/ | skip ] -HW #H - elim (lift_total W2 0 (i+1)) #U2 #HWU2 - lapply (tpss_lift_ge … HW12 … HLK … HWU1 … HWU2) -HLK -HWU1 // #HU12 - lapply (cpr_tpss … HU12) -HU12 #HU12 - @(snta_conv … U2) // /2 width=1/ /3 width=6/ (**) (* explicit constructor, /4 width=6/ is too slow *) - | lapply (ltpss_ldrop_conf_ge … HL12 … HLK1 ?) -L1 // -Hide /2 width=6/ - ] - ] - | * #K2 #V2 #W2 #Hdi #Hide #HLK2 #_ #_ - elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HL2K0 - elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K0 #V0 #_ #_ #H destruct - lapply (ldrop_mono … HL2K0 … HLK2) -HL2K0 -HLK2 #H destruct - ] -| #I #L1 #V1 #W1 #T1 #U1 #l1 #l2 #_ #_ #IHVW1 #IHTU1 #L2 #d #e #HL12 #X #H - elim (tpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct - lapply (cpr_tpss … HV12) #HV - lapply (IHTU1 (L2.ⓑ{I}V1) (d+1) e ? T1 ?) // /2 width=1/ #H - elim (snta_fwd_correct … H) -H #U2 #HU12 - @(snta_conv … (ⓑ{I}V2.U1)) /3 width=2/ /3 width=4/ /4 width=4/ (**) (* explicit constructor, /5 width=6/ is too slow *) -| #L1 #V1 #W11 #W12 #T1 #U1 #l1 #l2 #_ #_ #IHVW1 #IHTU1 #L2 #d #e #HL12 #X #H - elim (tpss_inv_flat1 … H) -H #V2 #Y #HV12 #HY #H destruct - elim (tpss_inv_bind1 … HY) -HY #W21 #T2 #HW121 #HT12 #H destruct - lapply (cpr_tpss … HV12) #HVV12 - lapply (IHTU1 L2 d e ? (ⓛW21.T2) ?) -IHTU1 // /2 width=1/ -HW121 -HT12 #H0 - elim (snta_fwd_correct … H0) #X #H - elim (snta_inv_bind1 … H) -H #W #U #l0 #HW #HU #_ - @(snta_conv … (ⓐV2.ⓛW12.U1)) /3 width=2/ /3 width=4/ /3 width=5/ (**) (* explicit constructor, /4 width=5/ is too slow *) -| #L1 #V1 #T1 #U1 #W1 #l #_ #_ #IHTU1 #IHUW1 #L2 #d #e #HL12 #X #H - elim (tpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct - lapply (cpr_tpss … HV12) #HV - elim (snta_fwd_correct h L2 (ⓐV1.T1) (ⓐV1.U1) (l+1) ?) [2: /3 width=4/ ] #U - @(snta_conv … (ⓐV2.U1)) /3 width=1/ /4 width=5/ (**) (* explicit constructor, /5 width=5/ is too slow *) -| #L1 #T1 #U1 #W1 #l1 #l2 #HTU1 #HUW1 #IHTU1 #IHUW1 #L2 #d #e #HL12 #X #H - elim (snta_fwd_correct … HTU1) -HTU1 #U #H - elim (snta_mono … HUW1 … H) -HUW1 -H #H #_ -U destruct - elim (tpss_inv_flat1 … H) -H #U2 #T2 #HU12 #HT12 #H destruct - lapply (cpr_tpss … HU12) #HU /4 width=4/ -| #L1 #T1 #U11 #U12 #U #l #_ #HU112 #_ #IHTU11 #IHU12 #L2 #d #e #HL12 #T2 #HT12 - @(snta_conv … U11) /2 width=5/ (**) (* explicit constructor, /3 width=7/ is too slow *) -] -qed. - -lemma snta_ltpss_tps_conf: ∀h,L1,T1,U,l. ⦃h, L1⦄ ⊢ T1 :[l] U → - ∀L2,d,e. L1 ▶* [d, e] L2 → - ∀T2. L2 ⊢ T1 ▶ [d, e] T2 → ⦃h, L2⦄ ⊢ T2 :[l] U. -/3 width=7/ qed. - -lemma snta_ltpss_conf: ∀h,L1,T,U,l. ⦃h, L1⦄ ⊢ T :[l] U → - ∀L2,d,e. L1 ▶* [d, e] L2 → ⦃h, L2⦄ ⊢ T :[l] U. -/2 width=7/ qed. - -lemma snta_tpss_conf: ∀h,L,T1,U,l. ⦃h, L⦄ ⊢ T1 :[l] U → - ∀T2,d,e. L ⊢ T1 ▶* [d, e] T2 → ⦃h, L⦄ ⊢ T2 :[l] U. -/2 width=7/ qed. - -lemma snta_tps_conf: ∀h,L,T1,U,l. ⦃h, L⦄ ⊢ T1 :[l] U → - ∀T2,d,e. L ⊢ T1 ▶ [d, e] T2 → ⦃h, L⦄ ⊢ T2 :[l] U. -/2 width=7/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/snta/snta_snta.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/snta/snta_snta.etc deleted file mode 100644 index db71e1192..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/snta/snta_snta.etc +++ /dev/null @@ -1,65 +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/dynamic/snta_lift.ma". - -(* STRATIFIED NATIVE TYPE ASSIGNMENT ON TERMS *******************************) - -(* Main properties **********************************************************) - -theorem snta_mono: ∀h,L,T,U1,l1. ⦃h, L⦄ ⊢ T :[l1] U1 → - ∀U2,l2. ⦃h, L⦄ ⊢ T :[l2] U2 → l1 = l2 ∧ L ⊢ U1 ⬌* U2. -#h #L #T #U1 #l1 #H elim H -L -T -U1 -l1 -[ #L #k #X #l2 #H - lapply (snta_inv_sort1 … H) -H * /2 width=1/ -| #L #K #V #W11 #W12 #i #l1 #HLK #_ #HW112 #IHVW11 #X #l2 #H - elim (snta_inv_lref1 … H) -H * #K0 #V0 #W21 #W22 #HLK0 #HVW21 #HW212 #HX - lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct - lapply (ldrop_fwd_ldrop2 … HLK) -HLK #HLK - elim (IHVW11 … HVW21) -IHVW11 -HVW21 #Hl12 #HW121 - lapply (cpcs_lift … HLK … HW112 … HW212 ?) // -K -W11 -W21 /3 width=3/ -| #L #K #W #V1 #V #i #l1 #HLK #_ #HWV #IHWV1 #X #l2 #H - elim (snta_inv_lref1 … H) -H * #K0 #W0 #V2 #V0 #HLK0 #HW0V2 #HWV0 [2: #HL2 ] #HX - lapply (ldrop_mono … HLK0 … HLK) -HLK0 -HLK #H destruct - lapply (lift_mono … HWV0 … HWV) -HWV0 -HWV #H destruct - elim (IHWV1 … HW0V2) -IHWV1 -HW0V2 /3 width=1/ -| #I #L #V #W1 #T #U1 #l10 #l1 #_ #_ #_ #IHTU1 #X #l2 #H - elim (snta_inv_bind1 … H) -H #W2 #U2 #l20 #_ #HTU2 #H - elim (IHTU1 … HTU2) -IHTU1 -HTU2 #Hl12 #HU12 - lapply (cpcs_trans … (ⓑ{I}V.U1) … H) -H /2 width=1/ -| #L #V #W #W1 #T #U1 #l10 #l1 #_ #_ #_ #IHTU1 #X #l2 #H - elim (snta_fwd_pure1 … H) -H #U2 #W2 #l20 #_ #HTU2 #H - elim (IHTU1 … HTU2) -IHTU1 -HTU2 #Hl12 #HU12 - lapply (cpcs_trans … (ⓐV.ⓛW1.U1) … H) -H /2 width=1/ -| #L #V #T #U1 #W1 #l1 #_ #_ #IHTU1 #_ #X #l2 #H - elim (snta_fwd_pure1 … H) -H #U2 #W2 #l20 #_ #HTU2 #H - elim (IHTU1 … HTU2) -IHTU1 -HTU2 #Hl12 #HU12 - lapply (cpcs_trans … (ⓐV.U1) … H) -H /2 width=1/ -| #L #T #U1 #W1 #l10 #l1 #_ #_ #IHTU1 #_ #X #l2 #H - elim (snta_inv_cast1 … H) -H #HTU1 - elim (IHTU1 … HTU1) -IHTU1 -HTU1 /2 width=1/ -| #L #T #U11 #U12 #V12 #l1 #_ #HU112 #_ #IHTU11 #_ #U2 #l2 #HTU2 - elim (IHTU11 … HTU2) -IHTU11 -HTU2 #Hl12 #H - lapply (cpcs_canc_sn … HU112 … H) -U11 /2 width=1/ -] -qed-. - -(* Advanced properties ******************************************************) - -lemma snta_cast_alt: ∀h,L,T,W,U,l. ⦃h, L⦄ ⊢ T :[l] W → ⦃h, L⦄ ⊢ T :[l] U → - ⦃h, L⦄ ⊢ ⓝW.T :[l] U. -#h #L #T #W #U #l #HTW #HTU -elim (snta_mono … HTW … HTU) #_ #HWU -elim (snta_fwd_correct … HTU) -HTU /3 width=3/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/snta/snta_thin.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/snta/snta_thin.etc deleted file mode 100644 index ceb5375bf..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/snta/snta_thin.etc +++ /dev/null @@ -1,116 +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/unfold/thin_ldrop.ma". -include "basic_2/equivalence/cpcs_delift.ma". -include "basic_2/dynamic/snta_lift.ma". - -(* STRATIFIED NATIVE TYPE ASSIGNMENT ON TERMS *******************************) - -(* Properties on basic local environment thinning ***************************) - -(* Note: this is known as the substitution lemma *) -lemma snta_thin_conf: ∀h,L1,T1,U1,l. ⦃h, L1⦄ ⊢ T1 :[l] U1 → - ∀L2,d,e. ≽ [d, e] L1 → L1 ▼*[d, e] ≡ L2 → - ∃∃T2,U2. ⦃h, L2⦄ ⊢ T2 :[l] U2 & - L1 ⊢ T1 ▼*[d, e] ≡ T2 & L1 ⊢ U1 ▼*[d, e] ≡ U2. -#h #L1 #T1 #U1 #l #H elim H -L1 -T1 -U1 -l -[ /2 width=5/ -| #L1 #K1 #V1 #W1 #U1 #i #l #HLK1 #HVW1 #HWU1 #IHVW1 #L2 #d #e #HL1 #HL12 - elim (lt_or_ge i d) #Hdi [ -HVW1 ] - [ lapply (sfr_ldrop_trans_ge … HLK1 … HL1 ?) -HL1 /2 width=2/ #H - lapply (sfr_inv_skip … H ?) -H /2 width=1/ #HK1 - elim (thin_ldrop_conf_le … HL12 … HLK1 ?) -HL12 /2 width=2/ #X #H #HLK2 - elim (thin_inv_delift1 … H ?) -H /2 width=1/ #K2 #V2 #HK12 #HV12 #H destruct - elim (IHVW1 … HK1 HK12) -IHVW1 -HK1 -HK12 #X2 #W2 #HVW2 #H #HW12 - lapply (delift_mono … H … HV12) -H -HV12 #H destruct - elim (lift_total W2 0 (i+1)) #U2 #HWU2 - lapply (ldrop_fwd_ldrop2 … HLK1) -V1 #HLK1 - lapply (delift_lift_ge … HW12 … HLK1 HWU1 … HWU2) -HW12 -HLK1 -HWU1 // - >minus_plus minus_plus #HU1 - lapply (lift_conf_be … HWU2 … HW2U ?) -W2 /2 width=1/ #HU2 - lapply (delift_lift_div_be … HU1 … HU2 ? ?) -U // /2 width=1/ /3 width=8/ - | lapply (transitive_le … (i+1) Hide ?) /2 width=1/ #Hdei - lapply (thin_ldrop_conf_ge … HL12 … HLK1 ?) -HL12 -HLK1 // #HL2K1 - elim (lift_split … HWU1 d (i+1-e) ? ? ?) -HWU1 // /2 width=1/ #W - commutative_plus minus_plus commutative_plus ≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → - ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] → - ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ T2 ¡[h, g]. -/3 width=6 by lpr_lpx, cpr_cpx/ qed-. - -fact snv_sta_aux: ∀h,g,G0,L0,T0. - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → - ∀G,L,T. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L, T⦄ → ⦃G, L⦄ ⊢ T ¡[h, g] → - ∀l. ⦃G, L⦄ ⊢ T ▪[h, g] l+1 → - ∀U. ⦃G, L⦄ ⊢ T •[h] U → ⦃G, L⦄ ⊢ U ¡[h, g]. -/3 width=6 by sta_cpx/ qed-. - -fact snv_cpxs_lpx_aux: ∀h,g,G0,L0,T0. - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → - ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] → - ∀T2. ⦃G, L1⦄ ⊢ T1 ➡*[h, g] T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → ⦃G, L2⦄ ⊢ T2 ¡[h, g]. -#h #g #G0 #L0 #T0 #IH #G #L1 #T1 #HLT0 #HT1 #T2 #H -@(cpxs_ind … H) -T2 /4 width=6 by fpbg_fpbs_trans, cpxs_fpbs/ -qed-. - -fact snv_cprs_lpr_aux: ∀h,g,G0,L0,T0. - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → - ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] → - ∀T2. ⦃G, L1⦄ ⊢ T1 ➡* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ T2 ¡[h, g]. -/3 width=10 by snv_cpxs_lpx_aux, cprs_cpxs, lpr_lpx/ qed-. - -fact snv_lstas_aux: ∀h,g,G0,L0,T0. - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → - ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] → - ∀l1,l2. l2 ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 → - ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, l2] U1 → ⦃G, L1⦄ ⊢ U1 ¡[h, g]. -/3 width=12 by snv_cpxs_lpx_aux, lstas_cpxs/ qed-. - -fact da_cprs_lpr_aux: ∀h,g,G0,L0,T0. - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) → - ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] → - ∀l. ⦃G, L1⦄ ⊢ T1 ▪[h, g] l → - ∀T2. ⦃G, L1⦄ ⊢ T1 ➡* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ T2 ▪[h, g] l. -#h #g #G0 #L0 #T0 #IH2 #IH1 #G #L1 #T1 #HLT0 #HT1 #l #Hl #T2 #H -@(cprs_ind … H) -T2 /4 width=10 by snv_cprs_lpr_aux, fpbg_fpbs_trans, cprs_fpbs/ -qed-. - -fact da_cpcs_aux: ∀h,g,G0,L0,T0. - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) → - ∀G,L,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L, T1⦄ → ⦃G, L⦄ ⊢ T1 ¡[h, g] → - ∀T2. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L, T2⦄ → ⦃G, L⦄ ⊢ T2 ¡[h, g] → - ∀l1. ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 → ∀l2. ⦃G, L⦄ ⊢ T2 ▪[h, g] l2 → - ⦃G, L⦄ ⊢ T1 ⬌* T2 → l1 = l2. -#h #g #G0 #L0 #T0 #IH2 #IH1 #G #L #T1 #HLT01 #HT1 #T2 #HLT02 #HT2 #l1 #Hl1 #l2 #Hl2 #H -elim (cpcs_inv_cprs … H) -H /4 width=18 by da_cprs_lpr_aux, da_mono/ -qed-. - -fact sta_cpr_lpr_aux: ∀h,g,G0,L0,T0. - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) → - ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] → - ∀l. ⦃G, L1⦄ ⊢ T1 ▪[h, g] l+1 → - ∀U1. ⦃G, L1⦄ ⊢ T1 •[h] U1 → - ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → - ∃∃U2. ⦃G, L2⦄ ⊢ T2 •[h] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2. -#h #g #G0 #L0 #T0 #IH #G #L1 #T1 #H01 #HT1 #l #Hl #U1 #HTU1 #T2 #HT12 #L2 #HL12 -elim (IH … H01 … 1 … Hl U1 … HT12 … HL12) -H01 -Hl -HT12 -HL12 -/3 width=3 by lstas_inv_SO, sta_lstas, ex2_intro/ -qed-. - -fact lstas_cprs_lpr_aux: ∀h,g,G0,L0,T0. - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) → - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) → - ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] → - ∀l1,l2. l2 ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 → - ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, l2] U1 → - ∀T2. ⦃G, L1⦄ ⊢ T1 ➡* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → - ∃∃U2. ⦃G, L2⦄ ⊢ T2 •*[h, l2] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2. -#h #g #G0 #L0 #T0 #IH3 #IH2 #IH1 #G #L1 #T1 #H01 #HT1 #l1 #l2 #Hl21 #Hl1 #U1 #HTU1 #T2 #H -@(cprs_ind … H) -T2 [ /2 width=10 by/ ] -#T #T2 #HT1T #HTT2 #IHT1 #L2 #HL12 -elim (IHT1 L1) // -IHT1 #U #HTU #HU1 -elim (IH1 … Hl21 … HTU … HTT2 … HL12) -IH1 -HTU -HTT2 -[2: /3 width=12 by da_cprs_lpr_aux/ -|3: /3 width=10 by snv_cprs_lpr_aux/ -|4: /3 width=5 by fpbg_fpbs_trans, cprs_fpbs/ -] -G0 -L0 -T0 -T1 -T -l1 -/4 width=5 by lpr_cpcs_conf, cpcs_trans, ex2_intro/ -qed-. - -fact lstas_cpcs_lpr_aux: ∀h,g,G0,L0,T0. - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) → - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) → - ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] → - ∀l,l1. l ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 → ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, l] U1 → - ∀T2. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T2⦄ → ⦃G, L1⦄ ⊢ T2 ¡[h, g] → - ∀l2. l ≤ l2 → ⦃G, L1⦄ ⊢ T2 ▪[h, g] l2 → ∀U2. ⦃G, L1⦄ ⊢ T2 •*[h, l] U2 → - ⦃G, L1⦄ ⊢ T1 ⬌* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ U1 ⬌* U2. -#h #g #G0 #L0 #T0 #IH3 #IH2 #IH1 #G #L1 #T1 #H01 #HT1 #l #l1 #Hl1 #HTl1 #U1 #HTU1 #T2 #H02 #HT2 #l2 #Hl2 #HTl2 #U2 #HTU2 #H #L2 #HL12 -elim (cpcs_inv_cprs … H) -H #T #H1 #H2 -elim (lstas_cprs_lpr_aux … H01 HT1 … Hl1 HTl1 … HTU1 … H1 … HL12) -T1 /2 width=1 by/ #W1 #H1 #HUW1 -elim (lstas_cprs_lpr_aux … H02 HT2 … Hl2 HTl2 … HTU2 … H2 … HL12) -T2 /2 width=1 by/ #W2 #H2 #HUW2 -L0 -T0 -lapply (lstas_mono … H1 … H2) -h -T -l #H destruct /2 width=3 by cpcs_canc_dx/ -qed-. - -fact lstas_cpds_aux: ∀h,g,G0,L0,T0. - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) → - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) → - ∀G,L,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L, T1⦄ → ⦃G, L⦄ ⊢ T1 ¡[h, g] → - ∀l1,l2. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 → - ∀U1. ⦃G, L⦄ ⊢ T1 •*[h, l2] U1 → ∀T2. ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2 → - ∃∃U2,l. l ≤ l2 & ⦃G, L⦄ ⊢ T2 •*[h, l] U2 & ⦃G, L⦄ ⊢ U1 •*⬌*[h, g] U2. -#h #g #G0 #L0 #T0 #IH3 #IH2 #IH1 #G #L #T1 #H01 #HT1 #l1 #l2 #Hl21 #Hl1 #U1 #HTU1 #T2 * #T #l0 #l #Hl0 #H #HT1T #HTT2 -lapply (da_mono … H … Hl1) -H #H destruct -lapply (lstas_da_conf … HTU1 … Hl1) #Hl12 -elim (le_or_ge l2 l) #Hl2 -[ lapply (lstas_conf_le … HTU1 … HT1T) -HT1T - /5 width=11 by cpds_cpes_dx, monotonic_le_minus_l, ex3_2_intro, ex4_3_intro/ -| lapply (lstas_da_conf … HT1T … Hl1) #Hl1l - lapply (lstas_conf_le … HT1T … HTU1) -HTU1 // #HTU1 - elim (lstas_cprs_lpr_aux … IH3 IH2 IH1 … Hl1l … HTU1 … HTT2 L) -IH2 -IH1 -Hl1l -HTU1 -HTT2 - /3 width=12 by snv_lstas_aux, cpcs_cpes, fpbg_fpbs_trans, lstas_fpbs, monotonic_le_minus_l, ex3_2_intro/ -] -qed-. - -fact cpds_cpr_lpr_aux: ∀h,g,G0,L0,T0. - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) → - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) → - ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] → - ∀U1. ⦃G, L1⦄ ⊢ T1 •*➡*[h, g] U1 → - ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → - ∃∃U2. ⦃G, L2⦄ ⊢ T2 •*➡*[h, g] U2 & ⦃G, L2⦄ ⊢ U1 ➡* U2. -#h #g #G0 #L0 #T0 #IH2 #IH1 #G #L1 #T1 #H01 #HT1 #U1 * #W1 #l1 #l2 #Hl21 #Hl1 #HTW1 #HWU1 #T2 #HT12 #L2 #HL12 -elim (IH1 … H01 … HTW1 … HT12 … HL12) -IH1 // #W2 #HTW2 #HW12 -lapply (IH2 … H01 … Hl1 … HT12 … HL12) -L0 -T0 // -T1 -lapply (lpr_cprs_conf … HL12 … HWU1) -L1 #HWU1 -lapply (cpcs_canc_sn … HW12 HWU1) -W1 #H -elim (cpcs_inv_cprs … H) -H /3 width=7 by ex4_3_intro, ex2_intro/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/snv/snv_da_lpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/snv/snv_da_lpr.etc deleted file mode 100644 index 119a40243..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/snv/snv_da_lpr.etc +++ /dev/null @@ -1,93 +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/static/lsubd_da.ma". -include "basic_2/computation/cpds_cpds.ma". -include "basic_2/dynamic/snv_aaa.ma". -include "basic_2/dynamic/snv_cpcs.ma". - -(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************) - -(* Properties on degree assignment for terms ********************************) - -fact da_cpr_lpr_aux: ∀h,g,G0,L0,T0. - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) → - ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_da_cpr_lpr h g G1 L1 T1. -#h #g #G0 #L0 #T0 #IH2 #IH1 #G1 #L1 * * [|||| * ] -[ #k #_ #_ #_ #_ #l #H2 #X3 #H3 #L2 #_ -IH2 -IH1 - lapply (da_inv_sort … H2) -H2 - lapply (cpr_inv_sort1 … H3) -H3 #H destruct /2 width=1 by da_sort/ -| #i #HG0 #HL0 #HT0 #H1 #l #H2 #X3 #H3 #L2 #HL12 destruct -IH2 - elim (snv_inv_lref … H1) -H1 #I0 #K0 #X0 #H #HX0 - elim (da_inv_lref … H2) -H2 * #K1 [ #V1 | #W1 #l1 ] #HLK1 [ #HV1 | #HW1 #H ] destruct - lapply (ldrop_mono … H … HLK1) -H #H destruct - elim (cpr_inv_lref1 … H3) -H3 - [1,3: #H destruct - lapply (fqup_lref … G1 … HLK1) - elim (lpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #H #HLK2 - elim (lpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct - /4 width=10 by da_ldef, da_ldec, fqup_fpbg/ - |2,4: * #K0 #V0 #W0 #H #HVW0 #HW0 - lapply (ldrop_mono … H … HLK1) -H #H destruct - lapply (fqup_lref … G1 … HLK1) - elim (lpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #H #HLK2 - elim (lpr_inv_pair1 … H) -H #K2 #V2 #HK12 #_ #H destruct - lapply (ldrop_fwd_drop2 … HLK2) -V2 - /4 width=8 by da_lift, fqup_fpbg/ - ] -| #p #_ #_ #HT0 #H1 destruct -IH2 -IH1 - elim (snv_inv_gref … H1) -| #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #l #H2 #X3 #H3 #L2 #HL12 destruct -IH2 - elim (snv_inv_bind … H1) -H1 #_ #HT1 - lapply (da_inv_bind … H2) -H2 - elim (cpr_inv_bind1 … H3) -H3 * - [ #V2 #T2 #HV12 #HT12 #H destruct - /4 width=9 by da_bind, fqup_fpbg, lpr_pair/ - | #T2 #HT12 #HT2 #H1 #H2 destruct - /4 width=11 by da_inv_lift, fqup_fpbg, lpr_pair, ldrop_drop/ - ] -| #V1 #T1 #HG0 #HL0 #HT0 #H1 #l #H2 #X3 #H3 #L2 #HL12 destruct - elim (snv_inv_appl … H1) -H1 #b0 #W1 #W0 #T0 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HT10 - lapply (da_inv_flat … H2) -H2 #Hl - elim (cpr_inv_appl1 … H3) -H3 * - [ #V2 #T2 #HV12 #HT12 #H destruct -IH2 /4 width=7 by da_flat, fqup_fpbg/ - | #b #V2 #W #W2 #U1 #U2 #HV12 #HW2 #HU12 #H1 #H2 destruct - elim (snv_inv_bind … HT1) -HT1 #HW #HU1 - lapply (da_inv_bind … Hl) -Hl #Hl - elim (cpds_inv_abst1 … HT10) -HT10 #W3 #U3 #HW3 #_ #H destruct -U3 - lapply (cprs_div … HW3 … HW10) -W3 #HWW1 - lapply (da_sta_conf … HVW1 … Hl0) ≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) → - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) → - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → - ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_snv_cpx_lpx h g G1 L1 T1. -#h #g #G0 #L0 #T0 #IH3 #IH2 #IH1 #G1 #L1 * * [|||| * ] -[ #k #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #_ destruct -IH3 -IH2 -IH1 -H1 - elim (cpx_inv_sort1 … H2) -H2 // * // -| #i #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #HL12 destruct -IH3 -IH2 - elim (snv_inv_lref … H1) -H1 #I #K1 #V1 #HLK1 #HV1 - elim (lpx_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2 - elim (lpx_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct - lapply (fqup_lref … G1 … HLK1) #HKL - elim (cpx_inv_lref1 … H2) -H2 - [ #H destruct -HLK1 /4 width=10 by fqup_fpbg, snv_lref/ - | * #I0 #K0 #V0 #W0 #H #HVW0 #W0 -HV12 - lapply (ldrop_mono … H … HLK1) -HLK1 -H #H destruct - lapply (ldrop_fwd_drop2 … HLK2) -HLK2 /4 width=8 by fqup_fpbg, snv_lift/ - ] -| #p #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #HL12 destruct -IH3 -IH2 -IH1 - elim (snv_inv_gref … H1) -| #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #HL12 destruct -IH3 -IH2 - elim (snv_inv_bind … H1) -H1 #HV1 #HT1 - elim (cpx_inv_bind1 … H2) -H2 * - [ #V2 #T2 #HV12 #HT12 #H destruct /4 width=8 by fqup_fpbg, snv_bind, lpx_pair/ - | #T2 #HT12 #HXT2 #H1 #H2 destruct -HV1 - /4 width=10 by fqup_fpbg, snv_inv_lift, lpx_pair, ldrop_drop/ - ] -| #V1 #T1 #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #HL12 destruct - elim (snv_inv_appl … H1) -H1 #a #W10 #W1 #U1 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HTU1 - elim (cpx_inv_appl1 … H2) -H2 * - [ #V2 #T2 #HV12 #HT12 #H destruct - lapply (IH1 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #HV2 - lapply (IH1 … HT12 … HL12) /2 width=1 by fqup_fpbg/ #HT2 -(* lapply (IH2 … Hl0 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #H2l0 - elim (sta_cpr_lpr_aux … IH3 … Hl0 … HVW1 … HV12 … HL12) -Hl0 -HVW1 -HV12 /2 width=1 by fqup_fpbg/ -HV1 #W2 #HVW2 #HW12 - elim (cpds_cpr_lpr_aux … IH2 IH3 … HTU1 … HT12 … HL12) /2 width=1 by fqup_fpbg/ -HT12 -HTU1 #X #HTU2 #H - elim (cprs_inv_abst1 … H) -H #W20 #U2 #HW120 #_ #H destruct - lapply (lpr_cprs_conf … HL12 … HW10) -L1 #HW10 - lapply (cpcs_cprs_strap1 … HW10 … HW120) -W1 #HW120 - lapply (cpcs_canc_sn … HW12 HW120) -W10 #HW20 - elim (cpcs_inv_cprs … HW20) -HW20 #W0 #HW20 #HW200 - lapply (cpds_cprs_trans … (ⓛ{a}W0.U2) HTU2 ?) - /2 width=7 by snv_appl, cprs_bind/ *) - | #b #V2 #W20 #W2 #T20 #T2 #HV12 #HW202 #HT202 #H1 #H2 destruct - elim (snv_inv_bind … HT1) -HT1 #HW20 #HT20 - elim (cpds_inv_abst1 … HTU1) -HTU1 #W30 #T30 #HW230 #_ #H destruct -T30 - lapply (cprs_div … HW10 … HW230) -W30 #HW120 - lapply (snv_sta_aux … IH1 … Hl0 … HVW1) /2 width=1 by fqup_fpbg/ #HW10 - lapply (da_sta_conf … HVW1 … Hl0) ≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) → - (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) → - ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_lstas_cpr_lpr h g G1 L1 T1. -#h #g #G0 #L0 #T0 #IH3 #IH2 #IH1 #G1 #L1 * * [|||| * ] -[ #k #_ #_ #_ #_ #l1 #l2 #_ #_ #X2 #H2 #X3 #H3 #L2 #_ -IH3 -IH2 -IH1 - >(lstas_inv_sort1 … H2) -X2 - >(cpr_inv_sort1 … H3) -X3 /2 width=3 by ex2_intro/ -| #i #HG0 #HL0 #HT0 #H1 #l1 #l2 @(nat_ind_plus … l2) -l2 [ #_ | #l2 #_ #Hl21 ] #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct -IH3 - [ lapply (lstas_inv_O … H2) -H2 #H destruct -IH1 -H1 -l1 /4 width=5 by lpr_cpcs_conf, cpr_cpcs_dx, ex2_intro/ ] - elim (snv_inv_lref … H1) -H1 #I0 #K0 #X0 #HK0 #HX0 - elim (da_inv_lref … Hl1) -Hl1 * #K1 [ #V1 | #W1 #l0 ] #HLK1 [ #HVl1 | #HWl1 #H destruct ] - lapply (ldrop_mono … HK0 … HLK1) -HK0 #H destruct - elim (lstas_inv_lref1 … H2) -H2 * #K0 #V0 #W0 [2,4: #X0 ] #HK0 [1,2: #_ -X0 ] #HVW0 #HX2 - lapply (ldrop_mono … HK0 … HLK1) -HK0 #H destruct - [ lapply (le_plus_to_le_r … Hl21) -Hl21 #Hl21 ] - lapply (fqup_lref … G1 … HLK1) #HKV1 - elim (lpr_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2 - elim (lpr_inv_pair1 … H) -H #K2 [ #W2 | #V2 ] #HK12 [ #HW12 | #HV12 ] #H destruct - lapply (ldrop_fwd_drop2 … HLK2) #H2 - elim (cpr_inv_lref1 … H3) -H3 - [1,3: #H destruct -HLK1 - |2,4: * #K0 #V0 #X0 #H #HVX0 #HX0 - lapply (ldrop_mono … H … HLK1) -H -HLK1 #H destruct - ] - [ lapply (IH2 … HWl1 … HW12 … HK12) /2 width=1 by fqup_fpbg/ -IH2 #H - elim (da_inv_sta … H) -H - elim (IH1 … HWl1 … HVW0 … HW12 … HK12) -IH1 -HVW0 /2 width=1 by fqup_fpbg/ #V2 #HWV2 #HV2 - elim (lift_total V2 0 (i+1)) - /3 width=12 by cpcs_lift, lstas_ldec, ex2_intro/ - | elim (IH1 … HVl1 … HVW0 … HV12 … HK12) -IH1 -HVl1 -HVW0 -HV12 -HK12 -IH2 /2 width=1 by fqup_fpbg/ #W2 #HVW2 #HW02 - elim (lift_total W2 0 (i+1)) - /4 width=12 by cpcs_lift, lstas_ldef, ex2_intro/ - | elim (IH1 … HVl1 … HVW0 … HVX0 … HK12) -IH1 -HVl1 -HVW0 -HVX0 -HK12 -IH2 -V2 /2 width=1 by fqup_fpbg/ -l1 #W2 #HXW2 #HW02 - elim (lift_total W2 0 (i+1)) - /3 width=12 by cpcs_lift, lstas_lift, ex2_intro/ - ] -| #p #_ #_ #HT0 #H1 destruct -IH3 -IH2 -IH1 - elim (snv_inv_gref … H1) -| #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct -IH3 -IH2 - elim (snv_inv_bind … H1) -H1 #_ #HT1 - lapply (da_inv_bind … Hl1) -Hl1 #Hl1 - elim (lstas_inv_bind1 … H2) -H2 #U1 #HTU1 #H destruct - elim (cpr_inv_bind1 … H3) -H3 * - [ #V2 #T2 #HV12 #HT12 #H destruct - elim (IH1 … Hl1 … HTU1 … HT12 (L2.ⓑ{I}V2)) -IH1 -Hl1 -HTU1 -HT12 /2 width=1 by fqup_fpbg, lpr_pair/ -T1 - /4 width=5 by cpcs_bind2, lpr_cpr_conf, lstas_bind, ex2_intro/ - | #T3 #HT13 #HXT3 #H1 #H2 destruct - elim (IH1 … Hl1 … HTU1 … HT13 (L2.ⓓV1)) -IH1 -Hl1 -HTU1 -HT13 /2 width=1 by fqup_fpbg, lpr_pair/ -T1 -HL12 #U3 #HTU3 #HU13 - elim (lstas_inv_lift1 … HTU3 L2 … HXT3) -T3 - /5 width=8 by cpcs_cpr_strap1, cpcs_bind1, cpr_zeta, ldrop_drop, ex2_intro/ - ] -| #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct - elim (snv_inv_appl … H1) -H1 #a #W1 #W10 #U10 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HTU10 - lapply (da_inv_flat … Hl1) -Hl1 #Hl1 - elim (lstas_inv_appl1 … H2) -H2 #U1 #HTU1 #H destruct - elim (cpr_inv_appl1 … H3) -H3 * - [ #V2 #T2 #HV12 #HT12 #H destruct -a -l0 -W1 -W10 -U10 -HV1 -IH3 -IH2 - elim (IH1 … Hl1 … HTU1 … HT12 … HL12) -IH1 -Hl1 -HTU1 - /4 width=5 by fqup_fpbg, cpcs_flat, lpr_cpr_conf, lstas_appl, ex2_intro/ - | #b #V2 #W2 #W3 #T2 #T3 #HV12 #HW23 #HT23 #H1 #H2 destruct - elim (snv_inv_bind … HT1) -HT1 #HW2 #HT2 - lapply (da_inv_bind … Hl1) -Hl1 #Hl1 - elim (lstas_inv_bind1 … HTU1) -HTU1 #U2 #HTU2 #H destruct - elim (cpds_inv_abst1 … HTU10) -HTU10 #W0 #U0 #HW20 #_ #H destruct - lapply (cprs_div … HW10 … HW20) -W0 #HW12 - lapply (da_sta_conf … HVW1 … Hl0) iter_SO // -qed-. - -lemma lstas_inv_gref1: ∀h,G,L,X,p,l. ⦃G, L⦄ ⊢ §p •*[h, l+1] X → ⊥. -#h #G #L #X #p #l #H elim (lstas_inv_step_sn … H) -H -#U #H #HUX elim (sta_inv_gref1 … H) -qed-. - -lemma lstas_inv_bind1: ∀h,a,I,G,L,V,T,X,l. ⦃G, L⦄ ⊢ ⓑ{a,I}V.T •*[h, l] X → - ∃∃U. ⦃G, L.ⓑ{I}V⦄ ⊢ T •*[h, l] U & X = ⓑ{a,I}V.U. -#h #a #I #G #L #V #T #X #l #H @(lstas_ind_dx … H) -X -l /2 width=3 by ex2_intro/ -#l #X #X0 #_ #HX0 * #U #HTU #H destruct -elim (sta_inv_bind1 … HX0) -HX0 #U0 #HU0 #H destruct /3 width=3 by lstar_dx, ex2_intro/ -qed-. - -lemma lstas_inv_appl1: ∀h,G,L,V,T,X,l. ⦃G, L⦄ ⊢ ⓐV.T •*[h, l] X → - ∃∃U. ⦃G, L⦄ ⊢ T •*[h, l] U & X = ⓐV.U. -#h #G #L #V #T #X #l #H @(lstas_ind_dx … H) -X -l /2 width=3 by ex2_intro/ -#l #X #X0 #_ #HX0 * #U #HTU #H destruct -elim (sta_inv_appl1 … HX0) -HX0 #U0 #HU0 #H destruct /3 width=3 by lstar_dx, ex2_intro/ -qed-. - -lemma lstas_inv_cast1: ∀h,G,L,W,T,U,l. ⦃G, L⦄ ⊢ ⓝW.T •*[h, l+1] U → ⦃G, L⦄ ⊢ T •*[h, l+1] U. -#h #G #L #W #T #X #l #H elim (lstas_inv_step_sn … H) -H -#U #H #HUX lapply (sta_inv_cast1 … H) -H /2 width=3 by lstar_S/ -qed-. - -(* Basic properties *********************************************************) - -lemma lstas_refl: ∀h,G,L. reflexive … (lstas h G L 0). -// qed. - -lemma sta_lstas: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ⦃G, L⦄ ⊢ T •*[h, 1] U. -/2 width=1 by lstar_step/ qed. - -lemma lstas_step_sn: ∀h,G,L,T1,U1,U2,l. ⦃G, L⦄ ⊢ T1 •[h] U1 → ⦃G, L⦄ ⊢ U1 •*[h, l] U2 → - ⦃G, L⦄ ⊢ T1 •*[h, l+1] U2. -/2 width=3 by lstar_S/ qed. - -lemma lstas_step_dx: ∀h,G,L,T1,T2,U2,l. ⦃G, L⦄ ⊢ T1 •*[h, l] T2 → ⦃G, L⦄ ⊢ T2 •[h] U2 → - ⦃G, L⦄ ⊢ T1 •*[h, l+1] U2. -/2 width=3 by lstar_dx/ qed. - -lemma lstas_split: ∀h,G,L. inv_ltransitive … (lstas h G L). -/2 width=1 by lstar_inv_ltransitive/ qed-. - -lemma lstas_sort: ∀h,G,L,l,k. ⦃G, L⦄ ⊢ ⋆k •*[h, l] ⋆((next h)^l k). -#h #G #L #l @(nat_ind_plus … l) -l // -#l #IHl #k >iter_SO /2 width=3 by sta_sort, lstas_step_dx/ -qed. - -lemma lstas_bind: ∀h,I,G,L,V,T,U,l. ⦃G, L.ⓑ{I}V⦄ ⊢ T •*[h, l] U → - ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V.T •*[h, l] ⓑ{a,I}V.U. -#h #I #G #L #V #T #U #l #H @(lstas_ind_dx … H) -U -l /3 width=3 by sta_bind, lstar_O, lstas_step_dx/ -qed. - -lemma lstas_appl: ∀h,G,L,T,U,l. ⦃G, L⦄ ⊢ T •*[h, l] U → - ∀V.⦃G, L⦄ ⊢ ⓐV.T •*[h, l] ⓐV.U. -#h #G #L #T #U #l #H @(lstas_ind_dx … H) -U -l /3 width=3 by sta_appl, lstar_O, lstas_step_dx/ -qed. - -lemma lstas_cast: ∀h,G,L,T,U,l. ⦃G, L⦄ ⊢ T •*[h, l+1] U → - ∀W. ⦃G, L⦄ ⊢ ⓝW.T •*[h, l+1] U. -#h #G #L #T #U #l #H elim (lstas_inv_step_sn … H) -H /3 width=3 by sta_cast, lstas_step_sn/ -qed. - -(* Basic_1: removed theorems 7: - sty1_abbr sty1_appl sty1_bind sty1_cast2 - sty1_correct sty1_lift sty1_trans -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/lstas_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/sta/lstas_aaa.etc deleted file mode 100644 index 7497f44b6..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/lstas_aaa.etc +++ /dev/null @@ -1,23 +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/static/sta_aaa.ma". -include "basic_2/unfold/lstas.ma". - -(* NAT-ITERATED STATIC TYPE ASSIGNMENT FOR TERMS ****************************) - -(* Properties on atomic arity assignment for terms **************************) - -lemma lstas_aaa_conf: ∀h,G,L,l. Conf3 … (aaa G L) (lstas h G L l). -/3 width=6 by sta_aaa_conf, lstar_Conf3/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/lstas_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/sta/lstas_alt.etc deleted file mode 100644 index 0ad7b9bbc..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/lstas_alt.etc +++ /dev/null @@ -1,102 +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/notation/relations/statictypestaralt_6.ma". -include "basic_2/unfold/lstas_lift.ma". - -(* NAT-ITERATED STATIC TYPE ASSIGNMENT FOR TERMS ****************************) - -(* alternative definition of lstas *) -inductive lstasa (h): genv → relation4 lenv nat term term ≝ -| lstasa_O : ∀G,L,T. lstasa h G L 0 T T -| lstasa_sort: ∀G,L,l,k. lstasa h G L l (⋆k) (⋆((next h)^l k)) -| lstasa_ldef: ∀G,L,K,V,W,U,i,l. ⇩[i] L ≡ K.ⓓV → lstasa h G K (l+1) V W → - ⇧[0, i+1] W ≡ U → lstasa h G L (l+1) (#i) U -| lstasa_ldec: ∀G,L,K,W,V,V0,U,i,l. ⇩[i] L ≡ K.ⓛW → ⦃G, K⦄ ⊢ W •[h] V0 → - lstasa h G K l W V → ⇧[0, i+1] V ≡ U → lstasa h G L (l+1) (#i) U -| lstasa_bind: ∀a,I,G,L,V,T,U,l. lstasa h G (L.ⓑ{I}V) l T U → - lstasa h G L l (ⓑ{a,I}V.T) (ⓑ{a,I}V.U) -| lstasa_appl: ∀G,L,V,T,U,l. lstasa h G L l T U → lstasa h G L l (ⓐV.T) (ⓐV.U) -| lstasa_cast: ∀G,L,W,T,U,l. lstasa h G L (l+1) T U → lstasa h G L (l+1) (ⓝW.T) U -. - -interpretation "nat-iterated static type assignment (term) alternative" - 'StaticTypeStarAlt h G L l T U = (lstasa h G L l T U). - -(* Base properties **********************************************************) - -lemma sta_lstasa: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ⦃G, L⦄ ⊢ T ••*[h, 1] U. -#h #G #L #T #U #H elim H -G -L -T -U -/2 width=8 by lstasa_O, lstasa_sort, lstasa_ldef, lstasa_ldec, lstasa_bind, lstasa_appl, lstasa_cast/ -qed. - -lemma lstasa_step_dx: ∀h,G,L,T1,T,l. ⦃G, L⦄ ⊢ T1 ••*[h, l] T → - ∀T2. ⦃G, L⦄ ⊢ T •[h] T2 → ⦃G, L⦄ ⊢ T1 ••*[h, l+1] T2. -#h #G #L #T1 #T #l #H elim H -G -L -T1 -T -l -[ /2 width=1 by sta_lstasa/ -| #G #L #l #k #X #H >(sta_inv_sort1 … H) -X >commutative_plus // -| #G #L #K #V #W #U #i #l #HLK #_ #HWU #IHVW #U2 #HU2 - lapply (drop_fwd_drop2 … HLK) #H - elim (sta_inv_lift1 … HU2 … H … HWU) -H -U /3 width=6 by lstasa_ldef/ -| #G #L #K #W #V #V0 #U #i #l #HLK #HWl0 #_ #HVU #IHWV #U2 #HU2 - lapply (drop_fwd_drop2 … HLK) #H - elim (sta_inv_lift1 … HU2 … H … HVU) -H -U /3 width=8 by lstasa_ldec/ -| #a #I #G #L #V #T1 #U1 #l #_ #IHTU1 #X #H - elim (sta_inv_bind1 … H) -H #U #HU1 #H destruct /3 width=1 by lstasa_bind/ -| #G #L #V #T1 #U1 #l #_ #IHTU1 #X #H - elim (sta_inv_appl1 … H) -H #U #HU1 #H destruct /3 width=1 by lstasa_appl/ -| /3 width=1 by lstasa_cast/ -] -qed. - -(* Main properties **********************************************************) - -theorem lstas_lstasa: ∀h,G,L,T,U,l. ⦃G, L⦄ ⊢ T •*[h, l] U → ⦃G, L⦄ ⊢ T ••*[h, l] U. -#h #G #L #T #U #l #H @(lstas_ind_dx … H) -U -l /2 width=3 by lstasa_step_dx, lstasa_O/ -qed. - -(* Main inversion lemmas ****************************************************) - -theorem lstasa_inv_lstas: ∀h,G,L,T,U,l. ⦃G, L⦄ ⊢ T ••*[h, l] U → ⦃G, L⦄ ⊢ T •*[h, l] U. -#h #G #L #T #U #l #H elim H -G -L -T -U -l -/2 width=8 by lstas_inv_SO, lstas_ldec, lstas_ldef, lstas_cast, lstas_appl, lstas_bind/ -qed-. - -(* Advanced eliminators *****************************************************) - -lemma lstas_ind_alt: ∀h. ∀R:genv→relation4 lenv nat term term. - (∀G,L,T. R G L O T T) → - (∀G,L,l,k. R G L l (⋆k) (⋆((next h)^l k))) → ( - ∀G,L,K,V,W,U,i,l. - ⇩[i] L ≡ K.ⓓV → ⦃G, K⦄ ⊢ V •*[h, l+1] W → ⇧[O, i+1] W ≡ U → - R G K (l+1) V W → R G L (l+1) (#i) U - ) → ( - ∀G,L,K,W,V,V0,U,i,l. - ⇩[i] L ≡ K.ⓛW → ⦃G, K⦄ ⊢ W •[h] V0 → - ⦃G, K⦄ ⊢ W •*[h, l]V → ⇧[O, i+1] V ≡ U → - R G K l W V → R G L (l+1) (#i) U - ) → ( - ∀a,I,G,L,V,T,U,l. ⦃G, L.ⓑ{I}V⦄ ⊢ T •*[h, l] U → - R G (L.ⓑ{I}V) l T U → R G L l (ⓑ{a,I}V.T) (ⓑ{a,I}V.U) - ) → ( - ∀G,L,V,T,U,l. ⦃G, L⦄ ⊢ T •*[h, l] U → - R G L l T U → R G L l (ⓐV.T) (ⓐV.U) - ) → ( - ∀G,L,W,T,U,l. ⦃G, L⦄⊢ T •*[h, l+1] U → - R G L (l+1) T U → R G L (l+1) (ⓝW.T) U - ) → - ∀G,L,l,T,U. ⦃G, L⦄ ⊢ T •*[h, l] U → R G L l T U. -#h #R #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #IH7 #G #L #l #T #U #H -elim (lstas_lstasa … H) /3 width=10 by lstasa_inv_lstas/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/lstas_da.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/sta/lstas_da.etc deleted file mode 100644 index 8b11d1dc0..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/lstas_da.etc +++ /dev/null @@ -1,40 +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/unfold/lstas.ma". -include "basic_2/static/da_sta.ma". - -(* NAT-ITERATED STATIC TYPE ASSIGNMENT FOR TERMS ****************************) - -(* Properties on degree assignment for terms ********************************) - -lemma lstas_da_conf: ∀h,g,G,L,T,U,l1. ⦃G, L⦄ ⊢ T •*[h, l1] U → - ∀l2. ⦃G, L⦄ ⊢ T ▪[h, g] l2 → ⦃G, L⦄ ⊢ U ▪[h, g] l2-l1. -#h #g #G #L #T #U #l1 #H @(lstas_ind_dx … H) -U -l1 // -#l1 #U #U0 #_ #HU0 #IHTU #l2 #HT -(plus_minus_m_m … Hl12) in ⊢ (%→?); -Hl12 >commutative_plus #H -elim (lstas_split … H) -H #U #HTU ->(lstas_mono … HTU … HTU1) -T // -qed-. - -(* Advanced properties ******************************************************) - -lemma lstas_sta_conf_pos: ∀h,G,L,T,U1. ⦃G, L⦄ ⊢ T •[h] U1 → - ∀U2,l. ⦃G, L⦄ ⊢ T •*[h, l+1] U2 → ⦃G, L⦄ ⊢ U1 •*[h, l] U2. -#h #G #L #T #U1 #HTU1 #U2 #l #HTU2 -lapply (lstas_conf_le … T U1 1 … HTU2) -HTU2 /2 width=1 by sta_lstas/ -qed-. - -lemma lstas_strip_pos: ∀h,G,L,T1,U1. ⦃G, L⦄ ⊢ T1 •[h] U1 → - ∀T2,l. ⦃G, L⦄ ⊢ T1 •*[h, l+1] T2 → - ∃∃U2. ⦃G, L⦄ ⊢ T2 •[h] U2 & ⦃G, L⦄ ⊢ U1 •*[h, l+1] U2. -#h #G #L #T1 #U1 #HTU1 #T2 #l #HT12 -elim (lstas_fwd_correct … HTU1 … HT12) -lapply (lstas_sta_conf_pos … HTU1 … HT12) -T1 /3 width=5 by lstas_step_dx, ex2_intro/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/sta.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/sta/sta.etc deleted file mode 100644 index fc6bf6a2a..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/sta.etc +++ /dev/null @@ -1,143 +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/notation/relations/statictype_5.ma". -include "basic_2/grammar/genv.ma". -include "basic_2/substitution/drop.ma". -include "basic_2/static/sh.ma". - -(* STATIC TYPE ASSIGNMENT ON TERMS ******************************************) - -(* activate genv *) -inductive sta (h:sh): relation4 genv lenv term term ≝ -| sta_sort: ∀G,L,k. sta h G L (⋆k) (⋆(next h k)) -| sta_ldef: ∀G,L,K,V,W,U,i. ⇩[i] L ≡ K.ⓓV → sta h G K V W → - ⇧[0, i + 1] W ≡ U → sta h G L (#i) U -| sta_ldec: ∀G,L,K,W,V,U,i. ⇩[i] L ≡ K.ⓛW → sta h G K W V → - ⇧[0, i + 1] W ≡ U → sta h G L (#i) U -| sta_bind: ∀a,I,G,L,V,T,U. sta h G (L.ⓑ{I}V) T U → - sta h G L (ⓑ{a,I}V.T) (ⓑ{a,I}V.U) -| sta_appl: ∀G,L,V,T,U. sta h G L T U → sta h G L (ⓐV.T) (ⓐV.U) -| sta_cast: ∀G,L,W,T,U. sta h G L T U → sta h G L (ⓝW.T) U -. - -interpretation "static type assignment (term)" - 'StaticType h G L T U = (sta h G L T U). - -(* Basic inversion lemmas ************************************************) - -fact sta_inv_sort1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀k0. T = ⋆k0 → - U = ⋆(next h k0). -#h #G #L #T #U * -G -L -T -U -[ #G #L #k #k0 #H destruct // -| #G #L #K #V #W #U #i #_ #_ #_ #k0 #H destruct -| #G #L #K #W #V #U #i #_ #_ #_ #k0 #H destruct -| #a #I #G #L #V #T #U #_ #k0 #H destruct -| #G #L #V #T #U #_ #k0 #H destruct -| #G #L #W #T #U #_ #k0 #H destruct -qed-. - -(* Basic_1: was: sty0_gen_sort *) -lemma sta_inv_sort1: ∀h,G,L,U,k. ⦃G, L⦄ ⊢ ⋆k •[h] U → U = ⋆(next h k). -/2 width=5 by sta_inv_sort1_aux/ qed-. - -fact sta_inv_lref1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀j. T = #j → - (∃∃K,V,W. ⇩[j] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •[h] W & - ⇧[0, j+1] W ≡ U - ) ∨ - (∃∃K,W,V. ⇩[j] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W •[h] V & - ⇧[0, j+1] W ≡ U - ). -#h #G #L #T #U * -G -L -T -U -[ #G #L #k #j #H destruct -| #G #L #K #V #W #U #i #HLK #HVW #HWU #j #H destruct /3 width=6 by or_introl, ex3_3_intro/ -| #G #L #K #W #V #U #i #HLK #HWV #HWU #j #H destruct /3 width=6 by or_intror, ex3_3_intro/ -| #a #I #G #L #V #T #U #_ #j #H destruct -| #G #L #V #T #U #_ #j #H destruct -| #G #L #W #T #U #_ #j #H destruct -] -qed-. - -(* Basic_1: was sty0_gen_lref *) -lemma sta_inv_lref1: ∀h,G,L,U,i. ⦃G, L⦄ ⊢ #i •[h] U → - (∃∃K,V,W. ⇩[i] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •[h] W & - ⇧[0, i+1] W ≡ U - ) ∨ - (∃∃K,W,V. ⇩[i] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W •[h] V & - ⇧[0, i+1] W ≡ U - ). -/2 width=3 by sta_inv_lref1_aux/ qed-. - -fact sta_inv_gref1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀p0. T = §p0 → ⊥. -#h #G #L #T #U * -G -L -T -U -[ #G #L #k #p0 #H destruct -| #G #L #K #V #W #U #i #_ #_ #_ #p0 #H destruct -| #G #L #K #W #V #U #i #_ #_ #_ #p0 #H destruct -| #a #I #G #L #V #T #U #_ #p0 #H destruct -| #G #L #V #T #U #_ #p0 #H destruct -| #G #L #W #T #U #_ #p0 #H destruct -qed-. - -lemma sta_inv_gref1: ∀h,G,L,U,p. ⦃G, L⦄ ⊢ §p •[h] U → ⊥. -/2 width=8 by sta_inv_gref1_aux/ qed-. - -fact sta_inv_bind1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀b,J,X,Y. T = ⓑ{b,J}Y.X → - ∃∃Z. ⦃G, L.ⓑ{J}Y⦄ ⊢ X •[h] Z & U = ⓑ{b,J}Y.Z. -#h #G #L #T #U * -G -L -T -U -[ #G #L #k #b #J #X #Y #H destruct -| #G #L #K #V #W #U #i #_ #_ #_ #b #J #X #Y #H destruct -| #G #L #K #W #V #U #i #_ #_ #_ #b #J #X #Y #H destruct -| #a #I #G #L #V #T #U #HTU #b #J #X #Y #H destruct /2 width=3 by ex2_intro/ -| #G #L #V #T #U #_ #b #J #X #Y #H destruct -| #G #L #W #T #U #_ #b #J #X #Y #H destruct -] -qed-. - -(* Basic_1: was: sty0_gen_bind *) -lemma sta_inv_bind1: ∀h,b,J,G,L,Y,X,U. ⦃G, L⦄ ⊢ ⓑ{b,J}Y.X •[h] U → - ∃∃Z. ⦃G, L.ⓑ{J}Y⦄ ⊢ X •[h] Z & U = ⓑ{b,J}Y.Z. -/2 width=3 by sta_inv_bind1_aux/ qed-. - -fact sta_inv_appl1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀X,Y. T = ⓐY.X → - ∃∃Z. ⦃G, L⦄ ⊢ X •[h] Z & U = ⓐY.Z. -#h #G #L #T #U * -G -L -T -U -[ #G #L #k #X #Y #H destruct -| #G #L #K #V #W #U #i #_ #_ #_ #X #Y #H destruct -| #G #L #K #W #V #U #i #_ #_ #_ #X #Y #H destruct -| #a #I #G #L #V #T #U #_ #X #Y #H destruct -| #G #L #V #T #U #HTU #X #Y #H destruct /2 width=3 by ex2_intro/ -| #G #L #W #T #U #_ #X #Y #H destruct -] -qed-. - -(* Basic_1: was: sty0_gen_appl *) -lemma sta_inv_appl1: ∀h,G,L,Y,X,U. ⦃G, L⦄ ⊢ ⓐY.X •[h] U → - ∃∃Z. ⦃G, L⦄ ⊢ X •[h] Z & U = ⓐY.Z. -/2 width=3 by sta_inv_appl1_aux/ qed-. - -fact sta_inv_cast1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀X,Y. T = ⓝY.X → - ⦃G, L⦄ ⊢ X •[h] U. -#h #G #L #T #U * -G -L -T -U -[ #G #L #k #X #Y #H destruct -| #G #L #K #V #W #U #i #_ #_ #_ #X #Y #H destruct -| #G #L #K #W #V #U #i #_ #_ #_ #X #Y #H destruct -| #a #I #G #L #V #T #U #_ #X #Y #H destruct -| #G #L #V #T #U #_ #X #Y #H destruct -| #G #L #W #T #U #HTU #X #Y #H destruct // -] -qed-. - -(* Basic_1: was: sty0_gen_cast *) -lemma sta_inv_cast1: ∀h,G,L,X,Y,U. ⦃G, L⦄ ⊢ ⓝY.X •[h] U → ⦃G, L⦄ ⊢ X •[h] U. -/2 width=4 by sta_inv_cast1_aux/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/sta_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/sta/sta_aaa.etc deleted file mode 100644 index affd2eded..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/sta_aaa.etc +++ /dev/null @@ -1,52 +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/static/sta.ma". -include "basic_2/static/aaa_lift.ma". - -(* STATIC TYPE ASSIGNMENT FOR TERMS *****************************************) - -(* Properties on atomic arity assignment for terms **************************) - -lemma aaa_sta: ∀h,G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∃U. ⦃G, L⦄ ⊢ T •[h] U. -#h #G #L #T #A #H elim H -G -L -T -A -[ /2 width=2 by sta_sort, ex_intro/ -| * #G #L #K [ #V | #W ] #B #i #HLK #_ * [ #W | #V ] #HVW - elim (lift_total W 0 (i+1)) /3 width=7 by sta_ldef, sta_ldec, ex_intro/ -| #a #G #L #V #T #B #A #_ #_ #_ * /3 width=2 by sta_bind, ex_intro/ -| #a #G #L #V #T #B #A #_ #_ #_ * /3 width=2 by sta_bind, ex_intro/ -| #G #L #V #T #B #A #_ #_ #_ * /3 width=2 by sta_appl, ex_intro/ -| #G #L #W #T #A #_ #_ #_ * /3 width=2 by sta_cast, ex_intro/ -] -qed-. - -lemma sta_aaa_conf: ∀h,G,L. Conf3 … (aaa G L) (sta h G L). -#h #G #L #T #A #H elim H -G -L -T -A -[ #G #L #k #U #H - lapply (sta_inv_sort1 … H) -H #H destruct // -| #I #G #L #K #V #B #i #HLK #HV #IHV #U #H - elim (sta_inv_lref1 … H) -H * #K0 #V0 #W0 #HLK0 #HVW0 #HU - lapply (drop_mono … HLK0 … HLK) -HLK0 #H0 destruct - lapply (drop_fwd_drop2 … HLK) -HLK #HLK - @(aaa_lift … HLK … HU) -HU -L /2 width=2 by/ -| #a #G #L #V #T #B #A #HV #_ #_ #IHT #X #H - elim (sta_inv_bind1 … H) -H #U #HTU #H destruct /3 width=2 by aaa_abbr/ -| #a #G #L #V #T #B #A #HV #_ #_ #IHT #X #H - elim (sta_inv_bind1 … H) -H #U #HTU #H destruct /3 width=2 by aaa_abst/ -| #G #L #V #T #B #A #HV #_ #_ #IHT #X #H - elim (sta_inv_appl1 … H) -H #U #HTU #H destruct /3 width=3 by aaa_appl/ -| #G #L #V #T #A #_ #_ #IHV #IHT #X #H - lapply (sta_inv_cast1 … H) -H /2 width=2 by/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/sta_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/sta/sta_lift.etc deleted file mode 100644 index 4d342878f..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/sta_lift.etc +++ /dev/null @@ -1,113 +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/substitution/drop_drop.ma". -include "basic_2/static/sta.ma". - -(* STATIC TYPE ASSIGNMENT ON TERMS ******************************************) - -(* Properties on relocation *************************************************) - -(* Basic_1: was: sty0_lift *) -lemma sta_lift: ∀h,G. l_liftable (sta h G). -#h #G #L1 #T1 #U1 #H elim H -G -L1 -T1 -U1 -[ #G #L1 #k #L2 #s #d #e #HL21 #X1 #H1 #X2 #H2 - >(lift_inv_sort1 … H1) -X1 - >(lift_inv_sort1 … H2) -X2 // -| #G #L1 #K1 #V1 #W1 #W #i #HLK1 #_ #HW1 #IHVW1 #L2 #s #d #e #HL21 #X #H #U2 #HWU2 - elim (lift_inv_lref1 … H) * #Hid #H destruct - [ elim (lift_trans_ge … HW1 … HWU2) -W // #W2 #HW12 #HWU2 - elim (drop_trans_le … HL21 … HLK1) -L1 /2 width=2 by lt_to_le/ #X #HLK2 #H - elim (drop_inv_skip2 … H) -H /2 width=1 by lt_plus_to_minus_r/ -Hid #K2 #V2 #HK21 #HV12 #H destruct - /3 width=9 by sta_ldef/ - | lapply (lift_trans_be … HW1 … HWU2 ? ?) -W /2 width=1 by le_S/ #HW1U2 - lapply (drop_trans_ge … HL21 … HLK1 ?) -L1 /3 width=9 by sta_ldef, drop_inv_gen/ - ] -| #G #L1 #K1 #W1 #V1 #W #i #HLK1 #_ #HW1 #IHWV1 #L2 #s #d #e #HL21 #X #H #U2 #HWU2 - elim (lift_inv_lref1 … H) * #Hid #H destruct - [ elim (lift_trans_ge … HW1 … HWU2) -W // (lift_inv_sort2 … H) -X /2 width=3 by sta_sort, lift_sort, ex2_intro/ -| #G #L2 #K2 #V2 #W2 #W #i #HLK2 #HVW2 #HW2 #IHVW2 #L1 #s #d #e #HL21 #X #H - elim (lift_inv_lref2 … H) * #Hid #H destruct [ -HVW2 | -IHVW2 ] - [ elim (drop_conf_lt … HL21 … HLK2) -L2 // #K1 #V1 #HLK1 #HK21 #HV12 - elim (IHVW2 … HK21 … HV12) -K2 -V2 #W1 #HW12 #HVW1 - elim (lift_trans_le … HW12 … HW2) -W2 // >minus_plus minus_minus_m_m /3 width=8 by sta_ldef, le_S, ex2_intro/ - ] -| #G #L2 #K2 #W2 #V2 #W #i #HLK2 #HWV2 #HW2 #IHWV2 #L1 #s #d #e #HL21 #X #H - elim (lift_inv_lref2 … H) * #Hid #H destruct [ -HWV2 | -IHWV2 ] - [ elim (drop_conf_lt … HL21 … HLK2) -L2 // #K1 #W1 #HLK1 #HK21 #HW12 - elim (IHWV2 … HK21 … HW12) -K2 #V1 #_ #HWV1 - elim (lift_trans_le … HW12 … HW2) -W2 // >minus_plus minus_minus_m_m /3 width=8 by sta_ldec, le_S, ex2_intro/ - ] -| #a #I #G #L2 #V2 #T2 #U2 #_ #IHTU2 #L1 #s #d #e #HL21 #X #H - elim (lift_inv_bind2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct - elim (IHTU2 (L1.ⓑ{I}V1) … HT12) -IHTU2 -HT12 /3 width=5 by sta_bind, drop_skip, lift_bind, ex2_intro/ -| #G #L2 #V2 #T2 #U2 #_ #IHTU2 #L1 #s #d #e #HL21 #X #H - elim (lift_inv_flat2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct - elim (IHTU2 … HL21 … HT12) -L2 -HT12 /3 width=5 by sta_appl, lift_flat, ex2_intro/ -| #G #L2 #W2 #T2 #U2 #_ #IHTU2 #L1 #s #d #e #HL21 #X #H - elim (lift_inv_flat2 … H) -H #W1 #T1 #_ #HT12 #H destruct - elim (IHTU2 … HL21 … HT12) -L2 -HT12 /3 width=3 by sta_cast, ex2_intro/ -] -qed-. - -(* Advanced forward lemmas **************************************************) - -(* Basic_1: was: sty0_correct *) -lemma sta_fwd_correct: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∃T0. ⦃G, L⦄ ⊢ U •[h] T0. -#h #G #L #T #U #H elim H -G -L -T -U -[ /2 width=2/ -| #G #L #K #V #W #W0 #i #HLK #_ #HW0 * #V0 #HWV0 - lapply (drop_fwd_drop2 … HLK) -HLK #HLK - elim (lift_total V0 0 (i+1)) /3 width=11 by ex_intro, sta_lift/ -| #G #L #K #W #V #V0 #i #HLK #HWV #HWV0 #_ - lapply (drop_fwd_drop2 … HLK) -HLK #HLK - elim (lift_total V 0 (i+1)) /3 width=11 by ex_intro, sta_lift/ -| #a #I #G #L #V #T #U #_ * /3 width=2 by sta_bind, ex_intro/ -| #G #L #V #T #U #_ * #T0 #HUT0 /3 width=2 by sta_appl, ex_intro/ -| #G #L #W #T #U #_ * /2 width=2 by ex_intro/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/sta_llpx_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/sta/sta_llpx_sn.etc deleted file mode 100644 index 3adf28fc4..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/sta_llpx_sn.etc +++ /dev/null @@ -1,43 +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/llpx_sn_drop.ma". -include "basic_2/static/sta.ma". - -(* STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS ******************************) - -(* Properties on lazy sn pointwise extensions *******************************) - -lemma sta_llpx_sn_conf: ∀R. (∀L. reflexive … (R L)) → l_liftable R → - ∀h,G. s_r_confluent1 … (sta h G) (llpx_sn R 0). -#R #H1R #H2R #h #G #Ls #T1 #T2 #H elim H -G -Ls -T1 -T2 -[ /3 width=4 by llpx_sn_fwd_length, llpx_sn_sort/ -| #G #Ls #Ks #V1s #W2s #V2s #i #HLKs #_ #HVW2s #IHV12s #Ld #H elim (llpx_sn_inv_lref_ge_sn … H … HLKs) // -H - #Kd #V1d #HLKd #HV1s #HV1sd - lapply (drop_fwd_drop2 … HLKs) -HLKs #HLKs - lapply (drop_fwd_drop2 … HLKd) -HLKd #HLKd - @(llpx_sn_lift_le … HLKs HLKd … HVW2s) -HLKs -HLKd -HVW2s /2 width=1 by/ (**) (* full auto too slow *) -| #G #Ls #Ks #V1s #W1s #V2s #i #HLKs #_ #HV12s #IHVW1s #Ld #H elim (llpx_sn_inv_lref_ge_sn … H … HLKs) // -H - #Kd #V1d #HLKd #HV1s #HV1sd - lapply (drop_fwd_drop2 … HLKs) -HLKs #HLKs - lapply (drop_fwd_drop2 … HLKd) -HLKd #HLKd - @(llpx_sn_lift_le … HLKs HLKd … HV12s) -HLKs -HLKd -HV12s /2 width=1 by/ (**) (* full auto too slow *) -| #a #I #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_bind_O … H) -H - /4 width=5 by llpx_sn_bind_repl_SO, llpx_sn_bind/ -| #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H - /3 width=1 by llpx_sn_flat/ -| #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H - /3 width=1 by llpx_sn_flat/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/sta_sta.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/sta/sta_sta.etc deleted file mode 100644 index 6d54d56d7..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/sta_sta.etc +++ /dev/null @@ -1,43 +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/substitution/drop_drop.ma". -include "basic_2/static/sta.ma". - -(* STATIC TYPE ASSIGNMENT ON TERMS ******************************************) - -(* Main properties **********************************************************) - -(* Note: apparently this was missing in basic_1 *) -theorem sta_mono: ∀h,G,L. singlevalued … (sta h G L). -#h #G #L #T #U1 #H elim H -G -L -T -U1 -[ #G #L #k #X #H >(sta_inv_sort1 … H) -X // -| #G #L #K #V #W #U1 #i #HLK #_ #HWU1 #IHVW #U2 #H - elim (sta_inv_lref1 … H) -H * #K0 #V0 #W0 #HLK0 #HVW0 #HW0U2 - lapply (drop_mono … HLK0 … HLK) -HLK -HLK0 #H destruct - lapply (IHVW … HVW0) -IHVW -HVW0 #H destruct - >(lift_mono … HWU1 … HW0U2) -W0 -U1 // -| #G #L #K #W #V #U1 #i #HLK #_ #HWU1 #IHWV #U2 #H - elim (sta_inv_lref1 … H) -H * #K0 #W0 #V0 #HLK0 #HWV0 #HV0U2 - lapply (drop_mono … HLK0 … HLK) -HLK -HLK0 #H destruct - lapply (IHWV … HWV0) -IHWV -HWV0 #H destruct - >(lift_mono … HWU1 … HV0U2) -W -U1 // -| #a #I #G #L #V #T #U1 #_ #IHTU1 #X #H - elim (sta_inv_bind1 … H) -H #U2 #HTU2 #H destruct /3 width=1 by eq_f/ -| #G #L #V #T #U1 #_ #IHTU1 #X #H - elim (sta_inv_appl1 … H) -H #U2 #HTU2 #H destruct /3 width=1 by eq_f/ -| #G #L #W #T #U1 #_ #IHTU1 #U2 #H - lapply (sta_inv_cast1 … H) -H /2 width=1 by/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/statictype_5.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/sta/statictype_5.etc deleted file mode 100644 index 9249be4e0..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/statictype_5.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 • break [ term 46 h ] break term 46 T2 )" - non associative with precedence 45 - for @{ 'StaticType $h $G $L $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/statictypestaralt_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/sta/statictypestaralt_6.etc deleted file mode 100644 index a6e46be62..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/statictypestaralt_6.etc +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 • • * break [ term 46 h , break term 46 l ] break term 46 T2 )" - non associative with precedence 45 - for @{ 'StaticTypeStarAlt $h $G $L $l $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/tshf/chnf.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/tshf/chnf.etc deleted file mode 100644 index f6106d38d..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/tshf/chnf.etc +++ /dev/null @@ -1,40 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( L ⊢ break 𝐇𝐍 ⦃ term 46 T ⦄ )" - non associative with precedence 45 - for @{ 'HdNormal $L $T }. - -include "basic_2/reduction/cpr_tshf.ma". - -(* CONTEXT-SENSITIVE WEAK HEAD NORMAL TERMS *********************************) - -definition chnf: lenv → predicate term ≝ λL. NF … (cpr L) tshf. - -interpretation - "context-sensitive head normality (term)" - 'HdNormal L T = (chnf L T). - -(* Basic inversion lemmas ***************************************************) - -lemma chnf_inv_tshf: ∀L,T. L ⊢ 𝐇𝐍⦃T⦄ → T ≈ T. -normalize /2 width=1/ -qed-. - -(* Basic properties *********************************************************) - -lemma tshf_thnf: ∀T. T ≈ T → ⋆ ⊢ 𝐇𝐍⦃T⦄. -#T #HT #T2 #H elim (cpr_fwd_tshf1 … H) -H // -#H elim H // -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/tshf/cpr_tshf.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/tshf/cpr_tshf.etc deleted file mode 100644 index 0fc5e1d0c..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/tshf/cpr_tshf.etc +++ /dev/null @@ -1,46 +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/grammar/tshf.ma". -include "basic_2/reduction/cpr.ma". - -(* CONTEXT-SENSITIVE PARALLEL REDUCTION FOR TERMS ***************************) - -(* Forward lemmas on same head forms for terms ******************************) - -lemma cpr_fwd_tshf1: ∀L,T1,T2. L ⊢ T1 ➡ T2 → T1 ≈ T1 → - T2 ≈ T1 ∨ (L = ⋆ → ⊥). -#L #T1 #T2 #H elim H -L -T1 -T2 -[ /2 width=1/ -| #L #K #V1 #V2 #W2 #i #HLK #_ #_ #_ #_ - @or_intror #H destruct - lapply (ldrop_inv_atom1 … HLK) -HLK #H destruct -| #a #I #L #V1 #V2 #T1 #T2 #_ #_ #_ #_ #H - elim (tshf_inv_bind1 … H) -H #W2 #U2 #H1 * #H2 destruct /2 width=1/ -| #I #L #V1 #V2 #T1 #T2 #_ #_ #_ #IHT12 #H - elim (tshf_inv_flat1 … H) -H #W2 #U2 #HT1U2 #HT1 #_ #H1 #H2 destruct - lapply (IHT12 HT1U2) -IHT12 -HT1U2 * #HUT2 /3 width=1/ - lapply (simple_tshf_repl_sn … HUT2 HT1) /3 width=1/ -| #L #V #T #T1 #T2 #_ #_ #_ #H - elim (tshf_inv_bind1 … H) -H #W2 #U2 #H1 * #H2 destruct -| #L #V #T1 #T2 #_ #_ #H - elim (tshf_inv_flat1 … H) -H #W2 #U2 #_ #_ #_ #H destruct -| #a #L #V1 #V2 #W #T1 #T2 #_ #_ #_ #_ #H - elim (tshf_inv_flat1 … H) -H #W2 #U2 #_ #H - elim (simple_inv_bind … H) -| #a #L #V2 #V1 #V #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #_ #H - elim (tshf_inv_flat1 … H) -H #U1 #U2 #_ #H - elim (simple_inv_bind … H) -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/tshf/tshf.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/tshf/tshf.etc deleted file mode 100644 index 583c3f46f..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/tshf/tshf.etc +++ /dev/null @@ -1,98 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( L ⊢ break term 46 T1 ≈ break term 46 T2 )" - non associative with precedence 45 - for @{ 'Hom $L $T1 $T2 }. - -notation "hvbox( L ⊢ break 𝐇𝐑 ⦃ term 46 T ⦄ )" - non associative with precedence 45 - for @{ 'HdReducible $L $T }. - -notation "hvbox( L ⊢ break 𝐇𝐈 ⦃ term 46 T ⦄ )" - non associative with precedence 45 - for @{ 'NotHdReducible $L $T }. - -include "basic_2/grammar/term_simple.ma". - -(* SAME HEAD TERM FORMS *****************************************************) - -inductive tshf: relation term ≝ - | tshf_atom: ∀I. tshf (⓪{I}) (⓪{I}) - | tshf_abbr: ∀V1,V2,T1,T2. tshf (-ⓓV1. T1) (-ⓓV2. T2) - | tshf_abst: ∀a,V1,V2,T1,T2. tshf (ⓛ{a}V1. T1) (ⓛ{a}V2. T2) - | tshf_appl: ∀V1,V2,T1,T2. tshf T1 T2 → 𝐒⦃T1⦄ → 𝐒⦃T2⦄ → - tshf (ⓐV1. T1) (ⓐV2. T2) -. - -interpretation "same head form (term)" 'napart T1 T2 = (tshf T1 T2). - -(* Basic properties *********************************************************) - -lemma tshf_sym: ∀T1,T2. T1 ≈ T2 → T2 ≈ T1. -#T1 #T2 #H elim H -T1 -T2 /2 width=1/ -qed. - -lemma tshf_refl2: ∀T1,T2. T1 ≈ T2 → T2 ≈ T2. -#T1 #T2 #H elim H -T1 -T2 // /2 width=1/ -qed. - -lemma tshf_refl1: ∀T1,T2. T1 ≈ T2 → T1 ≈ T1. -/3 width=2/ qed. - -lemma simple_tshf_repl_dx: ∀T1,T2. T1 ≈ T2 → 𝐒⦃T1⦄ → 𝐒⦃T2⦄. -#T1 #T2 #H elim H -T1 -T2 // -[ #V1 #V2 #T1 #T2 #H - elim (simple_inv_bind … H) -| #a #V1 #V2 #T1 #T2 #H - elim (simple_inv_bind … H) -] -qed. (**) (* remove from index *) - -lemma simple_tshf_repl_sn: ∀T1,T2. T1 ≈ T2 → 𝐒⦃T2⦄ → 𝐒⦃T1⦄. -/3 width=3/ qed-. - -(* Basic inversion lemmas ***************************************************) - -fact tshf_inv_bind1_aux: ∀T1,T2. T1 ≈ T2 → ∀a,I,W1,U1. T1 = ⓑ{a,I}W1.U1 → - ∃∃W2,U2. T2 = ⓑ{a,I}W2. U2 & - (Bind2 a I = Bind2 false Abbr ∨ I = Abst). -#T1 #T2 * -T1 -T2 -[ #J #a #I #W1 #U1 #H destruct -| #V1 #V2 #T1 #T2 #a #I #W1 #U1 #H destruct /3 width=3/ -| #b #V1 #V2 #T1 #T2 #a #I #W1 #U1 #H destruct /3 width=3/ -| #V1 #V2 #T1 #T2 #_ #_ #_ #a #I #W1 #U1 #H destruct -] -qed. - -lemma tshf_inv_bind1: ∀a,I,W1,U1,T2. ⓑ{a,I}W1.U1 ≈ T2 → - ∃∃W2,U2. T2 = ⓑ{a,I}W2. U2 & - (Bind2 a I = Bind2 false Abbr ∨ I = Abst). -/2 width=5/ qed-. - -fact tshf_inv_flat1_aux: ∀T1,T2. T1 ≈ T2 → ∀I,W1,U1. T1 = ⓕ{I}W1.U1 → - ∃∃W2,U2. U1 ≈ U2 & 𝐒⦃U1⦄ & 𝐒⦃U2⦄ & - I = Appl & T2 = ⓐW2. U2. -#T1 #T2 * -T1 -T2 -[ #J #I #W1 #U1 #H destruct -| #V1 #V2 #T1 #T2 #I #W1 #U1 #H destruct -| #a #V1 #V2 #T1 #T2 #I #W1 #U1 #H destruct -| #V1 #V2 #T1 #T2 #HT12 #HT1 #HT2 #I #W1 #U1 #H destruct /2 width=5/ -] -qed. - -lemma tshf_inv_flat1: ∀I,W1,U1,T2. ⓕ{I}W1.U1 ≈ T2 → - ∃∃W2,U2. U1 ≈ U2 & 𝐒⦃U1⦄ & 𝐒⦃U2⦄ & - I = Appl & T2 = ⓐW2. U2. -/2 width=4/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xpr_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xpr_aaa.etc deleted file mode 100644 index 98fe01347..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xpr_aaa.etc +++ /dev/null @@ -1,25 +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/static/ssta_aaa.ma". -include "basic_2/reducibility/cpr_aaa.ma". -include "basic_2/reducibility/xpr.ma". - -(* EXTENDED PARALLEL REDUCTION ON TERMS *************************************) - -(* Properties on atomic arity assignment for terms **************************) - -lemma xpr_aaa: ∀h,g,L,T,A. L ⊢ T ⁝ A → ∀U. ⦃h, L⦄ ⊢ T •➡[g] U → L ⊢ U ⁝ A. -#h #g #L #T #A #HT #U * /2 width=3/ /2 width=6/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xpr_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xpr_lift.etc deleted file mode 100644 index 8f5deca51..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xpr_lift.etc +++ /dev/null @@ -1,48 +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/static/ssta_lift.ma". -include "basic_2/reducibility/cpr_lift.ma". -include "basic_2/reducibility/xpr.ma". - -(* EXTENDED PARALLEL REDUCTION ON TERMS *************************************) - -(* Advanced inversion lemmas ************************************************) - -lemma xpr_inv_abst1: ∀h,g,a,L,V1,T1,U2. ⦃h, L⦄ ⊢ ⓛ{a}V1.T1 •➡[g] U2 → - ∃∃V2,T2. L ⊢ V1 ➡ V2 & ⦃h, L. ⓛV1⦄ ⊢ T1 •➡[g] T2 & - U2 = ⓛ{a}V2. T2. -#h #g #a #L #V1 #T1 #U2 * -[ #H elim (cpr_inv_abst1 … H Abst V1) /3 width=5/ -| #l #H elim (ssta_inv_bind1 … H) /3 width=5/ -] -qed-. - -(* Relocation properties ****************************************************) - -lemma xpr_lift: ∀L,K,d,e. ⇩[d, e] L ≡ K → - ∀T1,U1. ⇧[d, e] T1 ≡ U1 → ∀T2,U2. ⇧[d, e] T2 ≡ U2 → - ∀h,g. ⦃h, K⦄ ⊢ T1 •➡[g] T2 → ⦃h, L⦄ ⊢ U1 •➡[g] U2. -#L #K #d #e #HLK #T1 #U1 #HTU1 #T2 #U2 #HTU2 #h #g * -/3 width=9/ /3 width=10/ -qed. - -lemma xpr_inv_lift1: ∀L,K,d,e. ⇩[d, e] L ≡ K → - ∀T1,U1. ⇧[d, e] T1 ≡ U1 → ∀h,g,U2. ⦃h, L⦄ ⊢ U1 •➡[g] U2 → - ∃∃T2. ⇧[d, e] T2 ≡ U2 & ⦃h, K⦄ ⊢ T1 •➡[g] T2. -#L #K #d #e #HLK #T1 #U1 #HTU1 #h #g #U2 * [ #HU12 | #l #HU12 ] -[ elim (cpr_inv_lift1 … HLK … HTU1 … HU12) -L -U1 /3 width=3/ -| elim (ssta_inv_lift1 … HU12 … HLK … HTU1) -L -U1 /3 width=4/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xpr_lsubss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xpr_lsubss.etc deleted file mode 100644 index bc66cd2cd..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xpr_lsubss.etc +++ /dev/null @@ -1,28 +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/static/lsubss_ssta.ma". -include "basic_2/reducibility/xpr.ma". - -(* EXTENDED PARALLEL REDUCTION ON TERMS *************************************) - -(* Properties on lenv ref for stratified type assignment ********************) - -lemma lsubss_xpr_trans: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 → - ∀T1,T2. ⦃h, L2⦄ ⊢ T1 •➡[g] T2 → ⦃h, L1⦄ ⊢ T1 •➡[g] T2. -#h #g #L1 #L2 #HL12 #T1 #T2 * [ | #l ] #HT12 -[ lapply (lsubss_fwd_lsubs2 … HL12) -HL12 /3 width=3/ -| /3 width=4/ -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xprs.etc deleted file mode 100644 index bffc4e735..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xprs.etc +++ /dev/null @@ -1,72 +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 *) -(* *) -(**************************************************************************) - -notation "hvbox( ⦃ term 46 h , break term 46 L ⦄ ⊢ break term 46 T1 • ➡ * break [ term 46 g ] break term 46 T2 )" - non associative with precedence 45 - for @{ 'XPRedStar $h $g $L $T1 $T2 }. - -notation "hvbox( ⦃ term 46 h , break term 46 L ⦄ ⊢ • ⬊ * break [ term 46 g ] break term 46 T2 )" - non associative with precedence 45 - for @{ 'XSN $h $g $L $T }. - -include "basic_2/static/lsubss.ma". -include "basic_2/reducibility/xpr.ma". -(* -include "basic_2/reducibility/cnf.ma". -*) -(* EXTENDED PARALLEL COMPUTATION ON TERMS ***********************************) - -definition xprs: ∀h. sd h → lenv → relation term ≝ - λh,g,L. TC … (xpr h g L). - -interpretation "extended parallel computation (term)" - 'XPRedStar h g L T1 T2 = (xprs h g L T1 T2). - -(* Basic eliminators ********************************************************) - -lemma xprs_ind: ∀h,g,L,T1. ∀R:predicate term. R T1 → - (∀T,T2. ⦃h, L⦄ ⊢ T1 •➡*[g] T → ⦃h, L⦄ ⊢ T •➡[g] T2 → R T → R T2) → - ∀T2. ⦃h, L⦄ ⊢ T1 •➡*[g] T2 → R T2. -#h #g #L #T1 #R #HT1 #IHT1 #T2 #HT12 -@(TC_star_ind … HT1 IHT1 … HT12) // -qed-. - -lemma xprs_ind_dx: ∀h,g,L,T2. ∀R:predicate term. R T2 → - (∀T1,T. ⦃h, L⦄ ⊢ T1 •➡[g] T → ⦃h, L⦄ ⊢ T •➡*[g] T2 → R T → R T1) → - ∀T1. ⦃h, L⦄ ⊢ T1 •➡*[g] T2 → R T1. -#h #g #L #T2 #R #HT2 #IHT2 #T1 #HT12 -@(TC_star_ind_dx … HT2 IHT2 … HT12) // -qed-. - -(* Basic properties *********************************************************) - -lemma xprs_refl: ∀h,g,L. reflexive … (xprs h g L). -/2 width=1/ qed. - -lemma xprs_strap1: ∀h,g,L,T1,T,T2. - ⦃h, L⦄ ⊢ T1 •➡*[g] T → ⦃h, L⦄ ⊢ T •➡[g] T2 → ⦃h, L⦄ ⊢ T1 •➡*[g] T2. -/2 width=3/ qed. - -lemma xprs_strap2: ∀h,g,L,T1,T,T2. - ⦃h, L⦄ ⊢ T1 •➡[g] T → ⦃h, L⦄ ⊢ T •➡*[g] T2 → ⦃h, L⦄ ⊢ T1 •➡*[g] T2. -/2 width=3/ qed. - -(* Basic inversion lemmas ***************************************************) -(* -axiom xprs_inv_cnf1: ∀L,T,U. L ⊢ T ➡* U → L ⊢ 𝐍⦃T⦄ → T = U. -#L #T #U #H @(xprs_ind_dx … H) -T // -#T0 #T #H1T0 #_ #IHT #H2T0 -lapply (H2T0 … H1T0) -H1T0 #H destruct /2 width=1/ -qed-. -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xprs_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xprs_aaa.etc deleted file mode 100644 index 5beb8fe19..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xprs_aaa.etc +++ /dev/null @@ -1,24 +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/reducibility/xpr_aaa.ma". -include "basic_2/computation/xprs.ma". - -(* EXTENDED PARALLEL COMPUTATION ON TERMS ***********************************) - -(* Properties on atomic arity assignment for terms **************************) - -lemma xprs_aaa: ∀h,g,L,T,A. L ⊢ T ⁝ A → ∀U. ⦃h, L⦄ ⊢ T •➡*[g] U → L ⊢ U ⁝ A. -#h #g #L #T #A #HT #U #H @(xprs_ind … H) -U // /2 width=5/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xprs_cprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xprs_cprs.etc deleted file mode 100644 index 13a4f8889..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xprs_cprs.etc +++ /dev/null @@ -1,24 +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/computation/cprs.ma". -include "basic_2/computation/xprs.ma". - -(* EXTENDED PARALLEL COMPUTATION ON TERMS ***********************************) - -(* properties on context sensitive parallel computation for terms ***********) - -lemma cprs_xprs: ∀h,g,L,T1,T2. L ⊢ T1 ➡* T2 → ⦃h, L⦄ ⊢ T1 •➡*[g] T2. -#h #g #L #T1 #T2 #H @(cprs_ind … H) -T2 // /3 width=3/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xprs_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xprs_lift.etc deleted file mode 100644 index cb151a194..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xprs_lift.etc +++ /dev/null @@ -1,50 +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/reducibility/xpr_lift.ma". -include "basic_2/computation/cprs.ma". -include "basic_2/computation/xprs.ma". - -(* EXTENDED PARALLEL COMPUTATION ON TERMS ***********************************) - -(* Advanced forward lemmas **************************************************) - -lemma xprs_fwd_abst1: ∀h,g,a,L,V1,T1,U2. ⦃h, L⦄ ⊢ ⓛ{a}V1. T1 •➡*[g] U2 → - ∃∃V2,T2. L ⊢ V1 ➡* V2 & U2 = ⓛ{a}V2. T2. -#h #g #a #L #V1 #T1 #U2 #H @(xprs_ind … H) -U2 /2 width=4/ -#U #U2 #_ #HU2 * #V #T #HV1 #H destruct -elim (xpr_inv_abst1 … HU2) -HU2 #V2 #T2 #HV2 #_ #H destruct /3 width=4/ -qed-. - -(* Relocation properties ****************************************************) - -lemma xprs_lift: ∀L,K,d,e. ⇩[d, e] L ≡ K → ∀T1,U1. ⇧[d, e] T1 ≡ U1 → - ∀h,g,T2. ⦃h, K⦄ ⊢ T1 •➡*[g] T2 → ∀U2. ⇧[d, e] T2 ≡ U2 → - ⦃h, L⦄ ⊢ U1 •➡*[g] U2. -#L #K #d #e #HLK #T1 #U1 #HTU1 #h #g #T2 #HT12 @(xprs_ind … HT12) -T2 -[ -HLK #T2 #HT12 - <(lift_mono … HTU1 … HT12) -T1 // -| -HTU1 #T #T2 #_ #HT2 #IHT2 #U2 #HTU2 - elim (lift_total T d e) #U #HTU - lapply (xpr_lift … HLK … HTU … HTU2 … HT2) -T2 -HLK /3 width=3/ -] -qed. - -lemma xprs_inv_lift1: ∀L,K,d,e. ⇩[d, e] L ≡ K → - ∀T1,U1. ⇧[d, e] T1 ≡ U1 → ∀h,g,U2. ⦃h, L⦄ ⊢ U1 •➡*[g] U2 → - ∃∃T2. ⇧[d, e] T2 ≡ U2 & ⦃h, K⦄ ⊢ T1 •➡*[g] T2. -#L #K #d #e #HLK #T1 #U1 #HTU1 #h #g #U2 #HU12 @(xprs_ind … HU12) -U2 /2 width=3/ --HTU1 #U #U2 #_ #HU2 * #T #HTU #HT1 -elim (xpr_inv_lift1 … HLK … HTU … HU2) -U -HLK /3 width=5/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xprs_lsubss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xprs_lsubss.etc deleted file mode 100644 index c883c14f3..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xprs_lsubss.etc +++ /dev/null @@ -1,27 +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/reducibility/xpr_lsubss.ma". -include "basic_2/computation/xprs.ma". - -(* EXTENDED PARALLEL COMPUTATION ON TERMS ***********************************) - -(* Properties on lenv ref for stratified type assignment ********************) - -lemma lsubss_xprs_trans: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 → - ∀T1,T2. ⦃h, L2⦄ ⊢ T1 •➡*[g] T2 → ⦃h, L1⦄ ⊢ T1 •➡*[g] T2. -#h #g #L1 #L2 #HL12 #T1 #T2 #H @(xprs_ind … H) -T2 // -#T #T2 #_ #HT2 #IHT1 -lapply (lsubss_xpr_trans … HL12 … HT2) -L2 /2 width=3/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xprs_xprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xprs_xprs.etc deleted file mode 100644 index 9593f0550..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/xpr/xprs_xprs.etc +++ /dev/null @@ -1,20 +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/computation/xprs.ma". - -(* EXTENDED PARALLEL COMPUTATION ON TERMS ***********************************) - -theorem xprs_trans: ∀h,g,L. transitive … (xprs h g L). -/2 width=3/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cir_append.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cir_append.etc new file mode 100644 index 000000000..efd097f84 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cir_append.etc @@ -0,0 +1,34 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reduction/crr_append.ma". +include "basic_2/reduction/cir.ma". + +(* IRREDUCIBLE TERMS FOR CONTEXT-SENSITIVE REDUCTION ************************) + +(* Advanved properties ******************************************************) + +lemma cir_labst_last: ∀G,L,T,W. ⦃G, L⦄ ⊢ ➡ 𝐈⦃T⦄ → ⦃G, ⋆.ⓛW @@ L⦄ ⊢ ➡ 𝐈⦃T⦄. +/3 width=2 by crr_inv_labst_last/ qed. + +lemma cir_tif: ∀G,T,W. ⦃G, ⋆⦄ ⊢ ➡ 𝐈⦃T⦄ → ⦃G, ⋆.ⓛW⦄ ⊢ ➡ 𝐈⦃T⦄. +/3 width=2 by crr_inv_trr/ qed. + +(* Advanced inversion lemmas ************************************************) + +lemma cir_inv_append_sn: ∀G,L,K,T. ⦃G, K @@ L⦄ ⊢ ➡ 𝐈⦃T⦄ → ⦃G, L⦄ ⊢ ➡ 𝐈⦃T⦄. +/3 width=1/ qed-. + +lemma cir_inv_tir: ∀G,T,W. ⦃G, ⋆.ⓛW⦄ ⊢ ➡ 𝐈⦃T⦄ → ⦃G, ⋆⦄ ⊢ ➡ 𝐈⦃T⦄. +/3 width=1/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cix_append.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cix_append.etc new file mode 100644 index 000000000..7b5522ebd --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cix_append.etc @@ -0,0 +1,26 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reduction/crx_append.ma". +include "basic_2/reduction/cix.ma". + +(* IRREDUCIBLE TERMS FOR CONTEXT-SENSITIVE EXTENDED REDUCTION ***************) + +(* Advanced inversion lemmas ************************************************) + +lemma cix_inv_append_sn: ∀h,g,G,L,K,T. ⦃G, K @@ L⦄ ⊢ ➡[h, g] 𝐈⦃T⦄ → ⦃G, L⦄ ⊢ ➡[h, g] 𝐈⦃T⦄. +/3 width=1 by crx_append_sn/ qed-. + +lemma cix_inv_tix: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ ➡[h, g] 𝐈⦃T⦄ → ⦃G, ⋆⦄ ⊢ ➡[h, g] 𝐈⦃T⦄. +/3 width=1 by trx_crx/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cl_shift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cl_shift.etc new file mode 100644 index 000000000..5fdab7148 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cl_shift.etc @@ -0,0 +1,45 @@ +(**************************************************************************) +(* ___ *) +(* ||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/grammar/lenv_append.ma". + +(* SHIFT OF A CLOSURE *******************************************************) + +let rec shift L T on L ≝ match L with +[ LAtom ⇒ T +| LPair L I V ⇒ shift L (-ⓑ{I} V. T) +]. + +interpretation "shift (closure)" 'Append L T = (shift L T). + +(* Basic properties *********************************************************) + +lemma shift_append_assoc: ∀L,K. ∀T:term. (L @@ K) @@ T = L @@ K @@ T. +#L #K elim K -K // normalize // +qed. + +(* Basic inversion lemmas ***************************************************) + +lemma shift_inj: ∀L1,L2. ∀T1,T2:term. L1 @@ T1 = L2 @@ T2 → |L1| = |L2| → + L1 = L2 ∧ T1 = T2. +#L1 elim L1 -L1 +[ * normalize /2 width=1/ + #L2 #I2 #V2 #T1 #T2 #_ shift_append_assoc normalize #H + elim (cpr_inv_bind1 … H) -H * + [ #V0 #T0 #_ #HT10 #H destruct + elim (IH … HT10) -IH -HT10 #L2 #T2 #HL12 #H destruct + >append_length >HL12 -HL12 + @(ex2_2_intro … (⋆.ⓑ{I}V0@@L2) T2) [ >append_length ] /2 width=3 by trans_eq/ (**) (* explicit constructor *) + | #T #_ #_ #H destruct + ] +] +qed-. + diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cpx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cpx.etc new file mode 100644 index 000000000..5f8bf520c --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cpx.etc @@ -0,0 +1,25 @@ +lemma cpx_append: ∀h,g,G. l_appendable_sn … (cpx h g G). +#h #g #G #K #T1 #T2 #H elim H -G -K -T1 -T2 +/2 width=3 by cpx_sort, cpx_bind, cpx_flat, cpx_zeta, cpx_tau, cpx_ti, cpx_beta, cpx_theta/ +#I #G #K #K0 #V1 #V2 #W2 #i #HK0 #_ #HVW2 #IHV12 #L +lapply (ldrop_fwd_length_lt2 … HK0) #H +@(cpx_delta … I … (L@@K0) V1 … HVW2) // +@(ldrop_O1_append_sn_le … HK0) /2 width=2 by lt_to_le/ (**) (* /3/ does not work *) +qed. + +lemma cpx_fwd_shift1: ∀h,g,G,L1,L,T1,T. ⦃G, L⦄ ⊢ L1 @@ T1 ➡[h, g] T → + ∃∃L2,T2. |L1| = |L2| & T = L2 @@ T2. +#h #g #G #L1 @(lenv_ind_dx … L1) -L1 normalize +[ #L #T1 #T #HT1 + @(ex2_2_intro … (⋆)) // (**) (* explicit constructor *) +| #I #L1 #V1 #IH #L #T1 #X + >shift_append_assoc normalize #H + elim (cpx_inv_bind1 … H) -H * + [ #V0 #T0 #_ #HT10 #H destruct + elim (IH … HT10) -IH -HT10 #L2 #T2 #HL12 #H destruct + >append_length >HL12 -HL12 + @(ex2_2_intro … (⋆.ⓑ{I}V0@@L2) T2) [ >append_length ] /2 width=3 by refl, trans_eq/ (**) (* explicit constructor *) + | #T #_ #_ #H destruct + ] +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cpy2.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cpy2.etc new file mode 100644 index 000000000..e941c9653 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cpy2.etc @@ -0,0 +1,27 @@ +include "basic_2/grammar/cl_shift.ma". +include "basic_2/relocation/ldrop_append.ma". + +lemma cpy_append: ∀G,d,e. l_appendable_sn … (cpy d e G). +#G #d #e #K #T1 #T2 #H elim H -G -K -T1 -T2 -d -e +/2 width=1 by cpy_atom, cpy_bind, cpy_flat/ +#I #G #K #K0 #V #W #i #d #e #Hdi #Hide #HK0 #HVW #L +lapply (ldrop_fwd_length_lt2 … HK0) #H +@(cpy_subst I … (L@@K0) … HVW) // (**) (* /4/ does not work *) +@(ldrop_O1_append_sn_le … HK0) /2 width=2 by lt_to_le/ +qed-. + +lemma cpy_fwd_shift1: ∀G,L1,L,T1,T,d,e. ⦃G, L⦄ ⊢ L1 @@ T1 ▶[d, e] T → + ∃∃L2,T2. |L1| = |L2| & T = L2 @@ T2. +#G #L1 @(lenv_ind_dx … L1) -L1 normalize +[ #L #T1 #T #d #e #HT1 + @(ex2_2_intro … (⋆)) // (**) (* explicit constructor *) +| #I #L1 #V1 #IH #L #T1 #X #d #e + >shift_append_assoc normalize #H + elim (cpy_inv_bind1 … H) -H + #V0 #T0 #_ #HT10 #H destruct + elim (IH … HT10) -IH -HT10 #L2 #T2 #HL12 #H destruct + >append_length >HL12 -HL12 + @(ex2_2_intro … (⋆.ⓑ{I}V0@@L2) T2) [ >append_length ] (**) (* explicit constructor *) + /2 width=3 by trans_eq/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cpys0.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cpys0.etc new file mode 100644 index 000000000..fa9bcf6de --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cpys0.etc @@ -0,0 +1,24 @@ +include "basic_2/grammar/cl_shift.ma". +include "basic_2/relocation/ldrop_append.ma". + +lemma cpys_append: ∀G. l_appendable_sn … (cpys G). +#G #K #T1 #T2 #H elim H -G -K -T1 -T2 +/2 width=3 by cpys_bind, cpys_flat/ +#I #G #K #K0 #V1 #V2 #W2 #i #HK0 #_ #HVW2 #IHV12 #L +lapply (ldrop_fwd_length_lt2 … HK0) #H +@(cpys_delta … I … (L@@K0) V1 … HVW2) // +@(ldrop_O1_append_sn_le … HK0) /2 width=2 by lt_to_le/ (**) (* /3/ does not work *) +qed. + +lemma cpys_fwd_shift1: ∀G,L1,L,T1,T. ⦃G, L⦄ ⊢ L1 @@ T1 ▶*× T → + ∃∃L2,T2. |L1| = |L2| & T = L2 @@ T2. +#G #L1 @(lenv_ind_dx … L1) -L1 normalize +[ #L #T1 #T #HT1 @(ex2_2_intro … (⋆)) // (**) (* explicit constructor *) +| #I #L1 #V1 #IH #L #T1 #X >shift_append_assoc normalize + #H elim (cpys_inv_bind1 … H) -H + #V0 #T0 #_ #HT10 #H destruct + elim (IH … HT10) -IH -HT10 #L2 #T2 #HL12 #H destruct + >append_length >HL12 -HL12 + @(ex2_2_intro … (⋆.ⓑ{I}V0@@L2) T2) [ >append_length ] /2 width=3 by trans_eq/ (**) (* explicit constructor *) +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cpys2.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cpys2.etc new file mode 100644 index 000000000..22f74d0a8 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/cpys2.etc @@ -0,0 +1,14 @@ +lemma cpys_append: ∀G,d,e. l_appendable_sn … (cpys d e G). +#G #d #e #K #T1 #T2 #H @(cpys_ind … H) -T2 +/3 width=3 by cpys_strap1, cpy_append/ +qed-. + +lemma cpys_fwd_shift1: ∀G,L,L1,T1,T,d,e. ⦃G, L⦄ ⊢ L1 @@ T1 ▶*[d, e] T → + ∃∃L2,T2. |L1| = |L2| & T = L2 @@ T2. +#G #L #L1 #T1 #T #d #e #H @(cpys_ind … H) -T +[ /2 width=4 by ex2_2_intro/ +| #T #X #_ #HX * #L0 #T0 #HL10 #H destruct + elim (cpy_fwd_shift1 … HX) -HX #L2 #T2 #HL02 #H destruct + /2 width=4 by ex2_2_intro/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/crr_append.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/crr_append.etc new file mode 100644 index 000000000..dbf794d99 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/append/crr_append.etc @@ -0,0 +1,56 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/ldrop_append.ma". +include "basic_2/reduction/crr.ma". + +(* REDUCIBLE TERMS FOR CONTEXT-SENSITIVE REDUCTION **************************) + +(* Advanved properties ******************************************************) + +lemma crr_append_sn: ∀G,L,K,T. ⦃G, L⦄ ⊢ ➡ 𝐑⦃T⦄ → ⦃G, K @@ L⦄ ⊢ ➡ 𝐑⦃T⦄. +#G #L #K0 #T #H elim H -L -T /2 width=1/ +#L #K #V #i #HLK +lapply (ldrop_fwd_length_lt2 … HLK) #Hi +lapply (ldrop_O1_append_sn_le … HLK … K0) -HLK /2 width=2/ -Hi /2 width=3/ +qed. + +lemma trr_crr: ∀G,L,T. ⦃G, ⋆⦄ ⊢ ➡ 𝐑⦃T⦄ → ⦃G, L⦄ ⊢ ➡ 𝐑⦃T⦄. +#G #L #T #H lapply (crr_append_sn … H) // +qed. + +(* Advanced inversion lemmas ************************************************) + +fact crr_inv_labst_last_aux: ∀G,L1,T,W. ⦃G, L1⦄ ⊢ ➡ 𝐑⦃T⦄ → + ∀L2. L1 = ⋆.ⓛW @@ L2 → ⦃G, L2⦄ ⊢ ➡ 𝐑⦃T⦄. +#G #L1 #T #W #H elim H -L1 -T /2 width=1/ /3 width=1/ +[ #L1 #K1 #V1 #i #HLK1 #L2 #H destruct + lapply (ldrop_fwd_length_lt2 … HLK1) + >append_length >commutative_plus normalize in ⊢ (??% → ?); #H + elim (le_to_or_lt_eq i (|L2|)) /2 width=1/ -H #Hi destruct + [ elim (ldrop_O1_lt … Hi) #I2 #K2 #V2 #HLK2 + lapply (ldrop_O1_inv_append1_le … HLK1 … HLK2) -HLK1 /2 width=2/ -Hi + normalize #H destruct /2 width=3/ + | lapply (ldrop_O1_inv_append1_ge … HLK1 ?) -HLK1 // shift_append_assoc #H (ldrop_fwd_length … HL) -HL // +qed. + +lemma cny_lref_top: ∀G,L,d,e,i. d+e ≤ yinj i → ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃#i⦄. +#G #L #d #e #i #Hdei #X #H elim (cpy_inv_lref1 … H) -H // * +#I #K #V #_ #H elim (ylt_yle_false … H) // +qed. + +lemma cny_lref_skip: ∀G,L,d,e,i. yinj i < d → ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃#i⦄. +#G #L #d #e #i #Hid #X #H elim (cpy_inv_lref1 … H) -H // * +#I #K #V #H elim (ylt_yle_false … H) // +qed. + +lemma cny_gref: ∀G,L,d,e,p. ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃§p⦄. +#G #L #d #e #p #X #H elim (cpy_inv_gref1 … H) -H // +qed. + +lemma cny_bind: ∀G,L,V,d,e. ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃V⦄ → + ∀I,T. ⦃G, L.ⓑ{I}V⦄ ⊢ ▶[⫯d, e] 𝐍⦃T⦄ → + ∀a. ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃ⓑ{a,I}V.T⦄. +#G #L #V1 #d #e #HV1 #I #T1 #HT1 #a #X #H +elim (cpy_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct +>(HV1 … HV12) -V2 >(HT1 … HT12) -T2 // +qed. + +lemma cny_flat: ∀G,L,V,d,e. ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃V⦄ → + ∀T. ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃T⦄ → + ∀I. ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃ⓕ{I}V.T⦄. +#G #L #V1 #d #e #HV1 #T1 #HT1 #I #X #H +elim (cpy_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct +>(HV1 … HV12) -V2 >(HT1 … HT12) -T2 // +qed. + +lemma cny_narrow: ∀G,L,T,d1,e1. ⦃G, L⦄ ⊢ ▶[d1, e1] 𝐍⦃T⦄ → + ∀d2,e2. d1 ≤ d2 → d2 + e2 ≤ d1 + e1 → ⦃G, L⦄ ⊢ ▶[d2, e2] 𝐍⦃T⦄. +#G #L #T1 #d1 #e1 #HT1 #d2 #e2 #Hd12 #Hde21 #T2 #HT12 +@HT1 /2 width=5 by cpy_weak/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cny_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cny_lift.etc new file mode 100644 index 000000000..213fa6abb --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cny_lift.etc @@ -0,0 +1,118 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/cpy_lift.ma". +include "basic_2/relocation/cny.ma". + +(* NORMAL TERMS FOR CONTEXT-SENSITIVE EXTENDED SUBSTITUTION *****************) + +(* Properties on relocation *************************************************) + +lemma cny_lift_le: ∀G,L,K,T,U,s,d,dt,e,et. ⦃G, K⦄ ⊢ ▶[dt, et] 𝐍⦃T⦄ → ⇩[s, d, e] L ≡ K → + ⇧[d, e] T ≡ U → dt + et ≤ d → ⦃G, L⦄ ⊢ ▶[dt, et] 𝐍⦃U⦄. +#G #L #K #T1 #U1 #s #d #dt #e #et #HT1 #HLK #HTU1 #Hdetd #U2 #HU12 +elim (cpy_inv_lift1_le … HU12 … HLK … HTU1) // -L -Hdetd #T2 #HT12 +>(HT1 … HT12) -K /2 width=5 by lift_mono/ +qed-. + +lemma cny_lift_be: ∀G,L,K,T,U,s,d,dt,e,et. ⦃G, K⦄ ⊢ ▶[dt, et] 𝐍⦃T⦄ → ⇩[s, d, e] L ≡ K → + ⇧[d, e] T ≡ U → dt ≤ d → yinj d ≤ dt + et → ⦃G, L⦄ ⊢ ▶[dt, et+e] 𝐍⦃U⦄. +#G #L #K #T1 #U1 #s #d #dt #e #et #HT1 #HLK #HTU1 #Hdtd #Hddet #U2 #HU12 +elim (cpy_inv_lift1_be … HU12 … HLK … HTU1) /2 width=1 by monotonic_yle_plus_dx/ -L -Hdtd -Hddet #T2 +>yplus_minus_inj #HT12 >(HT1 … HT12) -K /2 width=5 by lift_mono/ +qed-. + +lemma cny_lift_ge: ∀G,L,K,T,U,s,d,dt,e,et. ⦃G, K⦄ ⊢ ▶[dt, et] 𝐍⦃T⦄ → ⇩[s, d, e] L ≡ K → + ⇧[d, e] T ≡ U → d ≤ dt → ⦃G, L⦄ ⊢ ▶[dt+e, et] 𝐍⦃U⦄. +#G #L #K #T1 #U1 #s #d #dt #e #et #HT1 #HLK #HTU1 #Hddt #U2 #HU12 +elim (cpy_inv_lift1_ge … HU12 … HLK … HTU1) /2 width=1 by monotonic_yle_plus_dx/ -L -Hddt #T2 +>yplus_minus_inj #HT12 >(HT1 … HT12) -K /2 width=5 by lift_mono/ +qed-. + +(* Inversion lemmas on relocation *******************************************) + +lemma cny_inv_lift_le: ∀G,L,K,T,U,s,d,dt,e,et. ⦃G, L⦄ ⊢ ▶[dt, et] 𝐍⦃U⦄ → ⇩[s, d, e] L ≡ K → + ⇧[d, e] T ≡ U → dt + et ≤ d → ⦃G, K⦄ ⊢ ▶[dt, et] 𝐍⦃T⦄. +#G #L #K #T1 #U1 #s #d #dt #e #et #HU1 #HLK #HTU1 #Hdetd #T2 #HT12 +elim (lift_total T2 d e) #U2 #HTU2 +lapply (cpy_lift_le … HT12 … HLK … HTU1 … HTU2 ?) // -K -Hdetd #HU12 +lapply (HU1 … HU12) -L /2 width=5 by lift_inj/ +qed-. + +lemma cny_inv_lift_be: ∀G,L,K,T,U,s,d,dt,e,et. ⦃G, L⦄ ⊢ ▶[dt, et] 𝐍⦃U⦄ → ⇩[s, d, e] L ≡ K → + ⇧[d, e] T ≡ U → dt ≤ d → yinj d + e ≤ dt + et → ⦃G, K⦄ ⊢ ▶[dt, et-e] 𝐍⦃T⦄. +#G #L #K #T1 #U1 #s #d #dt #e #et #HU1 #HLK #HTU1 #Hdtd #Hdedet #T2 #HT12 +lapply (yle_fwd_plus_ge_inj … Hdedet) // #Heet +elim (yle_inv_plus_inj2 … Hdedet) -Hdedet #Hddete #Hedet +elim (lift_total T2 d e) #U2 #HTU2 +lapply (cpy_lift_be … HT12 … HLK … HTU1 … HTU2 ? ?) // [ >yplus_minus_assoc_inj // ] -K -Hdtd -Hddete +>ymax_pre_sn // -Heet #HU12 +lapply (HU1 … HU12) -L /2 width=5 by lift_inj/ +qed-. + +lemma cny_inv_lift_ge: ∀G,L,K,T,U,s,d,dt,e,et. ⦃G, L⦄ ⊢ ▶[dt, et] 𝐍⦃U⦄ → ⇩[s, d, e] L ≡ K → + ⇧[d, e] T ≡ U → yinj d + e ≤ dt → ⦃G, K⦄ ⊢ ▶[dt-e, et] 𝐍⦃T⦄. +#G #L #K #T1 #U1 #s #d #dt #e #et #HU1 #HLK #HTU1 #Hdedt #T2 #HT12 +elim (yle_inv_plus_inj2 … Hdedt) -Hdedt #Hddte #Hedt +elim (lift_total T2 d e) #U2 #HTU2 +lapply (cpy_lift_ge … HT12 … HLK … HTU1 … HTU2 ?) // -K -Hddte +>ymax_pre_sn // -Hedt #HU12 +lapply (HU1 … HU12) -L /2 width=5 by lift_inj/ +qed-. + +(* Advanced inversion lemmas on relocation **********************************) + +lemma cny_inv_lift_ge_up: ∀G,L,K,T,U,s,d,dt,e,et. ⦃G, L⦄ ⊢ ▶[dt, et] 𝐍⦃U⦄ → ⇩[s, d, e] L ≡ K → + ⇧[d, e] T ≡ U → d ≤ dt → dt ≤ yinj d + e → yinj d + e ≤ dt + et → + ⦃G, K⦄ ⊢ ▶[d, dt + et - (yinj d + e)] 𝐍⦃T⦄. +#G #L #K #T1 #U1 #s #d #dt #e #et #HU1 #HLK #HTU1 #Hddt #Hdtde #Hdedet +lapply (cny_narrow … HU1 (d+e) (dt+et-(d+e)) ? ?) -HU1 [ >ymax_pre_sn_comm ] // #HU1 +lapply (cny_inv_lift_ge … HU1 … HLK … HTU1 ?) // -L -U1 +>yplus_minus_inj // +qed-. + +lemma cny_inv_lift_subst: ∀G,L,K,V,W,i,d,e. d ≤ yinj i → i < d + e → + ⇩[i+1] L ≡ K → ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃W⦄ → + ⇧[O, i+1] V ≡ W → ⦃G, K⦄ ⊢ ▶[O, ⫰(d+e-i)] 𝐍⦃V⦄. +#G #L #K #V #W #i #d #e #Hdi #Hide #HLK #HW #HVW +lapply (cny_inv_lift_ge_up … HW … HLK … HVW ? ? ?) // +>yplus_O1 yplus_SO2 +[ /2 width=1 by ylt_fwd_le_succ1/ +| /2 width=3 by yle_trans/ +| >yminus_succ2 // +] +qed-. + +(* Advanced properties ******************************************************) + +(* Note: this should be applicable in a forward manner *) +lemma cny_lift_ge_up: ∀G,L,K,T,U,s,d,dt,e,et. ⦃G, K⦄ ⊢ ▶[yinj d, dt + et - (yinj d + yinj e)] 𝐍⦃T⦄ → + ⇩[s, d, e] L ≡ K → ⇧[d, e] T ≡ U → + yinj d ≤ dt → dt ≤ yinj d + yinj e → yinj d + yinj e ≤ dt + et → + ⦃G, L⦄ ⊢ ▶[dt, et] 𝐍⦃U⦄. +#G #L #K #T1 #U1 #s #d #dt #e #et #HT1 #HLK #HTU1 #Hddt #Hdtde #Hdedet +lapply (cny_lift_be … HT1 … HLK … HTU1 ? ?) // -K -T1 +#HU1 @(cny_narrow … HU1) -HU1 // (**) (* auto fails *) +qed-. + +lemma cny_lift_subst: ∀G,L,K,V,W,i,d,e. d ≤ yinj i → i < d + e → + ⇩[i+1] L ≡ K → ⦃G, K⦄ ⊢ ▶[O, ⫰(d+e-i)] 𝐍⦃V⦄ → + ⇧[O, i+1] V ≡ W → ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃W⦄. +#G #L #K #V #W #i #d #e #Hdi #Hide #HLK #HV #HVW +@(cny_lift_ge_up … HLK … HVW) // >yplus_O1 yplus_SO2 +[ >yminus_succ2 // +| /2 width=3 by yle_trans/ +| /2 width=1 by ylt_fwd_le_succ1/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpx_cpzs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpx_cpzs.etc new file mode 100644 index 000000000..6c208d51b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpx_cpzs.etc @@ -0,0 +1,73 @@ +(**************************************************************************) +(* ___ *) +(* ||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/delta_equivalence/cpzs.ma". +include "basic_2/reduction/cpx.ma". + +fact destruct_tsort_tsort: ∀k1,k2. ⋆k1 = ⋆k2 → k1 = k2. +#k1 #k2 #H destruct // +qed-. + +axiom cpzs_inv_subst: ∀I,G,L,K,V1,V2,W2,i. + ⇩[i] L ≡ K.ⓑ{I}V1 → ⇧[O, i+1] V2 ≡ W2 → + ⦃G, L⦄ ⊢ #i ◆*[O, ∞] W2 → ⦃G, K⦄⊢ V1 ◆*[O, ∞] V2. + +axiom cpzs_subst: ∀I,G,L,K,V1,V2,W2,i. + ⇩[i] L ≡ K.ⓑ{I}V1 → ⇧[O, i+1] V2 ≡ W2 → + ⦃G, K⦄⊢ V1 ◆*[O, ∞] V2 → ⦃G, L⦄ ⊢ #i ◆*[O, ∞] W2. + +(* CONTEXT-SENSITIVE EXTENDED PARALLEL REDUCTION FOR TERMS ******************) + +(* Forward lemmas on delta-equivalence for terms ****************************) + +lemma cpx_fwd_cpys_cpzs: ∀h,g,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 → + ∀d,e. ⦃G, L⦄ ⊢ T1 ◆*[d, e] T2 ↔ ⦃G, L⦄ ⊢ T1 ▶*[d, e] T2. +#h #g #G #L #T1 #T2 #H elim H -G -L -T1 -T2 +[ /2 width=1 by conj/ +| #G #L #k #l #_ #d #e @conj #H lapply (next_lt h k) + [ <(cpzs_inv_sort … H) + | lapply (cpys_inv_sort1 … H) -H #H >(destruct_tsort_tsort … H) + ] -H #H elim (lt_refl_false … H) +| #I #G #L #K #V1 #V2 #W2 #i #HLK #_ #HVW2 #IHV12 #d #e @conj #H +(* + [ @(cpys_subst … HLK … HVW2) // >yminus_Y_inj /3 width=7 by cpzs_inv_subst/ + | elim (cpys_inv_lref1_ldrop … H … HLK … HVW2) -H /3 width=7 by cpzs_subst/ + ] +*) +| #a #I #G #L #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #d #e + elim (IHV12 d e) -IHV12 elim (IHT12 (⫯d) e) -IHT12 + #IHTdx #IHTsn #IHVdx #IHVsn @conj #H + [ elim (cpzs_inv_bind … H) -H /3 width=1 by cpys_bind/ + | elim (cpys_inv_bind1 … H) -H #X1 #X2 #H1 #H2 #H destruct /3 width=1 by cpzs_bind/ + ] +| #I #G #L #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #d #e + elim (IHV12 d e) -IHV12 elim (IHT12 (d) e) -IHT12 + #IHTdx #IHTsn #IHVdx #IHVsn @conj #H + [ elim (cpzs_inv_flat … H) -H /3 width=1 by cpys_flat/ + | elim (cpys_inv_flat1 … H) -H #X1 #X2 #H1 #H2 #H destruct /3 width=1 by cpzs_flat/ + ] +| #G #L #V #U1 #U2 #T2 #_ #HTU2 #_ #d #e @conj #H +| #G #L #V1 #T1 #T2 #_ #_ #d #e @conj #H +| #G #L #V1 #V2 #T1 #HV12 #_ #d #e @conj #H +| #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #d #e @conj #H + [ elim (cpzs_inv_flat_bind … H) + | elim (cpys_inv_flat1 … H) -H #X1 #X2 #H1 #H2 #H destruct + ] +| #a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #_ #d #e @conj #H + [ elim (cpzs_inv_flat_bind … H) + | elim (cpys_inv_flat1 … H) -H #X1 #X2 #H1 #H2 #H destruct + ] +] + + \ No newline at end of file diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpye.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpye.etc new file mode 100644 index 000000000..71e06ea72 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpye.etc @@ -0,0 +1,89 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/psubsteval_6.ma". +include "basic_2/relocation/cny.ma". +include "basic_2/substitution/cpys.ma". + +(* EVALUATION FOR CONTEXT-SENSITIVE EXTENDED SUBSTITUTION ON TERMS **********) + +definition cpye: ynat → ynat → relation4 genv lenv term term ≝ + λd,e,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ▶*[d, e] T2 ∧ ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃T2⦄. + +interpretation "evaluation for context-sensitive extended substitution (term)" + 'PSubstEval G L T1 T2 d e = (cpye d e G L T1 T2). + +(* Basic_properties *********************************************************) + +(* Note: this should go in subconversion *) +lemma leqy_cpye_trans: ∀G,L2,T1,T2,d,e. ⦃G, L2⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T2⦄ → + ∀L1. L1 ⊑×[d, e] L2 → L2 ⊑×[d, e] L1 → ⦃G, L1⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T2⦄. +#G #L2 #T1 #T2 #d #e * +/4 width=8 by lsuby_cpys_trans, lsuby_cny_conf, conj/ +qed-. + +lemma cpye_sort: ∀G,L,d,e,k. ⦃G, L⦄ ⊢ ⋆k ▶*[d, e] 𝐍⦃⋆k⦄. +/3 width=5 by cny_sort, conj/ qed. + +lemma cpye_free: ∀G,L,d,e,i. |L| ≤ i → ⦃G, L⦄ ⊢ #i ▶*[d, e] 𝐍⦃#i⦄. +/3 width=6 by cny_lref_free, conj/ qed. + +lemma cpye_top: ∀G,L,d,e,i. d + e ≤ yinj i → ⦃G, L⦄ ⊢ #i ▶*[d, e] 𝐍⦃#i⦄. +/3 width=6 by cny_lref_top, conj/ qed. + +lemma cpye_skip: ∀G,L,d,e,i. yinj i < d → ⦃G, L⦄ ⊢ #i ▶*[d, e] 𝐍⦃#i⦄. +/3 width=6 by cny_lref_skip, conj/ qed. + +lemma cpye_gref: ∀G,L,d,e,p. ⦃G, L⦄ ⊢ §p ▶*[d, e] 𝐍⦃§p⦄. +/3 width=5 by cny_gref, conj/ qed. + +lemma cpye_bind: ∀G,L,V1,V2,d,e. ⦃G, L⦄ ⊢ V1 ▶*[d, e] 𝐍⦃V2⦄ → + ∀I,T1,T2. ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ▶*[⫯d, e] 𝐍⦃T2⦄ → + ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ▶*[d, e] 𝐍⦃ⓑ{a,I}V2.T2⦄. +#G #L #V1 #V2 #d #e * #HV12 #HV2 #I #T1 #T2 * +/5 width=8 by cpys_bind, cny_bind, lsuby_cny_conf, lsuby_succ, conj/ +qed. + +lemma cpye_flat: ∀G,L,V1,V2,d,e. ⦃G, L⦄ ⊢ V1 ▶*[d, e] 𝐍⦃V2⦄ → + ∀T1,T2. ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T2⦄ → + ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ▶*[d, e] 𝐍⦃ⓕ{I}V2.T2⦄. +#G #L #V1 #V2 #d #e * #HV12 #HV2 #T1 #T2 * +/3 width=7 by cpys_flat, cny_flat, conj/ +qed. + +(* Basic inversion lemmas ***************************************************) + +lemma cpye_inv_sort1: ∀G,L,X,d,e,k. ⦃G, L⦄ ⊢ ⋆k ▶*[d, e] 𝐍⦃X⦄ → X = ⋆k. +#G #L #X #d #e #k * /2 width=5 by cpys_inv_sort1/ +qed-. + +lemma cpye_inv_gref1: ∀G,L,X,d,e,p. ⦃G, L⦄ ⊢ §p ▶*[d, e] 𝐍⦃X⦄ → X = §p. +#G #L #X #d #e #p * /2 width=5 by cpys_inv_gref1/ +qed-. + +lemma cpye_inv_bind1: ∀a,I,G,L,V1,T1,X,d,e. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ▶*[d, e] 𝐍⦃X⦄ → + ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ▶*[d, e] 𝐍⦃V2⦄ & ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ▶*[⫯d, e] 𝐍⦃T2⦄ & + X = ⓑ{a,I}V2.T2. +#a #I #G #L #V1 #T1 #X #d #e * #H1 #H2 elim (cpys_inv_bind1 … H1) -H1 +#V2 #T2 #HV12 #HT12 #H destruct elim (cny_inv_bind … H2) -H2 +/5 width=8 by lsuby_cny_conf, lsuby_succ, ex3_2_intro, conj/ +qed-. + +lemma cpye_inv_flat1: ∀I,G,L,V1,T1,X,d,e. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ▶*[d, e] 𝐍⦃X⦄ → + ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ▶*[d, e] 𝐍⦃V2⦄ & ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T2⦄ & + X = ⓕ{I}V2.T2. +#I #G #L #V1 #T1 #X #d #e * #H1 #H2 elim (cpys_inv_flat1 … H1) -H1 +#V2 #T2 #HV12 #HT12 #H destruct elim (cny_inv_flat … H2) -H2 +/3 width=5 by ex3_2_intro, conj/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpye_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpye_alt.etc new file mode 100644 index 000000000..a9dc53cf5 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpye_alt.etc @@ -0,0 +1,89 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/psubstevalalt_6.ma". +include "basic_2/substitution/cpye_lift.ma". + +(* EVALUATION FOR CONTEXT-SENSITIVE EXTENDED SUBSTITUTION ON TERMS **********) + +(* Note: alternative definition of cpye *) +inductive cpyea: ynat → ynat → relation4 genv lenv term term ≝ +| cpyea_sort : ∀G,L,d,e,k. cpyea d e G L (⋆k) (⋆k) +| cpyea_free : ∀G,L,d,e,i. |L| ≤ i → cpyea d e G L (#i) (#i) +| cpyea_top : ∀G,L,d,e,i. d + e ≤ yinj i → cpyea d e G L (#i) (#i) +| cpyea_skip : ∀G,L,d,e,i. yinj i < d → cpyea d e G L (#i) (#i) +| cpyea_subst: ∀I,G,L,K,V1,V2,W2,i,d,e. d ≤ yinj i → yinj i < d+e → + ⇩[i] L ≡ K.ⓑ{I}V1 → cpyea (yinj 0) (⫰(d+e-yinj i)) G K V1 V2 → + ⇧[0, i+1] V2 ≡ W2 → cpyea d e G L (#i) W2 +| cpyea_gref : ∀G,L,d,e,p. cpyea d e G L (§p) (§p) +| cpyea_bind : ∀a,I,G,L,V1,V2,T1,T2,d,e. + cpyea d e G L V1 V2 → cpyea (⫯d) e G (L.ⓑ{I}V1) T1 T2 → + cpyea d e G L (ⓑ{a,I}V1.T1) (ⓑ{a,I}V2.T2) +| cpyea_flat : ∀I,G,L,V1,V2,T1,T2,d,e. + cpyea d e G L V1 V2 → cpyea d e G L T1 T2 → + cpyea d e G L (ⓕ{I}V1.T1) (ⓕ{I}V2.T2) +. + +interpretation + "evaluation for context-sensitive extended substitution (term) alternative" + 'PSubstEvalAlt G L T1 T2 d e = (cpyea d e G L T1 T2). + +(* Main properties **********************************************************) + +theorem cpye_cpyea: ∀G,L,T1,T2,d,e. ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T2⦄ → ⦃G, L⦄ ⊢ T1 ▶▶*[d, e] 𝐍⦃T2⦄. +#G #L #T1 @(fqup_wf_ind_eq … G L T1) -G -L -T1 +#Z #Y #X #IH #G #L * * +[ #k #_ #_ #_ #T2 #d #e #H -X -Y -Z >(cpye_inv_sort1 … H) -H // +| #i #HG #HL #HT #T2 #d #e #H destruct + elim (cpye_inv_lref1 … H) -H * + /4 width=7 by cpyea_subst, cpyea_free, cpyea_top, cpyea_skip, fqup_lref/ +| #p #_ #_ #_ #T2 #d #e #H -X -Y -Z >(cpye_inv_gref1 … H) -H // +| #a #I #V1 #T1 #HG #HL #HT #T #d #e #H destruct + elim (cpye_inv_bind1 … H) -H /3 width=1 by cpyea_bind/ +| #I #V1 #T1 #HG #HL #HT #T #d #e #H destruct + elim (cpye_inv_flat1 … H) -H /3 width=1 by cpyea_flat/ +] +qed. + +(* Main inversion properties ************************************************) + +theorem cpyea_inv_cpye: ∀G,L,T1,T2,d,e. ⦃G, L⦄ ⊢ T1 ▶▶*[d, e] 𝐍⦃T2⦄ → ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T2⦄. +#G #L #T1 #T2 #d #e #H elim H -G -L -T1 -T2 -d -e +/2 width=7 by cpye_subst, cpye_flat, cpye_bind, cpye_skip, cpye_top, cpye_free/ +qed-. + +(* Advanced eliminators *****************************************************) + +lemma cpye_ind_alt: ∀R:ynat→ynat→relation4 genv lenv term term. + (∀G,L,d,e,k. R d e G L (⋆k) (⋆k)) → + (∀G,L,d,e,i. |L| ≤ i → R d e G L (#i) (#i)) → + (∀G,L,d,e,i. d + e ≤ yinj i → R d e G L (#i) (#i)) → + (∀G,L,d,e,i. yinj i < d → R d e G L (#i) (#i)) → + (∀I,G,L,K,V1,V2,W2,i,d,e. d ≤ yinj i → yinj i < d + e → + ⇩[i] L ≡ K.ⓑ{I}V1 → ⦃G, K⦄ ⊢ V1 ▶*[yinj O, ⫰(d+e-yinj i)] 𝐍⦃V2⦄ → + ⇧[O, i+1] V2 ≡ W2 → R (yinj O) (⫰(d+e-yinj i)) G K V1 V2 → R d e G L (#i) W2 + ) → + (∀G,L,d,e,p. R d e G L (§p) (§p)) → + (∀a,I,G,L,V1,V2,T1,T2,d,e. ⦃G, L⦄ ⊢ V1 ▶*[d, e] 𝐍⦃V2⦄ → + ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ▶*[⫯d, e] 𝐍⦃T2⦄ → R d e G L V1 V2 → + R (⫯d) e G (L.ⓑ{I}V1) T1 T2 → R d e G L (ⓑ{a,I}V1.T1) (ⓑ{a,I}V2.T2) + ) → + (∀I,G,L,V1,V2,T1,T2,d,e. ⦃G, L⦄ ⊢ V1 ▶*[d, e] 𝐍⦃V2⦄ → + ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T2⦄ → R d e G L V1 V2 → + R d e G L T1 T2 → R d e G L (ⓕ{I}V1.T1) (ⓕ{I}V2.T2) + ) → + ∀d,e,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T2⦄ → R d e G L T1 T2. +#R #H1 #H2 #H3 #H4 #H5 #H6 #H7 #H8 #d #e #G #L #T1 #T2 #H elim (cpye_cpyea … H) -G -L -T1 -T2 -d -e +/3 width=8 by cpyea_inv_cpye/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpye_cpye.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpye_cpye.etc new file mode 100644 index 000000000..42bd19b8e --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpye_cpye.etc @@ -0,0 +1,28 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/cpys_cny.ma". +include "basic_2/substitution/cpys_cpys.ma". +include "basic_2/substitution/cpye.ma". + +(* EVALUATION FOR CONTEXT-SENSITIVE EXTENDED SUBSTITUTION ON TERMS **********) + +(* Advanced properties ******************************************************) + +lemma cpye_cpys_conf: ∀G,L,T,T2,d,e. ⦃G, L⦄ ⊢ T ▶*[d, e] 𝐍⦃T2⦄ → + ∀T1. ⦃G, L⦄ ⊢ T ▶*[d, e] T1 → ⦃G, L⦄ ⊢ T1 ▶*[d, e] T2. +#G #L #T #T2 #d #e * #H2 #HT2 #T1 #H1 elim (cpys_conf_eq … H1 … H2) -T +#T0 #HT10 #HT20 >(cpys_inv_cny1 … HT2 … HT20) -T2 // +qed-. + \ No newline at end of file diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpye_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpye_lift.etc new file mode 100644 index 000000000..3c0abe617 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpye_lift.etc @@ -0,0 +1,169 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/cny_lift.ma". +include "basic_2/substitution/fqup.ma". +include "basic_2/substitution/cpys_lift.ma". +include "basic_2/substitution/cpye.ma". + +(* EVALUATION FOR CONTEXT-SENSITIVE EXTENDED SUBSTITUTION ON TERMS **********) + +(* Advanced properties ******************************************************) + +lemma cpye_subst: ∀I,G,L,K,V1,V2,W2,i,d,e. d ≤ yinj i → i < d + e → + ⇩[i] L ≡ K.ⓑ{I}V1 → ⦃G, K⦄ ⊢ V1 ▶*[O, ⫰(d+e-i)] 𝐍⦃V2⦄ → + ⇧[O, i+1] V2 ≡ W2 → ⦃G, L⦄ ⊢ #i ▶*[d, e] 𝐍⦃W2⦄. +#I #G #L #K #V1 #V2 #W2 #i #d #e #Hdi #Hide #HLK * +/4 width=13 by cpys_subst, cny_lift_subst, ldrop_fwd_drop2, conj/ +qed. + +lemma cpye_total: ∀G,L,T1,d,e. ∃T2. ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T2⦄. +#G #L #T1 @(fqup_wf_ind_eq … G L T1) -G -L -T1 +#Z #Y #X #IH #G #L * * +[ #k #HG #HL #HT #d #e destruct -IH /2 width=2 by ex_intro/ +| #i #HG #HL #HT #d #e destruct + elim (ylt_split i d) /3 width=2 by cpye_skip, ex_intro/ + elim (ylt_split i (d+e)) /3 width=2 by cpye_top, ex_intro/ + elim (lt_or_ge i (|L|)) /3 width=2 by cpye_free, ex_intro/ + #Hi #Hide #Hdi elim (ldrop_O1_lt L i) // -Hi + #I #K #V1 #HLK elim (IH G K V1 … 0 (⫰(d+e-i))) -IH /2 width=2 by fqup_lref/ + #V2 elim (lift_total V2 0 (i+1)) /3 width=8 by ex_intro, cpye_subst/ +| #p #HG #HL #HT #d #e destruct -IH /2 width=2 by ex_intro/ +| #a #I #V1 #T1 #HG #HL #HT #d #e destruct + elim (IH G L V1 … d e) // elim (IH G (L.ⓑ{I}V1) T1 … (⫯d) e) // + /3 width=2 by cpye_bind, ex_intro/ +| #I #V1 #T1 #HG #HL #HT #d #e destruct + elim (IH G L V1 … d e) // elim (IH G L T1 … d e) // + /3 width=2 by cpye_flat, ex_intro/ +] +qed-. + +(* Advanced inversion lemmas ************************************************) + +lemma cpye_inv_lref1: ∀G,L,T2,d,e,i. ⦃G, L⦄ ⊢ #i ▶*[d, e] 𝐍⦃T2⦄ → + ∨∨ |L| ≤ i ∧ T2 = #i + | d + e ≤ yinj i ∧ T2 = #i + | yinj i < d ∧ T2 = #i + | ∃∃I,K,V1,V2. d ≤ yinj i & yinj i < d + e & + ⇩[i] L ≡ K.ⓑ{I}V1 & + ⦃G, K⦄ ⊢ V1 ▶*[yinj 0, ⫰(d+e-yinj i)] 𝐍⦃V2⦄ & + ⇧[O, i+1] V2 ≡ T2. +#G #L #T2 #i #d #e * #H1 #H2 elim (cpys_inv_lref1 … H1) -H1 +[ #H destruct elim (cny_inv_lref … H2) -H2 + /3 width=1 by or4_intro0, or4_intro1, or4_intro2, conj/ +| * #I #K #V1 #V2 #Hdi #Hide #HLK #HV12 #HVT2 + @or4_intro3 @(ex5_4_intro … HLK … HVT2) (**) (* explicit constructor *) + /4 width=13 by cny_inv_lift_subst, ldrop_fwd_drop2, conj/ +] +qed-. + +lemma cpye_inv_lref1_free: ∀G,L,T2,d,e,i. ⦃G, L⦄ ⊢ #i ▶*[d, e] 𝐍⦃T2⦄ → + (∨∨ |L| ≤ i | d + e ≤ yinj i | yinj i < d) → T2 = #i. +#G #L #T2 #d #e #i #H * elim (cpye_inv_lref1 … H) -H * // +#I #K #V1 #V2 #Hdi #Hide #HLK #_ #_ #H +[ elim (lt_refl_false i) -d + @(lt_to_le_to_lt … H) -H /2 width=5 by ldrop_fwd_length_lt2/ (**) (* full auto slow: 19s *) +] +elim (ylt_yle_false … H) // +qed-. + +lemma cpye_inv_lref1_lget: ∀G,L,T2,d,e,i. ⦃G, L⦄ ⊢ #i ▶*[d, e] 𝐍⦃T2⦄ → + ∀I,K,V1. ⇩[i] L ≡ K.ⓑ{I}V1 → + ∨∨ d + e ≤ yinj i ∧ T2 = #i + | yinj i < d ∧ T2 = #i + | ∃∃V2. d ≤ yinj i & yinj i < d + e & + ⦃G, K⦄ ⊢ V1 ▶*[yinj 0, ⫰(d+e-yinj i)] 𝐍⦃V2⦄ & + ⇧[O, i+1] V2 ≡ T2. +#G #L #T2 #d #e #i #H #I #K #V1 #HLK elim (cpye_inv_lref1 … H) -H * +[ #H elim (lt_refl_false i) -T2 -d + @(lt_to_le_to_lt … H) -H /2 width=5 by ldrop_fwd_length_lt2/ +| /3 width=1 by or3_intro0, conj/ +| /3 width=1 by or3_intro1, conj/ +| #Z #Y #X1 #X2 #Hdi #Hide #HLY #HX12 #HXT2 + lapply (ldrop_mono … HLY … HLK) -HLY -HLK #H destruct + /3 width=3 by or3_intro2, ex4_intro/ +] +qed-. + +lemma cpye_inv_lref1_subst_ex: ∀G,L,T2,d,e,i. ⦃G, L⦄ ⊢ #i ▶*[d, e] 𝐍⦃T2⦄ → + ∀I,K,V1. d ≤ yinj i → yinj i < d + e → + ⇩[i] L ≡ K.ⓑ{I}V1 → + ∃∃V2. ⦃G, K⦄ ⊢ V1 ▶*[yinj 0, ⫰(d+e-yinj i)] 𝐍⦃V2⦄ & + ⇧[O, i+1] V2 ≡ T2. +#G #L #T2 #d #e #i #H #I #K #V1 #Hdi #Hide #HLK +elim (cpye_inv_lref1_lget … H … HLK) -H * /2 width=3 by ex2_intro/ +#H elim (ylt_yle_false … H) // +qed-. + +lemma cpye_inv_lref1_subst: ∀G,L,T2,d,e,i. ⦃G, L⦄ ⊢ #i ▶*[d, e] 𝐍⦃T2⦄ → + ∀I,K,V1,V2. d ≤ yinj i → yinj i < d + e → + ⇩[i] L ≡ K.ⓑ{I}V1 → ⇧[O, i+1] V2 ≡ T2 → + ⦃G, K⦄ ⊢ V1 ▶*[yinj 0, ⫰(d+e-yinj i)] 𝐍⦃V2⦄. +#G #L #T2 #d #e #i #H #I #K #V1 #V2 #Hdi #Hide #HLK #HVT2 +elim (cpye_inv_lref1_subst_ex … H … HLK) -H -HLK // +#X2 #H0 #HXT2 lapply (lift_inj … HXT2 … HVT2) -HXT2 -HVT2 #H destruct // +qed-. + +(* Inversion lemmas on relocation *******************************************) + +lemma cpye_inv_lift1_le: ∀G,L,U1,U2,dt,et. ⦃G, L⦄ ⊢ U1 ▶*[dt, et] 𝐍⦃U2⦄ → + ∀K,s,d,e. ⇩[s, d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → + dt + et ≤ d → + ∃∃T2. ⦃G, K⦄ ⊢ T1 ▶*[dt, et] 𝐍⦃T2⦄ & ⇧[d, e] T2 ≡ U2. +#G #L #U1 #U2 #dt #et * #HU12 #HU2 #K #s #d #e #HLK #T1 #HTU1 #Hdetd +elim (cpys_inv_lift1_le … HU12 … HLK … HTU1) -U1 // #T2 #HT12 #HTU2 +lapply (cny_inv_lift_le … HU2 … HLK … HTU2 ?) -L +/3 width=3 by ex2_intro, conj/ +qed-. + +lemma cpye_inv_lift1_be: ∀G,L,U1,U2,dt,et. ⦃G, L⦄ ⊢ U1 ▶*[dt, et] 𝐍⦃U2⦄ → + ∀K,s,d,e. ⇩[s, d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → + dt ≤ d → yinj d + e ≤ dt + et → + ∃∃T2. ⦃G, K⦄ ⊢ T1 ▶*[dt, et - e] 𝐍⦃T2⦄ & ⇧[d, e] T2 ≡ U2. +#G #L #U1 #U2 #dt #et * #HU12 #HU2 #K #s #d #e #HLK #T1 #HTU1 #Hdtd #Hdedet +elim (cpys_inv_lift1_be … HU12 … HLK … HTU1) -U1 // #T2 #HT12 #HTU2 +lapply (cny_inv_lift_be … HU2 … HLK … HTU2 ? ?) -L +/3 width=3 by ex2_intro, conj/ +qed-. + +lemma cpye_inv_lift1_ge: ∀G,L,U1,U2,dt,et. ⦃G, L⦄ ⊢ U1 ▶*[dt, et] 𝐍⦃U2⦄ → + ∀K,s,d,e. ⇩[s, d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → + yinj d + e ≤ dt → + ∃∃T2. ⦃G, K⦄ ⊢ T1 ▶*[dt - e, et] 𝐍⦃T2⦄ & ⇧[d, e] T2 ≡ U2. +#G #L #U1 #U2 #dt #et * #HU12 #HU2 #K #s #d #e #HLK #T1 #HTU1 #Hdedt +elim (cpys_inv_lift1_ge … HU12 … HLK … HTU1) -U1 // #T2 #HT12 #HTU2 +lapply (cny_inv_lift_ge … HU2 … HLK … HTU2 ?) -L +/3 width=3 by ex2_intro, conj/ +qed-. + +lemma cpye_inv_lift1_ge_up: ∀G,L,U1,U2,dt,et. ⦃G, L⦄ ⊢ U1 ▶*[dt, et] 𝐍⦃U2⦄ → + ∀K,s,d,e. ⇩[s, d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → + d ≤ dt → dt ≤ yinj d + e → yinj d + e ≤ dt + et → + ∃∃T2. ⦃G, K⦄ ⊢ T1 ▶*[d, dt + et - (yinj d + e)] 𝐍⦃T2⦄ & + ⇧[d, e] T2 ≡ U2. +#G #L #U1 #U2 #dt #et * #HU12 #HU2 #K #s #d #e #HLK #T1 #HTU1 #Hddt #Hdtde #Hdedet +elim (cpys_inv_lift1_ge_up … HU12 … HLK … HTU1) -U1 // #T2 #HT12 #HTU2 +lapply (cny_inv_lift_ge_up … HU2 … HLK … HTU2 ? ? ?) -L +/3 width=3 by ex2_intro, conj/ +qed-. + +lemma cpye_inv_lift1_subst: ∀G,L,W1,W2,d,e. ⦃G, L⦄ ⊢ W1 ▶*[d, e] 𝐍⦃W2⦄ → + ∀K,V1,i. ⇩[i+1] L ≡ K → ⇧[O, i+1] V1 ≡ W1 → + d ≤ yinj i → i < d + e → + ∃∃V2. ⦃G, K⦄ ⊢ V1 ▶*[O, ⫰(d+e-i)] 𝐍⦃V2⦄ & ⇧[O, i+1] V2 ≡ W2. +#G #L #W1 #W2 #d #e * #HW12 #HW2 #K #V1 #i #HLK #HVW1 #Hdi #Hide +elim (cpys_inv_lift1_subst … HW12 … HLK … HVW1) -W1 // #V2 #HV12 #HVW2 +lapply (cny_inv_lift_subst … HLK HW2 HVW2) -L +/3 width=3 by ex2_intro, conj/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpys_cny.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpys_cny.etc new file mode 100644 index 000000000..1499ceea5 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpys_cny.etc @@ -0,0 +1,26 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/cny.ma". +include "basic_2/substitution/cpys.ma". + +(* CONTEXT-SENSITIVE EXTENDED MULTIPLE SUBSTITUTION FOR TERMS ***************) + +(* Inversion lemmas on normality for extended substitution ******************) + +lemma cpys_inv_cny1: ∀G,L,T1,d,e. ⦃G, L⦄ ⊢ ▶[d, e] 𝐍⦃T1⦄ → + ∀T2. ⦃G, L⦄ ⊢ T1 ▶*[d, e] T2 → T1 = T2. +#G #L #T1 #d #e #HT1 #T2 #H @(cpys_ind … H) -T2 // +#T #T2 #_ #HT2 #IHT1 destruct <(HT1 … HT2) -T // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpzs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpzs.etc new file mode 100644 index 000000000..0fada97a0 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/cpzs.etc @@ -0,0 +1,83 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/pdeltaconvstar_6.ma". +include "basic_2/substitution/cpye_lift.ma". + +(* CONTEXT-SENSITIVE EXTENDED DELTA-EQUIVALENCE FOR TERMS *******************) + +definition cpzs: ynat → ynat → relation4 genv lenv term term ≝ + λd,e,G,L,T1,T2. + ∃∃T. ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T⦄ & ⦃G, L⦄ ⊢ T2 ▶*[d, e] 𝐍⦃T⦄. + +interpretation "context-sensitive extended delta-equivalence (term)" + 'PDeltaConvStar G L T1 d e T2 = (cpzs d e G L T1 T2). + +(* Basic properties **********************************************************) + +lemma cpye_div: ∀G,L,T1,T,d,e. ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T⦄ → + ∀T2. ⦃G, L⦄ ⊢ T2 ▶*[d, e] 𝐍⦃T⦄ → ⦃G, L⦄ ⊢ T1 ◆*[d, e] T2. +/2 width=3 by ex2_intro/ qed. + +lemma cpzs_refl: ∀G,L,d,e. reflexive … (cpzs d e G L). +#G #L #d #e #T elim (cpye_total G L T d e) /2 width=3 by cpye_div/ +qed. + +lemma cpzs_bind: ∀G,L,V1,V2,d,e. ⦃G, L⦄ ⊢ V1 ◆*[d, e] V2 → + ∀I,T1,T2. ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ◆*[⫯d, e] T2 → + ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ◆*[d, e] ⓑ{a,I}V2.T2. +#G #L #V1 #V2 #d #e * #V #HV1 #HV2 #I #T1 #T2 * +/5 width=10 by cpye_div, cpye_bind, leqy_cpye_trans, cny_bind, lsuby_succ/ +qed. + +lemma cpzs_flat: ∀G,L,V1,V2,d,e. ⦃G, L⦄ ⊢ V1 ◆*[d, e] V2 → + ∀T1,T2. ⦃G, L⦄ ⊢ T1 ◆*[d, e] T2 → + ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ◆*[d, e] ⓕ{I}V2.T2. +#G #L #V1 #V2 #d #e * #V #HV1 #HV2 #T1 #T2 * +/3 width=5 by cpye_div, cpye_flat, cny_flat/ +qed. + +(* Basic inversion lemmas ***************************************************) + +lemma cpzs_inv_sort: ∀G,L,d,e,k1,k2. ⦃G, L⦄ ⊢ ⋆k1 ◆*[d, e] ⋆k2 → k1 = k2. +#G #L #d #e #k1 #k2 * #X #H1 #H2 +lapply (cpye_inv_sort1 … H1) -H1 #H1 +lapply (cpye_inv_sort1 … H2) -H2 #H2 +destruct // +qed-. + +lemma cpzs_inv_bind: ∀a1,a2,I1,I2,G,L,V1,V2,T1,T2,d,e. ⦃G, L⦄ ⊢ ⓑ{a1,I1}V1.T1 ◆*[d, e] ⓑ{a2,I2}V2.T2 → + ∧∧ a1 = a2 & I1 = I2 + & ⦃G, L⦄ ⊢ V1 ◆*[d, e] V2 & ⦃G, L.ⓑ{I1}V1⦄ ⊢ T1 ◆*[⫯d, e] T2. +#a1 #a2 #I1 #I2 #G #L #V1 #V2 #T1 #T2 #d #e * #X #H1 #H2 +elim (cpye_inv_bind1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H1 +elim (cpye_inv_bind1 … H2) -H2 #W2 #U2 #HW12 #HU12 #H2 +destruct /5 width=8 by cpye_div, leqy_cpye_trans, lsuby_succ, and4_intro/ +qed-. + +lemma cpzs_inv_flat: ∀I1,I2,G,L,V1,V2,T1,T2,d,e. ⦃G, L⦄ ⊢ ⓕ{I1}V1.T1 ◆*[d, e] ⓕ{I2}V2.T2 → + ∧∧ I1 = I2 + & ⦃G, L⦄ ⊢ V1 ◆*[d, e] V2 & ⦃G, L⦄ ⊢ T1 ◆*[d, e] T2. +#I1 #I2 #G #L #V1 #V2 #T1 #T2 #d #e * #X #H1 #H2 +elim (cpye_inv_flat1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H1 +elim (cpye_inv_flat1 … H2) -H2 #W2 #U2 #HW12 #HU12 #H2 +destruct /3 width=3 by cpye_div, and3_intro/ +qed-. + +lemma cpzs_inv_flat_bind: ∀a2,I1,I2,G,L,V1,V2,T1,T2,d,e. ⦃G, L⦄ ⊢ ⓕ{I1}V1.T1 ◆*[d, e] ⓑ{a2,I2}V2.T2 → ⊥. +#a2 #I1 #I2 #G #L #V1 #V2 #T1 #T2 #d #e * #X #H1 #H2 +elim (cpye_inv_flat1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H1 +elim (cpye_inv_bind1 … H2) -H2 #W2 #U2 #HW12 #HU12 #H2 +destruct +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/lleq_cpye.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/lleq_cpye.etc new file mode 100644 index 000000000..e6890e637 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/lleq_cpye.etc @@ -0,0 +1,49 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/cpye_lift.ma". +include "basic_2/substitution/lleq_alt.ma". + +(* LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **********************************) + +(* Forward lemmas on evaluation for extended substitution *******************) + +lemma lleq_fwd_cpye: ∀L1,L2,T,d. L1 ⋕[T, d] L2 → ∀G,T1. ⦃G, L1⦄ ⊢ T ▶*[d, ∞] 𝐍⦃T1⦄ → + ∀T2. ⦃G, L2⦄ ⊢ T ▶*[d, ∞] 𝐍⦃T2⦄ → T1 = T2. +#L1 #L2 #T #d #H @(lleq_ind_alt … H) -L1 -L2 -T -d +[ #L1 #L2 #d #k #_ #G #T1 #H1 #T2 #H2 + >(cpye_inv_sort1 … H1) -H1 >(cpye_inv_sort1 … H2) -H2 // +| #L1 #L2 #d #i #_ #Hid #G #T1 #H1 #T2 #H2 + >(cpye_inv_lref1_free … H1) -H1 [ >(cpye_inv_lref1_free … H2) -H2 ] + /2 width=1 by or3_intro2/ +| #I1 #I2 #L1 #L2 #K1 #K2 #V #d #i #Hdi #HLK1 #HLK2 #_ #IHV #G #T1 #H1 #T2 #H2 + elim (cpye_inv_lref1_subst_ex … H1 … HLK1) -H1 -HLK1 // + elim (cpye_inv_lref1_subst_ex … H2 … HLK2) -H2 -HLK2 // + >yminus_Y_inj #V2 #HV2 #HVT2 #V1 #HV1 #HVT1 + lapply (IHV … HV1 … HV2) -IHV -HV1 -HV2 #H destruct /2 width=5 by lift_mono/ +| #L1 #L2 #d #i #_ #HL1 #HL2 #G #T1 #H1 #T2 #H2 + >(cpye_inv_lref1_free … H1) -H1 [ >(cpye_inv_lref1_free … H2) -H2 ] + /2 width=1 by or3_intro0/ +| #L1 #L2 #d #p #_ #G #T1 #H1 #T2 #H2 + >(cpye_inv_gref1 … H1) -H1 >(cpye_inv_gref1 … H2) -H2 // +| #a #I #L1 #L2 #V #T #d #_ #_ #IHV #IHT #G #X1 #H1 #X2 #H2 + elim (cpye_inv_bind1 … H1) -H1 #V1 #T1 #HV1 #HT1 #H destruct + elim (cpye_inv_bind1 … H2) -H2 #V2 #T2 #HV2 #HT2 #H destruct + /3 width=3 by eq_f2/ +| #I #L1 #L2 #V #T #d #_ #_ #IHV #IHT #G #X1 #H1 #X2 #H2 + elim (cpye_inv_flat1 … H1) -H1 #V1 #T1 #HV1 #HT1 #H destruct + elim (cpye_inv_flat1 … H2) -H2 #V2 #T2 #HV2 #HT2 #H destruct + /3 width=3 by eq_f2/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/lpx_cpye.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/lpx_cpye.etc new file mode 100644 index 000000000..48816c85d --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/lpx_cpye.etc @@ -0,0 +1,44 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/cpye_cpye.ma". +include "basic_2/reduction/lpx_cpys.ma". + +axiom cpx_cpys_conf_lpx: ∀h,g,G,d,e. + ∀L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡[h, g] T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡[h, g] L1 → + ∀T2. ⦃G, L0⦄ ⊢ T0 ▶*[d, e] T2 → + ∃∃T. ⦃G, L1⦄ ⊢ T1 ▶*[d, e] T & ⦃G, L0⦄ ⊢ T2 ➡[h, g] T. + +(* SN EXTENDED PARALLEL REDUCTION ON LOCAL ENVIRONMENTS *********************) + +(* Forward lemmas on evaluation for extended substitution *******************) + +lemma cpx_cpys_cpye_fwd_lpx: ∀h,g,G,L1,T1,T2. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2 → + ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → + ∀U1,d,e. ⦃G, L1⦄ ⊢ T1 ▶*[d, e] U1 → + ∀U2. ⦃G, L2⦄ ⊢ T2 ▶*[d, e] 𝐍⦃U2⦄ → + ⦃G, L1⦄ ⊢ U1 ➡[h, g] U2. +#h #g #G #L1 #T1 #T2 #HT12 #L2 #HL12 #U1 #d #e #HTU1 +elim (cpx_cpys_conf_lpx … HT12 … HL12 … HTU1) -T1 +/3 width=9 by cpx_cpys_trans_lpx, cpye_cpys_conf/ +qed-. + +lemma cpx_cpye_fwd_lpx: ∀h,g,G,L1,T1,T2. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2 → + ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → + ∀U1,d,e. ⦃G, L1⦄ ⊢ T1 ▶*[d, e] 𝐍⦃U1⦄ → + ∀U2. ⦃G, L2⦄ ⊢ T2 ▶*[d, e] 𝐍⦃U2⦄ → + ⦃G, L1⦄ ⊢ U1 ➡[h, g] U2. +#h #g #G #L1 #T1 #T2 #HT12 #L2 #HL12 #U1 #d #e * +/2 width=9 by cpx_cpys_cpye_fwd_lpx/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/lpxs_cpye.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/lpxs_cpye.etc new file mode 100644 index 000000000..a6f0f86bd --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/lpxs_cpye.etc @@ -0,0 +1,36 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/cpye_lift.ma". +include "basic_2/reduction/lpx_cpye.ma". +include "basic_2/computation/cpxs_cpxs.ma". +include "basic_2/computation/lpxs.ma". + +(* SN EXTENDED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS *******************) + +(* Forward lemmas on evaluation for extended substitution *******************) + +lemma cpx_cpye_fwd_lpxs: ∀h,g,G,L1,L2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → + ∀T1,T2. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2 → + ∀U1,d,e. ⦃G, L1⦄ ⊢ T1 ▶*[d, e] 𝐍⦃U1⦄ → + ∀U2. ⦃G, L2⦄ ⊢ T2 ▶*[d, e] 𝐍⦃U2⦄ → + ⦃G, L1⦄ ⊢ U1 ➡*[h, g] U2. +#h #g #G #L1 #L2 #H @(lpxs_ind_dx … H) -L1 +[ /3 width=9 by cpx_cpxs, cpx_cpye_fwd_lpx/ +| #L1 #L #HL1 #_ #IHL2 #T1 #T2 #HT12 #U1 #d #e #HTU1 #U2 #HTU2 + elim (cpye_total G L T2 d e) #X2 #HTX2 + lapply (cpx_cpye_fwd_lpx … HT12 … HL1 … HTU1 … HTX2) -T1 + /4 width=9 by lpx_cpxs_trans, cpxs_strap2/ (**) (* full auto too long: 41s *) +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/pdeltaconvstar_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/pdeltaconvstar_6.etc new file mode 100644 index 000000000..b7de5f543 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/pdeltaconvstar_6.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 break ◆ * [ term 46 d , break term 46 e ] break term 46 T2 )" + non associative with precedence 45 + for @{ 'PDeltaConvStar $G $L $T1 $d $e $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/psubsteval_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/psubsteval_6.etc new file mode 100644 index 000000000..360f43d29 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/psubsteval_6.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ break term 46 T1 ▶ * break [ term 46 d , break term 46 e ] break 𝐍 ⦃ term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'PSubstEval $G $L $T1 $T2 $d $e }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/psubstevalalt_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/psubstevalalt_6.etc new file mode 100644 index 000000000..18cdf608f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/psubstevalalt_6.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ break term 46 T1 ▶ ▶ * break [ term 46 d , break term 46 e ] break 𝐍 ⦃ term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'PSubstEvalAlt $G $L $T1 $T2 $d $e }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/psubstnormal_5.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/psubstnormal_5.etc new file mode 100644 index 000000000..4a7a78afc --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cny/psubstnormal_5.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ ▶ break [ term 46 d , break term 46 e ] 𝐍 break ⦃ term 46 T ⦄ )" + non associative with precedence 45 + for @{ 'PSubstNormal $G $L $T $d $e }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cofrees/cofrees.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cofrees/cofrees.etc new file mode 100644 index 000000000..e1b9b06b2 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cofrees/cofrees.etc @@ -0,0 +1,130 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/cofreestar_4.ma". +include "basic_2/relocation/lift_neg.ma". +include "basic_2/substitution/cpys.ma". + +(* CONTEXT-SENSITIVE EXCLUSION FROM FREE VARIABLES **************************) + +definition cofrees: relation4 ynat nat lenv term ≝ + λd,i,L,U1. ∀U2. ⦃⋆, L⦄ ⊢ U1 ▶*[d, ∞] U2 → ∃T2. ⇧[i, 1] T2 ≡ U2. + +interpretation + "context-sensitive exclusion from free variables (term)" + 'CoFreeStar L i d T = (cofrees d i L T). + +(* Basic forward lemmas *****************************************************) + +lemma cofrees_fwd_lift: ∀L,U,d,i. L ⊢ i ~ϵ 𝐅*[d]⦃U⦄ → ∃T. ⇧[i, 1] T ≡ U. +/2 width=1 by/ qed-. + +lemma cofrees_fwd_bind_sn: ∀a,I,L,W,U,i,d. L ⊢ i ~ϵ 𝐅*[d]⦃ⓑ{a,I}W.U⦄ → + L ⊢ i ~ϵ 𝐅*[d]⦃W⦄. +#a #I #L #W1 #U #i #d #H #W2 #HW12 elim (H (ⓑ{a,I}W2.U)) /2 width=1 by cpys_bind/ -W1 +#X #H elim (lift_inv_bind2 … H) -H /2 width=2 by ex_intro/ +qed-. + +lemma cofrees_fwd_bind_dx: ∀a,I,L,W,U,i,d. L ⊢ i ~ϵ 𝐅*[d]⦃ⓑ{a,I}W.U⦄ → + L.ⓑ{I}W ⊢ i+1 ~ϵ 𝐅*[⫯d]⦃U⦄. +#a #I #L #W #U1 #i #d #H #U2 #HU12 elim (H (ⓑ{a,I}W.U2)) /2 width=1 by cpys_bind/ -U1 +#X #H elim (lift_inv_bind2 … H) -H /2 width=2 by ex_intro/ +qed-. + +lemma cofrees_fwd_flat_sn: ∀I,L,W,U,i,d. L ⊢ i ~ϵ 𝐅*[d]⦃ⓕ{I}W.U⦄ → + L ⊢ i ~ϵ 𝐅*[d]⦃W⦄. +#I #L #W1 #U #i #d #H #W2 #HW12 elim (H (ⓕ{I}W2.U)) /2 width=1 by cpys_flat/ -W1 +#X #H elim (lift_inv_flat2 … H) -H /2 width=2 by ex_intro/ +qed-. + +lemma cofrees_fwd_flat_dx: ∀I,L,W,U,i,d. L ⊢ i ~ϵ 𝐅*[d]⦃ⓕ{I}W.U⦄ → + L ⊢ i ~ϵ 𝐅*[d]⦃U⦄. +#I #L #W #U1 #i #d #H #U2 #HU12 elim (H (ⓕ{I}W.U2)) /2 width=1 by cpys_flat/ -U1 +#X #H elim (lift_inv_flat2 … H) -H /2 width=2 by ex_intro/ +qed-. + +(* Basic inversion lemmas ***************************************************) + +lemma cofrees_inv_gen: ∀L,U,U0,d,i. ⦃⋆, L⦄ ⊢ U ▶*[d, ∞] U0 → (∀T. ⇧[i, 1] T ≡ U0 → ⊥) → + L ⊢ i ~ϵ 𝐅*[d]⦃U⦄ → ⊥. +#L #U #U0 #d #i #HU0 #HnU0 #HU elim (HU … HU0) -L -U -d /2 width=2 by/ +qed-. + +lemma cofrees_inv_lref_eq: ∀L,d,i. L ⊢ i ~ϵ 𝐅*[d]⦃#i⦄ → ⊥. +#L #d #i #H elim (H (#i)) -H // +#X #H elim (lift_inv_lref2_be … H) -H // +qed-. + +lemma cofrees_inv_bind: ∀a,I,L,W,U,i,d. L ⊢ i ~ϵ 𝐅*[d]⦃ⓑ{a,I}W.U⦄ → + L ⊢ i ~ϵ 𝐅*[d]⦃W⦄ ∧ L.ⓑ{I}W ⊢ i+1 ~ϵ 𝐅*[⫯d]⦃U⦄. +/3 width=8 by cofrees_fwd_bind_sn, cofrees_fwd_bind_dx, conj/ qed-. + +lemma cofrees_inv_flat: ∀I,L,W,U,i,d. L ⊢ i ~ϵ 𝐅*[d]⦃ⓕ{I}W.U⦄ → + L ⊢ i ~ϵ 𝐅*[d]⦃W⦄ ∧ L ⊢ i ~ϵ 𝐅*[d]⦃U⦄. +/3 width=7 by cofrees_fwd_flat_sn, cofrees_fwd_flat_dx, conj/ qed-. + +(* Basic Properties *********************************************************) + +lemma cofrees_lsuby_conf: ∀L1,U,d,i. L1 ⊢ i ~ϵ 𝐅*[d]⦃U⦄ → + ∀L2. L1 ⊆[d, ∞] L2 → L2 ⊢ i ~ϵ 𝐅*[d]⦃U⦄. +/3 width=3 by lsuby_cpys_trans/ qed-. + +lemma cofrees_sort: ∀L,d,i,k. L ⊢ i ~ϵ 𝐅*[d]⦃⋆k⦄. +#L #d #i #k #X #H >(cpys_inv_sort1 … H) -X /2 width=2 by ex_intro/ +qed. + +lemma cofrees_gref: ∀L,d,i,p. L ⊢ i ~ϵ 𝐅*[d]⦃§p⦄. +#L #d #i #p #X #H >(cpys_inv_gref1 … H) -X /2 width=2 by ex_intro/ +qed. + +lemma cofrees_bind: ∀L,V,d,i. L ⊢ i ~ϵ 𝐅*[d] ⦃V⦄ → + ∀I,T. L.ⓑ{I}V ⊢ i+1 ~ϵ 𝐅*[⫯d]⦃T⦄ → + ∀a. L ⊢ i ~ϵ 𝐅*[d]⦃ⓑ{a,I}V.T⦄. +#L #W1 #d #i #HW1 #I #U1 #HU1 #a #X #H elim (cpys_inv_bind1 … H) -H +#W2 #U2 #HW12 #HU12 #H destruct +elim (HW1 … HW12) elim (HU1 … HU12) -W1 -U1 /3 width=2 by lift_bind, ex_intro/ +qed. + +lemma cofrees_flat: ∀L,V,d,i. L ⊢ i ~ϵ 𝐅*[d]⦃V⦄ → ∀T. L ⊢ i ~ϵ 𝐅*[d]⦃T⦄ → + ∀I. L ⊢ i ~ϵ 𝐅*[d]⦃ⓕ{I}V.T⦄. +#L #W1 #d #i #HW1 #U1 #HU1 #I #X #H elim (cpys_inv_flat1 … H) -H +#W2 #U2 #HW12 #HU12 #H destruct +elim (HW1 … HW12) elim (HU1 … HU12) -W1 -U1 /3 width=2 by lift_flat, ex_intro/ +qed. + +lemma cofrees_cpy_trans: ∀L,U1,U2,d. ⦃⋆, L⦄ ⊢ U1 ▶[d, ∞] U2 → + ∀i. L ⊢ i ~ϵ 𝐅*[d]⦃U1⦄ → L ⊢ i ~ϵ 𝐅*[d]⦃U2⦄. +/3 width=3 by cpys_strap2/ qed-. + +axiom cofrees_dec: ∀L,T,d,i. Decidable (L ⊢ i ~ϵ 𝐅*[d]⦃T⦄). + +(* Basic negated properties *************************************************) + +lemma frees_cpy_div: ∀L,U1,U2,d. ⦃⋆, L⦄ ⊢ U1 ▶[d, ∞] U2 → + ∀i. (L ⊢ i ~ϵ 𝐅*[d]⦃U2⦄ → ⊥) → (L ⊢ i ~ϵ 𝐅*[d]⦃U1⦄ → ⊥). +/3 width=7 by cofrees_cpy_trans/ qed-. + +(* Basic negated inversion lemmas *******************************************) + +lemma frees_inv_bind: ∀a,I,L,V,T,d,i. (L ⊢ i ~ϵ 𝐅*[d]⦃ⓑ{a,I}V.T⦄ → ⊥) → + (L ⊢ i ~ϵ 𝐅*[d]⦃V⦄ → ⊥) ∨ (L.ⓑ{I}V ⊢ i+1 ~ϵ 𝐅*[⫯d]⦃T⦄ → ⊥). +#a #I #L #W #U #d #i #H elim (cofrees_dec L W d i) +/4 width=9 by cofrees_bind, or_intror, or_introl/ +qed-. + +lemma frees_inv_flat: ∀I,L,V,T,d,i. (L ⊢ i ~ϵ 𝐅*[d]⦃ⓕ{I}V.T⦄ → ⊥) → + (L ⊢ i ~ϵ 𝐅*[d]⦃V⦄ → ⊥) ∨ (L ⊢ i ~ϵ 𝐅*[d]⦃T⦄ → ⊥). +#I #L #W #U #d #H elim (cofrees_dec L W d) +/4 width=8 by cofrees_flat, or_intror, or_introl/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cofrees/cofrees_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cofrees/cofrees_alt.etc new file mode 100644 index 000000000..7bb9c9ca7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cofrees/cofrees_alt.etc @@ -0,0 +1,54 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/cpy_nlift.ma". +include "basic_2/substitution/cofrees_lift.ma". + +(* CONTEXT-SENSITIVE EXCLUSION FROM FREE VARIABLES **************************) + +(* Alternative definition of frees_ge ***************************************) + +lemma nlift_frees: ∀L,U,d,i. (∀T. ⇧[i, 1] T ≡ U → ⊥) → (L ⊢ i ~ϵ 𝐅*[d]⦃U⦄ → ⊥). +#L #U #d #i #HnTU #H elim (cofrees_fwd_lift … H) -H /2 width=2 by/ +qed-. + +lemma frees_inv_ge: ∀L,U,d,i. d ≤ yinj i → (L ⊢ i ~ϵ 𝐅*[d]⦃U⦄ → ⊥) → + (∀T. ⇧[i, 1] T ≡ U → ⊥) ∨ + ∃∃I,K,W,j. d ≤ yinj j & j < i & ⇩[j]L ≡ K.ⓑ{I}W & + (K ⊢ i-j-1 ~ϵ 𝐅*[yinj 0]⦃W⦄ → ⊥) & (∀T. ⇧[j, 1] T ≡ U → ⊥). +#L #U #d #i #Hdi #H @(frees_ind … H) -U /3 width=2 by or_introl/ +#U1 #U2 #HU12 #HU2 * +[ #HnU2 elim (cpy_fwd_nlift2_ge … HU12 … HnU2) -HU12 -HnU2 /3 width=2 by or_introl/ + * /5 width=9 by nlift_frees, ex5_4_intro, or_intror/ +| * #I2 #K2 #W2 #j2 #Hdj2 #Hj2i #HLK2 #HnW2 #HnU2 elim (cpy_fwd_nlift2_ge … HU12 … HnU2) -HU12 -HnU2 /4 width=9 by ex5_4_intro, or_intror/ + * #I1 #K1 #W1 #j1 #Hdj1 #Hj12 #HLK1 #HnW1 #HnU1 + lapply (ldrop_conf_ge … HLK1 … HLK2 ?) -HLK2 /2 width=1 by lt_to_le/ + #HK12 lapply (ldrop_inv_drop1_lt … HK12 ?) /2 width=1 by lt_plus_to_minus_r/ -HK12 + #HK12 + @or_intror @(ex5_4_intro … HLK1 … HnU1) -HLK1 -HnU1 /2 width=3 by transitive_lt/ + @(frees_be … HK12 … HnW1) /2 width=1 by arith_k_sn/ -HK12 -HnW1 + >minus_plus in ⊢ (??(?(?%?)?)??→?); >minus_plus in ⊢ (??(?(??%)?)??→?); >arith_b1 /2 width=1 by/ +] +qed-. + +lemma frees_ind_ge: ∀R:relation4 ynat nat lenv term. + (∀d,i,L,U. d ≤ yinj i → (∀T. ⇧[i, 1] T ≡ U → ⊥) → R d i L U) → + (∀d,i,j,I,L,K,W,U. d ≤ yinj j → j < i → ⇩[j]L ≡ K.ⓑ{I}W → (K ⊢ i-j-1 ~ϵ 𝐅*[0]⦃W⦄ → ⊥) → (∀T. ⇧[j, 1] T ≡ U → ⊥) → R 0 (i-j-1) K W → R d i L U) → + ∀d,i,L,U. d ≤ yinj i → (L ⊢ i ~ϵ 𝐅*[d]⦃U⦄ → ⊥) → R d i L U. +#R #IH1 #IH2 #d #i #L #U +generalize in match d; -d generalize in match i; -i +@(f2_ind … rfw … L U) -L -U +#n #IHn #L #U #Hn #i #d #Hdi #H elim (frees_inv_ge … H) -H /3 width=2 by/ +-IH1 * #I #K #W #j #Hdj #Hji #HLK #HnW #HnU destruct /4 width=12 by ldrop_fwd_rfw/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cofrees/cofrees_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cofrees/cofrees_lift.etc new file mode 100644 index 000000000..f93f72216 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cofrees/cofrees_lift.etc @@ -0,0 +1,180 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/cpys_lift.ma". +include "basic_2/substitution/cofrees.ma". + +(* CONTEXT-SENSITIVE EXCLUSION FROM FREE VARIABLES **************************) + +(* Advanced inversion lemmas ************************************************) + +lemma cofrees_inv_lref_be: ∀L,d,i,j. L ⊢ i ~ϵ 𝐅*[d]⦃#j⦄ → d ≤ yinj j → j < i → + ∀I,K,W. ⇩[j]L ≡ K.ⓑ{I}W → K ⊢ i-j-1 ~ϵ 𝐅*[yinj 0]⦃W⦄. +#L #d #i #j #Hj #Hdj #Hji #I #K #W1 #HLK #W2 #HW12 elim (lift_total W2 0 (j+1)) +#X2 #HWX2 elim (Hj X2) /2 width=7 by cpys_subst_Y2/ -I -L -K -W1 -d +#Z2 #HZX2 elim (lift_div_le … HWX2 (i-j-1) 1 Z2) -HWX2 /2 width=2 by ex_intro/ +>minus_plus minus_plus_plus_l // +| #J #W #U #Hn #d #i #H1 #j #H2 #I #K #V #HLK #Hdj #Hji destruct + elim (cofrees_inv_flat … H1) -H1 #HW #HU + elim (nlift_inv_flat … H2) -H2 [ /3 width=9 by/ ] + #HnU @(IH … HU … HnU … HLK) // (**) (* full auto fails *) +] +qed-. + +(* Advanced properties ******************************************************) + +lemma cofrees_lref_skip: ∀L,d,i,j. j < i → yinj j < d → L ⊢ i ~ϵ 𝐅*[d]⦃#j⦄. +#L #d #i #j #Hji #Hjd #X #H elim (cpys_inv_lref1_Y2 … H) -H +[ #H destruct /3 width=2 by lift_lref_lt, ex_intro/ +| * #I #K #W1 #W2 #Hdj elim (ylt_yle_false … Hdj) -i -I -L -K -W1 -W2 -X // +] +qed. + +lemma cofrees_lref_lt: ∀L,d,i,j. i < j → L ⊢ i ~ϵ 𝐅*[d]⦃#j⦄. +#L #d #i #j #Hij #X #H elim (cpys_inv_lref1_Y2 … H) -H +[ #H destruct /3 width=2 by lift_lref_ge_minus, ex_intro/ +| * #I #K #V1 #V2 #_ #_ #_ #H -I -L -K -V1 -d + elim (lift_split … H i j) /2 width=2 by lt_to_le, ex_intro/ +] +qed. + +lemma cofrees_lref_gt: ∀I,L,K,W,d,i,j. j < i → ⇩[j] L ≡ K.ⓑ{I}W → + K ⊢ (i-j-1) ~ϵ 𝐅*[O]⦃W⦄ → L ⊢ i ~ϵ 𝐅*[d]⦃#j⦄. +#I #L #K #W1 #d #i #j #Hji #HLK #HW1 #X #H elim (cpys_inv_lref1_Y2 … H) -H +[ #H destruct /3 width=2 by lift_lref_lt, ex_intro/ +| * #I0 #K0 #W0 #W2 #Hdj #HLK0 #HW12 #HW2 lapply (ldrop_mono … HLK0 … HLK) -L + #H destruct elim (HW1 … HW12) -I -K -W1 -d + #V2 #HVW2 elim (lift_trans_le … HVW2 … HW2) -W2 // + >minus_plus minus_plus yplus_inj >yminus_Y_inj #T2 #HT12 + lapply (cpys_weak … HT12 (d-yinj e0) (∞) ? ?) /2 width=1 by yle_plus2_to_minus_inj2/ -HT12 + | elim (cpys_inv_lift1_ge … HU12 … HLK … HTU1) // #T2 + ] +| elim (cpys_inv_lift1_be … HU12 … HLK … HTU1) // >yminus_Y_inj #T2 #HT12 + lapply (cpys_weak … HT12 (d-yinj e0) (∞) ? ?) // -HT12 +] +-s -L #HT12 #HTU2 +elim (HT1 … HT12) -T1 #V2 #HVT2 +elim (lift_trans_le … HVT2 … HTU2 ?) // (tpss_inv_sort1 … H) -H // +| #I #L1 #K1 #V1 #B #i #HLK1 #_ #IHV1 #L2 #d #e #HL12 #T2 #H + elim (tpss_inv_lref1 … H) -H + [ #H destruct + elim (lt_or_ge i d) #Hdi + [ elim (ltpss_dx_ldrop_conf_le … HL12 … HLK1 ?) -L1 /2 width=2/ #X #H #HLK2 + elim (ltpss_dx_inv_tpss11 … H ?) -H /2 width=1/ -Hdi #K2 #V2 #HK12 #HV12 #H destruct + /3 width=8 by aaa_lref/ (**) (* too slow without trace *) + | elim (lt_or_ge i (d + e)) #Hide + [ elim (ltpss_dx_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HLK2 + elim (ltpss_dx_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K2 #V2 #HK12 #HV12 #H destruct + /3 width=8 by aaa_lref/ (**) (* too slow without trace *) + | -Hdi + lapply (ltpss_dx_ldrop_conf_ge … HL12 … HLK1 ?) -L1 // -Hide + /3 width=8 by aaa_lref/ (**) (* too slow without trace *) + ] + ] + | * #K2 #V2 #W2 #Hdi #Hide #HLK2 #HVW2 #HWT2 + elim (ltpss_dx_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HL2K0 + elim (ltpss_dx_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K0 #V0 #HK12 #HV12 #H destruct + lapply (ldrop_mono … HL2K0 … HLK2) -HL2K0 #H destruct + lapply (ldrop_fwd_ldrop2 … HLK2) -HLK2 #HLK2 + lapply (tpss_trans_eq … HV12 HVW2) -V2 /3 width=7/ + ] +| #a #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #L2 #d #e #HL12 #X #H + elim (tpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct /4 width=4/ +| #a #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #L2 #d #e #HL12 #X #H + elim (tpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct /4 width=4/ +| #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #L2 #d #e #HL12 #X #H + elim (tpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct /3 width=4/ +| #L1 #V1 #T1 #A #_ #_ #IHV1 #IHT1 #L2 #d #e #HL12 #X #H + elim (tpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct /3 width=4/ +] +qed. + +lemma aaa_ltpss_dx_tps_conf: ∀L1,T1,A. L1 ⊢ T1 ⁝ A → + ∀L2,d,e. L1 ▶* [d, e] L2 → + ∀T2. L2 ⊢ T1 ▶ [d, e] T2 → L2 ⊢ T2 ⁝ A. +/3 width=7/ qed. + +lemma aaa_ltpss_dx_conf: ∀L1,T,A. L1 ⊢ T ⁝ A → + ∀L2,d,e. L1 ▶* [d, e] L2 → L2 ⊢ T ⁝ A. +/2 width=7/ qed. + +lemma aaa_tpss_conf: ∀L,T1,A. L ⊢ T1 ⁝ A → + ∀T2,d,e. L ⊢ T1 ▶* [d, e] T2 → L ⊢ T2 ⁝ A. +/2 width=7/ qed. + +lemma aaa_tps_conf: ∀L,T1,A. L ⊢ T1 ⁝ A → + ∀T2,d,e. L ⊢ T1 ▶ [d, e] T2 → L ⊢ T2 ⁝ A. +/2 width=7/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/aaa_ltpss_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/aaa_ltpss_sn.etc new file mode 100644 index 000000000..4f2a44827 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/aaa_ltpss_sn.etc @@ -0,0 +1,37 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/ltpss_sn_alt.ma". +include "basic_2/static/aaa_ltpss_dx.ma". + +(* ATONIC ARITY ASSIGNMENT ON TERMS *****************************************) + +(* Properties about sn parallel unfold **************************************) + +lemma aaa_ltpss_sn_conf: ∀L1,T,A. L1 ⊢ T ⁝ A → + ∀L2,d,e. L1 ⊢ ▶* [d, e] L2 → L2 ⊢ T ⁝ A. +#L1 #T #A #HT #L2 #d #e #HL12 +lapply (ltpss_sn_ltpssa … HL12) -HL12 #HL12 +@(TC_Conf3 … (λL,A. L ⊢ T ⁝ A) … HT ? HL12) /2 width=5/ +qed. + +lemma aaa_ltpss_sn_tpss_conf: ∀L1,T1,A. L1 ⊢ T1 ⁝ A → + ∀L2,d,e. L1 ⊢ ▶* [d, e] L2 → + ∀T2. L2 ⊢ T1 ▶* [d, e] T2 → L2 ⊢ T2 ⁝ A. +/3 width=5/ qed. + +lemma aaa_ltpss_sn_tps_conf: ∀L1,T1,A. L1 ⊢ T1 ⁝ A → + ∀L2,d,e. L1 ⊢ ▶* [d, e] L2 → + ∀T2. L2 ⊢ T1 ▶ [d, e] T2 → L2 ⊢ T2 ⁝ A. +/3 width=5/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cnf_cif.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cnf_cif.etc new file mode 100644 index 000000000..5a1ae5a5b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cnf_cif.etc @@ -0,0 +1,106 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/cif.ma". +include "basic_2/reducibility/cnf_lift.ma". + +(* CONTEXT-SENSITIVE NORMAL TERMS *******************************************) + +(* Main properties **********************************************************) + +lemma tps_cif_eq: ∀L,T1,T2,d,e. L ⊢ T1 ▶[d, e] T2 → L ⊢ 𝐈⦃T1⦄ → T1 = T2. +#L #T1 #T2 #d #e #H elim H -L -T1 -T2 -d -e +[ // +| #L #K #V #W #i #d #e #_ #_ #HLK #_ #H -d -e + elim (cif_inv_delta … HLK ?) // +| #L #a #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #H + elim (cif_inv_bind … H) -H #HV1 #HT1 * #H destruct + lapply (IHV12 … HV1) -IHV12 -HV1 #H destruct /3 width=1/ +| #L #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #H + elim (cif_inv_flat … H) -H #HV1 #HT1 #_ #_ /3 width=1/ +] +qed. + +lemma tpss_cif_eq: ∀L,T1,T2,d,e. L ⊢ T1 ▶*[d, e] T2 → L ⊢ 𝐈⦃T1⦄ → T1 = T2. +#L #T1 #T2 #d #e #H @(tpss_ind … H) -T2 // +#T #T2 #_ #HT2 #IHT1 #HT1 +lapply (IHT1 HT1) -IHT1 #H destruct /2 width=5/ +qed. + +lemma tpr_cif_eq: ∀T1,T2. T1 ➡ T2 → ∀L. L ⊢ 𝐈⦃T1⦄ → T1 = T2. +#T1 #T2 #H elim H -T1 -T2 +[ // +| * #V1 #V2 #T1 #T2 #_ #_ #IHV1 #IHT1 #L #H + [ elim (cif_inv_appl … H) -H #HV1 #HT1 #_ + >IHV1 -IHV1 // -HV1 >IHT1 -IHT1 // + | elim (cif_inv_ri2 … H) /2 width=1/ + ] +| #a #V1 #V2 #W #T1 #T2 #_ #_ #_ #_ #L #H + elim (cif_inv_appl … H) -H #_ #_ #H + elim (simple_inv_bind … H) +| #a * #V1 #V2 #T1 #T #T2 #_ #_ #HT2 #IHV1 #IHT1 #L #H + [ lapply (tps_lsubr_trans … HT2 (L.ⓓV2) ?) -HT2 /2 width=1/ #HT2 + elim (cif_inv_bind … H) -H #HV1 #HT1 * #H destruct + lapply (IHV1 … HV1) -IHV1 -HV1 #H destruct + lapply (IHT1 … HT1) -IHT1 #H destruct + lapply (tps_cif_eq … HT2 ?) -HT2 // + | <(tps_inv_refl_SO2 … HT2 ?) -HT2 // + elim (cif_inv_ib2 … H) -H /2 width=1/ /3 width=2/ + ] +| #a #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #_ #L #H + elim (cif_inv_appl … H) -H #_ #_ #H + elim (simple_inv_bind … H) +| #V1 #T1 #T #T2 #_ #_ #_ #L #H + elim (cif_inv_ri2 … H) /2 width=1/ +| #V1 #T1 #T2 #_ #_ #L #H + elim (cif_inv_ri2 … H) /2 width=1/ +] +qed. + +lemma cpr_cif_eq: ∀L,T1,T2. L ⊢ T1 ➡ T2 → L ⊢ 𝐈⦃T1⦄ → T1 = T2. +#L #T1 #T2 * #T0 #HT10 #HT02 #HT1 +lapply (tpr_cif_eq … HT10 … HT1) -HT10 #H destruct /2 width=5/ +qed. + +theorem cif_cnf: ∀L,T. L ⊢ 𝐈⦃T⦄ → L ⊢ 𝐍⦃T⦄. +/3 width=3/ qed. + +(* Note: this property is unusual *) +lemma cnf_crf_false: ∀L,T. L ⊢ 𝐑⦃T⦄ → L ⊢ 𝐍⦃T⦄ → ⊥. +#L #T #H elim H -L -T +[ #L #K #V #i #HLK #H + elim (cnf_inv_delta … HLK H) +| #L #V #T #_ #IHV #H + elim (cnf_inv_appl … H) -H /2 width=1/ +| #L #V #T #_ #IHT #H + elim (cnf_inv_appl … H) -H /2 width=1/ +| #I #L #V #T * #H1 #H2 destruct + [ elim (cnf_inv_zeta … H2) + | elim (cnf_inv_tau … H2) + ] +|5,6: #a * [ elim a ] #L #V #T * #H1 #_ #IH #H2 destruct + [1,3: elim (cnf_inv_abbr … H2) -H2 /2 width=1/ + |*: elim (cnf_inv_abst … H2) -H2 /2 width=1/ + ] +| #a #L #V #W #T #H + elim (cnf_inv_appl … H) -H #_ #_ #H + elim (simple_inv_bind … H) +| #a #L #V #W #T #H + elim (cnf_inv_appl … H) -H #_ #_ #H + elim (simple_inv_bind … H) +] +qed. + +theorem cnf_cif: ∀L,T. L ⊢ 𝐍⦃T⦄ → L ⊢ 𝐈⦃T⦄. +/2 width=4/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpcs_ltpss_dx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpcs_ltpss_dx.etc new file mode 100644 index 000000000..80f418b08 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpcs_ltpss_dx.etc @@ -0,0 +1,50 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/cprs_ltpss_dx.ma". +include "basic_2/equivalence/cpcs_cpcs.ma". + +(* CONTEXT-SENSITIVE PARALLEL EQUIVALENCE ON TERMS **************************) + +(* Properties concerning dx partial unfold on local environments ************) + +lemma cpcs_ltpss_dx_conf: ∀L1,L2,d,e. L1 ▶* [d, e] L2 → + ∀T1,T2. L1 ⊢ T1 ⬌* T2 → L2 ⊢ T1 ⬌* T2. +#L1 #L2 #d #e #HL12 #T1 #T2 #H +elim (cpcs_inv_cprs … H) -H #T #HT1 #HT2 +elim (cprs_ltpss_dx_conf … HT1 … HL12) -HT1 #U1 #HTU1 #H1 +elim (cprs_ltpss_dx_conf … HT2 … HL12) -L1 #U2 #HTU2 #H2 +elim (tpss_conf_eq … H1 … H2) -T #U #HU1 #HU2 +lapply (cprs_tpss_trans … HTU1 … HU1) -U1 +lapply (cprs_tpss_trans … HTU2 … HU2) -U2 /2 width=3/ +qed-. + +lemma cpcs_ltpss_dx_tpss_conf: ∀L1,L2,d,e. L1 ▶* [d, e] L2 → + ∀T,T2. L1 ⊢ T ⬌* T2 → + ∀T1. L2 ⊢ T ▶* [d, e] T1 → + L2 ⊢ T1 ⬌* T2. +#L1 #L2 #d #e #HL12 #T #T2 #HT2 #T1 #HT1 +lapply (cpcs_ltpss_dx_conf … HL12 … HT2) -L1 #HT2 +lapply (cpcs_tpss_conf … HT1 … HT2) -T // +qed-. + +lemma cpcs_ltpss_dx_tpss2_conf: ∀L1,L2,d,e. L1 ▶* [d, e] L2 → + ∀T1,T2. L1 ⊢ T1 ⬌* T2 → + ∀T3. L2 ⊢ T1 ▶* [d, e] T3 → + ∀T4. L2 ⊢ T2 ▶* [d, e] T4 → + L2 ⊢ T3 ⬌* T4. +#L1 #L2 #d #e #HL12 #T1 #T2 #HT12 #T3 #HT13 #T4 #HT24 +lapply (cpcs_ltpss_dx_tpss_conf … HL12 … HT12 … HT13) -L1 -T1 #HT32 +lapply (cpcs_tpss_strap1 … HT32 … HT24) -T2 // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpcs_ltpss_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpcs_ltpss_sn.etc new file mode 100644 index 000000000..5bf1ed57f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpcs_ltpss_sn.etc @@ -0,0 +1,28 @@ +(**************************************************************************) +(* ___ *) +(* ||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/equivalence/cpcs_ltpss_dx.ma". + +(* CONTEXT-SENSITIVE PARALLEL EQUIVALENCE ON TERMS **************************) + +(* Properties concerning sn partial unfold on local environments ************) + +lemma cpcs_ltpss_sn_conf: ∀L1,L2,d,e. L1 ⊢ ▶* [d, e] L2 → + ∀T1,T2. L1 ⊢ T1 ⬌* T2 → L2 ⊢ T1 ⬌* T2. +#L1 #L2 #d #e #H +lapply (ltpss_sn_ltpssa … H) -H #H @(ltpssa_ind … H) -L2 // +#L #L2 #_ #HL2 #IHL1 #T1 #U1 #HTU1 +lapply (IHL1 … HTU1) -IHL1 -HTU1 #HTU1 +lapply (cpcs_ltpss_dx_conf … HL2 … HTU1) -HTU1 -HL2 // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpr.etc new file mode 100644 index 000000000..d82299c38 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpr.etc @@ -0,0 +1,111 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/tpss.ma". +include "basic_2/reducibility/tpr.ma". + +(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS ****************************) + +(* Basic_1: includes: pr2_delta1 *) +definition cpr: lenv → relation term ≝ + λL,T1,T2. ∃∃T. T1 ➡ T & L ⊢ T ▶* [0, |L|] T2. + +interpretation + "context-sensitive parallel reduction (term)" + 'PRed L T1 T2 = (cpr L T1 T2). + +(* Basic properties *********************************************************) + +lemma cpr_intro: ∀L,T1,T,T2,d,e. T1 ➡ T → L ⊢ T ▶* [d, e] T2 → L ⊢ T1 ➡ T2. +/3 width=5/ qed-. + +(* Basic_1: was by definition: pr2_free *) +lemma cpr_tpr: ∀T1,T2. T1 ➡ T2 → ∀L. L ⊢ T1 ➡ T2. +/2 width=3/ qed. + +lemma cpr_tpss: ∀L,T1,T2,d,e. L ⊢ T1 ▶* [d, e] T2 → L ⊢ T1 ➡ T2. +/3 width=5/ qed. + +lemma cpr_refl: ∀L,T. L ⊢ T ➡ T. +/2 width=1/ qed. + +(* Note: new property *) +(* Basic_1: was only: pr2_thin_dx *) +lemma cpr_flat: ∀I,L,V1,V2,T1,T2. + L ⊢ V1 ➡ V2 → L ⊢ T1 ➡ T2 → L ⊢ ⓕ{I} V1. T1 ➡ ⓕ{I} V2. T2. +#I #L #V1 #V2 #T1 #T2 * #V #HV1 #HV2 * /3 width=5/ +qed. + +lemma cpr_cast: ∀L,V,T1,T2. + L ⊢ T1 ➡ T2 → L ⊢ ⓝV. T1 ➡ T2. +#L #V #T1 #T2 * /3 width=3/ +qed. + +(* Note: it does not hold replacing |L1| with |L2| *) +(* Basic_1: was only: pr2_change *) +lemma cpr_lsubr_trans: ∀L1,T1,T2. L1 ⊢ T1 ➡ T2 → + ∀L2. L2 ⊑ [0, |L1|] L1 → L2 ⊢ T1 ➡ T2. +#L1 #T1 #T2 * #T #HT1 #HT2 #L2 #HL12 +lapply (tpss_lsubr_trans … HT2 … HL12) -HT2 -HL12 /3 width=4/ +qed. + +(* Basic inversion lemmas ***************************************************) + +(* Basic_1: was: pr2_gen_csort *) +lemma cpr_inv_atom: ∀T1,T2. ⋆ ⊢ T1 ➡ T2 → T1 ➡ T2. +#T1 #T2 * #T #HT normalize #HT2 +<(tpss_inv_refl_O2 … HT2) -HT2 // +qed-. + +(* Basic_1: was: pr2_gen_sort *) +lemma cpr_inv_sort1: ∀L,T2,k. L ⊢ ⋆k ➡ T2 → T2 = ⋆k. +#L #T2 #k * #X #H +>(tpr_inv_atom1 … H) -H #H +>(tpss_inv_sort1 … H) -H // +qed-. + +(* Basic_1: was: pr2_gen_cast *) +lemma cpr_inv_cast1: ∀L,V1,T1,U2. L ⊢ ⓝV1. T1 ➡ U2 → ( + ∃∃V2,T2. L ⊢ V1 ➡ V2 & L ⊢ T1 ➡ T2 & + U2 = ⓝV2. T2 + ) ∨ L ⊢ T1 ➡ U2. +#L #V1 #T1 #U2 * #X #H #HU2 +elim (tpr_inv_cast1 … H) -H /3 width=3/ +* #V #T #HV1 #HT1 #H destruct +elim (tpss_inv_flat1 … HU2) -HU2 #V2 #T2 #HV2 #HT2 #H destruct /4 width=5/ +qed-. + +(* Basic forward lemmas *****************************************************) + +lemma cpr_fwd_bind1_minus: ∀I,L,V1,T1,T. L ⊢ -ⓑ{I}V1.T1 ➡ T → ∀b. + ∃∃V2,T2. L ⊢ ⓑ{b,I}V1.T1 ➡ ⓑ{b,I}V2.T2 & + T = -ⓑ{I}V2.T2. +#I #L #V1 #T1 #T * #X #H1 #H2 #b +elim (tpr_fwd_bind1_minus … H1 b) -H1 #V0 #T0 #HT10 #H destruct +elim (tpss_inv_bind1 … H2) -H2 #V2 #T2 #HV02 #HT02 #H destruct /4 width=5/ +qed-. + +lemma cpr_fwd_shift1: ∀L,L1,T1,T. L ⊢ L1 @@ T1 ➡ T → + ∃∃L2,T2. |L1| = |L2| & T = L2 @@ T2. +#L #L1 #T1 #T * #X #H1 #H2 +elim (tpr_fwd_shift1 … H1) -H1 #L0 #T0 #HL10 #H destruct +elim (tpss_fwd_shift1 … H2) -H2 #L2 #T2 #HL02 #H destruct /2 width=4/ +qed-. + +(* Basic_1: removed theorems 6: + pr2_head_2 pr2_cflat pr2_gen_cflat clear_pr2_trans + pr2_gen_ctail pr2_ctail + Basic_1: removed local theorems 3: + pr2_free_free pr2_free_delta pr2_delta_delta +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpr_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpr_aaa.etc new file mode 100644 index 000000000..7c1273334 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpr_aaa.etc @@ -0,0 +1,25 @@ +(**************************************************************************) +(* ___ *) +(* ||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/static/aaa_ltpss_sn.ma". +include "basic_2/reducibility/ltpr_aaa.ma". +include "basic_2/reducibility/cpr.ma". + +(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS ****************************) + +(* Properties about atomic arity assignment on terms ************************) + +lemma aaa_cpr_conf: ∀L,T1,A. L ⊢ T1 ⁝ A → ∀T2. L ⊢ T1 ➡ T2 → L ⊢ T2 ⁝ A. +#L #T1 #A #HT1 #T2 * /3 width=5/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpr_cpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpr_cpr.etc new file mode 100644 index 000000000..d231c849f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpr_cpr.etc @@ -0,0 +1,63 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/tpr_tpr.ma". +include "basic_2/reducibility/cpr.ma". + +(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS ****************************) + +(* Advanced properties ******************************************************) + +lemma cpr_bind_sn: ∀a,I,L,V1,V2,T1,T2. L ⊢ V1 ➡ V2 → T1 ➡ T2 → + L ⊢ ⓑ{a,I} V1. T1 ➡ ⓑ{a,I} V2. T2. +#a #I #L #V1 #V2 #T1 #T2 * #V #HV1 #HV2 #HT12 +@ex2_intro [2: @(tpr_delta … HV1 HT12) | skip ] /2 width=3/ (* /3 width=5/ is too slow *) +qed. + +(* Basic_1: was only: pr2_gen_cbind *) +lemma cpr_bind_dx: ∀a,I,L,V1,V2,T1,T2. V1 ➡ V2 → L. ⓑ{I} V2 ⊢ T1 ➡ T2 → + L ⊢ ⓑ{a,I} V1. T1 ➡ ⓑ{a,I} V2. T2. +#a #I #L #V1 #V2 #T1 #T2 #HV12 * #T #HT1 normalize #HT2 +elim (tpss_split_up … HT2 1 ? ?) -HT2 // #T0 (tpr_inv_atom1 … H) -H #H +elim (tpss_inv_lref1 … H) -H /2 width=1/ +* /3 width=6/ +qed-. + +(* Basic_1: was pr2_gen_abbr *) +lemma cpr_inv_abbr1: ∀a,L,V1,T1,U2. L ⊢ ⓓ{a}V1. T1 ➡ U2 → + (∃∃V,V2,T2. V1 ➡ V & L ⊢ V ▶* [O, |L|] V2 & + L. ⓓV ⊢ T1 ➡ T2 & + U2 = ⓓ{a}V2. T2 + ) ∨ + ∃∃T2. L.ⓓV1 ⊢ T1 ➡ T2 & ⇧[0,1] U2 ≡ T2 & a = true. +#a #L #V1 #T1 #Y * #X #H1 #H2 +elim (tpr_inv_abbr1 … H1) -H1 * +[ #V #T #T0 #HV1 #HT1 #HT0 #H destruct + elim (tpss_inv_bind1 … H2) -H2 #V2 #T2 #HV2 #HT02 #H destruct + lapply (tps_lsubr_trans … HT0 (L. ⓓV) ?) -HT0 /2 width=1/ #HT0 + lapply (tps_weak_full … HT0) -HT0 #HT0 + lapply (tpss_lsubr_trans … HT02 (L. ⓓV) ?) -HT02 /2 width=1/ #HT02 + lapply (tpss_weak_full … HT02) -HT02 #HT02 + lapply (tpss_strap2 … HT0 HT02) -T0 /4 width=7/ +| #T2 #HT12 #HXT2 #H destruct + elim (lift_total Y 0 1) #Z #HYZ + lapply (tpss_lift_ge … H2 (L.ⓓV1) … HXT2 … HYZ) -X // /2 width=1/ #H + lapply (cpr_intro … HT12 … H) -T2 /3 width=3/ +] +qed-. + +(* Basic_1: was: pr2_gen_abst *) +lemma cpr_inv_abst1: ∀a,L,V1,T1,U2. L ⊢ ⓛ{a}V1. T1 ➡ U2 → ∀I,W. + ∃∃V2,T2. L ⊢ V1 ➡ V2 & L. ⓑ{I} W ⊢ T1 ➡ T2 & U2 = ⓛ{a}V2. T2. +#a #L #V1 #T1 #Y * #X #H1 #H2 #I #W +elim (tpr_inv_abst1 … H1) -H1 #V #T #HV1 #HT1 #H destruct +elim (tpss_inv_bind1 … H2) -H2 #V2 #T2 #HV2 #HT2 #H destruct +lapply (tpss_lsubr_trans … HT2 (L. ⓑ{I} W) ?) -HT2 /2 width=1/ /4 width=5/ +qed-. + +(* Basic_1: was pr2_gen_appl *) +lemma cpr_inv_appl1: ∀L,V1,U0,U2. L ⊢ ⓐV1. U0 ➡ U2 → + ∨∨ ∃∃V2,T2. L ⊢ V1 ➡ V2 & L ⊢ U0 ➡ T2 & + U2 = ⓐV2. T2 + | ∃∃a,V2,W,T1,T2. L ⊢ V1 ➡ V2 & L. ⓓV2 ⊢ T1 ➡ T2 & + U0 = ⓛ{a}W. T1 & + U2 = ⓓ{a}V2. T2 + | ∃∃a,V2,V,W1,W2,T1,T2. L ⊢ V1 ➡ V2 & L ⊢ W1 ➡ W2 & L. ⓓW2 ⊢ T1 ➡ T2 & + ⇧[0,1] V2 ≡ V & + U0 = ⓓ{a}W1. T1 & + U2 = ⓓ{a}W2. ⓐV. T2. +#L #V1 #U0 #Y * #X #H1 #H2 +elim (tpr_inv_appl1 … H1) -H1 * +[ #V #U #HV1 #HU0 #H destruct + elim (tpss_inv_flat1 … H2) -H2 #V2 #U2 #HV2 #HU2 #H destruct /4 width=5/ +| #a #V #W #T0 #T #HV1 #HT0 #H #H1 destruct + elim (tpss_inv_bind1 … H2) -H2 #V2 #T2 #HV2 #HT2 #H destruct + lapply (tpss_weak … HT2 0 (|L|+1) ? ?) -HT2 // /4 width=9/ +| #a #V0 #V #W #W0 #T #T0 #HV10 #HW0 #HT0 #HV0 #H #H1 destruct + elim (tpss_inv_bind1 … H2) -H2 #W2 #X #HW02 #HX #HY destruct + elim (tpss_inv_flat1 … HX) -HX #V2 #T2 #HV2 #HT2 #H destruct + elim (tpss_inv_lift1_ge … HV2 … HV0 ?) -V // [3: /2 width=1/ |2: skip ] #V (ltpr_fwd_length … HL12) in HT2; #HT2 +elim (ltpr_tpr_tpss_conf … HL12 … HT2) -L1 /3 width=3/ +qed. + +lemma cpr_ltpr_conf_tpss: ∀L1,L2. L1 ➡ L2 → ∀T1,T2. L1 ⊢ T1 ➡ T2 → + ∀d,e,U1. L1 ⊢ T1 ▶* [d, e] U1 → + ∃∃U2. L2 ⊢ U1 ➡ U2 & L2 ⊢ T2 ➡ U2. +#L1 #L2 #HL12 #T1 #T2 #HT12 #d #e #U1 #HTU1 +elim (cpr_ltpr_conf_eq … HT12 … HL12) -HT12 #T #HT1 #HT2 +elim (cpr_tpss_ltpr … HL12 … HT1 … HTU1) -L1 -HT1 #U2 #HU12 #HTU2 +lapply (tpss_weak_full … HTU2) -HTU2 #HTU2 /3 width=5/ (**) (* /4 width=5/ is too slow *) +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpr_ltpss_dx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpr_ltpss_dx.etc new file mode 100644 index 000000000..5d90e6865 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpr_ltpss_dx.etc @@ -0,0 +1,28 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/ltpss_dx_ltpss_dx.ma". +include "basic_2/reducibility/cpr.ma". + +(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS ****************************) + +(* Properties concerning dx partial unfold on local environments ************) + +lemma ltpss_dx_cpr_conf: ∀L1,T,U1. L1 ⊢ T ➡ U1 → + ∀L2,d,e. L1 ▶* [d, e] L2 → + ∃∃U2. L2 ⊢ T ➡ U2 & L2 ⊢ U1 ▶* [d, e] U2. +#L1 #T #U1 * #U #HTU #HU1 #L2 #d #e #HL12 +lapply (ltpss_dx_fwd_length … HL12) #H >H in HU1; -H #HU1 +elim (ltpss_dx_tpss_conf … HU1 … HL12) -L1 /3 width=3/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpr_ltpss_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpr_ltpss_sn.etc new file mode 100644 index 000000000..f946e4cfb --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpr_ltpss_sn.etc @@ -0,0 +1,35 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/ltpss_sn_alt.ma". +include "basic_2/reducibility/cpr.ma". + +(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS ****************************) + +(* Properties concerning sn partial unfold on local environments ************) + +lemma ltpss_sn_cpr_trans: ∀L1,L2,d,e. L1 ⊢ ▶* [d, e] L2 → + ∀T1,T2. L2 ⊢ T1 ➡ T2 → L1 ⊢ T1 ➡ T2. +#L1 #L2 #d #e #HL12 #T1 #T2 * +lapply (ltpss_sn_weak_full … HL12) +<(ltpss_sn_fwd_length … HL12) -HL12 /3 width=5/ +qed. + +lemma ltpss_sn_cpr_conf: ∀L1,T,U1. L1 ⊢ T ➡ U1 → + ∀L2,d,e. L1 ⊢ ▶* [d, e] L2 → + ∃∃U2. L2 ⊢ T ➡ U2 & L1 ⊢ U1 ▶* [d, e] U2. +#L1 #T #U1 * #U #HTU #HU1 #L2 #d #e #HL12 +lapply (ltpss_sn_fwd_length … HL12) #H >H in HU1; -H #HU1 +elim (ltpss_sn_tpss_conf … HU1 … HL12) -HU1 -HL12 /3 width=3/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpr_tpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpr_tpss.etc new file mode 100644 index 000000000..d8c7225d9 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cpr_tpss.etc @@ -0,0 +1,39 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/ltpr_tpss.ma". +include "basic_2/reducibility/cpr.ma". + +(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS ****************************) + +(* Properties on partial unfold for terms ***********************************) + +lemma cpr_tpss_trans: ∀L,T1,T. L ⊢ T1 ➡ T → + ∀T2,d,e. L ⊢ T ▶* [d, e] T2 → L ⊢ T1 ➡ T2. +#L #T1 #T * #T0 #HT10 #HT0 #T2 #d #e #HT2 +lapply (tpss_weak_full … HT2) -HT2 #HT2 +lapply (tpss_trans_eq … HT0 HT2) -T /2 width=3/ +qed. + +lemma cpr_tps_trans: ∀L,T1,T. L ⊢ T1 ➡ T → + ∀T2,d,e. L ⊢ T ▶ [d, e] T2 → L ⊢ T1 ➡ T2. +/3 width=5/ qed. + +lemma cpr_tpss_conf: ∀L,T0,T1. L ⊢ T0 ➡ T1 → + ∀T2,d,e. L ⊢ T0 ▶* [d, e] T2 → + ∃∃T. L ⊢ T1 ▶* [d, e] T & L ⊢ T2 ➡ T. +#L #T0 #T1 * #U0 #HTU0 #HU0T1 #T2 #d #e #HT02 +elim (tpr_tpss_conf … HTU0 … HT02) -T0 #T0 #HT20 #HUT0 +elim (tpss_conf_eq … HU0T1 … HUT0) -U0 /3 width=5/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cprs_ltpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cprs_ltpr.etc new file mode 100644 index 000000000..2682a7609 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cprs_ltpr.etc @@ -0,0 +1,32 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/cpr_ltpr.ma". +include "basic_2/computation/cprs.ma". + +(* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************) + +(* Properties concerning parallel unfold on terms ***************************) + +(* Basic_1: was only: pr3_subst1 *) +lemma cprs_tpss_ltpr: ∀L1,T1,U1,d,e. L1 ⊢ T1 ▶* [d, e] U1 → + ∀L2. L1 ➡ L2 → ∀T2. L2 ⊢ T1 ➡* T2 → + ∃∃U2. L2 ⊢ U1 ➡* U2 & L2 ⊢ T2 ▶* [d, e] U2. +#L1 #T1 #U1 #d #e #HTU1 #L2 #HL12 #T2 #HT12 elim HT12 -T2 +[ #T2 #HT12 + elim (cpr_tpss_ltpr … HL12 … HT12 … HTU1) -L1 -T1 /3 width=3/ +| #T #T2 #_ #HT2 * #U #HU1 #HTU + elim (cpr_tpss_ltpr … HT2 … HTU) -L1 -T // /3 width=3/ +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cprs_ltpss_dx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cprs_ltpss_dx.etc new file mode 100644 index 000000000..7f8618007 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cprs_ltpss_dx.etc @@ -0,0 +1,52 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/cpr_ltpss_dx.ma". +include "basic_2/computation/cprs_tpss.ma". + +(* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************) + +(* Properties concerning dx partial unfold on local environments ************) + +lemma cprs_ltpss_dx_conf: ∀L1,T,U1. L1 ⊢ T ➡* U1 → + ∀L2,d,e. L1 ▶* [d, e] L2 → + ∃∃U2. L2 ⊢ T ➡* U2 & L2 ⊢ U1 ▶* [d, e] U2. +#L1 #T #U1 #H @(cprs_ind … H) -U1 /2 width=3/ +#T1 #U1 #_ #HTU1 #IHT1 #L2 #d #e #HL12 +elim (IHT1 … HL12) -IHT1 #U #HTU #HT1U +elim (ltpss_dx_cpr_conf … HTU1 … HL12) -L1 #U0 #HT1U0 #HU10 +elim (cpr_tpss_conf … HT1U0 … HT1U) -T1 #U2 #HU02 #HU2 +lapply (tpss_trans_eq … HU10 HU02) -U0 /3 width=3/ +qed-. + +lemma cprs_ltpss_dx_tpss_conf: ∀L1,T1,U1. L1 ⊢ T1 ➡* U1 → + ∀L2,d,e. L1 ▶* [d, e] L2 → + ∀T2. L2 ⊢ T1 ▶* [d, e] T2 → + ∃∃U2. L2 ⊢ T2 ➡* U2 & L2 ⊢ U1 ▶* [d, e] U2. +#L1 #T1 #U1 #HTU1 #L2 #d #e #HL12 #T2 #HT12 +elim (cprs_ltpss_dx_conf … HTU1 … HL12) -L1 #U #HT1U #HU1 +elim (cprs_tpss_conf … HT1U … HT12) -T1 #T #HUT #HT2 +lapply (tpss_trans_eq … HU1 HUT) -U /2 width=3/ +qed-. + +lemma cprs_ltpss_dx_tpss2_conf: ∀L1,T1,U1. L1 ⊢ T1 ➡* U1 → + ∀L2,d,e. L1 ▶* [d, e] L2 → + ∀T2. L2 ⊢ T1 ▶* [d, e] T2 → + ∀U2. L2 ⊢ U1 ▶* [d, e] U2 → + ∃∃U. L2 ⊢ T2 ➡* U & L2 ⊢ U2 ▶* [d, e] U. +#L1 #T1 #U1 #HTU1 #L2 #d #e #HL12 #T2 #HT12 #U2 #HU12 +elim (cprs_ltpss_dx_tpss_conf … HTU1 … HL12 … HT12) -L1 -T1 #U #HT2U #HU1 +elim (tpss_conf_eq … HU12 … HU1) -U1 #U0 #HU20 #HU0 +lapply (cprs_tpss_trans … HT2U … HU0) -U /2 width=3/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cprs_ltpss_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cprs_ltpss_sn.etc new file mode 100644 index 000000000..32009d11d --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cprs_ltpss_sn.etc @@ -0,0 +1,34 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/ltpss_sn_alt.ma". +include "basic_2/computation/cprs_ltpss_dx.ma". + +(* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************) + +(* Properties concerning sn partial unfold on local environments ************) + +lemma cprs_ltpss_sn_conf: ∀L1,L2,d,e. L1 ⊢ ▶* [d, e] L2 → + ∀T,U1. L1 ⊢ T ➡* U1 → + ∃∃U2. L2 ⊢ T ➡* U2 & L1 ⊢ U1 ▶* [d, e] U2. +#L1 #L2 #d #e #H +lapply (ltpss_sn_ltpssa … H) -H #H @(ltpssa_ind … H) -L2 /2 width=3/ +#L #L2 #HL1 #HL2 #IHL1 #T #U1 #HTU1 +lapply (ltpssa_ltpss_sn … HL1) -HL1 #HL1 +lapply (ltpss_sn_dx_trans_eq … HL1 … HL2) -HL1 #HL12 +elim (IHL1 … HTU1) -IHL1 -HTU1 #U #HTU #HU1 +elim (cprs_ltpss_dx_conf … HTU … HL2) -HTU -HL2 #U2 #HTU2 #HU2 +lapply (ltpss_sn_tpss_trans_eq … HU2 … HL12) -HU2 -HL12 #HU2 +lapply (tpss_trans_eq … HU1 HU2) -U /2 width=3/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cprs_tpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cprs_tpss.etc new file mode 100644 index 000000000..0c575ae02 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/cprs_tpss.etc @@ -0,0 +1,38 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/cpr_tpss.ma". +include "basic_2/computation/cprs.ma". + +(* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************) + +(* Properties on partial unfold for terms ***********************************) + +lemma cprs_tpss_trans: ∀L,T1,T. L ⊢ T1 ➡* T → + ∀T2,d,e. L ⊢ T ▶* [d, e] T2 → L ⊢ T1 ➡* T2. +#L #T1 #T #H @(cprs_ind … H) -T /2 width=3/ /3 width=5/ +qed. + +lemma cprs_tps_trans: ∀L,T1,T. L ⊢ T1 ➡* T → + ∀T2,d,e. L ⊢ T ▶ [d, e] T2 → L ⊢ T1 ➡* T2. +/3 width=5 by inj, cprs_tpss_trans/ qed. (**) (* auto too slow without trace *) + +lemma cprs_tpss_conf: ∀L,T0,T1. L ⊢ T0 ➡* T1 → + ∀T2,d,e. L ⊢ T0 ▶* [d, e] T2 → + ∃∃T. L ⊢ T1 ▶* [d, e] T & L ⊢ T2 ➡* T. +#L #T0 #T1 #H @(cprs_ind … H) -T1 /2 width=3/ +#T #T1 #_ #HT1 #IHT0 #T2 #d #e #HT02 +elim (IHT0 … HT02) -T0 #T0 #HT0 #HT20 +elim (cpr_tpss_conf … HT1 … HT0) -T /3 width=5/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/dxprs_ltpss_dx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/dxprs_ltpss_dx.etc new file mode 100644 index 000000000..8e3260dd4 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/dxprs_ltpss_dx.etc @@ -0,0 +1,50 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unwind/sstas_ltpss_dx.ma". +include "basic_2/computation/cprs_ltpss_dx.ma". +include "basic_2/computation/dxprs.ma". + +(* DECOMPOSED EXTENDED PARALLEL COMPUTATION ON TERMS ************************) + +(* Properties about dx parallel unfold **************************************) + +lemma dxprs_ltpss_dx_conf: ∀h,g,L1,T,U1. ⦃h, L1⦄ ⊢ T •*➡*[g] U1 → + ∀L2,d,e. L1 ▶* [d, e] L2 → + ∃∃U2. ⦃h, L2⦄ ⊢ T •*➡*[g] U2 & L2 ⊢ U1 ▶* [d, e] U2. +#h #g #L1 #T #U1 * #U #HTU #HU1 #L2 #d #e #HL12 +elim (sstas_ltpss_dx_conf … HTU … HL12) -HTU #U0 #HTU0 #HU0 +elim (cprs_ltpss_dx_conf … HU1 … HL12) -L1 #U2 #HU2 #HU12 +elim (cprs_tpss_conf … HU2 … HU0) -U #U #HU2 #HU0 +lapply (tpss_trans_eq … HU12 HU2) -U2 /3 width=3/ +qed-. + +lemma dxprs_tpss_conf: ∀h,g,L,T1,U1. ⦃h, L⦄ ⊢ T1 •*➡*[g] U1 → + ∀T2,d,e. L ⊢ T1 ▶* [d, e] T2 → + ∃∃U2. ⦃h, L⦄ ⊢ T2 •*➡*[g] U2 & L ⊢ U1 ▶* [d, e] U2. +#h #g #L #T1 #U1 * #W1 #HTW1 #HWU1 #T2 #d #e #HT12 +elim (sstas_tpss_conf … HTW1 … HT12) -T1 #W2 #HTW2 #HW12 +elim (cprs_tpss_conf … HWU1 … HW12) -W1 /3 width=3/ +qed-. + +lemma dxprs_ltpss_dx_tpss_conf: ∀h,g,L1,T1,U1. ⦃h, L1⦄ ⊢ T1 •*➡*[g] U1 → + ∀L2,d,e. L1 ▶* [d, e] L2 → + ∀T2. L2 ⊢ T1 ▶* [d, e] T2 → + ∃∃U2. ⦃h, L2⦄ ⊢ T2 •*➡*[g] U2 & + L2 ⊢ U1 ▶* [d, e] U2. +#h #g #L1 #T1 #U1 #HTU1 #L2 #d #e #HL12 #T2 #HT12 +elim (dxprs_ltpss_dx_conf … HTU1 … HL12) -L1 #U #HT1U #HU1 +elim (dxprs_tpss_conf … HT1U … HT12) -T1 #U2 #HTU2 #HU2 +lapply (tpss_trans_eq … HU1 HU2) -U /2 width=3/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/dxprs_ltpss_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/dxprs_ltpss_sn.etc new file mode 100644 index 000000000..553e4658b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/dxprs_ltpss_sn.etc @@ -0,0 +1,34 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/ltpss_sn_alt.ma". +include "basic_2/computation/dxprs_ltpss_dx.ma". + +(* DECOMPOSED EXTENDED PARALLEL COMPUTATION ON TERMS ************************) + +(* Properties about sn parallel unfold **************************************) + +lemma dxprs_ltpss_sn_conf: ∀h,g,L1,L2,d,e. L1 ⊢ ▶* [d, e] L2 → + ∀T,U1. ⦃h, L1⦄ ⊢ T •*➡*[g] U1 → + ∃∃U2. ⦃h, L2⦄ ⊢ T •*➡*[g] U2 & L1 ⊢ U1 ▶* [d, e] U2. +#h #g #L1 #L2 #d #e #H +lapply (ltpss_sn_ltpssa … H) -H #H @(ltpssa_ind … H) -L2 [ /2 width=3/ ] +#L #L2 #HL1 #HL2 #IHL1 #T #U1 #HTU1 +lapply (ltpssa_ltpss_sn … HL1) -HL1 #HL1 +lapply (ltpss_sn_dx_trans_eq … HL1 … HL2) -HL1 #HL12 +elim (IHL1 … HTU1) -IHL1 -HTU1 #U #HTU #HU1 +elim (dxprs_ltpss_dx_conf … HTU … HL2) -HTU -HL2 #U2 #HTU2 #HU2 +lapply (ltpss_sn_tpss_trans_eq … HU2 … HL12) -HU2 -HL12 #HU2 +lapply (tpss_trans_eq … HU1 HU2) -U /2 width=3/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ldrop_lbotr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ldrop_lbotr.etc new file mode 100644 index 000000000..df6b2c11e --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ldrop_lbotr.etc @@ -0,0 +1,94 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/lsubr_lbotr.ma". +include "basic_2/relocation/ldrop_ldrop.ma". + +(* DROPPING *****************************************************************) + +(* Inversion lemmas about local env. full refinement for substitution *******) + +(* Note: ldrop_ldrop not needed *) +lemma lbotr_inv_ldrop: ∀I,L,K,V,i. ⇩[0, i] L ≡ K. ⓑ{I}V → ∀d,e. ⊒[d, e] L → + d ≤ i → i < d + e → I = Abbr. +#I #L elim L -L +[ #K #V #i #H + lapply (ldrop_inv_atom1 … H) -H #H destruct +| #L #J #W #IHL #K #V #i #H + elim (ldrop_inv_O1 … H) -H * + [ -IHL #H1 #H2 #d #e #HL #Hdi #Hide destruct + lapply (le_n_O_to_eq … Hdi) -Hdi #H destruct + lapply (HL … (L.ⓓW) ?) -HL /2 width=1/ #H + elim (lsubr_inv_abbr2 … H ?) -H // -Hide #K #_ #H destruct // + | #Hi #HLK #d @(nat_ind_plus … d) -d + [ #e #H #_ #Hide + elim (lbotr_inv_bind … H ?) -H [2: /2 width=2/ ] #HL #H destruct + @(IHL … HLK … HL) -IHL -HLK -HL // /2 width=1/ + | #d #_ #e #H #Hdi #Hide + lapply (lbotr_inv_skip … H ?) -H // #HL + @(IHL … HLK … HL) -IHL -HLK -HL /2 width=1/ + ] + ] +] +qed-. + +(* Properties about local env. full refinement for substitution *************) + +(* Note: ldrop_ldrop not needed *) +lemma lbotr_ldrop: ∀L,d,e. + (∀I,K,V,i. d ≤ i → i < d + e → ⇩[0, i] L ≡ K. ⓑ{I}V → I = Abbr) → + ⊒[d, e] L. +#L elim L -L // +#L #I #V #IHL #d @(nat_ind_plus … d) -d +[ #e @(nat_ind_plus … e) -e // + #e #_ #H0 + >(H0 I L V 0 ? ? ?) // + /5 width=6 by lbotr_abbr, ldrop_ldrop, lt_minus_to_plus_r/ (**) (* auto now too slow without trace *) +| #d #_ #e #H0 + /5 width=6 by lbotr_skip, ldrop_ldrop, le_S_S, lt_minus_to_plus_r/ (**) (* auto now too slow without trace *) +] +qed. + +lemma lbotr_ldrop_trans_le: ∀L1,L2,d,e. ⇩[d, e] L1 ≡ L2 → ∀dd,ee. ⊒[dd, ee] L1 → + dd + ee ≤ d → ⊒[dd, ee] L2. +#L1 #L2 #d #e #HL12 #dd #ee #HL1 #Hddee +@lbotr_ldrop #I #K2 #V2 #i #Hddi #Hiddee #HLK2 +lapply (lt_to_le_to_lt … Hiddee Hddee) -Hddee #Hid +elim (ldrop_trans_le … HL12 … HLK2 ?) -L2 /2 width=2/ #X #HLK1 #H +elim (ldrop_inv_skip2 … H ?) -H /2 width=1/ -Hid #K1 #V1 #HK12 #HV21 #H destruct +@(lbotr_inv_ldrop … HLK1 … HL1) -L1 -K1 -V1 // +qed. + +lemma lbotr_ldrop_trans_be_up: ∀L1,L2,d,e. ⇩[d, e] L1 ≡ L2 → + ∀dd,ee. ⊒[dd, ee] L1 → + dd ≤ d + e → d + e ≤ dd + ee → + ⊒[d, dd + ee - d - e] L2. +#L1 #L2 #d #e #HL12 #dd #ee #HL1 #Hdde #Hddee +@lbotr_ldrop #I #K2 #V2 #i #Hdi #Hiddee #HLK2 +lapply (transitive_le ? ? (i+e)… Hdde ?) -Hdde /2 width=1/ #Hddie +>commutative_plus in Hiddee; >minus_minus_comm commutative_plus // -Hddie /2 width=1/ +qed. + +lemma lbotr_ldrop_trans_ge: ∀L1,L2,d,e. ⇩[d, e] L1 ≡ L2 → ∀dd,ee. ⊒[dd, ee] L1 → + d + e ≤ dd → ⊒[dd - e, ee] L2. +#L1 #L2 #d #e #HL12 #dd #ee #HL1 #Hddee +@lbotr_ldrop #I #K2 #V2 #i #Hddi #Hiddee #HLK2 +elim (le_inv_plus_l … Hddee) -Hddee #Hdde #Hedd +>plus_minus in Hiddee; // #Hiddee +lapply (transitive_le … Hdde Hddi) -Hdde #Hid +lapply (ldrop_trans_ge … HL12 … HLK2 ?) -L2 // -Hid #HL1K2 +@(lbotr_inv_ldrop … HL1K2 … HL1) -L1 >commutative_plus /2 width=1/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ldrop_lpx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ldrop_lpx.etc new file mode 100644 index 000000000..d23ed28e5 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ldrop_lpx.etc @@ -0,0 +1,68 @@ +(**************************************************************************) +(* ___ *) +(* ||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/grammar/lenv_px.ma". +include "basic_2/relocation/ldrop.ma". + +(* DROPPING *****************************************************************) + +(* Properties on pointwise extension ****************************************) + +lemma lpx_deliftable_dropable: ∀R. t_deliftable_sn R → dropable_sn (lpx R). +#R #HR #L1 #K1 #d #e #H elim H -L1 -K1 -d -e +[ #d #e #X #H >(lpx_inv_atom1 … H) -H /2 width=3/ +| #K1 #I #V1 #X #H + elim (lpx_inv_pair1 … H) -H #L2 #V2 #HL12 #HV12 #H destruct /3 width=5/ +| #L1 #K1 #I #V1 #e #_ #IHLK1 #X #H + elim (lpx_inv_pair1 … H) -H #L2 #V2 #HL12 #HV12 #H destruct + elim (IHLK1 … HL12) -L1 /3 width=3/ +| #L1 #K1 #I #V1 #W1 #d #e #_ #HWV1 #IHLK1 #X #H + elim (lpx_inv_pair1 … H) -H #L2 #V2 #HL12 #HV12 #H destruct + elim (HR … HV12 … HWV1) -V1 + elim (IHLK1 … HL12) -L1 /3 width=5/ +] +qed. + +lemma lpx_liftable_dedropable: ∀R. reflexive ? R → + t_liftable R → dedropable_sn (lpx R). +#R #H1R #H2R #L1 #K1 #d #e #H elim H -L1 -K1 -d -e +[ #d #e #X #H >(lpx_inv_atom1 … H) -H /2 width=3/ +| #K1 #I #V1 #X #H + elim (lpx_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct /3 width=5/ +| #L1 #K1 #I #V1 #e #_ #IHLK1 #K2 #HK12 + elim (IHLK1 … HK12) -K1 /3 width=5/ +| #L1 #K1 #I #V1 #W1 #d #e #_ #HWV1 #IHLK1 #X #H + elim (lpx_inv_pair1 … H) -H #K2 #W2 #HK12 #HW12 #H destruct + elim (lift_total W2 d e) #V2 #HWV2 + lapply (H2R … HW12 … HWV1 … HWV2) -W1 + elim (IHLK1 … HK12) -K1 /3 width=5/ +] +qed. + +fact lpx_dropable_aux: ∀R,L2,K2,d,e. ⇩[d, e] L2 ≡ K2 → ∀L1. lpx R L1 L2 → + d = 0 → ∃∃K1. ⇩[0, e] L1 ≡ K1 & lpx R K1 K2. +#R #L2 #K2 #d #e #H elim H -L2 -K2 -d -e +[ #d #e #X #H >(lpx_inv_atom2 … H) -H /2 width=3/ +| #K2 #I #V2 #X #H + elim (lpx_inv_pair2 … H) -H #K1 #V1 #HK12 #HV12 #H destruct /3 width=5/ +| #L2 #K2 #I #V2 #e #_ #IHLK2 #X #H #_ + elim (lpx_inv_pair2 … H) -H #L1 #V1 #HL12 #HV12 #H destruct + elim (IHLK2 … HL12 ?) -L2 // /3 width=3/ +| #L2 #K2 #I #V2 #W2 #d #e #_ #_ #_ #L1 #_ + >commutative_plus normalize #H destruct +] +qed-. + +lemma lpx_dropable: ∀R. dropable_dx (lpx R). +/2 width=5 by lpx_dropable_aux/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lenv_px.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lenv_px.etc new file mode 100644 index 000000000..ea916e10a --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lenv_px.etc @@ -0,0 +1,166 @@ +(**************************************************************************) +(* ___ *) +(* ||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/grammar/lenv_append.ma". + +(* POINTWISE EXTENSION OF A CONTEXT-FREE REALTION FOR TERMS *****************) + +inductive lpx (R:relation term): relation lenv ≝ +| lpx_stom: lpx R (⋆) (⋆) +| lpx_pair: ∀I,K1,K2,V1,V2. + lpx R K1 K2 → R V1 V2 → lpx R (K1. ⓑ{I} V1) (K2. ⓑ{I} V2) +. + +(* Basic inversion lemmas ***************************************************) + +fact lpx_inv_atom1_aux: ∀R,L1,L2. lpx R L1 L2 → L1 = ⋆ → L2 = ⋆. +#R #L1 #L2 * -L1 -L2 +[ // +| #I #K1 #K2 #V1 #V2 #_ #_ #H destruct +] +qed-. + +lemma lpx_inv_atom1: ∀R,L2. lpx R (⋆) L2 → L2 = ⋆. +/2 width=4 by lpx_inv_atom1_aux/ qed-. + +fact lpx_inv_pair1_aux: ∀R,L1,L2. lpx R L1 L2 → ∀I,K1,V1. L1 = K1. ⓑ{I} V1 → + ∃∃K2,V2. lpx R K1 K2 & R V1 V2 & L2 = K2. ⓑ{I} V2. +#R #L1 #L2 * -L1 -L2 +[ #J #K1 #V1 #H destruct +| #I #K1 #K2 #V1 #V2 #HK12 #HV12 #J #L #W #H destruct /2 width=5/ +] +qed-. + +lemma lpx_inv_pair1: ∀R,I,K1,V1,L2. lpx R (K1. ⓑ{I} V1) L2 → + ∃∃K2,V2. lpx R K1 K2 & R V1 V2 & L2 = K2. ⓑ{I} V2. +/2 width=3 by lpx_inv_pair1_aux/ qed-. + +fact lpx_inv_atom2_aux: ∀R,L1,L2. lpx R L1 L2 → L2 = ⋆ → L1 = ⋆. +#R #L1 #L2 * -L1 -L2 +[ // +| #I #K1 #K2 #V1 #V2 #_ #_ #H destruct +] +qed-. + +lemma lpx_inv_atom2: ∀R,L1. lpx R L1 (⋆) → L1 = ⋆. +/2 width=4 by lpx_inv_atom2_aux/ qed-. + +fact lpx_inv_pair2_aux: ∀R,L1,L2. lpx R L1 L2 → ∀I,K2,V2. L2 = K2. ⓑ{I} V2 → + ∃∃K1,V1. lpx R K1 K2 & R V1 V2 & L1 = K1. ⓑ{I} V1. +#R #L1 #L2 * -L1 -L2 +[ #J #K2 #V2 #H destruct +| #I #K1 #K2 #V1 #V2 #HK12 #HV12 #J #K #W #H destruct /2 width=5/ +] +qed-. + +lemma lpx_inv_pair2: ∀R,I,L1,K2,V2. lpx R L1 (K2. ⓑ{I} V2) → + ∃∃K1,V1. lpx R K1 K2 & R V1 V2 & L1 = K1. ⓑ{I} V1. +/2 width=3 by lpx_inv_pair2_aux/ qed-. + +(* Basic forward lemmas *****************************************************) + +lemma lpx_fwd_length: ∀R,L1,L2. lpx R L1 L2 → |L1| = |L2|. +#R #L1 #L2 #H elim H -L1 -L2 normalize // +qed-. + +(* Advanced inversion lemmas ************************************************) + +lemma lpx_inv_append1: ∀R,L1,K1,L. lpx R (K1 @@ L1) L → + ∃∃K2,L2. lpx R K1 K2 & lpx R L1 L2 & L = K2 @@ L2. +#R #L1 elim L1 -L1 normalize +[ #K1 #K2 #HK12 + @(ex3_2_intro … K2 (⋆)) // (**) (* explicit constructor, /2 width=5/ does not work *) +| #L1 #I #V1 #IH #K1 #X #H + elim (lpx_inv_pair1 … H) -H #L #V2 #H1 #HV12 #H destruct + elim (IH … H1) -IH -H1 #K2 #L2 #HK12 #HL12 #H destruct + @(ex3_2_intro … HK12) [2: /2 width=2/ | skip | // ] (* explicit constructor, /3 width=5/ does not work *) +] +qed-. + +lemma lpx_inv_append2: ∀R,L2,K2,L. lpx R L (K2 @@ L2) → + ∃∃K1,L1. lpx R K1 K2 & lpx R L1 L2 & L = K1 @@ L1. +#R #L2 elim L2 -L2 normalize +[ #K2 #K1 #HK12 + @(ex3_2_intro … K1 (⋆)) // (**) (* explicit constructor, /2 width=5/ does not work *) +| #L2 #I #V2 #IH #K2 #X #H + elim (lpx_inv_pair2 … H) -H #L #V1 #H1 #HV12 #H destruct + elim (IH … H1) -IH -H1 #K1 #L1 #HK12 #HL12 #H destruct + @(ex3_2_intro … HK12) [2: /2 width=2/ | skip | // ] (* explicit constructor, /3 width=5/ does not work *) +] +qed-. + +(* Basic properties *********************************************************) + +lemma lpx_refl: ∀R. reflexive ? R → reflexive … (lpx R). +#R #HR #L elim L -L // /2 width=1/ +qed. + +lemma lpx_sym: ∀R. symmetric ? R → symmetric … (lpx R). +#R #HR #L1 #L2 #H elim H -H // /3 width=1/ +qed. + +lemma lpx_trans: ∀R. Transitive ? R → Transitive … (lpx R). +#R #HR #L1 #L #H elim H -L // +#I #K1 #K #V1 #V #_ #HV1 #IHK1 #X #H +elim (lpx_inv_pair1 … H) -H #K2 #V2 #HK2 #HV2 #H destruct /3 width=3/ +qed. + +lemma lpx_conf: ∀R. confluent ? R → confluent … (lpx R). +#R #HR #L0 #L1 #H elim H -L1 +[ #X #H >(lpx_inv_atom1 … H) -X /2 width=3/ +| #I #K0 #K1 #V0 #V1 #_ #HV01 #IHK01 #X #H + elim (lpx_inv_pair1 … H) -H #K2 #V2 #HK02 #HV02 #H destruct + elim (IHK01 … HK02) -K0 #K #HK1 #HK2 + elim (HR … HV01 … HV02) -HR -V0 /3 width=5/ +] +qed. + +lemma lpx_TC_inj: ∀R,L1,L2. lpx R L1 L2 → lpx (TC … R) L1 L2. +#R #L1 #L2 #H elim H -L1 -L2 // /3 width=1/ +qed. + +lemma lpx_TC_step: ∀R,L1,L. lpx (TC … R) L1 L → + ∀L2. lpx R L L2 → lpx (TC … R) L1 L2. +#R #L1 #L #H elim H -L /2 width=1/ +#I #K1 #K #V1 #V #_ #HV1 #IHK1 #X #H +elim (lpx_inv_pair1 … H) -H #K2 #V2 #HK2 #HV2 #H destruct /3 width=3/ +qed. + +lemma TC_lpx_pair_dx: ∀R. reflexive ? R → + ∀I,K,V1,V2. TC … R V1 V2 → + TC … (lpx R) (K.ⓑ{I}V1) (K.ⓑ{I}V2). +#R #HR #I #K #V1 #V2 #H elim H -V2 +/4 width=5 by lpx_refl, lpx_pair, inj, step/ (**) (* too slow without trace *) +qed. + +lemma TC_lpx_pair_sn: ∀R. reflexive ? R → + ∀I,V,K1,K2. TC … (lpx R) K1 K2 → + TC … (lpx R) (K1.ⓑ{I}V) (K2.ⓑ{I}V). +#R #HR #I #V #K1 #K2 #H elim H -K2 +/4 width=5 by lpx_refl, lpx_pair, inj, step/ (**) (* too slow without trace *) +qed. + +lemma lpx_TC: ∀R,L1,L2. TC … (lpx R) L1 L2 → lpx (TC … R) L1 L2. +#R #L1 #L2 #H elim H -L2 /2 width=1/ /2 width=3/ +qed. + +lemma lpx_inv_TC: ∀R. reflexive ? R → + ∀L1,L2. lpx (TC … R) L1 L2 → TC … (lpx R) L1 L2. +#R #HR #L1 #L2 #H elim H -L1 -L2 /3 width=1/ /3 width=3/ +qed. + +lemma lpx_append: ∀R,K1,K2. lpx R K1 K2 → ∀L1,L2. lpx R L1 L2 → + lpx R (L1 @@ K1) (L2 @@ K2). +#R #K1 #K2 #H elim H -K1 -K2 // /3 width=1/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lenv_top.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lenv_top.etc new file mode 100644 index 000000000..ab90cebe7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lenv_top.etc @@ -0,0 +1,68 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( T1 𝟙 break term 46 T2 )" + non associative with precedence 45 + for @{ 'RTop $T1 $T2 }. + +include "basic_2/grammar/lenv_px.ma". + +(* POINTWISE EXTENSION OF TOP RELATION FOR TERMS ****************************) + +definition ttop: relation term ≝ λT1,T2. True. + +definition ltop: relation lenv ≝ lpx ttop. + +interpretation + "top reduction (environment)" + 'RTop L1 L2 = (ltop L1 L2). + +(* Basic properties *********************************************************) + +lemma ltop_refl: reflexive … ltop. +/2 width=1/ qed. + +lemma ltop_sym: symmetric … ltop. +/2 width=1/ qed. + +lemma ltop_trans: transitive … ltop. +/2 width=3/ qed. + +lemma ltop_append: ∀K1,K2. K1 𝟙 K2 → ∀L1,L2. L1 𝟙 L2 → L1 @@ K1 𝟙 L2 @@ K2. +/2 width=1/ qed. + +(* Basic inversion lemmas ***************************************************) + +lemma ltop_inv_atom1: ∀L2. ⋆ 𝟙 L2 → L2 = ⋆. +/2 width=2 by lpx_inv_atom1/ qed-. + +lemma ltop_inv_pair1: ∀K1,I,V1,L2. K1. ⓑ{I} V1 𝟙 L2 → + ∃∃K2,V2. K1 𝟙 K2 & L2 = K2. ⓑ{I} V2. +#K1 #I #V1 #L2 #H +elim (lpx_inv_pair1 … H) -H /2 width=4/ +qed-. + +lemma ltop_inv_atom2: ∀L1. L1 𝟙 ⋆ → L1 = ⋆. +/2 width=2 by lpx_inv_atom2/ qed-. + +lemma ltop_inv_pair2: ∀L1,K2,I,V2. L1 𝟙 K2. ⓑ{I} V2 → + ∃∃K1,V1. K1 𝟙 K2 & L1 = K1. ⓑ{I} V1. +#L1 #K2 #I #V2 #H +elim (lpx_inv_pair2 … H) -H /2 width=4/ +qed-. + +(* Basic forward lemmas *****************************************************) + +lemma ltop_fwd_length: ∀L1,L2. L1 𝟙 L2 → |L1| = |L2|. +/2 width=2 by lpx_fwd_length/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lfpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lfpr.etc new file mode 100644 index 000000000..ea9f585a6 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lfpr.etc @@ -0,0 +1,48 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( ⦃ term 46 L1 ⦄ ➡ break ⦃ term 46 L2 ⦄ )" + non associative with precedence 45 + for @{ 'FocalizedPRed $L1 $L2 }. + +include "basic_2/unfold/ltpss_sn.ma". +include "basic_2/reducibility/ltpr.ma". + +(* FOCALIZED PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ***********************) + +definition lfpr: relation lenv ≝ + λL1,L2. ∃∃L. L1 ➡ L & L ⊢ ▶* [0, |L|] L2 +. + +interpretation + "focalized parallel reduction (environment)" + 'FocalizedPRed L1 L2 = (lfpr L1 L2). + +(* Basic properties *********************************************************) + +(* Note: lemma 250 *) +lemma lfpr_refl: ∀L. ⦃L⦄ ➡ ⦃L⦄. +/2 width=3/ qed. + +lemma ltpss_sn_lfpr: ∀L1,L2,d,e. L1 ⊢ ▶* [d, e] L2 → ⦃L1⦄ ➡ ⦃L2⦄. +/3 width=5/ qed. + +lemma ltpr_lfpr: ∀L1,L2. L1 ➡ L2 → ⦃L1⦄ ➡ ⦃L2⦄. +/3 width=3/ qed. + +(* Basic inversion lemmas ***************************************************) + +lemma lfpr_inv_atom1: ∀L2. ⦃⋆⦄ ➡ ⦃L2⦄ → L2 = ⋆. +#L2 * #L #HL >(ltpr_inv_atom1 … HL) -HL #HL2 >(ltpss_sn_inv_atom1 … HL2) -HL2 // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lfpr_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lfpr_aaa.etc new file mode 100644 index 000000000..6f6c49df3 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lfpr_aaa.etc @@ -0,0 +1,25 @@ +(**************************************************************************) +(* ___ *) +(* ||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/static/aaa_ltpss_sn.ma". +include "basic_2/reducibility/ltpr_aaa.ma". +include "basic_2/reducibility/lfpr.ma". + +(* FOCALIZED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS **********************) + +(* Properties about atomic arity assignment on terms ************************) + +lemma aaa_lfpr_conf: ∀L1,T,A. L1 ⊢ T ⁝ A → ∀L2. ⦃L1⦄ ➡ ⦃L2⦄ → L2 ⊢ T ⁝ A. +#L1 #T #A #HT #L2 * /3 width=5/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lfpr_cpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lfpr_cpr.etc new file mode 100644 index 000000000..8a01f263a --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lfpr_cpr.etc @@ -0,0 +1,52 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/ltpss_sn_ltpss_sn.ma". +include "basic_2/reducibility/ltpr_ldrop.ma". +include "basic_2/reducibility/cpr.ma". +include "basic_2/reducibility/lfpr.ma". + +(* FOCALIZED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS **********************) + +(* Advanced properties ******************************************************) + +lemma lfpr_pair_cpr: ∀L1,L2. ⦃L1⦄ ➡ ⦃L2⦄ → ∀V1,V2. L2 ⊢ V1 ➡ V2 → + ∀I. ⦃L1. ⓑ{I} V1⦄ ➡ ⦃L2. ⓑ{I} V2⦄. +#L1 #L2 * #L #HL1 #HL2 #V1 #V2 * +<(ltpss_sn_fwd_length … HL2) #V #HV1 #HV2 #I +lapply (ltpss_sn_tpss_trans_eq … HV2 … HL2) -HV2 #V2 +@(ex2_intro … (L.ⓑ{I}V)) /2 width=1/ (**) (* explicit constructor *) +qed. + +(* Properties on supclosure *************************************************) +(* +lamma fsub_cpr_trans: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ → ∀U2. L2 ⊢ T2 ➡ U2 → + ∃∃L,U1. ⦃L1⦄ ➡ ⦃L⦄ & L ⊢ T1 ➡ U1 & ⦃L, U1⦄ ⊃ ⦃L2, U2⦄. +#L1 #L2 #T1 #T2 #HT12 #U2 * #T #H1 #H2 +elim (fsub_tpr_trans … HT12 … H1) -T2 #L #U #HL1 #HT1U #HUT +elim (fsup_tpss_trans_full … HUT … H2) -T -HUT -H2 #L #U #HL1 #HT1U #HUT + + + + + + + #H elim H -L1 -L2 -T1 -T2 [1,2,3,4,5: /3 width=5/ ] +#L1 #K1 #K2 #T1 #T2 #U1 #d #e #HLK1 #HTU1 #_ #IHT12 #U2 #HTU2 +elim (IHT12 … HTU2) -IHT12 -HTU2 #K #T #HK1 #HT1 #HK2 +elim (lift_total T d e) #U #HTU +elim (ldrop_ltpr_trans … HLK1 … HK1) -HLK1 -HK1 #L #HL1 #HLK +lapply (tpr_lift … HT1 … HTU1 … HTU) -HT1 -HTU1 /3 width=11/ +qed-. +*) \ No newline at end of file diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lfpr_lfpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lfpr_lfpr.etc new file mode 100644 index 000000000..7031e792b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lfpr_lfpr.etc @@ -0,0 +1,39 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/ltpr_ltpss_sn.ma". +include "basic_2/reducibility/ltpr_ltpr.ma". +include "basic_2/reducibility/lfpr.ma". + +(* FOCALIZED PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ***********************) + +(* Main properties **********************************************************) + +theorem lfpr_conf: ∀L0,L1,L2. ⦃L0⦄ ➡ ⦃L1⦄ → ⦃L0⦄ ➡ ⦃L2⦄ → + ∃∃L. ⦃L1⦄ ➡ ⦃L⦄ & ⦃L2⦄ ➡ ⦃L⦄. +#K0 #L1 #L2 * #K1 #HK01 #HKL1 * #K2 #HK02 #HKL2 +lapply (ltpr_fwd_length … HK01) #H +>(ltpr_fwd_length … HK02) in H; #H +elim (ltpr_conf … HK01 … HK02) -K0 #K #HK1 #HK2 +lapply (ltpss_sn_fwd_length … HKL1) #H1 +lapply (ltpss_sn_fwd_length … HKL2) #H2 +>H1 in HKL1 H; -H1 #HKL1 +>H2 in HKL2; -H2 #HKL2 #H +elim (ltpr_ltpss_sn_conf … HKL1 … HK1) -K1 #K1 #HK1 #HLK1 +elim (ltpr_ltpss_sn_conf … HKL2 … HK2) -K2 #K2 #HK2 #HLK2 +elim (ltpss_sn_conf … HK1 … HK2) -K #K #HK1 #HK2 +lapply (ltpr_fwd_length … HLK1) #H1 +lapply (ltpr_fwd_length … HLK2) #H2 +/3 width=5/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lfprs_ltprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lfprs_ltprs.etc new file mode 100644 index 000000000..99ae801d7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lfprs_ltprs.etc @@ -0,0 +1,23 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/ltprs.ma". +include "basic_2/computation/lfprs.ma". + +(* FOCALIZED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS *********************) + +(* Properties on context-free parallel computation for local environments ***) + +lemma ltprs_lfprs: ∀L1,L2. L1 ➡* L2 → ⦃L1⦄ ➡* ⦃L2⦄. +/3 width=3/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lift.etc new file mode 100644 index 000000000..f0d631ebb --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lift.etc @@ -0,0 +1,25 @@ +definition t_liftable: relation term → Prop ≝ + λR. ∀T1,T2. R T1 T2 → ∀U1,d,e. ⇧[d, e] T1 ≡ U1 → + ∀U2. ⇧[d, e] T2 ≡ U2 → R U1 U2. + +definition t_deliftable_sn: relation term → Prop ≝ + λR. ∀U1,U2. R U1 U2 → ∀T1,d,e. ⇧[d, e] T1 ≡ U1 → + ∃∃T2. ⇧[d, e] T2 ≡ U2 & R T1 T2. + +lemma t_liftable_TC: ∀R. t_liftable R → t_liftable (TC … R). +#R #HR #T1 #T2 #H elim H -T2 +[ /3 width=7/ +| #T #T2 #_ #HT2 #IHT1 #U1 #d #e #HTU1 #U2 #HTU2 + elim (lift_total T d e) /3 width=9/ +] +qed. + +lemma t_deliftable_sn_TC: ∀R. t_deliftable_sn R → t_deliftable_sn (TC … R). +#R #HR #U1 #U2 #H elim H -U2 +[ #U2 #HU12 #T1 #d #e #HTU1 + elim (HR … HU12 … HTU1) -U1 /3 width=3/ +| #U #U2 #_ #HU2 #IHU1 #T1 #d #e #HTU1 + elim (IHU1 … HTU1) -U1 #T #HTU #HT1 + elim (HR … HU2 … HTU) -U /3 width=5/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lsubr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lsubr.etc new file mode 100644 index 000000000..8655a5e54 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lsubr.etc @@ -0,0 +1,198 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( L1 break ⊑ [ term 46 d , break term 46 e ] break term 46 L2 )" + non associative with precedence 45 + for @{ 'SubEq $L1 $d $e $L2 }. + +include "basic_2/grammar/lenv_length.ma". + +(* LOCAL ENVIRONMENT REFINEMENT FOR SUBSTITUTION ****************************) + +inductive lsubr: nat → nat → relation lenv ≝ +| lsubr_sort: ∀d,e. lsubr d e (⋆) (⋆) +| lsubr_OO: ∀L1,L2. lsubr 0 0 L1 L2 +| lsubr_abbr: ∀L1,L2,V,e. lsubr 0 e L1 L2 → + lsubr 0 (e + 1) (L1. ⓓV) (L2.ⓓV) +| lsubr_abst: ∀L1,L2,I,V1,V2,e. lsubr 0 e L1 L2 → + lsubr 0 (e + 1) (L1. ⓑ{I}V1) (L2. ⓛV2) +| lsubr_skip: ∀L1,L2,I1,I2,V1,V2,d,e. + lsubr d e L1 L2 → lsubr (d + 1) e (L1. ⓑ{I1} V1) (L2. ⓑ{I2} V2) +. + +interpretation + "local environment refinement (substitution)" + 'SubEq L1 d e L2 = (lsubr d e L1 L2). + +definition lsubr_trans: ∀S. (lenv → relation S) → Prop ≝ λS,R. + ∀L2,s1,s2. R L2 s1 s2 → + ∀L1,d,e. L1 ⊑ [d, e] L2 → R L1 s1 s2. + +(* Basic properties *********************************************************) + +lemma lsubr_bind_eq: ∀L1,L2,e. L1 ⊑ [0, e] L2 → ∀I,V. + L1. ⓑ{I} V ⊑ [0, e + 1] L2.ⓑ{I} V. +#L1 #L2 #e #HL12 #I #V elim I -I /2 width=1/ +qed. + +lemma lsubr_abbr_lt: ∀L1,L2,V,e. L1 ⊑ [0, e - 1] L2 → 0 < e → + L1. ⓓV ⊑ [0, e] L2.ⓓV. +#L1 #L2 #V #e #HL12 #He >(plus_minus_m_m e 1) // /2 width=1/ +qed. + +lemma lsubr_abst_lt: ∀L1,L2,I,V1,V2,e. L1 ⊑ [0, e - 1] L2 → 0 < e → + L1. ⓑ{I}V1 ⊑ [0, e] L2. ⓛV2. +#L1 #L2 #I #V1 #V2 #e #HL12 #He >(plus_minus_m_m e 1) // /2 width=1/ +qed. + +lemma lsubr_skip_lt: ∀L1,L2,d,e. L1 ⊑ [d - 1, e] L2 → 0 < d → + ∀I1,I2,V1,V2. L1. ⓑ{I1} V1 ⊑ [d, e] L2. ⓑ{I2} V2. +#L1 #L2 #d #e #HL12 #Hd >(plus_minus_m_m d 1) // /2 width=1/ +qed. + +lemma lsubr_bind_lt: ∀I,L1,L2,V,e. L1 ⊑ [0, e - 1] L2 → 0 < e → + L1. ⓓV ⊑ [0, e] L2. ⓑ{I}V. +* /2 width=1/ qed. + +lemma lsubr_refl: ∀d,e,L. L ⊑ [d, e] L. +#d elim d -d +[ #e elim e -e // #e #IHe #L elim L -L // /2 width=1/ +| #d #IHd #e #L elim L -L // /2 width=1/ +] +qed. + +lemma TC_lsubr_trans: ∀S,R. lsubr_trans S R → lsubr_trans S (λL. (TC … (R L))). +#S #R #HR #L1 #s1 #s2 #H elim H -s2 +[ /3 width=5/ +| #s #s2 #_ #Hs2 #IHs1 #L2 #d #e #HL12 + lapply (HR … Hs2 … HL12) -HR -Hs2 -HL12 /3 width=3/ +] +qed. + +(* Basic inversion lemmas ***************************************************) + +fact lsubr_inv_atom1_aux: ∀L1,L2,d,e. L1 ⊑ [d, e] L2 → L1 = ⋆ → + L2 = ⋆ ∨ (d = 0 ∧ e = 0). +#L1 #L2 #d #e * -L1 -L2 -d -e +[ /2 width=1/ +| /3 width=1/ +| #L1 #L2 #W #e #_ #H destruct +| #L1 #L2 #I #W1 #W2 #e #_ #H destruct +| #L1 #L2 #I1 #I2 #W1 #W2 #d #e #_ #H destruct +] +qed. + +lemma lsubr_inv_atom1: ∀L2,d,e. ⋆ ⊑ [d, e] L2 → + L2 = ⋆ ∨ (d = 0 ∧ e = 0). +/2 width=3/ qed-. + +fact lsubr_inv_skip1_aux: ∀L1,L2,d,e. L1 ⊑ [d, e] L2 → + ∀I1,K1,V1. L1 = K1.ⓑ{I1}V1 → 0 < d → + ∃∃I2,K2,V2. K1 ⊑ [d - 1, e] K2 & L2 = K2.ⓑ{I2}V2. +#L1 #L2 #d #e * -L1 -L2 -d -e +[ #d #e #I1 #K1 #V1 #H destruct +| #L1 #L2 #I1 #K1 #V1 #_ #H + elim (lt_zero_false … H) +| #L1 #L2 #W #e #_ #I1 #K1 #V1 #_ #H + elim (lt_zero_false … H) +| #L1 #L2 #I #W1 #W2 #e #_ #I1 #K1 #V1 #_ #H + elim (lt_zero_false … H) +| #L1 #L2 #J1 #J2 #W1 #W2 #d #e #HL12 #I1 #K1 #V1 #H #_ destruct /2 width=5/ +] +qed. + +lemma lsubr_inv_skip1: ∀I1,K1,L2,V1,d,e. K1.ⓑ{I1}V1 ⊑ [d, e] L2 → 0 < d → + ∃∃I2,K2,V2. K1 ⊑ [d - 1, e] K2 & L2 = K2.ⓑ{I2}V2. +/2 width=5/ qed-. + +fact lsubr_inv_atom2_aux: ∀L1,L2,d,e. L1 ⊑ [d, e] L2 → L2 = ⋆ → + L1 = ⋆ ∨ (d = 0 ∧ e = 0). +#L1 #L2 #d #e * -L1 -L2 -d -e +[ /2 width=1/ +| /3 width=1/ +| #L1 #L2 #W #e #_ #H destruct +| #L1 #L2 #I #W1 #W2 #e #_ #H destruct +| #L1 #L2 #I1 #I2 #W1 #W2 #d #e #_ #H destruct +] +qed. + +lemma lsubr_inv_atom2: ∀L1,d,e. L1 ⊑ [d, e] ⋆ → + L1 = ⋆ ∨ (d = 0 ∧ e = 0). +/2 width=3/ qed-. + +fact lsubr_inv_abbr2_aux: ∀L1,L2,d,e. L1 ⊑ [d, e] L2 → + ∀K2,V. L2 = K2.ⓓV → d = 0 → 0 < e → + ∃∃K1. K1 ⊑ [0, e - 1] K2 & L1 = K1.ⓓV. +#L1 #L2 #d #e * -L1 -L2 -d -e +[ #d #e #K1 #V #H destruct +| #L1 #L2 #K1 #V #_ #_ #H + elim (lt_zero_false … H) +| #L1 #L2 #W #e #HL12 #K1 #V #H #_ #_ destruct /2 width=3/ +| #L1 #L2 #I #W1 #W2 #e #_ #K1 #V #H destruct +| #L1 #L2 #I1 #I2 #W1 #W2 #d #e #_ #K1 #V #_ >commutative_plus normalize #H destruct +] +qed. + +lemma lsubr_inv_abbr2: ∀L1,K2,V,e. L1 ⊑ [0, e] K2.ⓓV → 0 < e → + ∃∃K1. K1 ⊑ [0, e - 1] K2 & L1 = K1.ⓓV. +/2 width=5/ qed-. + +fact lsubr_inv_skip2_aux: ∀L1,L2,d,e. L1 ⊑ [d, e] L2 → + ∀I2,K2,V2. L2 = K2.ⓑ{I2}V2 → 0 < d → + ∃∃I1,K1,V1. K1 ⊑ [d - 1, e] K2 & L1 = K1.ⓑ{I1}V1. +#L1 #L2 #d #e * -L1 -L2 -d -e +[ #d #e #I1 #K1 #V1 #H destruct +| #L1 #L2 #I1 #K1 #V1 #_ #H + elim (lt_zero_false … H) +| #L1 #L2 #W #e #_ #I1 #K1 #V1 #_ #H + elim (lt_zero_false … H) +| #L1 #L2 #I #W1 #W2 #e #_ #I1 #K1 #V1 #_ #H + elim (lt_zero_false … H) +| #L1 #L2 #J1 #J2 #W1 #W2 #d #e #HL12 #I1 #K1 #V1 #H #_ destruct /2 width=5/ +] +qed. + +lemma lsubr_inv_skip2: ∀I2,L1,K2,V2,d,e. L1 ⊑ [d, e] K2.ⓑ{I2}V2 → 0 < d → + ∃∃I1,K1,V1. K1 ⊑ [d - 1, e] K2 & L1 = K1.ⓑ{I1}V1. +/2 width=5/ qed-. + +(* Basic forward lemmas *****************************************************) + +fact lsubr_fwd_length_full1_aux: ∀L1,L2,d,e. L1 ⊑ [d, e] L2 → + d = 0 → e = |L1| → |L1| ≤ |L2|. +#L1 #L2 #d #e #H elim H -L1 -L2 -d -e normalize +[ // +| /2 width=1/ +| /3 width=1/ +| /3 width=1/ +| #L1 #L2 #_ #_ #_ #_ #d #e #_ #_ >commutative_plus normalize #H destruct +] +qed. + +lemma lsubr_fwd_length_full1: ∀L1,L2. L1 ⊑ [0, |L1|] L2 → |L1| ≤ |L2|. +/2 width=5/ qed-. + +fact lsubr_fwd_length_full2_aux: ∀L1,L2,d,e. L1 ⊑ [d, e] L2 → + d = 0 → e = |L2| → |L2| ≤ |L1|. +#L1 #L2 #d #e #H elim H -L1 -L2 -d -e normalize +[ // +| /2 width=1/ +| /3 width=1/ +| /3 width=1/ +| #L1 #L2 #_ #_ #_ #_ #d #e #_ #_ >commutative_plus normalize #H destruct +] +qed. + +lemma lsubr_fwd_length_full2: ∀L1,L2. L1 ⊑ [0, |L2|] L2 → |L2| ≤ |L1|. +/2 width=5/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lsubr_lbotr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lsubr_lbotr.etc new file mode 100644 index 000000000..b95a19b66 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/lsubr_lbotr.etc @@ -0,0 +1,77 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( ⊒ [ term 46 d , break term 46 e ] break term 46 L2 )" + non associative with precedence 45 + for @{ 'SubEqBottom $d $e $L2 }. + +include "basic_2/relocation/lsubr.ma". + +(* LOCAL ENVIRONMENT REFINEMENT FOR SUBSTITUTION ****************************) + +(* bottom element of the refinement *) +definition lbotr: nat → nat → predicate lenv ≝ + λd,e. NF_sn … (lsubr d e) (lsubr d e …). + +interpretation + "local environment full refinement (substitution)" + 'SubEqBottom d e L = (lbotr d e L). + +(* Basic properties *********************************************************) + +lemma lbotr_atom: ∀d,e. ⊒[d, e] ⋆. +#d #e #L #H +elim (lsubr_inv_atom2 … H) -H +[ #H destruct // +| * #H1 #H2 destruct // +] +qed. + +lemma lbotr_OO: ∀L. ⊒[0, 0] L. +// qed. + +lemma lbotr_abbr: ∀L,V,e. ⊒[0, e] L → ⊒[0, e + 1] L.ⓓV. +#L #V #e #HL #K #H +elim (lsubr_inv_abbr2 … H ?) -H // (tpr_inv_atom1 … H2) -Y +|4,5: [ #a ] * #V1 #T1 #Hn #X #H1 #L2 #HL12 #Y #H2 destruct +] +[ >(aaa_inv_sort … H1) -X // +| elim (aaa_inv_lref … H1) #I #K1 #V1 #HLK1 #HA + lapply (ldrop_pair2_fwd_fw … HLK1 (#i)) #HKV1 + elim (ltpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #Y #H #HLK2 + elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct + lapply (IH … HKV1 … HA … HK12 … HV12) -L1 -K1 -V1 /2 width=5/ +| elim (aaa_inv_gref … H1) +| elim (aaa_inv_abbr … H1) -H1 #B #HB #HA + elim (tpr_inv_abbr1 … H2) -H2 * + [ #V2 #T #T2 #HV12 #HT1 #HT2 #H destruct + lapply (tps_lsubr_trans … HT2 (L2.ⓓV2) ?) -HT2 /2 width=1/ #HT2 + lapply (IH … HB … HL12 … HV12) -HB /width=5/ #HB + lapply (IH … HA … (L2.ⓓV2) … HT1) -IH -HA -HT1 /width=5/ -T1 /2 width=1/ -L1 -V1 /3 width=5/ + | -B #T #HT1 #HXT #H destruct + lapply (IH … HA … (L2.ⓓV1) … HT1) /width=5/ -T1 /2 width=1/ -L1 #HA + @(aaa_inv_lift … HA … HXT) /2 width=1/ + ] +| elim (aaa_inv_abst … H1) -H1 #B #A #HB #HA #H destruct + elim (tpr_inv_abst1 … H2) -H2 #V2 #T2 #HV12 #HT12 #H destruct + lapply (IH … HB … HL12 … HV12) -HB /width=5/ #HB + lapply (IH … HA … (L2.ⓛV2) … HT12) -IH -HA -HT12 /width=5/ -T1 /2 width=1/ +| elim (aaa_inv_appl … H1) -H1 #B #HB #HA + elim (tpr_inv_appl1 … H2) -H2 * + [ #V2 #T2 #HV12 #HT12 #H destruct + lapply (IH … HB … HL12 … HV12) -HB -HV12 /width=5/ #HB + lapply (IH … HA … HL12 … HT12) -IH -HA -HL12 -HT12 /width=5/ /2 width=3/ + | #b #V2 #W2 #T0 #T2 #HV12 #HT02 #H1 #H2 destruct + elim (aaa_inv_abst … HA) -HA #B0 #A0 #HB0 #HA0 #H destruct + lapply (IH … HB … HL12 … HV12) -HB -HV12 /width=5/ #HB + lapply (IH … HB0 … HL12 W2 ?) -HB0 /width=5/ #HB0 + lapply (IH … HA0 … (L2.ⓛW2) … HT02) -IH -HA0 -HT02 // /2 width=1/ -T0 -L1 -V1 /4 width=7/ + | #b #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HW02 #HT02 #HV02 #H1 #H2 destruct + elim (aaa_inv_abbr … HA) -HA #B0 #HW0 #HT0 + lapply (IH … HW0 … HL12 … HW02) -HW0 /width=5/ #HW2 + lapply (IH … HB … HL12 … HV10) -HB -HV10 /width=5/ #HV0 + lapply (IH … HT0 … (L2.ⓓW2) … HT02) -IH -HT0 -HT02 // /2 width=1/ -V1 -T0 -L1 -W0 #HT2 + @(aaa_abbr … HW2) -HW2 + @(aaa_appl … HT2) -HT2 /3 width=7/ (**) (* explict constructors, /5 width=7/ is too slow *) + ] +| elim (aaa_inv_cast … H1) -H1 #HV1 #HT1 + elim (tpr_inv_cast1 … H2) -H2 + [ * #V2 #T2 #HV12 #HT12 #H destruct + lapply (IH … HV1 … HL12 … HV12) -HV1 -HV12 /width=5/ #HV2 + lapply (IH … HT1 … HL12 … HT12) -IH -HT1 -HL12 -HT12 /width=5/ -L1 -V1 -T1 /2 width=1/ + | -HV1 #HT1X + lapply (IH … HT1 … HL12 … HT1X) -IH -HT1 -HL12 -HT1X /width=5/ + ] +] +qed. + +lemma aaa_ltpr_conf: ∀L1,T,A. L1 ⊢ T ⁝ A → ∀L2. L1 ➡ L2 → L2 ⊢ T ⁝ A. +/2 width=5/ qed. + +lemma aaa_tpr_conf: ∀L,T1,A. L ⊢ T1 ⁝ A → ∀T2. T1 ➡ T2 → L ⊢ T2 ⁝ A. +/2 width=5/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpr_ldrop.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpr_ldrop.etc new file mode 100644 index 000000000..02404a11d --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpr_ldrop.etc @@ -0,0 +1,45 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/ldrop_lpx.ma". +include "basic_2/substitution/fsup.ma". +include "basic_2/reducibility/tpr_lift.ma". +include "basic_2/reducibility/ltpr.ma". + +(* CONTEXT-FREE PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ********************) + +(* Properies on local environment slicing ***********************************) + +(* Basic_1: was: wcpr0_drop *) +lemma ltpr_ldrop_conf: dropable_sn ltpr. +/3 width=3 by lpx_deliftable_dropable, tpr_inv_lift1/ qed. + +(* Basic_1: was: wcpr0_drop_back *) +lemma ldrop_ltpr_trans: dedropable_sn ltpr. +/2 width=3/ qed. + +lemma ltpr_ldrop_trans_O1: dropable_dx ltpr. +/2 width=3/ qed. + +(* Properties on supclosure *************************************************) + +lemma fsub_tpr_trans: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ → ∀U2. T2 ➡ U2 → + ∃∃L,U1. L1 ➡ L & T1 ➡ U1 & ⦃L, U1⦄ ⊃ ⦃L2, U2⦄. +#L1 #L2 #T1 #T2 #H elim H -L1 -L2 -T1 -T2 [1,2,3,4,5: /3 width=5/ ] +#L1 #K1 #K2 #T1 #T2 #U1 #d #e #HLK1 #HTU1 #_ #IHT12 #U2 #HTU2 +elim (IHT12 … HTU2) -IHT12 -HTU2 #K #T #HK1 #HT1 #HK2 +elim (lift_total T d e) #U #HTU +elim (ldrop_ltpr_trans … HLK1 … HK1) -HLK1 -HK1 #L #HL1 #HLK +lapply (tpr_lift … HT1 … HTU1 … HTU) -HT1 -HTU1 /3 width=11/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpr_ltpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpr_ltpr.etc new file mode 100644 index 000000000..4a27a6e70 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpr_ltpr.etc @@ -0,0 +1,29 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/tpr_tpr.ma". +include "basic_2/reducibility/ltpr.ma". + +(* CONTEXT-FREE PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ********************) + +(* Main properties **********************************************************) + +theorem ltpr_conf: ∀L0:lenv. ∀L1. L0 ➡ L1 → ∀L2. L0 ➡ L2 → + ∃∃L. L1 ➡ L & L2 ➡ L. +#L0 #L1 #H elim H -L0 -L1 /2 width=3/ +#I #K0 #K1 #V0 #V1 #_ #HV01 #IHK01 #L2 #H +elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK02 #HV02 #H destruct +elim (IHK01 … HK02) -K0 #K #HK1 #HK2 +elim (tpr_conf … HV01 HV02) -V0 /3 width=5/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpr_ltpss_dx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpr_ltpss_dx.etc new file mode 100644 index 000000000..00730b732 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpr_ltpss_dx.etc @@ -0,0 +1,36 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/ltpr_tpss.ma". + +(* CONTEXT-FREE PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ********************) + +(* Properties concerning dx parallel unfold on local environments ***********) + +lemma ltpr_ltpss_dx_conf: ∀L1,K1,d,e. L1 ▶* [d, e] K1 → ∀L2. L1 ➡ L2 → + ∃∃K2. L2 ▶* [d, e] K2 & K1 ➡ K2. +#L1 #K1 #d #e #H elim H -L1 -K1 -d -e +[ /2 width=3/ +| #L1 #I #V1 #X #H + elim (ltpr_inv_pair1 … H) -H #L2 #V2 #HL12 #HV12 #H destruct /3 width=5/ +| #L1 #K1 #I #V1 #W1 #e #_ #HVW1 #IHLK1 #X #H + elim (ltpr_inv_pair1 … H) -H #L2 #V2 #HL12 #HV12 #H destruct + elim (IHLK1 … HL12) -L1 #K2 #HLK2 #HK12 + elim (ltpr_tpr_tpss_conf … HK12 … HV12 … HVW1) -V1 /3 width=5/ +| #L1 #K1 #I #V1 #W1 #d #e #_ #HVW1 #IHLK1 #X #H + elim (ltpr_inv_pair1 … H) -H #L2 #V2 #HL12 #HV12 #H destruct + elim (IHLK1 … HL12) -L1 #K2 #HLK2 #HK12 + elim (ltpr_tpr_tpss_conf … HK12 … HV12 … HVW1) -V1 /3 width=5/ +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpr_ltpss_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpr_ltpss_sn.etc new file mode 100644 index 000000000..79ffb7c9e --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpr_ltpss_sn.etc @@ -0,0 +1,31 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/ltpss_sn_alt.ma". +include "basic_2/reducibility/ltpr_ltpss_dx.ma". + +(* CONTEXT-FREE PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ********************) + +(* Properties on sn parallel unfold on local environments *******************) + +(* Note: this can also be proved like ltpr_ltpss_dx_conf *) +lemma ltpr_ltpss_sn_conf: ∀L1,K1,d,e. L1 ⊢ ▶* [d, e] K1 → ∀L2. L1 ➡ L2 → + ∃∃K2. L2 ⊢ ▶* [d, e] K2 & K1 ➡ K2. +#L1 #K1 #d #e #H +lapply (ltpss_sn_ltpssa … H) -H #H +@(ltpssa_ind … H) -K1 /2 width=3/ +#K #K1 #_ #HK1 #IHK #L2 #HL12 +elim (IHK … HL12) -L1 #K2 #HLK2 #HK2 +elim (ltpr_ltpss_dx_conf … HK1 … HK2) -K /3 width=3/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpr_tps.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpr_tps.etc new file mode 100644 index 000000000..7f08be62b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpr_tps.etc @@ -0,0 +1,57 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/ltpr_ldrop.ma". + +(* CONTEXT-FREE PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ********************) + +(* Properties concerning parallel substitution on terms *********************) + +(* Basic_1: was: pr0_subst1_fwd *) +lemma ltpr_tps_conf: ∀L1,T1,T2,d,e. L1 ⊢ T1 ▶ [d, e] T2 → ∀L2. L1 ➡ L2 → + ∃∃T. L2 ⊢ T1 ▶ [d, e] T & T2 ➡ T. +#L1 #T1 #T2 #d #e #H elim H -L1 -T1 -T2 -d -e +[ /2 width=3/ +| #L1 #K1 #V1 #W1 #i #d #e #Hdi #Hide #HLK1 #HVW1 #L2 #HL12 + elim (ltpr_ldrop_conf … HLK1 … HL12) -L1 #X #H #HLK2 + elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct -K1 + elim (lift_total V2 0 (i+1)) #W2 #HVW2 + lapply (tpr_lift … HV12 … HVW1 … HVW2) -V1 /3 width=4/ +| #L1 #a #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #L2 #HL12 + elim (IHV12 … HL12) -IHV12 #V #HV1 #HV2 + elim (IHT12 (L2.ⓑ{I}V) ?) /2 width=1/ -L1 /3 width=5/ +| #L1 #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #L2 #HL12 + elim (IHV12 … HL12) -IHV12 + elim (IHT12 … HL12) -L1 /3 width=5/ +] +qed-. + +(* Basic_1: was: pr0_subst1_back *) +lemma ltpr_tps_trans: ∀L2,T1,T2,d,e. L2 ⊢ T1 ▶ [d, e] T2 → ∀L1. L1 ➡ L2 → + ∃∃T. L1 ⊢ T1 ▶ [d, e] T & T ➡ T2. +#L2 #T1 #T2 #d #e #H elim H -L2 -T1 -T2 -d -e +[ /2 width=3/ +| #L2 #K2 #V2 #W2 #i #d #e #Hdi #Hide #HLK2 #HVW2 #L1 #HL12 + elim (ltpr_ldrop_trans_O1 … HL12 … HLK2) -L2 #X #HLK1 #H + elim (ltpr_inv_pair2 … H) -H #K1 #V1 #HK12 #HV12 #H destruct -K2 + elim (lift_total V1 0 (i+1)) #W1 #HVW1 + lapply (tpr_lift … HV12 … HVW1 … HVW2) -V2 /3 width=4/ +| #L2 #a #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #L1 #HL12 + elim (IHV12 … HL12) -IHV12 #V #HV1 #HV2 + elim (IHT12 (L1.ⓑ{I}V) ?) /2 width=1/ -L2 /3 width=5/ +| #L2 #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #L1 #HL12 + elim (IHV12 … HL12) -IHV12 + elim (IHT12 … HL12) -L2 /3 width=5/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpr_tpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpr_tpss.etc new file mode 100644 index 000000000..71586fa36 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpr_tpss.etc @@ -0,0 +1,91 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/ltpss_dx_ltpss_dx.ma". +include "basic_2/reducibility/ltpr_tps.ma". + +(* CONTEXT-FREE PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ********************) + +(* Properties on partial unfold for terms ***********************************) + +(* Basic_1: was: pr0_subst1 *) +lemma ltpr_tpr_tps_conf: ∀T1,T2. T1 ➡ T2 → + ∀L1,d,e,U1. L1 ⊢ T1 ▶ [d, e] U1 → + ∀L2. L1 ➡ L2 → + ∃∃U2. U1 ➡ U2 & L2 ⊢ T2 ▶* [d, e] U2. +#T1 #T2 #H elim H -T1 -T2 +[ #I #L1 #d #e #U1 #H #L2 #HL12 + elim (ltpr_tps_conf … H … HL12) -L1 /3 width=3/ +| #I #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #d #e #X #H #L2 #HL12 + elim (tps_inv_flat1 … H) -H #W1 #U1 #HVW1 #HTU1 #H destruct + elim (IHV12 … HVW1 … HL12) -V1 + elim (IHT12 … HTU1 … HL12) -T1 -HL12 /3 width=5/ +| #a #V1 #V2 #W #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #d #e #X #H #L2 #HL12 + elim (tps_inv_flat1 … H) -H #VV1 #Y #HVV1 #HY #HX destruct + elim (tps_inv_bind1 … HY) -HY #WW #TT1 #_ #HTT1 #H destruct + elim (IHV12 … HVV1 … HL12) -V1 #VV2 #HVV12 #HVV2 + elim (IHT12 … HTT1 (L2. ⓛWW) ?) -T1 /2 width=1/ -HL12 #TT2 #HTT12 #HTT2 + lapply (tpss_lsubr_trans … HTT2 (L2. ⓓVV2) ?) -HTT2 /3 width=5/ +| #a #I #V1 #V2 #T1 #T #T2 #HV12 #_ #HT2 #IHV12 #IHT1 #L1 #d #e #X #H #L2 #HL12 + elim (tps_inv_bind1 … H) -H #W1 #U1 #HVW1 #HTU1 #H destruct + elim (IHV12 … HVW1 … HL12) -V1 #W2 #HW12 #HVW2 + elim (IHT1 … HTU1 (L2. ⓑ{I} W2) ?) -T1 /2 width=1/ -HL12 #U #HU1 #HTU + elim (tpss_strip_neq … HTU … HT2 ?) -T /2 width=1/ #U2 #HU2 #HTU2 + lapply (tps_lsubr_trans … HU2 (L2. ⓑ{I} V2) ?) -HU2 /2 width=1/ #HU2 + elim (ltpss_dx_tps_conf … HU2 (L2. ⓑ{I} W2) (d + 1) e ?) -HU2 /2 width=1/ #U3 #HU3 #HU23 + lapply (tps_lsubr_trans … HU3 (⋆. ⓑ{I} W2) ?) -HU3 /2 width=1/ #HU3 + lapply (tpss_lsubr_trans … HU23 (L2. ⓑ{I} W2) ?) -HU23 /2 width=1/ #HU23 + lapply (tpss_trans_eq … HTU2 … HU23) -U2 /3 width=5/ +| #a #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV12 #IHW12 #IHT12 #L1 #d #e #X #H #L2 #HL12 + elim (tps_inv_flat1 … H) -H #VV1 #Y #HVV1 #HY #HX destruct + elim (tps_inv_bind1 … HY) -HY #WW1 #TT1 #HWW1 #HTT1 #H destruct + elim (IHV12 … HVV1 … HL12) -V1 #VV2 #HVV12 #HVV2 + elim (IHW12 … HWW1 … HL12) -W1 #WW2 #HWW12 #HWW2 + elim (IHT12 … HTT1 (L2. ⓓWW2) ?) -T1 /2 width=1/ -HL12 #TT2 #HTT12 #HTT2 + elim (lift_total VV2 0 1) #VV #H2VV + lapply (tpss_lift_ge … HVV2 (L2. ⓓWW2) … HV2 … H2VV) -V2 /2 width=1/ #HVV + @ex2_intro [2: @tpr_theta |1: skip |3: @tpss_bind [2: @tpss_flat ] ] /width=11/ (**) (* /4 width=11/ is too slow *) +| #V #T1 #T #T2 #_ #HT2 #IHT1 #L1 #d #e #X #H #L2 #HL12 + elim (tps_inv_bind1 … H) -H #W #U1 #_ #HTU1 #H destruct -V + elim (IHT1 … HTU1 (L2.ⓓW) ?) -T1 /2 width=1/ -HL12 #U #HU1 #HTU + elim (tpss_inv_lift1_ge … HTU L2 … HT2 ?) -T (ltpr_inv_atom1 … HL2) -L2 // +qed-. + +lemma ltprs_inv_pair1: ∀I,K1,L2,V1. K1. ⓑ{I} V1 ➡* L2 → + ∃∃K2,V2. K1 ➡* K2 & V1 ➡* V2 & L2 = K2. ⓑ{I} V2. +#I #K1 #L2 #V1 #H @(ltprs_ind … H) -L2 /2 width=5/ +#L #L2 #_ #HL2 * #K #V #HK1 #HV1 #H destruct +elim (ltpr_inv_pair1 … HL2) -HL2 #K2 #V2 #HK2 #HV2 #H destruct /3 width=5/ +qed-. + +lemma ltprs_inv_atom2: ∀L1. L1 ➡* ⋆ → L1 = ⋆. +#L1 #H @(ltprs_ind_dx … H) -L1 // +#L1 #L #HL1 #_ #IHL2 destruct +>(ltpr_inv_atom2 … HL1) -L1 // +qed-. + +lemma ltprs_inv_pair2: ∀I,L1,K2,V2. L1 ➡* K2. ⓑ{I} V2 → + ∃∃K1,V1. K1 ➡* K2 & V1 ➡* V2 & L1 = K1. ⓑ{I} V1. +#I #L1 #K2 #V2 #H @(ltprs_ind_dx … H) -L1 /2 width=5/ +#L1 #L #HL1 #_ * #K #V #HK2 #HV2 #H destruct +elim (ltpr_inv_pair2 … HL1) -HL1 #K1 #V1 #HK1 #HV1 #H destruct /3 width=5/ +qed-. + +(* Basic forward lemmas *****************************************************) + +lemma ltprs_fwd_length: ∀L1,L2. L1 ➡* L2 → |L1| = |L2|. +#L1 #L2 #H @(ltprs_ind … H) -L2 // +#L #L2 #_ #HL2 #IHL1 +>IHL1 -L1 >(ltpr_fwd_length … HL2) -HL2 // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltprs_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltprs_alt.etc new file mode 100644 index 000000000..1d2db2daf --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltprs_alt.etc @@ -0,0 +1,38 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( T1 ➡ ➡ * break term 46 T2 )" + non associative with precedence 45 + for @{ 'PRedStarAlt $T1 $T2 }. + +include "basic_2/computation/ltprs.ma". + +(* CONTEXT-FREE PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS ******************) + +(* alternative definition of ltprs *) +definition ltprsa: relation lenv ≝ lpx tprs. + +interpretation + "context-free parallel computation (environment) alternative" + 'PRedStarAlt L1 L2 = (ltprsa L1 L2). + +(* Basic properties *********************************************************) + +lemma ltprs_ltprsa: ∀L1,L2. L1 ➡* L2 → L1 ➡➡* L2. +/2 width=1/ qed. + +(* Basic inversion lemmas ***************************************************) + +lemma ltprsa_ltprs: ∀L1,L2. L1 ➡➡* L2 → L1 ➡* L2. +/2 width=1/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltprs_ldrop.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltprs_ldrop.etc new file mode 100644 index 000000000..a7c320089 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltprs_ldrop.etc @@ -0,0 +1,27 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/ltpr_ldrop.ma". +include "basic_2/computation/ltprs.ma". + +(* CONTEXT-FREE PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS ******************) + +lemma ltprs_ldrop_conf: dropable_sn ltprs. +/2 width=3/ qed. + +lemma ldrop_ltprs_trans: dedropable_sn ltprs. +/2 width=3/ qed. + +lemma ltprs_ldrop_trans_O1: dropable_dx ltprs. +/2 width=3/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltprs_ltprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltprs_ltprs.etc new file mode 100644 index 000000000..7ededf2af --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltprs_ltprs.etc @@ -0,0 +1,32 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/ltpr_ltpr.ma". +include "basic_2/computation/ltprs.ma". + +(* CONTEXT-FREE PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS ******************) + +(* Advanced properties ******************************************************) + +lemma ltprs_strip: ∀L1. ∀L:lenv. L ➡* L1 → ∀L2. L ➡ L2 → + ∃∃L0. L1 ➡ L0 & L2 ➡* L0. +/3 width=3/ qed. + +(* Main properties **********************************************************) + +theorem ltprs_conf: confluent … ltprs. +/3 width=3/ qed. + +theorem ltprs_trans: Transitive … ltprs. +/2 width=3/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpss_dx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpss_dx.etc new file mode 100644 index 000000000..753c948cc --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpss_dx.etc @@ -0,0 +1,278 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( T1 break ▶ * [ term 46 d , break term 46 e ] break term 46 T2 )" + non associative with precedence 45 + for @{ 'PSubstStar $T1 $d $e $T2 }. + +include "basic_2/unfold/tpss.ma". + +(* DX PARALLEL UNFOLD ON LOCAL ENVIRONMENTS *********************************) + +(* Basic_1: includes: csubst1_bind *) +inductive ltpss_dx: nat → nat → relation lenv ≝ +| ltpss_dx_atom : ∀d,e. ltpss_dx d e (⋆) (⋆) +| ltpss_dx_pair : ∀L,I,V. ltpss_dx 0 0 (L. ⓑ{I} V) (L. ⓑ{I} V) +| ltpss_dx_tpss2: ∀L1,L2,I,V1,V2,e. + ltpss_dx 0 e L1 L2 → L2 ⊢ V1 ▶* [0, e] V2 → + ltpss_dx 0 (e + 1) (L1. ⓑ{I} V1) (L2. ⓑ{I} V2) +| ltpss_dx_tpss1: ∀L1,L2,I,V1,V2,d,e. + ltpss_dx d e L1 L2 → L2 ⊢ V1 ▶* [d, e] V2 → + ltpss_dx (d + 1) e (L1. ⓑ{I} V1) (L2. ⓑ{I} V2) +. + +interpretation "parallel unfold (local environment, dx variant)" + 'PSubstStar L1 d e L2 = (ltpss_dx d e L1 L2). + +(* Basic inversion lemmas ***************************************************) + +fact ltpss_dx_inv_refl_O2_aux: ∀d,e,L1,L2. L1 ▶* [d, e] L2 → e = 0 → L1 = L2. +#d #e #L1 #L2 #H elim H -d -e -L1 -L2 // +[ #L1 #L2 #I #V1 #V2 #e #_ #_ #_ >commutative_plus normalize #H destruct +| #L1 #L2 #I #V1 #V2 #d #e #_ #HV12 #IHL12 #He destruct + >(IHL12 ?) -IHL12 // >(tpss_inv_refl_O2 … HV12) // +] +qed. + +lemma ltpss_dx_inv_refl_O2: ∀d,L1,L2. L1 ▶* [d, 0] L2 → L1 = L2. +/2 width=4/ qed-. + +fact ltpss_dx_inv_atom1_aux: ∀d,e,L1,L2. + L1 ▶* [d, e] L2 → L1 = ⋆ → L2 = ⋆. +#d #e #L1 #L2 * -d -e -L1 -L2 +[ // +| #L #I #V #H destruct +| #L1 #L2 #I #V1 #V2 #e #_ #_ #H destruct +| #L1 #L2 #I #V1 #V2 #d #e #_ #_ #H destruct +] +qed. + +lemma ltpss_dx_inv_atom1: ∀d,e,L2. ⋆ ▶* [d, e] L2 → L2 = ⋆. +/2 width=5/ qed-. + +fact ltpss_dx_inv_tpss21_aux: ∀d,e,L1,L2. L1 ▶* [d, e] L2 → d = 0 → 0 < e → + ∀K1,I,V1. L1 = K1. ⓑ{I} V1 → + ∃∃K2,V2. K1 ▶* [0, e - 1] K2 & + K2 ⊢ V1 ▶* [0, e - 1] V2 & + L2 = K2. ⓑ{I} V2. +#d #e #L1 #L2 * -d -e -L1 -L2 +[ #d #e #_ #_ #K1 #I #V1 #H destruct +| #L1 #I #V #_ #H elim (lt_refl_false … H) +| #L1 #L2 #I #V1 #V2 #e #HL12 #HV12 #_ #_ #K1 #J #W1 #H destruct /2 width=5/ +| #L1 #L2 #I #V1 #V2 #d #e #_ #_ >commutative_plus normalize #H destruct +] +qed. + +lemma ltpss_dx_inv_tpss21: ∀e,K1,I,V1,L2. K1. ⓑ{I} V1 ▶* [0, e] L2 → 0 < e → + ∃∃K2,V2. K1 ▶* [0, e - 1] K2 & + K2 ⊢ V1 ▶* [0, e - 1] V2 & + L2 = K2. ⓑ{I} V2. +/2 width=5/ qed-. + +fact ltpss_dx_inv_tpss11_aux: ∀d,e,L1,L2. L1 ▶* [d, e] L2 → 0 < d → + ∀I,K1,V1. L1 = K1. ⓑ{I} V1 → + ∃∃K2,V2. K1 ▶* [d - 1, e] K2 & + K2 ⊢ V1 ▶* [d - 1, e] V2 & + L2 = K2. ⓑ{I} V2. +#d #e #L1 #L2 * -d -e -L1 -L2 +[ #d #e #_ #I #K1 #V1 #H destruct +| #L #I #V #H elim (lt_refl_false … H) +| #L1 #L2 #I #V1 #V2 #e #_ #_ #H elim (lt_refl_false … H) +| #L1 #L2 #I #V1 #V2 #d #e #HL12 #HV12 #_ #J #K1 #W1 #H destruct /2 width=5/ +] +qed. + +lemma ltpss_dx_inv_tpss11: ∀d,e,I,K1,V1,L2. K1. ⓑ{I} V1 ▶* [d, e] L2 → 0 < d → + ∃∃K2,V2. K1 ▶* [d - 1, e] K2 & + K2 ⊢ V1 ▶* [d - 1, e] V2 & + L2 = K2. ⓑ{I} V2. +/2 width=3/ qed-. + +fact ltpss_dx_inv_atom2_aux: ∀d,e,L1,L2. + L1 ▶* [d, e] L2 → L2 = ⋆ → L1 = ⋆. +#d #e #L1 #L2 * -d -e -L1 -L2 +[ // +| #L #I #V #H destruct +| #L1 #L2 #I #V1 #V2 #e #_ #_ #H destruct +| #L1 #L2 #I #V1 #V2 #d #e #_ #_ #H destruct +] +qed. + +lemma ltpss_dx_inv_atom2: ∀d,e,L1. L1 ▶* [d, e] ⋆ → L1 = ⋆. +/2 width=5/ qed-. + +fact ltpss_dx_inv_tpss22_aux: ∀d,e,L1,L2. L1 ▶* [d, e] L2 → d = 0 → 0 < e → + ∀K2,I,V2. L2 = K2. ⓑ{I} V2 → + ∃∃K1,V1. K1 ▶* [0, e - 1] K2 & + K2 ⊢ V1 ▶* [0, e - 1] V2 & + L1 = K1. ⓑ{I} V1. +#d #e #L1 #L2 * -d -e -L1 -L2 +[ #d #e #_ #_ #K1 #I #V1 #H destruct +| #L1 #I #V #_ #H elim (lt_refl_false … H) +| #L1 #L2 #I #V1 #V2 #e #HL12 #HV12 #_ #_ #K2 #J #W2 #H destruct /2 width=5/ +| #L1 #L2 #I #V1 #V2 #d #e #_ #_ >commutative_plus normalize #H destruct +] +qed. + +lemma ltpss_dx_inv_tpss22: ∀e,L1,K2,I,V2. L1 ▶* [0, e] K2. ⓑ{I} V2 → 0 < e → + ∃∃K1,V1. K1 ▶* [0, e - 1] K2 & + K2 ⊢ V1 ▶* [0, e - 1] V2 & + L1 = K1. ⓑ{I} V1. +/2 width=5/ qed-. + +fact ltpss_dx_inv_tpss12_aux: ∀d,e,L1,L2. L1 ▶* [d, e] L2 → 0 < d → + ∀I,K2,V2. L2 = K2. ⓑ{I} V2 → + ∃∃K1,V1. K1 ▶* [d - 1, e] K2 & + K2 ⊢ V1 ▶* [d - 1, e] V2 & + L1 = K1. ⓑ{I} V1. +#d #e #L1 #L2 * -d -e -L1 -L2 +[ #d #e #_ #I #K2 #V2 #H destruct +| #L #I #V #H elim (lt_refl_false … H) +| #L1 #L2 #I #V1 #V2 #e #_ #_ #H elim (lt_refl_false … H) +| #L1 #L2 #I #V1 #V2 #d #e #HL12 #HV12 #_ #J #K2 #W2 #H destruct /2 width=5/ +] +qed. + +lemma ltpss_dx_inv_tpss12: ∀L1,K2,I,V2,d,e. L1 ▶* [d, e] K2. ⓑ{I} V2 → 0 < d → + ∃∃K1,V1. K1 ▶* [d - 1, e] K2 & + K2 ⊢ V1 ▶* [d - 1, e] V2 & + L1 = K1. ⓑ{I} V1. +/2 width=3/ qed-. + +(* Basic properties *********************************************************) + +lemma ltpss_dx_tps2: ∀L1,L2,I,V1,V2,e. + L1 ▶* [0, e] L2 → L2 ⊢ V1 ▶ [0, e] V2 → + L1. ⓑ{I} V1 ▶* [0, e + 1] L2. ⓑ{I} V2. +/3 width=1/ qed. + +lemma ltpss_dx_tps1: ∀L1,L2,I,V1,V2,d,e. + L1 ▶* [d, e] L2 → L2 ⊢ V1 ▶ [d, e] V2 → + L1. ⓑ{I} V1 ▶* [d + 1, e] L2. ⓑ{I} V2. +/3 width=1/ qed. + +lemma ltpss_dx_tpss2_lt: ∀L1,L2,I,V1,V2,e. + L1 ▶* [0, e - 1] L2 → L2 ⊢ V1 ▶* [0, e - 1] V2 → + 0 < e → L1. ⓑ{I} V1 ▶* [0, e] L2. ⓑ{I} V2. +#L1 #L2 #I #V1 #V2 #e #HL12 #HV12 #He +>(plus_minus_m_m e 1) /2 width=1/ +qed. + +lemma ltpss_dx_tpss1_lt: ∀L1,L2,I,V1,V2,d,e. + L1 ▶* [d - 1, e] L2 → L2 ⊢ V1 ▶* [d - 1, e] V2 → + 0 < d → L1. ⓑ{I} V1 ▶* [d, e] L2. ⓑ{I} V2. +#L1 #L2 #I #V1 #V2 #d #e #HL12 #HV12 #Hd +>(plus_minus_m_m d 1) /2 width=1/ +qed. + +lemma ltpss_dx_tps2_lt: ∀L1,L2,I,V1,V2,e. + L1 ▶* [0, e - 1] L2 → L2 ⊢ V1 ▶ [0, e - 1] V2 → + 0 < e → L1. ⓑ{I} V1 ▶* [0, e] L2. ⓑ{I} V2. +/3 width=1/ qed. + +lemma ltpss_dx_tps1_lt: ∀L1,L2,I,V1,V2,d,e. + L1 ▶* [d - 1, e] L2 → L2 ⊢ V1 ▶ [d - 1, e] V2 → + 0 < d → L1. ⓑ{I} V1 ▶* [d, e] L2. ⓑ{I} V2. +/3 width=1/ qed. + +(* Basic_1: was by definition: csubst1_refl *) +lemma ltpss_dx_refl: ∀L,d,e. L ▶* [d, e] L. +#L elim L -L // +#L #I #V #IHL * /2 width=1/ * /2 width=1/ +qed. + +lemma ltpss_dx_weak: ∀L1,L2,d1,e1. L1 ▶* [d1, e1] L2 → + ∀d2,e2. d2 ≤ d1 → d1 + e1 ≤ d2 + e2 → L1 ▶* [d2, e2] L2. +#L1 #L2 #d1 #e1 #H elim H -L1 -L2 -d1 -e1 // +[ #L1 #L2 #I #V1 #V2 #e1 #_ #HV12 #IHL12 #d2 #e2 #Hd2 #Hde2 + lapply (le_n_O_to_eq … Hd2) #H destruct normalize in Hde2; + lapply (lt_to_le_to_lt 0 … Hde2) // #He2 + lapply (le_plus_to_minus_r … Hde2) -Hde2 /3 width=5/ +| #L1 #L2 #I #V1 #V2 #d1 #e1 #_ #HV12 #IHL12 #d2 #e2 #Hd21 #Hde12 + >plus_plus_comm_23 in Hde12; #Hde12 + elim (le_to_or_lt_eq 0 d2 ?) // #H destruct + [ lapply (le_plus_to_minus_r … Hde12) -Hde12 plus_plus_comm_23 + /4 width=5 by ltpss_dx_tpss2, tpss_append, tpss_weak, monotonic_le_plus_r/ (**) (* too slow without trace *) +| #K1 #K2 #I #V1 #V2 #d #x #_ #HV12 #IHK12 normalize (ldrop_inv_atom1 … H) -H // +| // +| normalize #K0 #K1 #I #V0 #V1 #e1 #_ #_ #IHK01 #L2 #e2 #H #He12 + elim (le_inv_plus_l … He12) #_ #He2 + lapply (ldrop_inv_ldrop1 … H ?) -H // #HK0L2 + lapply (IHK01 … HK0L2 ?) -K0 /2 width=1/ +| #K0 #K1 #I #V0 #V1 #d1 #e1 >plus_plus_comm_23 #_ #_ #IHK01 #L2 #e2 #H #Hd1e2 + elim (le_inv_plus_l … Hd1e2) #_ #He2 + lapply (ldrop_inv_ldrop1 … H ?) -H // #HK0L2 + lapply (IHK01 … HK0L2 ?) -K0 /2 width=1/ +] +qed. + +lemma ltpss_dx_ldrop_trans_ge: ∀L1,L0,d1,e1. L1 ▶* [d1, e1] L0 → + ∀L2,e2. ⇩[0, e2] L0 ≡ L2 → + d1 + e1 ≤ e2 → ⇩[0, e2] L1 ≡ L2. +#L1 #L0 #d1 #e1 #H elim H -L1 -L0 -d1 -e1 +[ #d1 #e1 #L2 #e2 #H >(ldrop_inv_atom1 … H) -H // +| // +| normalize #K1 #K0 #I #V1 #V0 #e1 #_ #_ #IHK10 #L2 #e2 #H #He12 + elim (le_inv_plus_l … He12) #_ #He2 + lapply (ldrop_inv_ldrop1 … H ?) -H // #HK0L2 + lapply (IHK10 … HK0L2 ?) -K0 /2 width=1/ +| #K0 #K1 #I #V1 #V0 #d1 #e1 >plus_plus_comm_23 #_ #_ #IHK10 #L2 #e2 #H #Hd1e2 + elim (le_inv_plus_l … Hd1e2) #_ #He2 + lapply (ldrop_inv_ldrop1 … H ?) -H // #HK0L2 + lapply (IHK10 … HK0L2 ?) -IHK10 -HK0L2 /2 width=1/ +] +qed. + +lemma ltpss_dx_ldrop_conf_be: ∀L0,L1,d1,e1. L0 ▶* [d1, e1] L1 → + ∀L2,e2. ⇩[0, e2] L0 ≡ L2 → d1 ≤ e2 → e2 ≤ d1 + e1 → + ∃∃L. L2 ▶* [0, d1 + e1 - e2] L & ⇩[0, e2] L1 ≡ L. +#L0 #L1 #d1 #e1 #H elim H -L0 -L1 -d1 -e1 +[ #d1 #e1 #L2 #e2 #H >(ldrop_inv_atom1 … H) -H /2 width=3/ +| normalize #L #I #V #L2 #e2 #HL2 #_ #He2 + lapply (le_n_O_to_eq … He2) -He2 #H destruct + lapply (ldrop_inv_refl … HL2) -HL2 #H destruct /2 width=3/ +| normalize #K0 #K1 #I #V0 #V1 #e1 #HK01 #HV01 #IHK01 #L2 #e2 #H #_ #He21 + lapply (ldrop_inv_O1 … H) -H * * #He2 #HK0L2 + [ -IHK01 -He21 destruct plus_plus_comm_23 #_ #_ #IHK01 #L2 #e2 #H #Hd1e2 #He2de1 + elim (le_inv_plus_l … Hd1e2) #_ #He2 + (ldrop_inv_atom1 … H) -H /2 width=3/ +| normalize #L #I #V #L2 #e2 #HL2 #_ #He2 + lapply (le_n_O_to_eq … He2) -He2 #H destruct + lapply (ldrop_inv_refl … HL2) -HL2 #H destruct /2 width=3/ +| normalize #K1 #K0 #I #V1 #V0 #e1 #HK10 #HV10 #IHK10 #L2 #e2 #H #_ #He21 + lapply (ldrop_inv_O1 … H) -H * * #He2 #HK0L2 + [ -IHK10 -He21 destruct plus_plus_comm_23 #_ #_ #IHK10 #L2 #e2 #H #Hd1e2 #He2de1 + elim (le_inv_plus_l … Hd1e2) #_ #He2 + (ldrop_inv_atom1 … H) -H /2 width=3/ +| /2 width=3/ +| normalize #K0 #K1 #I #V0 #V1 #e1 #HK01 #HV01 #_ #L2 #e2 #H #He2 + lapply (le_n_O_to_eq … He2) -He2 #He2 destruct + lapply (ldrop_inv_refl … H) -H #H destruct /3 width=3/ +| #K0 #K1 #I #V0 #V1 #d1 #e1 #HK01 #HV01 #IHK01 #L2 #e2 #H #He2d1 + lapply (ldrop_inv_O1 … H) -H * * #He2 #HK0L2 + [ -IHK01 -He2d1 destruct (ldrop_inv_atom1 … H) -H /2 width=3/ +| /2 width=3/ +| normalize #K1 #K0 #I #V1 #V0 #e1 #HK10 #HV10 #_ #L2 #e2 #H #He2 + lapply (le_n_O_to_eq … He2) -He2 #He2 destruct + lapply (ldrop_inv_refl … H) -H #H destruct /3 width=3/ +| #K1 #K0 #I #V1 #V0 #d1 #e1 #HK10 #HV10 #IHK10 #L2 #e2 #H #He2d1 + lapply (ldrop_inv_O1 … H) -H * * #He2 #HK0L2 + [ -IHK10 -He2d1 destruct (ltpss_dx_inv_atom1 … H) -H /2 width=3/ +| /2 width=3/ +| #L1 #K1 #I #V #e1 #_ #IHLK1 #K2 #d2 #e2 #HK12 #Hd + elim (IHLK1 … HK12 Hd) -K1 -Hd /3 width=5/ +| #L1 #K1 #I #V1 #W1 #d1 #e1 #_ #HWV1 #IHLK1 #X #d2 #e2 #H #Hd12 + elim (le_inv_plus_l … Hd12) -Hd12 #Hd12 #Hd2 + elim (ltpss_dx_inv_tpss11 … H Hd2) -H #K2 #W2 #HK12 #HW12 #H destruct + elim (IHLK1 … HK12 … Hd12) -IHLK1 -HK12 (ltpss_dx_inv_atom1 … H) -H /2 width=3/ +| #K1 #I #V1 #K2 #d2 #e2 #HK12 #H #_ + lapply (le_n_O_to_eq … H) -H #H destruct /2 width=3/ +| #L1 #K1 #I #V #e1 #_ #IHLK1 #K2 #d2 #e2 #HK12 #H1 #H2 + elim (IHLK1 … HK12 H1 H2) -K1 -H2 + lapply (le_n_O_to_eq … H1) -H1 #H destruct /3 width=5/ +| #L1 #K1 #I #V1 #W1 #d1 #e1 #_ #HWV1 #IHLK1 #X #d2 #e2 #H #Hd21 #Hd12 + elim (eq_or_gt d2) #Hd2 [ -Hd21 elim (eq_or_gt e2) #He2 ] destruct + [ lapply (le_n_O_to_eq … Hd12) -Hd12 plus_minus_commutative // #L2 #HL12 #HLK2 + elim (lift_total W2 d1 e1) #V2 #HWV2 + lapply (tpss_lift_be … HW12 … HLK2 HWV1 … HWV2) -W1 // /2 width=1/ + >plus_minus // >commutative_plus /4 width=5/ + | elim (ltpss_dx_inv_tpss11 … H Hd2) -H #K2 #W2 #HK12 #HW12 #H destruct + elim (IHLK1 … HK12 …) -IHLK1 [2: >plus_minus // ] /2 width=1/ #L2 #HL12 #HLK2 + elim (lift_total W2 d1 e1) #V2 #HWV2 + lapply (tpss_lift_be … HW12 … HLK2 HWV1 … HWV2) -W1 [ >plus_minus // ] /2 width=1/ + >commutative_plus /3 width=5/ + ] +] +qed-. + +lemma ldrop_ltpss_dx_trans_ge: ∀L1,K1,d1,e1. ⇩[d1, e1] L1 ≡ K1 → + ∀K2,d2,e2. K1 ▶* [d2, e2] K2 → d2 + e2 ≤ d1 → + ∃∃L2. L1 ▶* [d2, e2] L2 & ⇩[d1, e1] L2 ≡ K2. +#L1 #K1 #d1 #e1 #H elim H -L1 -K1 -d1 -e1 +[ #d1 #e1 #K2 #d2 #e2 #H #_ + >(ltpss_dx_inv_atom1 … H) -H /2 width=3/ +| #K1 #I #V1 #K2 #d2 #e2 #HK12 #H + elim (plus_le_0 … H) -H #H1 #H2 destruct /2 width=3/ +| #L1 #K1 #I #V #e1 #_ #IHLK1 #K2 #d2 #e2 #HK12 #H + elim (IHLK1 … HK12 H) -K1 + elim (plus_le_0 … H) -H #H1 #H2 destruct #L2 #HL12 + >(ltpss_dx_inv_refl_O2 … HL12) -L1 /3 width=5/ +| #L1 #K1 #I #V1 #W1 #d1 #e1 #HLK1 #HWV1 #IHLK1 #X #d2 #e2 #H #Hd21 + elim (eq_or_gt d2) #Hd2 [ elim (eq_or_gt e2) #He2 ] destruct + [ -IHLK1 -Hd21 <(ltpss_dx_inv_refl_O2 … H) -X /3 width=5/ + | elim (ltpss_dx_inv_tpss21 … H He2) -H #K2 #W2 #HK12 #HW12 #H destruct + elim (IHLK1 … HK12 …) -IHLK1 /2 width=1/ #L2 #HL12 #HLK2 + elim (lift_total W2 d1 e1) #V2 #HWV2 + lapply (tpss_lift_le … HW12 … HLK2 HWV1 … HWV2) -W1 /2 width=1/ /3 width=5/ + | elim (ltpss_dx_inv_tpss11 … H Hd2) -H #K2 #W2 #HK12 #HW12 #H destruct + elim (IHLK1 … HK12 …) -IHLK1 [2: >plus_minus // /2 width=1/ ] #L2 #HL12 #HLK2 + elim (lift_total W2 d1 e1) #V2 #HWV2 + lapply (tpss_lift_le … HW12 … HLK2 HWV1 … HWV2) -W1 [ >plus_minus // /2 width=1/ ] /3 width=5/ + ] +] +qed-. + +(* Properties on supclosure *************************************************) + +lemma fsup_tps_trans_full: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ → ∀U2. L2 ⊢ T2 ▶[0,|L2|] U2 → + ∃∃L,U1. L1 ▶*[0,|L|] L & L ⊢ T1 ▶[0,|L|] U1 & ⦃L, U1⦄ ⊃ ⦃L2, T2⦄. +#L1 #L2 #T1 #T2 #H elim H -L1 -L2 -T1 -T2 [1,2,3,4,5: /3 width=5/ ] +#L1 #K1 #K2 #T1 #T2 #U1 #d #e #HLK1 #HTU1 #_ #IHT12 #U2 #HTU2 +elim (IHT12 … HTU2) -IHT12 -HTU2 #K #T #HK1 #HT1 #HT2 +elim (lift_total T d e) #U #HTU +elim (le_or_ge d (|K|)) #Hd +[ elim (ldrop_ltpss_dx_trans_be … HLK1 … HK1 … Hd) // -HLK1 -HK1 #L2 #HL12 #HL2K + lapply (tps_lift_be … HT1 … HL2K … HTU1 HTU … Hd) // -HT1 -HTU1 #HU1 +| elim (ldrop_ltpss_dx_trans_ge … HLK1 … HK1 Hd) -HLK1 -HK1 #L2 #HL12 #HL2K + lapply (tps_lift_le … HT1 … HL2K … HTU1 HTU Hd) -HT1 -HTU1 #HU1 +] +lapply (ltpss_dx_weak_full … HL12) -HL12 #HL12 +lapply (tps_weak_full … HU1) -HU1 #HU1 +@(ex3_2_intro … L2 U) // /2 width=7/ (**) (* explicit constructor: auto /3 width=14/ too slow *) +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpss_dx_ltpss_dx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpss_dx_ltpss_dx.etc new file mode 100644 index 000000000..74b898d69 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpss_dx_ltpss_dx.etc @@ -0,0 +1,106 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/tpss_tpss.ma". +include "basic_2/unfold/ltpss_dx_tpss.ma". + +(* DX PARTIAL UNFOLD ON LOCAL ENVIRONMENTS **********************************) + +(* Advanced properties ******************************************************) + +lemma ltpss_dx_tpss_conf: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 ▶* [d2, e2] U2 → + ∀L1,d1,e1. L0 ▶* [d1, e1] L1 → + ∃∃T. L1 ⊢ T2 ▶* [d2, e2] T & + L1 ⊢ U2 ▶* [d1, e1] T. +#L0 #T2 #U2 #d2 #e2 #H #L1 #d1 #e1 #HL01 @(tpss_ind … H) -U2 /2 width=3/ +#U #U2 #_ #HU2 * #X2 #HTX2 #HUX2 +elim (ltpss_dx_tps_conf … HU2 … HL01) -L0 #X1 #HUX1 #HU2X1 +elim (tpss_strip_eq … HUX2 … HUX1) -U #X #HX2 #HX1 +lapply (tpss_trans_eq … HU2X1 … HX1) -X1 /3 width=3/ +qed. + +lemma ltpss_dx_tpss_trans_down: ∀L0,L1,T2,U2,d1,e1,d2,e2. d2 + e2 ≤ d1 → + L1 ▶* [d1, e1] L0 → L0 ⊢ T2 ▶* [d2, e2] U2 → + ∃∃T. L1 ⊢ T2 ▶* [d2, e2] T & L0 ⊢ T ▶* [d1, e1] U2. +#L0 #L1 #T2 #U2 #d1 #e1 #d2 #e2 #Hde2d1 #HL10 #H @(tpss_ind … H) -U2 +[ /2 width=3/ +| #U #U2 #_ #HU2 * #T #HT2 #HTU + elim (tpss_strap1_down … HTU … HU2 ?) -U // #U #HTU #HU2 + elim (ltpss_dx_tps_trans … HTU … HL10) -HTU -HL10 #X #HTX #HXU + lapply (tpss_trans_eq … HXU HU2) -U /3 width=3/ +] +qed. + +lemma ltpss_dx_tpss_trans_eq: ∀L1,T2,U2,d,e. L1 ⊢ T2 ▶* [d, e] U2 → + ∀L0. L0 ▶* [d, e] L1 → L0 ⊢ T2 ▶* [d, e] U2. +#L1 #T2 @(f2_ind … fw … L1 T2) -L1 -T2 #n #IH #L1 * +[ #I #Hn #W2 #d #e #H #L0 #HL01 destruct + elim (tpss_inv_atom1 … H) -H // * + #K1 #V1 #V2 #i #Hdi #Hide #HLK1 #HV12 #HVW2 #H destruct + lapply (ldrop_fwd_lw … HLK1) #H1 normalize in H1; + elim (ltpss_dx_ldrop_trans_be … HL01 … HLK1 ? ?) -HL01 -HLK1 // /2 width=2/ #X #H #HLK0 + elim (ltpss_dx_inv_tpss22 … H ?) -H /2 width=1/ #K0 #V0 #HK01 #HV01 #H destruct + lapply (tpss_fwd_tw … HV01) #H2 + lapply (transitive_le (♯{K1} + ♯{V0}) … H1) -H1 /2 width=1/ -H2 #H + lapply (tpss_trans_eq … HV01 HV12) -V1 #HV02 + lapply (IH … HV02 … HK01) -IH -HV02 -HK01 + [ normalize /2 width=1/ | /2 width=6/ ] +| * [ #a ] #I #V2 #T2 #Hn #X #d #e #H #L0 #HL0 destruct + [ elim (tpss_inv_bind1 … H) -H #W2 #U2 #HVW2 #HTU2 #H destruct + lapply (tpss_lsubr_trans … HTU2 (L1. ⓑ{I} V2) ?) -HTU2 /2 width=1/ #HTU2 + lapply (IH … HVW2 … HL0) -HVW2 [ /2 width=2/ ] #HVW2 + lapply (IH … HTU2 (L0. ⓑ{I} V2) ?) -IH -HTU2 // /2 width=2/ -HL0 #HTU2 + lapply (tpss_lsubr_trans … HTU2 (L0. ⓑ{I} W2) ?) -HTU2 /2 width=1/ + | elim (tpss_inv_flat1 … H) -H #W2 #U2 #HVW2 #HTU2 #H destruct + lapply (IH … HVW2 … HL0) -HVW2 // + lapply (IH … HTU2 … HL0) -IH -HTU2 // -HL0 /2 width=1/ +] +qed. + +lemma ltpss_dx_tps_trans_eq: ∀L0,L1,T2,U2,d,e. L0 ▶* [d, e] L1 → + L1 ⊢ T2 ▶ [d, e] U2 → L0 ⊢ T2 ▶* [d, e] U2. +/3 width=3/ qed. + +(* Main properties **********************************************************) + +theorem ltpss_dx_conf: ∀L0,L1,d1,e1. L0 ▶* [d1, e1] L1 → + ∀L2,d2,e2. L0 ▶* [d2, e2] L2 → + ∃∃L. L1 ▶* [d2, e2] L & L2 ▶* [d1, e1] L. +#L0 @(f_ind … lw … L0) -L0 #n #IH * +[ #_ #L1 #d1 #e1 #H1 #L2 #d2 #e2 #H2 -n + >(ltpss_dx_inv_atom1 … H1) -L1 + >(ltpss_dx_inv_atom1 … H2) -L2 /2 width=3/ +| #K0 #I0 #V0 #Hn #L1 #d1 #e1 #H1 #L2 #d2 #e2 #H2 destruct + elim (eq_or_gt d1) #Hd1 [ elim (eq_or_gt e1) #He1 ] destruct + [ lapply (ltpss_dx_inv_refl_O2 … H1) -H1 #H1 + | elim (ltpss_dx_inv_tpss21 … H1 … He1) -H1 #K1 #V1 #HK01 #HV01 #H1 + | elim (ltpss_dx_inv_tpss11 … H1 … Hd1) -H1 #K1 #V1 #HK01 #HV01 #H1 + ] destruct + elim (eq_or_gt d2) #Hd2 [1,3,5: elim (eq_or_gt e2) #He2 ] destruct + [1,3,5: lapply (ltpss_dx_inv_refl_O2 … H2) -H2 #H2 + |2,4,6: elim (ltpss_dx_inv_tpss21 … H2 … He2) -H2 #K2 #V2 #HK02 #HV02 #H2 + |7,8,9: elim (ltpss_dx_inv_tpss11 … H2 … Hd2) -H2 #K2 #V2 #HK02 #HV02 #H2 + ] destruct + [1: -IH /2 width=3/ + |2,3,4,7: -IH /3 width=5/ + |5,6,8,9: + elim (IH … HK01 … HK02) // -K0 #K #HK1 #HK2 + elim (ltpss_dx_tpss_conf … HV01 … HK1) -HV01 #W1 #HW1 #HVW1 + elim (ltpss_dx_tpss_conf … HV02 … HK2) -HV02 #W2 #HW2 #HVW2 + elim (tpss_conf_eq … HW1 … HW2) -V0 #V #HW1 #HW2 + lapply (tpss_trans_eq … HVW1 HW1) -W1 + lapply (tpss_trans_eq … HVW2 HW2) -W2 /3 width=5/ + ] +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpss_dx_tps.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpss_dx_tps.etc new file mode 100644 index 000000000..b10306677 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpss_dx_tps.etc @@ -0,0 +1,47 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/ltpss_dx_ldrop.ma". + +(* DX PARALLEL UNFOLD ON LOCAL ENVIRONMENTS *********************************) + +(* Properties concerning partial substitution on terms **********************) + +lemma ltpss_dx_tps_conf_ge: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 ▶ [d2, e2] U2 → + ∀L1,d1,e1. L0 ▶* [d1, e1] L1 → d1 + e1 ≤ d2 → + L1 ⊢ T2 ▶ [d2, e2] U2. +#L0 #T2 #U2 #d2 #e2 #H elim H -L0 -T2 -U2 -d2 -e2 +[ // +| #L0 #K0 #V0 #W0 #i2 #d2 #e2 #Hdi2 #Hide2 #HLK0 #HVW0 #L1 #d1 #e1 #HL01 #Hde1d2 + lapply (transitive_le … Hde1d2 Hdi2) -Hde1d2 #Hde1i2 + lapply (ltpss_dx_ldrop_conf_ge … HL01 … HLK0 ?) -L0 // /2 width=4/ +| #L0 #a #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL01 #Hde1d2 + @tps_bind [ /2 width=4/ | @IHTU2 -IHTU2 -IHVW2 [3: /2 by ltpss_dx_tpss1/ |1,2: skip | /2 width=1/ ] ] (**) (* explicit constructor *) +| /3 width=4/ +] +qed. + +lemma ltpss_dx_tps_trans_ge: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 ▶ [d2, e2] U2 → + ∀L1,d1,e1. L1 ▶* [d1, e1] L0 → d1 + e1 ≤ d2 → + L1 ⊢ T2 ▶ [d2, e2] U2. +#L0 #T2 #U2 #d2 #e2 #H elim H -L0 -T2 -U2 -d2 -e2 +[ // +| #L0 #K0 #V0 #W0 #i2 #d2 #e2 #Hdi2 #Hide2 #HLK0 #HVW0 #L1 #d1 #e1 #HL10 #Hde1d2 + lapply (transitive_le … Hde1d2 Hdi2) -Hde1d2 #Hde1i2 + lapply (ltpss_dx_ldrop_trans_ge … HL10 … HLK0 ?) -L0 // /2 width=4/ +| #L0 #a #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL10 #Hde1d2 + @tps_bind [ /2 width=4/ | @IHTU2 -IHTU2 -IHVW2 [3: /2 by ltpss_dx_tpss1/ |1,2: skip | /2 width=1/ ] ] (**) (* explicit constructor *) +| /3 width=4/ +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpss_dx_tpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpss_dx_tpss.etc new file mode 100644 index 000000000..9c7875927 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpss_dx_tpss.etc @@ -0,0 +1,101 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/ltpss_dx_tps.ma". + +(* DX PARALLEL UNFOLD ON LOCAL ENVIRONMENTS *********************************) + +(* Properties concerning partial unfold on terms ****************************) + +lemma ltpss_dx_tpss_conf_ge: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 ▶* [d2, e2] U2 → + ∀L1,d1,e1. L0 ▶* [d1, e1] L1 → d1 + e1 ≤ d2 → + L1 ⊢ T2 ▶* [d2, e2] U2. +#L0 #T2 #U2 #d2 #e2 #H #L1 #d1 #e1 #HL01 #Hde1d2 @(tpss_ind … H) -U2 // +#U #U2 #_ #HU2 #IHU +lapply (ltpss_dx_tps_conf_ge … HU2 … HL01 ?) -L0 // -Hde1d2 /2 width=3/ +qed. + +(* Basic_1: was: subst1_subst1_back *) +lemma ltpss_dx_tps_conf: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 ▶ [d2, e2] U2 → + ∀L1,d1,e1. L0 ▶* [d1, e1] L1 → + ∃∃T. L1 ⊢ T2 ▶ [d2, e2] T & + L1 ⊢ U2 ▶* [d1, e1] T. +#L0 #T2 #U2 #d2 #e2 #H elim H -L0 -T2 -U2 -d2 -e2 +[ /2 width=3/ +| #L0 #K0 #V0 #W0 #i2 #d2 #e2 #Hdi2 #Hide2 #HLK0 #HVW0 #L1 #d1 #e1 #HL01 + elim (lt_or_ge i2 d1) #Hi2d1 + [ elim (ltpss_dx_ldrop_conf_le … HL01 … HLK0 ?) -L0 /2 width=2/ #X #H #HLK1 + elim (ltpss_dx_inv_tpss11 … H ?) -H /2 width=1/ #K1 #V1 #_ #HV01 #H destruct + lapply (ldrop_fwd_ldrop2 … HLK1) #H + elim (lift_total V1 0 (i2 + 1)) #W1 #HVW1 + lapply (tpss_lift_ge … HV01 … H HVW0 … HVW1) -V0 -H // >minus_plus minus_plus >commutative_plus /2 width=1/ + | lapply (ltpss_dx_ldrop_conf_ge … HL01 … HLK0 ?) -L0 // /3 width=4/ + ] + ] +| #L0 #a #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL01 + elim (IHVW2 … HL01) -IHVW2 #V #HV2 #HVW2 + elim (IHTU2 (L1. ⓑ{I} V) (d1 + 1) e1 ?) -IHTU2 /2 width=1/ -HL01 /3 width=5/ +| #L0 #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL01 + elim (IHVW2 … HL01) -IHVW2 + elim (IHTU2 … HL01) -IHTU2 -HL01 /3 width=5/ +] +qed. + +lemma ltpss_dx_tpss_trans_ge: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 ▶* [d2, e2] U2 → + ∀L1,d1,e1. L1 ▶* [d1, e1] L0 → d1 + e1 ≤ d2 → + L1 ⊢ T2 ▶* [d2, e2] U2. +#L0 #T2 #U2 #d2 #e2 #H #L1 #d1 #e1 #HL01 #Hde1d2 @(tpss_ind … H) -U2 // +#U #U2 #_ #HU2 #IHU +lapply (ltpss_dx_tps_trans_ge … HU2 … HL01 ?) -L0 // -Hde1d2 /2 width=3/ +qed. + +(* Basic_1: was: subst1_subst1 *) +lemma ltpss_dx_tps_trans: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 ▶ [d2, e2] U2 → + ∀L1,d1,e1. L1 ▶* [d1, e1] L0 → + ∃∃T. L1 ⊢ T2 ▶ [d2, e2] T & + L0 ⊢ T ▶* [d1, e1] U2. +#L0 #T2 #U2 #d2 #e2 #H elim H -L0 -T2 -U2 -d2 -e2 +[ /2 width=3/ +| #L0 #K0 #V0 #W0 #i2 #d2 #e2 #Hdi2 #Hide2 #HLK0 #HVW0 #L1 #d1 #e1 #HL10 + elim (lt_or_ge i2 d1) #Hi2d1 + [ elim (ltpss_dx_ldrop_trans_le … HL10 … HLK0 ?) -HL10 /2 width=2/ #X #H #HLK1 + elim (ltpss_dx_inv_tpss12 … H ?) -H /2 width=1/ #K1 #V1 #_ #HV01 #H destruct + lapply (ldrop_fwd_ldrop2 … HLK0) -HLK0 #H + elim (lift_total V1 0 (i2 + 1)) #W1 #HVW1 + lapply (tpss_lift_ge … HV01 … H HVW1 … HVW0) -V0 -H // >minus_plus minus_plus >commutative_plus /2 width=1/ + | lapply (ltpss_dx_ldrop_trans_ge … HL10 … HLK0 ?) -HL10 -HLK0 // /3 width=4/ + ] + ] +| #L0 #a #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL10 + elim (IHVW2 … HL10) -IHVW2 #V #HV2 #HVW2 + elim (IHTU2 (L1. ⓑ{I} V) (d1 + 1) e1 ?) -IHTU2 /2 width=1/ -HL10 /3 width=5/ +| #L0 #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL10 + elim (IHVW2 … HL10) -IHVW2 + elim (IHTU2 … HL10) -IHTU2 -HL10 /3 width=5/ +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpss_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpss_sn.etc new file mode 100644 index 000000000..577c1506d --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpss_sn.etc @@ -0,0 +1,259 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( T1 break ⊢ ▶ * [ term 46 d , break term 46 e ] break term 46 T2 )" + non associative with precedence 45 + for @{ 'PSubstStarSn $T1 $d $e $T2 }. + +include "basic_2/unfold/tpss.ma". + +(* SN PARALLEL UNFOLD ON LOCAL ENVIRONMENTS *********************************) + +inductive ltpss_sn: nat → nat → relation lenv ≝ +| ltpss_sn_atom : ∀d,e. ltpss_sn d e (⋆) (⋆) +| ltpss_sn_pair : ∀L,I,V. ltpss_sn 0 0 (L. ⓑ{I} V) (L. ⓑ{I} V) +| ltpss_sn_tpss2: ∀L1,L2,I,V1,V2,e. + ltpss_sn 0 e L1 L2 → L1 ⊢ V1 ▶* [0, e] V2 → + ltpss_sn 0 (e + 1) (L1. ⓑ{I} V1) (L2. ⓑ{I} V2) +| ltpss_sn_tpss1: ∀L1,L2,I,V1,V2,d,e. + ltpss_sn d e L1 L2 → L1 ⊢ V1 ▶* [d, e] V2 → + ltpss_sn (d + 1) e (L1. ⓑ{I} V1) (L2. ⓑ{I} V2) +. + +interpretation "parallel unfold (local environment, sn variant)" + 'PSubstStarSn L1 d e L2 = (ltpss_sn d e L1 L2). + +(* Basic inversion lemmas ***************************************************) + +fact ltpss_sn_inv_refl_O2_aux: ∀d,e,L1,L2. L1 ⊢ ▶* [d, e] L2 → e = 0 → L1 = L2. +#d #e #L1 #L2 #H elim H -d -e -L1 -L2 // +[ #L1 #L2 #I #V1 #V2 #e #_ #_ #_ >commutative_plus normalize #H destruct +| #L1 #L2 #I #V1 #V2 #d #e #_ #HV12 #IHL12 #He destruct + >(IHL12 ?) -IHL12 // >(tpss_inv_refl_O2 … HV12) // +] +qed. + +lemma ltpss_sn_inv_refl_O2: ∀d,L1,L2. L1 ⊢ ▶* [d, 0] L2 → L1 = L2. +/2 width=4/ qed-. + +fact ltpss_sn_inv_atom1_aux: ∀d,e,L1,L2. + L1 ⊢ ▶* [d, e] L2 → L1 = ⋆ → L2 = ⋆. +#d #e #L1 #L2 * -d -e -L1 -L2 +[ // +| #L #I #V #H destruct +| #L1 #L2 #I #V1 #V2 #e #_ #_ #H destruct +| #L1 #L2 #I #V1 #V2 #d #e #_ #_ #H destruct +] +qed. + +lemma ltpss_sn_inv_atom1: ∀d,e,L2. ⋆ ⊢ ▶* [d, e] L2 → L2 = ⋆. +/2 width=5/ qed-. + +fact ltpss_sn_inv_tpss21_aux: ∀d,e,L1,L2. L1 ⊢ ▶* [d, e] L2 → d = 0 → 0 < e → + ∀K1,I,V1. L1 = K1. ⓑ{I} V1 → + ∃∃K2,V2. K1 ⊢ ▶* [0, e - 1] K2 & + K1 ⊢ V1 ▶* [0, e - 1] V2 & + L2 = K2. ⓑ{I} V2. +#d #e #L1 #L2 * -d -e -L1 -L2 +[ #d #e #_ #_ #K1 #I #V1 #H destruct +| #L1 #I #V #_ #H elim (lt_refl_false … H) +| #L1 #L2 #I #V1 #V2 #e #HL12 #HV12 #_ #_ #K1 #J #W1 #H destruct /2 width=5/ +| #L1 #L2 #I #V1 #V2 #d #e #_ #_ >commutative_plus normalize #H destruct +] +qed. + +lemma ltpss_sn_inv_tpss21: ∀e,K1,I,V1,L2. K1. ⓑ{I} V1 ⊢ ▶* [0, e] L2 → 0 < e → + ∃∃K2,V2. K1 ⊢ ▶* [0, e - 1] K2 & + K1 ⊢ V1 ▶* [0, e - 1] V2 & + L2 = K2. ⓑ{I} V2. +/2 width=5/ qed-. + +fact ltpss_sn_inv_tpss11_aux: ∀d,e,L1,L2. L1 ⊢ ▶* [d, e] L2 → 0 < d → + ∀I,K1,V1. L1 = K1. ⓑ{I} V1 → + ∃∃K2,V2. K1 ⊢ ▶* [d - 1, e] K2 & + K1 ⊢ V1 ▶* [d - 1, e] V2 & + L2 = K2. ⓑ{I} V2. +#d #e #L1 #L2 * -d -e -L1 -L2 +[ #d #e #_ #I #K1 #V1 #H destruct +| #L #I #V #H elim (lt_refl_false … H) +| #L1 #L2 #I #V1 #V2 #e #_ #_ #H elim (lt_refl_false … H) +| #L1 #L2 #I #V1 #V2 #d #e #HL12 #HV12 #_ #J #K1 #W1 #H destruct /2 width=5/ +] +qed. + +lemma ltpss_sn_inv_tpss11: ∀d,e,I,K1,V1,L2. K1. ⓑ{I} V1 ⊢ ▶* [d, e] L2 → 0 < d → + ∃∃K2,V2. K1 ⊢ ▶* [d - 1, e] K2 & + K1 ⊢ V1 ▶* [d - 1, e] V2 & + L2 = K2. ⓑ{I} V2. +/2 width=3/ qed-. + +fact ltpss_sn_inv_atom2_aux: ∀d,e,L1,L2. + L1 ⊢ ▶* [d, e] L2 → L2 = ⋆ → L1 = ⋆. +#d #e #L1 #L2 * -d -e -L1 -L2 +[ // +| #L #I #V #H destruct +| #L1 #L2 #I #V1 #V2 #e #_ #_ #H destruct +| #L1 #L2 #I #V1 #V2 #d #e #_ #_ #H destruct +] +qed. + +lemma ltpss_sn_inv_atom2: ∀d,e,L1. L1 ⊢ ▶* [d, e] ⋆ → L1 = ⋆. +/2 width=5/ qed-. + +fact ltpss_sn_inv_tpss22_aux: ∀d,e,L1,L2. L1 ⊢ ▶* [d, e] L2 → d = 0 → 0 < e → + ∀K2,I,V2. L2 = K2. ⓑ{I} V2 → + ∃∃K1,V1. K1 ⊢ ▶* [0, e - 1] K2 & + K1 ⊢ V1 ▶* [0, e - 1] V2 & + L1 = K1. ⓑ{I} V1. +#d #e #L1 #L2 * -d -e -L1 -L2 +[ #d #e #_ #_ #K1 #I #V1 #H destruct +| #L1 #I #V #_ #H elim (lt_refl_false … H) +| #L1 #L2 #I #V1 #V2 #e #HL12 #HV12 #_ #_ #K2 #J #W2 #H destruct /2 width=5/ +| #L1 #L2 #I #V1 #V2 #d #e #_ #_ >commutative_plus normalize #H destruct +] +qed. + +lemma ltpss_sn_inv_tpss22: ∀e,L1,K2,I,V2. L1 ⊢ ▶* [0, e] K2. ⓑ{I} V2 → 0 < e → + ∃∃K1,V1. K1 ⊢ ▶* [0, e - 1] K2 & + K1 ⊢ V1 ▶* [0, e - 1] V2 & + L1 = K1. ⓑ{I} V1. +/2 width=5/ qed-. + +fact ltpss_sn_inv_tpss12_aux: ∀d,e,L1,L2. L1 ⊢ ▶* [d, e] L2 → 0 < d → + ∀I,K2,V2. L2 = K2. ⓑ{I} V2 → + ∃∃K1,V1. K1 ⊢ ▶* [d - 1, e] K2 & + K1 ⊢ V1 ▶* [d - 1, e] V2 & + L1 = K1. ⓑ{I} V1. +#d #e #L1 #L2 * -d -e -L1 -L2 +[ #d #e #_ #I #K2 #V2 #H destruct +| #L #I #V #H elim (lt_refl_false … H) +| #L1 #L2 #I #V1 #V2 #e #_ #_ #H elim (lt_refl_false … H) +| #L1 #L2 #I #V1 #V2 #d #e #HL12 #HV12 #_ #J #K2 #W2 #H destruct /2 width=5/ +] +qed. + +lemma ltpss_sn_inv_tpss12: ∀L1,K2,I,V2,d,e. L1 ⊢ ▶* [d, e] K2. ⓑ{I} V2 → 0 < d → + ∃∃K1,V1. K1 ⊢ ▶* [d - 1, e] K2 & + K1 ⊢ V1 ▶* [d - 1, e] V2 & + L1 = K1. ⓑ{I} V1. +/2 width=3/ qed-. + +(* Basic properties *********************************************************) + +lemma ltpss_sn_tps2: ∀L1,L2,I,V1,V2,e. + L1 ⊢ ▶* [0, e] L2 → L1 ⊢ V1 ▶ [0, e] V2 → + L1. ⓑ{I} V1 ⊢ ▶* [0, e + 1] L2. ⓑ{I} V2. +/3 width=1/ qed. + +lemma ltpss_sn_tps1: ∀L1,L2,I,V1,V2,d,e. + L1 ⊢ ▶* [d, e] L2 → L1 ⊢ V1 ▶ [d, e] V2 → + L1. ⓑ{I} V1 ⊢ ▶* [d + 1, e] L2. ⓑ{I} V2. +/3 width=1/ qed. + +lemma ltpss_sn_tpss2_lt: ∀L1,L2,I,V1,V2,e. + L1 ⊢ ▶* [0, e - 1] L2 → L1 ⊢ V1 ▶* [0, e - 1] V2 → + 0 < e → L1. ⓑ{I} V1 ⊢ ▶* [0, e] L2. ⓑ{I} V2. +#L1 #L2 #I #V1 #V2 #e #HL12 #HV12 #He +>(plus_minus_m_m e 1) /2 width=1/ +qed. + +lemma ltpss_sn_tpss1_lt: ∀L1,L2,I,V1,V2,d,e. + L1 ⊢ ▶* [d - 1, e] L2 → L1 ⊢ V1 ▶* [d - 1, e] V2 → + 0 < d → L1. ⓑ{I} V1 ⊢ ▶* [d, e] L2. ⓑ{I} V2. +#L1 #L2 #I #V1 #V2 #d #e #HL12 #HV12 #Hd +>(plus_minus_m_m d 1) /2 width=1/ +qed. + +lemma ltpss_sn_tps2_lt: ∀L1,L2,I,V1,V2,e. + L1 ⊢ ▶* [0, e - 1] L2 → L1 ⊢ V1 ▶ [0, e - 1] V2 → + 0 < e → L1. ⓑ{I} V1 ⊢ ▶* [0, e] L2. ⓑ{I} V2. +/3 width=1/ qed. + +lemma ltpss_sn_tps1_lt: ∀L1,L2,I,V1,V2,d,e. + L1 ⊢ ▶* [d - 1, e] L2 → L1 ⊢ V1 ▶ [d - 1, e] V2 → + 0 < d → L1. ⓑ{I} V1 ⊢ ▶* [d, e] L2. ⓑ{I} V2. +/3 width=1/ qed. + +lemma ltpss_sn_refl: ∀L,d,e. L ⊢ ▶* [d, e] L. +#L elim L -L // +#L #I #V #IHL * /2 width=1/ * /2 width=1/ +qed. + +lemma ltpss_sn_weak: ∀L1,L2,d1,e1. L1 ⊢ ▶* [d1, e1] L2 → + ∀d2,e2. d2 ≤ d1 → d1 + e1 ≤ d2 + e2 → L1 ⊢ ▶* [d2, e2] L2. +#L1 #L2 #d1 #e1 #H elim H -L1 -L2 -d1 -e1 // +[ #L1 #L2 #I #V1 #V2 #e1 #_ #HV12 #IHL12 #d2 #e2 #Hd2 #Hde2 + lapply (le_n_O_to_eq … Hd2) #H destruct normalize in Hde2; + lapply (lt_to_le_to_lt 0 … Hde2) // #He2 + lapply (le_plus_to_minus_r … Hde2) -Hde2 /3 width=5/ +| #L1 #L2 #I #V1 #V2 #d1 #e1 #_ #HV12 #IHL12 #d2 #e2 #Hd21 #Hde12 + >plus_plus_comm_23 in Hde12; #Hde12 + elim (le_to_or_lt_eq 0 d2 ?) // #H destruct + [ lapply (le_plus_to_minus_r … Hde12) -Hde12 plus_plus_comm_23 + /4 width=5 by ltpss_sn_tpss2, tpss_append, tpss_weak, monotonic_le_plus_r/ (**) (* too slow without trace *) +| #K1 #K2 #I #V1 #V2 #d #x #_ #HV12 #IHK12 normalize (ldrop_inv_atom1 … H) -H // +| // +| normalize #K0 #K1 #I #V0 #V1 #e1 #_ #_ #IHK01 #L2 #e2 #H #He12 + elim (le_inv_plus_l … He12) #_ #He2 + lapply (ldrop_inv_ldrop1 … H ?) -H // #HK0L2 + lapply (IHK01 … HK0L2 ?) -K0 /2 width=1/ +| #K0 #K1 #I #V0 #V1 #d1 #e1 >plus_plus_comm_23 #_ #_ #IHK01 #L2 #e2 #H #Hd1e2 + elim (le_inv_plus_l … Hd1e2) #_ #He2 + lapply (ldrop_inv_ldrop1 … H ?) -H // #HK0L2 + lapply (IHK01 … HK0L2 ?) -K0 /2 width=1/ +] +qed. + +lemma ltpss_sn_ldrop_trans_ge: ∀L1,L0,d1,e1. L1 ⊢ ▶* [d1, e1] L0 → + ∀L2,e2. ⇩[0, e2] L0 ≡ L2 → + d1 + e1 ≤ e2 → ⇩[0, e2] L1 ≡ L2. +#L1 #L0 #d1 #e1 #H elim H -L1 -L0 -d1 -e1 +[ #d1 #e1 #L2 #e2 #H >(ldrop_inv_atom1 … H) -H // +| // +| normalize #K1 #K0 #I #V1 #V0 #e1 #_ #_ #IHK10 #L2 #e2 #H #He12 + elim (le_inv_plus_l … He12) #_ #He2 + lapply (ldrop_inv_ldrop1 … H ?) -H // #HK0L2 + lapply (IHK10 … HK0L2 ?) -K0 /2 width=1/ +| #K0 #K1 #I #V1 #V0 #d1 #e1 >plus_plus_comm_23 #_ #_ #IHK10 #L2 #e2 #H #Hd1e2 + elim (le_inv_plus_l … Hd1e2) #_ #He2 + lapply (ldrop_inv_ldrop1 … H ?) -H // #HK0L2 + lapply (IHK10 … HK0L2 ?) -IHK10 -HK0L2 /2 width=1/ +] +qed. + +lemma ltpss_sn_ldrop_conf_be: ∀L0,L1,d1,e1. L0 ⊢ ▶* [d1, e1] L1 → + ∀L2,e2. ⇩[0, e2] L0 ≡ L2 → d1 ≤ e2 → e2 ≤ d1 + e1 → + ∃∃L. L2 ⊢ ▶* [0, d1 + e1 - e2] L & ⇩[0, e2] L1 ≡ L. +#L0 #L1 #d1 #e1 #H elim H -L0 -L1 -d1 -e1 +[ #d1 #e1 #L2 #e2 #H >(ldrop_inv_atom1 … H) -H /2 width=3/ +| normalize #L #I #V #L2 #e2 #HL2 #_ #He2 + lapply (le_n_O_to_eq … He2) -He2 #H destruct + lapply (ldrop_inv_refl … HL2) -HL2 #H destruct /2 width=3/ +| normalize #K0 #K1 #I #V0 #V1 #e1 #HK01 #HV01 #IHK01 #L2 #e2 #H #_ #He21 + lapply (ldrop_inv_O1 … H) -H * * #He2 #HK0L2 + [ -IHK01 -He21 destruct plus_plus_comm_23 #_ #_ #IHK01 #L2 #e2 #H #Hd1e2 #He2de1 + elim (le_inv_plus_l … Hd1e2) #_ #He2 + (ldrop_inv_atom1 … H) -H /2 width=3/ +| normalize #L #I #V #L2 #e2 #HL2 #_ #He2 + lapply (le_n_O_to_eq … He2) -He2 #H destruct + lapply (ldrop_inv_refl … HL2) -HL2 #H destruct /2 width=3/ +| normalize #K1 #K0 #I #V1 #V0 #e1 #HK10 #HV10 #IHK10 #L2 #e2 #H #_ #He21 + lapply (ldrop_inv_O1 … H) -H * * #He2 #HK0L2 + [ -IHK10 -He21 destruct plus_plus_comm_23 #_ #_ #IHK10 #L2 #e2 #H #Hd1e2 #He2de1 + elim (le_inv_plus_l … Hd1e2) #_ #He2 + (ldrop_inv_atom1 … H) -H /2 width=3/ +| /2 width=3/ +| normalize #K0 #K1 #I #V0 #V1 #e1 #HK01 #HV01 #_ #L2 #e2 #H #He2 + lapply (le_n_O_to_eq … He2) -He2 #He2 destruct + lapply (ldrop_inv_refl … H) -H #H destruct /3 width=3/ +| #K0 #K1 #I #V0 #V1 #d1 #e1 #HK01 #HV01 #IHK01 #L2 #e2 #H #He2d1 + lapply (ldrop_inv_O1 … H) -H * * #He2 #HK0L2 + [ -IHK01 -He2d1 destruct (ldrop_inv_atom1 … H) -H /2 width=3/ +| /2 width=3/ +| normalize #K1 #K0 #I #V1 #V0 #e1 #HK10 #HV10 #_ #L2 #e2 #H #He2 + lapply (le_n_O_to_eq … He2) -He2 #He2 destruct + lapply (ldrop_inv_refl … H) -H #H destruct /3 width=3/ +| #K1 #K0 #I #V1 #V0 #d1 #e1 #HK10 #HV10 #IHK10 #L2 #e2 #H #He2d1 + lapply (ldrop_inv_O1 … H) -H * * #He2 #HK0L2 + [ -IHK10 -He2d1 destruct (ltpss_sn_inv_atom1 … H) -H /2 width=3/ +| /2 width=3/ +| #L1 #K1 #I #V #e1 #_ #IHLK1 #K2 #d2 #e2 #HK12 #Hd + elim (IHLK1 … HK12 Hd) -K1 -Hd /3 width=5/ +| #L1 #K1 #I #V1 #W1 #d1 #e1 #HLK1 #HWV1 #IHLK1 #X #d2 #e2 #H #Hd12 + elim (le_inv_plus_l … Hd12) -Hd12 #Hd12 #Hd2 + elim (ltpss_sn_inv_tpss11 … H Hd2) -H #K2 #W2 #HK12 #HW12 #H destruct + elim (IHLK1 … HK12 … Hd12) -IHLK1 -HK12 (ltpss_sn_inv_atom1 … H) -H /2 width=3/ +| #K1 #I #V1 #K2 #d2 #e2 #HK12 #H #_ + lapply (le_n_O_to_eq … H) -H #H destruct /2 width=3/ +| #L1 #K1 #I #V #e1 #_ #IHLK1 #K2 #d2 #e2 #HK12 #H1 #H2 + elim (IHLK1 … HK12 H1 H2) -K1 -H2 + lapply (le_n_O_to_eq … H1) -H1 #H destruct /3 width=5/ +| #L1 #K1 #I #V1 #W1 #d1 #e1 #HLK1 #HWV1 #IHLK1 #X #d2 #e2 #H #Hd21 #Hd12 + elim (eq_or_gt d2) #Hd2 [ -Hd21 elim (eq_or_gt e2) #He2 ] destruct + [ lapply (le_n_O_to_eq … Hd12) -Hd12 plus_minus_commutative // #L2 #HL12 #HLK2 + elim (lift_total W2 d1 e1) #V2 #HWV2 + lapply (tpss_lift_be … HW12 … HLK1 HWV1 … HWV2) -HLK1 -W1 // /2 width=1/ + >plus_minus // >commutative_plus /4 width=5/ + | elim (ltpss_sn_inv_tpss11 … H Hd2) -H #K2 #W2 #HK12 #HW12 #H destruct + elim (IHLK1 … HK12 …) -IHLK1 [2: >plus_minus // ] /2 width=1/ #L2 #HL12 #HLK2 + elim (lift_total W2 d1 e1) #V2 #HWV2 + lapply (tpss_lift_be … HW12 … HLK1 HWV1 … HWV2) -HLK1 -W1 [ >plus_minus // ] /2 width=1/ + >commutative_plus /3 width=5/ + ] +] +qed-. + +lemma ldrop_ltpss_sn_trans_ge: ∀L1,K1,d1,e1. ⇩[d1, e1] L1 ≡ K1 → + ∀K2,d2,e2. K1 ⊢ ▶* [d2, e2] K2 → d2 + e2 ≤ d1 → + ∃∃L2. L1 ⊢ ▶* [d2, e2] L2 & ⇩[d1, e1] L2 ≡ K2. +#L1 #K1 #d1 #e1 #H elim H -L1 -K1 -d1 -e1 +[ #d1 #e1 #K2 #d2 #e2 #H #_ + >(ltpss_sn_inv_atom1 … H) -H /2 width=3/ +| #K1 #I #V1 #K2 #d2 #e2 #HK12 #H + elim (plus_le_0 … H) -H #H1 #H2 destruct /2 width=3/ +| #L1 #K1 #I #V #e1 #_ #IHLK1 #K2 #d2 #e2 #HK12 #H + elim (IHLK1 … HK12 H) -K1 + elim (plus_le_0 … H) -H #H1 #H2 destruct #L2 #HL12 + >(ltpss_sn_inv_refl_O2 … HL12) -L1 /3 width=5/ +| #L1 #K1 #I #V1 #W1 #d1 #e1 #HLK1 #HWV1 #IHLK1 #X #d2 #e2 #H #Hd21 + elim (eq_or_gt d2) #Hd2 [ elim (eq_or_gt e2) #He2 ] destruct + [ -IHLK1 -Hd21 <(ltpss_sn_inv_refl_O2 … H) -X /3 width=5/ + | elim (ltpss_sn_inv_tpss21 … H He2) -H #K2 #W2 #HK12 #HW12 #H destruct + elim (IHLK1 … HK12 …) -IHLK1 /2 width=1/ #L2 #HL12 #HLK2 + elim (lift_total W2 d1 e1) #V2 #HWV2 + lapply (tpss_lift_le … HW12 … HLK1 HWV1 … HWV2) -HLK1 -W1 /2 width=1/ /3 width=5/ + | elim (ltpss_sn_inv_tpss11 … H Hd2) -H #K2 #W2 #HK12 #HW12 #H destruct + elim (IHLK1 … HK12 …) -IHLK1 [2: >plus_minus // /2 width=1/ ] #L2 #HL12 #HLK2 + elim (lift_total W2 d1 e1) #V2 #HWV2 + lapply (tpss_lift_le … HW12 … HLK1 HWV1 … HWV2) -HLK1 -W1 [ >plus_minus // /2 width=1/ ] /3 width=5/ + ] +] +qed-. + +(* Properties on supclosure *************************************************) + +lemma fsup_tpss_trans_full: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ → ∀U2. L2 ⊢ T2 ▶*[0,|L2|] U2 → + ∃∃L,U1. L1 ⊢ ▶*[0,|L1|] L & L ⊢ T1 ▶*[0,|L|] U1 & ⦃L, U1⦄ ⊃ ⦃L2, T2⦄. +#L1 #L2 #T1 #T2 #H elim H -L1 -L2 -T1 -T2 [1,2,3,4,5: /3 width=5/ ] +#L1 #K1 #K2 #T1 #T2 #U1 #d #e #HLK1 #HTU1 #_ #IHT12 #U2 #HTU2 +elim (IHT12 … HTU2) -IHT12 -HTU2 #K #T #HK1 #HT1 #HT2 +elim (lift_total T d e) #U #HTU +lapply (ltpss_sn_fwd_length … HK1) #H >H in HK1; -H #HK1 +elim (le_or_ge d (|K|)) #Hd +[ elim (ldrop_ltpss_sn_trans_be … HLK1 … HK1 … Hd) // -HLK1 -HK1 #L2 #HL12 #HL2K + lapply (tpss_lift_be … HT1 … Hd HL2K HTU1 … HTU) // -HT1 -HTU1 #HU1 +| elim (ldrop_ltpss_sn_trans_ge … HLK1 … HK1 Hd) -HLK1 -HK1 #L2 #HL12 #HL2K + lapply (tpss_lift_le … HT1 … Hd HL2K HTU1 … HTU) -HT1 -HTU1 #HU1 +] +lapply (ltpss_sn_weak_full … HL12) -HL12 #HL12 +lapply (tpss_weak_full … HU1) -HU1 #HU1 +@(ex3_2_intro … L2 U) // /2 width=7/ (**) (* explicit constructor: auto /3 width=14/ too slow *) +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpss_sn_ltpss_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpss_sn_ltpss_sn.etc new file mode 100644 index 000000000..67c287e2b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ltpss_sn_ltpss_sn.etc @@ -0,0 +1,81 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/tpss_tpss.ma". +include "basic_2/unfold/ltpss_sn_tpss.ma". + +(* PARTIAL UNFOLD ON LOCAL ENVIRONMENTS *************************************) + +(* Advanced properties ******************************************************) + +lemma ltpss_sn_tpss_trans_eq: ∀L1,T2,U2,d,e. L1 ⊢ T2 ▶* [d, e] U2 → + ∀L0. L0 ⊢ ▶* [d, e] L1 → L0 ⊢ T2 ▶* [d, e] U2. +#L1 #T2 @(f2_ind … fw … L1 T2) -L1 -T2 #n #IH #L1 * +[ #I #Hn #W2 #d #e #H #L0 #HL01 destruct + elim (tpss_inv_atom1 … H) -H // * + #K1 #V1 #V2 #i #Hdi #Hide #HLK1 #HV12 #HVW2 #H destruct + lapply (ldrop_fwd_lw … HLK1) #H1 normalize in H1; + elim (ltpss_sn_ldrop_trans_be … HL01 … HLK1 ? ?) -HL01 -HLK1 // /2 width=2/ #X #H #HLK0 + elim (ltpss_sn_inv_tpss22 … H ?) -H /2 width=1/ #K0 #V0 #HK01 #HV01 #H destruct + lapply (IH … HV12 … HK01) -IH -HV12 -HK01 [ normalize /2 width=1/ ] #HV12 + lapply (tpss_trans_eq … HV01 HV12) -V1 /2 width=6/ +| * [ #a ] #I #V2 #T2 #Hn #X #d #e #H #L0 #HL0 destruct + [ elim (tpss_inv_bind1 … H) -H #W2 #U2 #HVW2 #HTU2 #H destruct + lapply (tpss_lsubr_trans … HTU2 (L1. ⓑ{I} V2) ?) -HTU2 /2 width=1/ #HTU2 + lapply (IH … HVW2 … HL0) -HVW2 [ /2 width=2/ ] #HVW2 + lapply (IH … HTU2 (L0. ⓑ{I} V2) ?) -IH -HTU2 // /2 width=2/ -HL0 #HTU2 + lapply (tpss_lsubr_trans … HTU2 (L0. ⓑ{I} W2) ?) -HTU2 /2 width=1/ + | elim (tpss_inv_flat1 … H) -H #W2 #U2 #HVW2 #HTU2 #H destruct + lapply (IH … HVW2 … HL0) -HVW2 // + lapply (IH … HTU2 … HL0) -IH -HTU2 // -HL0 /2 width=1/ +] +qed. + +lemma ltpss_sn_tps_trans_eq: ∀L0,L1,T2,U2,d,e. L0 ⊢ ▶* [d, e] L1 → + L1 ⊢ T2 ▶ [d, e] U2 → L0 ⊢ T2 ▶* [d, e] U2. +/3 width=3/ qed. + +(* Main properties **********************************************************) + +theorem ltpss_sn_trans_eq: ∀L1,L,d,e. L1 ⊢ ▶* [d, e] L → + ∀L2. L ⊢ ▶* [d, e] L2 → L1 ⊢ ▶* [d, e] L2. +#L1 #L #d #e #H elim H -L1 -L -d -e // +[ #L1 #L #I #V1 #V #e #HL1 #HV1 #IHL1 #X #H + elim (ltpss_sn_inv_tpss21 … H ?) -H // shift_append_assoc #H + elim (tps_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct + elim (IH … HT12) -IH -HT12 #L2 #T #HL12 #HT1 #H destruct + append_length minus_plus minus_plus >commutative_plus /2 width=1/ + | lapply (ltpss_sn_ldrop_conf_ge … HL01 … HLK0 ?) -HL01 -HLK0 // /3 width=4/ + ] + ] +| #L0 #a #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL01 + elim (IHVW2 … HL01) -IHVW2 #V #HV2 #HVW2 + elim (IHTU2 (L1. ⓑ{I} V) (d1 + 1) e1 ?) -IHTU2 /2 width=1/ -HL01 #T #HT2 #H + lapply (tpss_lsubr_trans … H (L0.ⓑ{I}V) ?) -H /2 width=1/ /3 width=5/ +| #L0 #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL01 + elim (IHVW2 … HL01) -IHVW2 + elim (IHTU2 … HL01) -IHTU2 -HL01 /3 width=5/ +] +qed. + +lemma ltpss_sn_tpss_trans_ge: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 ▶* [d2, e2] U2 → + ∀L1,d1,e1. L1 ⊢ ▶* [d1, e1] L0 → d1 + e1 ≤ d2 → + L1 ⊢ T2 ▶* [d2, e2] U2. +#L0 #T2 #U2 #d2 #e2 #H #L1 #d1 #e1 #HL01 #Hde1d2 @(tpss_ind … H) -U2 // +#U #U2 #_ #HU2 #IHU +lapply (ltpss_sn_tps_trans_ge … HU2 … HL01 ?) -L0 // -Hde1d2 /2 width=3/ +qed. + +lemma ltpss_sn_tps_trans: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 ▶ [d2, e2] U2 → + ∀L1,d1,e1. L1 ⊢ ▶* [d1, e1] L0 → + ∃∃T. L1 ⊢ T2 ▶ [d2, e2] T & + L1 ⊢ T ▶* [d1, e1] U2. +#L0 #T2 #U2 #d2 #e2 #H elim H -L0 -T2 -U2 -d2 -e2 +[ /2 width=3/ +| #L0 #K0 #V0 #W0 #i2 #d2 #e2 #Hdi2 #Hide2 #HLK0 #HVW0 #L1 #d1 #e1 #HL10 + elim (lt_or_ge i2 d1) #Hi2d1 + [ elim (ltpss_sn_ldrop_trans_le … HL10 … HLK0 ?) -L0 /2 width=2/ #X #H #HLK1 + elim (ltpss_sn_inv_tpss12 … H ?) -H /2 width=1/ #K1 #V1 #_ #HV01 #H destruct + lapply (ldrop_fwd_ldrop2 … HLK1) #H + elim (lift_total V1 0 (i2 + 1)) #W1 #HVW1 + lapply (tpss_lift_ge … HV01 … H HVW1 … HVW0) -V0 -H // >minus_plus minus_plus >commutative_plus /2 width=1/ + | lapply (ltpss_sn_ldrop_trans_ge … HL10 … HLK0 ?) -HL10 -HLK0 // /3 width=4/ + ] + ] +| #L0 #a #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL10 + elim (IHVW2 … HL10) -IHVW2 #V #HV2 #HVW2 + elim (IHTU2 (L1. ⓑ{I} V) (d1 + 1) e1 ?) -IHTU2 /2 width=1/ -HL10 #T #HT2 #H + lapply (tpss_lsubr_trans … H (L1.ⓑ{I}W2) ?) -H /2 width=1/ /3 width=5/ +| #L0 #I #V2 #W2 #T2 #U2 #d2 #e2 #_ #_ #IHVW2 #IHTU2 #L1 #d1 #e1 #HL10 + elim (IHVW2 … HL10) -IHVW2 + elim (IHTU2 … HL10) -IHTU2 -HL10 /3 width=5/ +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/snv_ltpss_dx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/snv_ltpss_dx.etc new file mode 100644 index 000000000..ca55239f0 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/snv_ltpss_dx.etc @@ -0,0 +1,87 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/dxprs_ltpss_dx.ma". +include "basic_2/equivalence/cpcs_ltpss_dx.ma". +include "basic_2/dynamic/snv_lift.ma". + +(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************) + +(* Properties about dx parallel unfold **************************************) + +lemma snv_ltpss_dx_tpss_conf: ∀h,g,L1,T1. ⦃h, L1⦄ ⊢ T1 ¡[g] → + ∀L2,d,e. L1 ▶* [d, e] L2 → + ∀T2. L2 ⊢ T1 ▶* [d, e] T2 → ⦃h, L2⦄ ⊢ T2 ¡[g]. +#h #g #L1 #T1 #H elim H -L1 -T1 +[ #L1 #k #L2 #d #e #_ #X #H + >(tpss_inv_sort1 … H) -X // +| #I #L1 #K1 #V1 #i #HLK1 #HV1 #IHV1 #L2 #d #e #HL12 #X #H + elim (tpss_inv_lref1 … H) -H + [ #H destruct + elim (lt_or_ge i d) #Hdi [ | elim (lt_or_ge i (d + e)) #Hide ] + [ elim (ltpss_dx_ldrop_conf_le … HL12 … HLK1 …) -L1 /2 width=2/ #X #H #HLK2 + elim (ltpss_dx_inv_tpss11 … H …) -H /2 width=1/ #K2 #V2 #HK12 #HV12 #H destruct + lapply (IHV1 … HK12 … HV12) -IHV1 -HK12 -HV12 /2 width=5/ + | elim (ltpss_dx_ldrop_conf_be … HL12 … HLK1 …) -L1 // /2 width=2/ #X #H #HLK2 + elim (ltpss_dx_inv_tpss21 … H …) -H /2 width=1/ #K2 #V2 #HK12 #HV12 #H destruct + lapply (IHV1 … HK12 … HV12) -IHV1 -HK12 -HV12 /2 width=5/ + | lapply (ltpss_dx_ldrop_conf_ge … HL12 … HLK1 ?) -L1 // -Hide /2 width=5/ + ] + | * #K2 #V2 #W2 #Hdi #Hide #HLK2 #HVW2 #HWT2 + elim (ltpss_dx_ldrop_conf_be … HL12 … HLK1 …) -L1 // /2 width=2/ #X #H1 #H2 + elim (ltpss_dx_inv_tpss21 … H1 …) -H1 /2 width=1/ #K0 #V0 #HK12 #HV12 #H destruct + lapply (ldrop_mono … H2 … HLK2) -H2 #H destruct + lapply (ldrop_fwd_ldrop2 … HLK2) -HLK2 #HLK2 + lapply (tpss_trans_eq … HV12 HVW2) -V2 #HV1W2 + lapply (IHV1 … HK12 … HV1W2) -IHV1 -HK12 -HV1W2 /2 width=7/ + ] +| #a #I #L1 #V1 #T1 #_ #_ #IHV1 #IHT1 #L2 #d #e #HL12 #X #H + elim (tpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct + lapply (IHV1 … HL12 … HV12) -IHV1 #HV2 + lapply (IHT1 … HT12) -IHT1 -HT12 /2 width=1/ +| #a #L1 #V1 #W1 #W0 #T1 #U1 #l #_ #_ #HVW1 #HW10 #HTU1 #IHV1 #IHT1 #L2 #d #e #HL12 #X #H + elim (tpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct + lapply (IHV1 … HL12 … HV12) -IHV1 #HV2 + lapply (IHT1 … HT12) -IHT1 /2 width=1/ #HT2 + elim (ssta_ltpss_dx_tpss_conf … HVW1 … HL12 … HV12) -V1 #W2 #HVW2 #HW12 + elim (dxprs_ltpss_dx_tpss_conf … HTU1 … HL12 … HT12) -T1 #X #HTU2 #H + elim (tpss_inv_bind1 … H) -H #W #U2 #HW0 #_ #H -U1 destruct + elim (cprs_ltpss_dx_tpss2_conf … HW10 … HL12 … HW12 … HW0) -L1 -W1 -W0 #W0 #HW20 #HW0 + lapply (dxprs_strap1 … (ⓛ{a}W0.U2) HTU2 ?) -HTU2 /3 width=3/ -HW0 /2 width=8/ +| #L1 #W1 #T1 #U1 #l #_ #_ #HTU1 #HUW1 #IHW1 #IHT1 #L2 #d #e #HL12 #X #H + elim (tpss_inv_flat1 … H) -H #W2 #T2 #HW12 #HT12 #H destruct + lapply (IHW1 … HL12 … HW12) -IHW1 #HW2 + lapply (IHT1 … HL12 … HT12) -IHT1 #HT2 + elim (ssta_ltpss_dx_tpss_conf … HTU1 … HL12 … HT12) -T1 #U2 #HTU2 #HU12 + lapply (cpcs_ltpss_dx_tpss2_conf … HL12 … HUW1 … HU12 … HW12) -L1 -W1 -U1 /2 width=4/ +] +qed-. + +lemma snv_ltpss_dx_conf: ∀h,g,L1,T. ⦃h, L1⦄ ⊢ T ¡[g] → + ∀L2,d,e. L1 ▶* [d, e] L2 → ⦃h, L2⦄ ⊢ T ¡[g]. +#h #g #L1 #T #HT #L2 #d #e #HL12 +@(snv_ltpss_dx_tpss_conf … HT … HL12) // +qed-. + +lemma snv_tpss_conf: ∀h,g,L,T1. ⦃h, L⦄ ⊢ T1 ¡[g] → + ∀T2,d,e. L ⊢ T1 ▶* [d, e] T2 → ⦃h, L⦄ ⊢ T2 ¡[g]. +#h #g #L #T1 #HT1 #T2 #d #e #HT12 +@(snv_ltpss_dx_tpss_conf … HT1 … HT12) // +qed-. + +lemma snv_tps_conf: ∀h,g,L,T1. ⦃h, L⦄ ⊢ T1 ¡[g] → + ∀T2,d,e. L ⊢ T1 ▶ [d, e] T2 → ⦃h, L⦄ ⊢ T2 ¡[g]. +#h #g #L #T1 #HT1 #T2 #d #e #HT12 +@(snv_tpss_conf … HT1 T2) /2 width=3/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/snv_ltpss_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/snv_ltpss_sn.etc new file mode 100644 index 000000000..3c8070249 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/snv_ltpss_sn.etc @@ -0,0 +1,28 @@ +(**************************************************************************) +(* ___ *) +(* ||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/dynamic/snv_ltpss_dx.ma". + +(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************) + +(* Properties about sn parallel unfold **************************************) + +lemma snv_ltpss_sn_conf: ∀h,g,L1,L2,d,e. L1 ⊢ ▶* [d, e] L2 → + ∀T. ⦃h, L1⦄ ⊢ T ¡[g] → ⦃h, L2⦄ ⊢ T ¡[g]. +#h #g #L1 #L2 #d #e #H +lapply (ltpss_sn_ltpssa … H) -H #H @(ltpssa_ind … H) -L2 // +#L #L2 #_ #HL2 #IHL1 #T1 #HT1 +lapply (IHL1 … HT1) -IHL1 -HT1 #HT1 +lapply (snv_ltpss_dx_conf … HT1 … HL2) -HT1 -HL2 // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ssta_ltpss_dx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ssta_ltpss_dx.etc new file mode 100644 index 000000000..72eff7850 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/ssta_ltpss_dx.etc @@ -0,0 +1,125 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/tpss_tpss.ma". +include "basic_2/unfold/ltpss_dx_tpss.ma". +include "basic_2/static/ssta_lift.ma". + +(* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************) + +(* Properties about dx parallel unfold **************************************) + +(* Note: apparently this was missing in basic_1 *) +lemma ssta_ltpss_dx_tpss_conf: ∀h,g,L1,T1,U1,l. ⦃h, L1⦄ ⊢ T1 •[g] ⦃l, U1⦄ → + ∀L2,d,e. L1 ▶* [d, e] L2 → + ∀T2. L2 ⊢ T1 ▶* [d, e] T2 → + ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g] ⦃l, U2⦄ & + L2 ⊢ U1 ▶* [d, e] U2. +#h #g #L1 #T1 #U #l #H elim H -L1 -T1 -U -l +[ #L1 #k1 #l1 #Hkl1 #L2 #d #e #_ #T2 #H + >(tpss_inv_sort1 … H) -H /3 width=3/ +| #L1 #K1 #V1 #W1 #U1 #i #l #HLK1 #HVW1 #HWU1 #IHVW1 #L2 #d #e #HL12 #T2 #H + elim (tpss_inv_lref1 … H) -H [ | -HVW1 ] + [ #H destruct + elim (lt_or_ge i d) #Hdi [ -HVW1 | ] + [ elim (ltpss_dx_ldrop_conf_le … HL12 … HLK1 ?) -L1 /2 width=2/ #X #H #HLK2 + elim (ltpss_dx_inv_tpss11 … H ?) -H /2 width=1/ #K2 #V2 #HK12 #HV12 #H destruct + elim (IHVW1 … HK12 … HV12) -IHVW1 -HK12 -HV12 #W2 #HVW2 #HW12 + lapply (ldrop_fwd_ldrop2 … HLK2) #H + elim (lift_total W2 0 (i+1)) #U2 #HWU2 + lapply (tpss_lift_ge … HW12 … H … HWU1 … HWU2) // -HW12 -H -HWU1 + >minus_plus minus_plus #H + lapply (tpss_weak … H d e ? ?) [1,2: normalize [ >commutative_plus minus_plus #H + lapply (tpss_weak … H d e ? ?) [1,2: normalize [ >commutative_plus minus_plus minus_plus #H + lapply (tpss_weak … H d e ? ?) [1,2: normalize [ >commutative_plus (tpss_inv_sort1 … H) -H /2 width=3/ +| #L1 #K1 #V1 #W1 #U1 #i #HLK1 #HVW1 #HWU1 #IHVW1 #L2 #d #e #HL12 #T2 #H + elim (tpss_inv_lref1 … H) -H [ | -HVW1 ] + [ #H destruct + elim (lt_or_ge i d) #Hdi [ -HVW1 | ] + [ elim (ltpss_ldrop_conf_le … HL12 … HLK1 ?) -L1 /2 width=2/ #X #H #HLK2 + elim (ltpss_inv_tpss11 … H ?) -H /2 width=1/ #K2 #V2 #HK12 #HV12 #H destruct + elim (IHVW1 … HK12 … HV12) -IHVW1 -HK12 -HV12 #W2 #HVW2 #HW12 + lapply (ldrop_fwd_ldrop2 … HLK2) #H + elim (lift_total W2 0 (i+1)) #U2 #HWU2 + lapply (tpss_lift_ge … HW12 … H … HWU1 … HWU2) // -HW12 -H -HWU1 + >minus_plus minus_plus #H + lapply (tpss_weak … H d e ? ?) [1,2: normalize [ >commutative_plus minus_plus #H + lapply (tpss_weak … H d e ? ?) [1,2: normalize [ >commutative_plus minus_plus minus_plus #H + lapply (tpss_weak … H d e ? ?) [1,2: normalize [ >commutative_plus shift_append_assoc normalize #H + elim (tpr_inv_bind1 … H) -H * + [ #V0 #T0 #X0 #_ #HT10 #H0 #H destruct + elim (IH … HT10) -IH -T1 #L #T #HL1 #H destruct + elim (tps_fwd_shift1 … H0) -T #L2 #T2 #HL2 #H destruct + >append_length >HL1 >HL2 -L1 -L + @(ex2_2_intro … (⋆.ⓑ{I}V0@@L2) T2) [ >append_length ] // /2 width=3/ (**) (* explicit constructor *) + | #T #_ #_ #H destruct + ] +] +qed-. + +(* Basic_1: removed theorems 3: + pr0_subst0_back pr0_subst0_fwd pr0_subst0 +*) +(* Basic_1: removed local theorems: 1: pr0_delta_tau *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tpr_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tpr_lift.etc new file mode 100644 index 000000000..8d6b0363a --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tpr_lift.etc @@ -0,0 +1,121 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/tps_lift.ma". +include "basic_2/reducibility/tpr.ma". + +(* CONTEXT-FREE PARALLEL REDUCTION ON TERMS *********************************) + +(* Relocation properties ****************************************************) + +(* Basic_1: was: pr0_lift *) +lemma tpr_lift: t_liftable tpr. +#T1 #T2 #H elim H -T1 -T2 +[ * #i #U1 #d #e #HU1 #U2 #HU2 + lapply (lift_mono … HU1 … HU2) -HU1 #H destruct + [ lapply (lift_inv_sort1 … HU2) -HU2 #H destruct // + | lapply (lift_inv_lref1 … HU2) * * #Hid #H destruct // + | lapply (lift_inv_gref1 … HU2) -HU2 #H destruct // + ] +| #I #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #X1 #d #e #HX1 #X2 #HX2 + elim (lift_inv_flat1 … HX1) -HX1 #W1 #U1 #HVW1 #HTU1 #HX1 destruct + elim (lift_inv_flat1 … HX2) -HX2 #W2 #U2 #HVW2 #HTU2 #HX2 destruct /3 width=4/ +| #a #V1 #V2 #W #T1 #T2 #_ #_ #IHV12 #IHT12 #X1 #d #e #HX1 #X2 #HX2 + elim (lift_inv_flat1 … HX1) -HX1 #V0 #X #HV10 #HX #HX1 destruct + elim (lift_inv_bind1 … HX) -HX #W0 #T0 #HW0 #HT10 #HX destruct + elim (lift_inv_bind1 … HX2) -HX2 #V3 #T3 #HV23 #HT23 #HX2 destruct /3 width=4/ +| #a #I #V1 #V2 #T1 #T #T2 #_ #_ #HT2 #IHV12 #IHT1 #X1 #d #e #HX1 #X2 #HX2 + elim (lift_inv_bind1 … HX1) -HX1 #W1 #U1 #HVW1 #HTU1 #HX1 destruct + elim (lift_inv_bind1 … HX2) -HX2 #W2 #U0 #HVW2 #HTU0 #HX2 destruct + elim (lift_total T (d + 1) e) #U #HTU + @tpr_delta + [4: @(tps_lift_le … HT2 … HTU HTU0 ?) /2 width=1/ |1: skip |2: /2 width=4/ |3: /2 width=4/ ] (**) (*/3. is too slow *) +| #a #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV12 #IHW12 #IHT12 #X1 #d #e #HX1 #X2 #HX2 + elim (lift_inv_flat1 … HX1) -HX1 #V0 #X #HV10 #HX #HX1 destruct + elim (lift_inv_bind1 … HX) -HX #W0 #T0 #HW0 #HT10 #HX destruct + elim (lift_inv_bind1 … HX2) -HX2 #W3 #X #HW23 #HX #HX2 destruct + elim (lift_inv_flat1 … HX) -HX #V3 #T3 #HV3 #HT23 #HX destruct + elim (lift_trans_ge … HV2 … HV3 ?) -V // /3 width=4/ +| #V #T1 #T #T2 #_ #HT2 #IHT1 #X #d #e #H #U2 #HTU2 + elim (lift_inv_bind1 … H) -H #V3 #T3 #_ #HT13 #H destruct -V + elim (lift_conf_O1 … HTU2 … HT2) -T2 /3 width=4/ +| #V #T1 #T2 #_ #IHT12 #X #d #e #HX #T #HT2 + elim (lift_inv_flat1 … HX) -HX #V0 #T0 #_ #HT0 #HX destruct /3 width=4/ +] +qed. + +(* Basic_1: was: pr0_gen_lift *) +lemma tpr_inv_lift1: t_deliftable_sn tpr. +#T1 #T2 #H elim H -T1 -T2 +[ * #i #X #d #e #HX + [ lapply (lift_inv_sort2 … HX) -HX #H destruct /2 width=3/ + | lapply (lift_inv_lref2 … HX) -HX * * #Hid #H destruct /3 width=3/ + | lapply (lift_inv_gref2 … HX) -HX #H destruct /2 width=3/ + ] +| #I #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #X #d #e #HX + elim (lift_inv_flat2 … HX) -HX #V0 #T0 #HV01 #HT01 #HX destruct + elim (IHV12 … HV01) -V1 + elim (IHT12 … HT01) -T1 /3 width=5/ +| #a #V1 #V2 #W1 #T1 #T2 #_ #_ #IHV12 #IHT12 #X #d #e #HX + elim (lift_inv_flat2 … HX) -HX #V0 #Y #HV01 #HY #HX destruct + elim (lift_inv_bind2 … HY) -HY #W0 #T0 #HW01 #HT01 #HY destruct + elim (IHV12 … HV01) -V1 + elim (IHT12 … HT01) -T1 /3 width=5/ +| #a #I #V1 #V2 #T1 #T #T2 #_ #_ #HT2 #IHV12 #IHT1 #X #d #e #HX + elim (lift_inv_bind2 … HX) -HX #W1 #U1 #HWV1 #HUT1 #HX destruct + elim (IHV12 … HWV1) -V1 #W2 #HWV2 #HW12 + elim (IHT1 … HUT1) -T1 #U #HUT #HU1 + elim (tps_inv_lift1_le … HT2 … HUT ?) -T // [3: /2 width=5/ |2: skip ] #U2 #HU2 #HUT2 + @ex2_intro [2: /2 width=2/ |1: skip |3: /2 width=3/ ] (**) (* /3 width=5/ is slow *) +| #a #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV12 #IHW12 #IHT12 #X #d #e #HX + elim (lift_inv_flat2 … HX) -HX #V0 #Y #HV01 #HY #HX destruct + elim (lift_inv_bind2 … HY) -HY #W0 #T0 #HW01 #HT01 #HY destruct + elim (IHV12 … HV01) -V1 #V3 #HV32 #HV03 + elim (IHW12 … HW01) -W1 #W3 #HW32 #HW03 + elim (IHT12 … HT01) -T1 #T3 #HT32 #HT03 + elim (lift_trans_le … HV32 … HV2 ?) -V2 // #V2 #HV32 #HV2 + @ex2_intro [2: /3 width=2/ |1: skip |3: /2 width=3/ ] (**) (* /4 width=5/ is slow *) +| #V #T1 #T #T2 #_ #HT2 #IHT1 #X #d #e #HX + elim (lift_inv_bind2 … HX) -HX #V3 #T3 #_ #HT31 #H destruct + elim (IHT1 … HT31) -T1 #T1 #HT1 #HT31 + elim (lift_div_le … HT2 … HT1 ?) -T // /3 width=5/ +| #V #T1 #T2 #_ #IHT12 #X #d #e #HX + elim (lift_inv_flat2 … HX) -HX #V0 #T0 #_ #HT01 #H destruct + elim (IHT12 … HT01) -T1 /3 width=3/ +] +qed-. + +(* Advanced inversion lemmas ************************************************) + +(* Basic_1: was pr0_gen_abst *) +lemma tpr_inv_abst1: ∀a,V1,T1,U2. ⓛ{a}V1. T1 ➡ U2 → + ∃∃V2,T2. V1 ➡ V2 & T1 ➡ T2 & U2 = ⓛ{a}V2. T2. +#a #V1 #T1 #U2 #H elim (tpr_inv_bind1 … H) -H * +[ #V2 #T #T2 #HV12 #HT1 #HT2 + lapply (tps_inv_refl_SO2 … HT2 ???) -HT2 // /2 width=5/ +| #T2 #_ #_ #_ #H destruct +] +qed-. + +(* Advanced forward lemmas **************************************************) + +lemma tpr_fwd_abst1: ∀a,V1,T1,U2. ⓛ{a}V1.T1 ➡ U2 → ∀b,I,W. + ∃∃V2,T2. ⓑ{b,I}W.T1 ➡ ⓑ{b,I}W.T2 & + U2 = ⓛ{a}V2.T2. +#a #V1 #T1 #U2 #H #b #I #W elim (tpr_inv_bind1 … H) -H * +[ #V2 #T #T2 #HV12 #HT1 #HT2 + lapply (tps_inv_refl_SO2 … HT2 ???) -HT2 // /3 width=4/ +| #T2 #_ #_ #_ #H destruct +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tpr_tpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tpr_tpr.etc new file mode 100644 index 000000000..a733345bf --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tpr_tpr.etc @@ -0,0 +1,261 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/ltpr_tpss.ma". + +(* CONTEXT-FREE PARALLEL REDUCTION ON TERMS *********************************) + +(* Confluence lemmas ********************************************************) + +fact tpr_conf_atom_atom: ∀I. ∃∃X. ⓪{I} ➡ X & ⓪{I} ➡ X. +/2 width=3/ qed. + +fact tpr_conf_flat_flat: + ∀I,V0,V1,T0,T1,V2,T2. ( + ∀X0:term. ♯{X0} < ♯{V0} + ♯{T0} + 1 → + ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → + ∃∃X. X1 ➡ X & X2 ➡ X + ) → + V0 ➡ V1 → V0 ➡ V2 → T0 ➡ T1 → T0 ➡ T2 → + ∃∃T0. ⓕ{I} V1. T1 ➡ T0 & ⓕ{I} V2. T2 ➡ T0. +#I #V0 #V1 #T0 #T1 #V2 #T2 #IH #HV01 #HV02 #HT01 #HT02 +elim (IH … HV01 … HV02) -HV01 -HV02 // #V #HV1 #HV2 +elim (IH … HT01 … HT02) -HT01 -HT02 -IH // /3 width=5/ +qed. + +fact tpr_conf_flat_beta: + ∀a,V0,V1,T1,V2,W0,U0,T2. ( + ∀X0:term. ♯{X0} < ♯{V0} + (♯{W0} + ♯{U0} + 1) + 1 → + ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → + ∃∃X. X1 ➡ X & X2 ➡ X + ) → + V0 ➡ V1 → V0 ➡ V2 → + U0 ➡ T2 → ⓛ{a}W0. U0 ➡ T1 → + ∃∃X. ⓐV1. T1 ➡ X & ⓓ{a}V2. T2 ➡ X. +#a #V0 #V1 #T1 #V2 #W0 #U0 #T2 #IH #HV01 #HV02 #HT02 #H +elim (tpr_inv_abst1 … H) -H #W1 #U1 #HW01 #HU01 #H destruct +elim (IH … HV01 … HV02) -HV01 -HV02 /2 width=1/ #V #HV1 #HV2 +elim (IH … HT02 … HU01) -HT02 -HU01 -IH /2 width=1/ /3 width=5/ +qed. + +(* Basic-1: was: + pr0_cong_upsilon_refl pr0_cong_upsilon_zeta + pr0_cong_upsilon_cong pr0_cong_upsilon_delta +*) +fact tpr_conf_flat_theta: + ∀a,V0,V1,T1,V2,V,W0,W2,U0,U2. ( + ∀X0:term. ♯{X0} < ♯{V0} + (♯{W0} + ♯{U0} + 1) + 1 → + ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → + ∃∃X. X1 ➡ X & X2 ➡ X + ) → + V0 ➡ V1 → V0 ➡ V2 → ⇧[O,1] V2 ≡ V → + W0 ➡ W2 → U0 ➡ U2 → ⓓ{a}W0. U0 ➡ T1 → + ∃∃X. ⓐV1. T1 ➡ X & ⓓ{a}W2. ⓐV. U2 ➡ X. +#a #V0 #V1 #T1 #V2 #V #W0 #W2 #U0 #U2 #IH #HV01 #HV02 #HV2 #HW02 #HU02 #H +elim (IH … HV01 … HV02) -HV01 -HV02 /2 width=1/ #VV #HVV1 #HVV2 +elim (lift_total VV 0 1) #VVV #HVV +lapply (tpr_lift … HVV2 … HV2 … HVV) #HVVV +elim (tpr_inv_abbr1 … H) -H * +(* case 1: delta *) +[ -HV2 -HVV2 #WW2 #UU2 #UU #HWW2 #HUU02 #HUU2 #H destruct + elim (IH … HW02 … HWW2) -HW02 -HWW2 /2 width=1/ #W #HW02 #HWW2 + elim (IH … HU02 … HUU02) -HU02 -HUU02 -IH /2 width=1/ #U #HU2 #HUUU2 + elim (tpr_tps_conf_bind … HWW2 HUUU2 … HUU2) -UU2 #UUU #HUUU2 #HUUU1 + @ex2_intro + [2: @tpr_theta [6: @HVV |7: @HWW2 |8: @HUUU2 |1,2,3,4: skip | // ] + |1:skip + |3: @tpr_delta [3: @tpr_flat |1: skip ] /2 width=5/ + ] (**) (* /5 width=14/ is too slow *) +(* case 3: zeta *) +| -HV2 -HW02 -HVV2 #U1 #HU01 #HTU1 + elim (IH … HU01 … HU02) -HU01 -HU02 -IH // -U0 #U #HU1 #HU2 + elim (tpr_inv_lift1 … HU1 … HTU1) -U1 #UU #HUU #HT1UU #H destruct + @(ex2_intro … (ⓐVV.UU)) /2 width=1/ /3 width=5/ (**) (* /4 width=9/ is too slow *) +] +qed. + +fact tpr_conf_flat_cast: + ∀X2,V0,V1,T0,T1. ( + ∀X0:term. ♯{X0} < ♯{V0} + ♯{T0} + 1 → + ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → + ∃∃X. X1 ➡ X & X2 ➡ X + ) → + V0 ➡ V1 → T0 ➡ T1 → T0 ➡ X2 → + ∃∃X. ⓝV1. T1 ➡ X & X2 ➡ X. +#X2 #V0 #V1 #T0 #T1 #IH #_ #HT01 #HT02 +elim (IH … HT01 … HT02) -HT01 -HT02 -IH // /3 width=3/ +qed. + +fact tpr_conf_beta_beta: + ∀a. ∀W0:term. ∀V0,V1,T0,T1,V2,T2. ( + ∀X0:term. ♯{X0} < ♯{V0} + (♯{W0} + ♯{T0} + 1) + 1 → + ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → + ∃∃X. X1 ➡ X & X2 ➡ X + ) → + V0 ➡ V1 → V0 ➡ V2 → T0 ➡ T1 → T0 ➡ T2 → + ∃∃X. ⓓ{a}V1. T1 ➡X & ⓓ{a}V2. T2 ➡ X. +#a #W0 #V0 #V1 #T0 #T1 #V2 #T2 #IH #HV01 #HV02 #HT01 #HT02 +elim (IH … HV01 … HV02) -HV01 -HV02 /2 width=1/ +elim (IH … HT01 … HT02) -HT01 -HT02 -IH /2 width=1/ /3 width=5/ +qed. + +(* Basic_1: was: pr0_cong_delta pr0_delta_delta *) +fact tpr_conf_delta_delta: + ∀a,I1,V0,V1,T0,T1,TT1,V2,T2,TT2. ( + ∀X0:term. ♯{X0} < ♯{V0} + ♯{T0} + 1 → + ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → + ∃∃X. X1 ➡ X & X2 ➡ X + ) → + V0 ➡ V1 → V0 ➡ V2 → T0 ➡ T1 → T0 ➡ T2 → + ⋆. ⓑ{I1} V1 ⊢ T1 ▶ [O, 1] TT1 → + ⋆. ⓑ{I1} V2 ⊢ T2 ▶ [O, 1] TT2 → + ∃∃X. ⓑ{a,I1} V1. TT1 ➡ X & ⓑ{a,I1} V2. TT2 ➡ X. +#a #I1 #V0 #V1 #T0 #T1 #TT1 #V2 #T2 #TT2 #IH #HV01 #HV02 #HT01 #HT02 #HTT1 #HTT2 +elim (IH … HV01 … HV02) -HV01 -HV02 // #V #HV1 #HV2 +elim (IH … HT01 … HT02) -HT01 -HT02 -IH // #T #HT1 #HT2 +elim (tpr_tps_conf_bind … HV1 HT1 … HTT1) -T1 #U1 #TTU1 #HTU1 +elim (tpr_tps_conf_bind … HV2 HT2 … HTT2) -T2 #U2 #TTU2 #HTU2 +elim (tps_conf_eq … HTU1 … HTU2) -T #U #HU1 #HU2 +@ex2_intro [2,3: @tpr_delta |1: skip ] /width=10/ (**) (* /3 width=10/ is too slow *) +qed. + +fact tpr_conf_delta_zeta: + ∀X2,V0,V1,T0,T1,TT1,T2. ( + ∀X0:term. ♯{X0} < ♯{V0} + ♯{T0} + 1 → + ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → + ∃∃X. X1 ➡ X & X2 ➡ X + ) → + V0 ➡ V1 → T0 ➡ T1 → ⋆. ⓓV1 ⊢ T1 ▶ [O,1] TT1 → + T0 ➡ T2 → ⇧[O, 1] X2 ≡ T2 → + ∃∃X. +ⓓV1. TT1 ➡ X & X2 ➡ X. +#X2 #V0 #V1 #T0 #T1 #TT1 #T2 #IH #_ #HT01 #HTT1 #HT02 #HXT2 +elim (IH … HT01 … HT02) -IH -HT01 -HT02 // -V0 -T0 #T #HT1 #HT2 +elim (tpr_tps_conf_bind ? ? V1 … HT1 HTT1) -T1 // #TT #HTT1 #HTT +elim (tpr_inv_lift1 … HT2 … HXT2) -T2 #X #HXT #HX2 +lapply (tps_inv_lift1_eq … HTT … HXT) -HTT #H destruct /3 width=3/ +qed. + +(* Basic_1: was: pr0_upsilon_upsilon *) +fact tpr_conf_theta_theta: + ∀a,VV1,V0,V1,W0,W1,T0,T1,V2,VV2,W2,T2. ( + ∀X0:term. ♯{X0} < ♯{V0} + (♯{W0} + ♯{T0} + 1) + 1 → + ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → + ∃∃X. X1 ➡ X & X2 ➡ X + ) → + V0 ➡ V1 → V0 ➡ V2 → W0 ➡ W1 → W0 ➡ W2 → T0 ➡ T1 → T0 ➡ T2 → + ⇧[O, 1] V1 ≡ VV1 → ⇧[O, 1] V2 ≡ VV2 → + ∃∃X. ⓓ{a}W1. ⓐVV1. T1 ➡ X & ⓓ{a}W2. ⓐVV2. T2 ➡ X. +#a #VV1 #V0 #V1 #W0 #W1 #T0 #T1 #V2 #VV2 #W2 #T2 #IH #HV01 #HV02 #HW01 #HW02 #HT01 #HT02 #HVV1 #HVV2 +elim (IH … HV01 … HV02) -HV01 -HV02 /2 width=1/ #V #HV1 #HV2 +elim (IH … HW01 … HW02) -HW01 -HW02 /2 width=1/ #W #HW1 #HW2 +elim (IH … HT01 … HT02) -HT01 -HT02 -IH /2 width=1/ #T #HT1 #HT2 +elim (lift_total V 0 1) #VV #HVV +lapply (tpr_lift … HV1 … HVV1 … HVV) -V1 #HVV1 +lapply (tpr_lift … HV2 … HVV2 … HVV) -V2 -HVV #HVV2 +@ex2_intro [2,3: @tpr_bind |1:skip ] /2 width=5/ (**) (* /4 width=5/ is too slow *) +qed. + +fact tpr_conf_zeta_zeta: + ∀V0:term. ∀X2,TT0,T0,T1,TT2. ( + ∀X0:term. ♯{X0} < ♯{V0} + ♯{TT0} + 1 → + ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → + ∃∃X. X1 ➡ X & X2 ➡ X + ) → + TT0 ➡ T0 → ⇧[O, 1] T1 ≡ T0 → + TT0 ➡ TT2 → ⇧[O, 1] X2 ≡ TT2 → + ∃∃X. T1 ➡ X & X2 ➡ X. +#V0 #X2 #TT0 #T0 #T1 #TT2 #IH #HTT0 #HT10 #HTT02 #HXTT2 +elim (IH … HTT0 … HTT02) -IH -HTT0 -HTT02 // -V0 -TT0 #T #HT0 #HTT2 +elim (tpr_inv_lift1 … HT0 … HT10) -T0 #T0 #HT0 #HT10 +elim (tpr_inv_lift1 … HTT2 … HXTT2) -TT2 #TT2 #HTT2 #HXTT2 +lapply (lift_inj … HTT2 … HT0) -HTT2 #H destruct /2 width=3/ +qed. + +fact tpr_conf_tau_tau: + ∀V0,T0:term. ∀X2,T1. ( + ∀X0:term. ♯{X0} < ♯{V0} + ♯{T0} + 1 → + ∀X1,X2. X0 ➡ X1 → X0 ➡ X2 → + ∃∃X. X1 ➡ X & X2 ➡ X + ) → + T0 ➡ T1 → T0 ➡ X2 → + ∃∃X. T1 ➡ X & X2 ➡ X. +#V0 #T0 #X2 #T1 #IH #HT01 #HT02 +elim (IH … HT01 … HT02) -HT01 -HT02 -IH // /2 width=3/ +qed. + +(* Confluence ***************************************************************) + +(* Basic_1: was: pr0_confluence *) +theorem tpr_conf: ∀T0:term. ∀T1,T2. T0 ➡ T1 → T0 ➡ T2 → + ∃∃T. T1 ➡ T & T2 ➡ T. +#T0 @(f_ind … tw … T0) -T0 #n #IH * +[ #I #_ #X1 #X2 #H1 #H2 -n + >(tpr_inv_atom1 … H1) -X1 + >(tpr_inv_atom1 … H2) -X2 +(* case 1: atom, atom *) + // +| * [ #a ] #I #V0 #T0 #Hn #X1 #X2 #H1 #H2 + [ elim (tpr_inv_bind1 … H1) -H1 * + [ #V1 #T1 #U1 #HV01 #HT01 #HTU1 #H1 + | #T1 #HT01 #HXT1 #H11 #H12 + ] + elim (tpr_inv_bind1 … H2) -H2 * + [1,3: #V2 #T2 #U2 #HV02 #HT02 #HTU2 #H2 + |2,4: #T2 #HT02 #HXT2 #H21 #H22 + ] destruct +(* case 2: delta, delta *) + [ /3 width=11 by tpr_conf_delta_delta/ (**) (* /3 width=11/ is too slow *) +(* case 3: zeta, delta (repeated) *) + | @ex2_commute /3 width=10 by tpr_conf_delta_zeta/ +(* case 4: delta, zeta *) + | /3 width=10 by tpr_conf_delta_zeta/ (**) (* /3 width=10/ is too slow *) +(* case 5: zeta, zeta *) + | /3 width=9 by tpr_conf_zeta_zeta/ (**) (* /3 width=9/ is too slow *) + ] + | elim (tpr_inv_flat1 … H1) -H1 * + [ #V1 #T1 #HV01 #HT01 #H1 + | #b1 #V1 #W1 #U1 #T1 #HV01 #HUT1 #H11 #H12 #H13 + | #b1 #V1 #Y1 #W1 #Z1 #U1 #T1 #HV01 #HWZ1 #HUT1 #HVY1 #H11 #H12 #H13 + | #HX1 #H1 + ] + elim (tpr_inv_flat1 … H2) -H2 * + [1,5,9,13: #V2 #T2 #HV02 #HT02 #H2 + |2,6,10,14: #b2 #V2 #W2 #U2 #T2 #HV02 #HUT2 #H21 #H22 #H23 + |3,7,11,15: #b2 #V2 #Y2 #W2 #Z2 #U2 #T2 #HV02 #HWZ2 #HUT2 #HVY2 #H21 #H22 #H23 + |4,8,12,16: #HX2 #H2 + ] destruct +(* case 6: flat, flat *) + [ /3 width=7 by tpr_conf_flat_flat/ (**) (* /3 width=7/ is too slow *) +(* case 7: beta, flat (repeated) *) + | @ex2_commute /3 width=8 by tpr_conf_flat_beta/ +(* case 8: theta, flat (repeated) *) + | @ex2_commute /3 width=11 by tpr_conf_flat_theta/ +(* case 9: tau, flat (repeated) *) + | @ex2_commute /3 width=6 by tpr_conf_flat_cast/ +(* case 10: flat, beta *) + | /3 width=8 by tpr_conf_flat_beta/ (**) (* /3 width=8/ is too slow *) +(* case 11: beta, beta *) + | /3 width=8 by tpr_conf_beta_beta/ (**) (* /3 width=8/ is too slow *) +(* case 12: flat, theta *) + | /3 width=11 by tpr_conf_flat_theta/ (**) (* /3 width=11/ is too slow *) +(* case 13: theta, theta *) + | /3 width=14 by tpr_conf_theta_theta/ (**) (* /3 width=14/ is too slow *) +(* case 14: flat, tau *) + | /3 width=6 by tpr_conf_flat_cast/ (**) (* /3 width=6/ is too slow *) +(* case 15: tau, tau *) + | /3 width=5 by tpr_conf_tau_tau/ + ] + ] +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tprs.etc new file mode 100644 index 000000000..492b39041 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tprs.etc @@ -0,0 +1,94 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( T1 ➡ * break term 46 T2 )" + non associative with precedence 45 + for @{ 'PRedStar $T1 $T2 }. + +include "basic_2/reducibility/tpr.ma". + +(* CONTEXT-FREE PARALLEL COMPUTATION ON TERMS *******************************) + +(* Basic_1: includes: pr1_pr0 *) +definition tprs: relation term ≝ TC … tpr. + +interpretation "context-free parallel computation (term)" + 'PRedStar T1 T2 = (tprs T1 T2). + +(* Basic eliminators ********************************************************) + +lemma tprs_ind: ∀T1. ∀R:predicate term. R T1 → + (∀T,T2. T1 ➡* T → T ➡ T2 → R T → R T2) → + ∀T2. T1 ➡* T2 → R T2. +#T1 #R #HT1 #IHT1 #T2 #HT12 +@(TC_star_ind … HT1 IHT1 … HT12) // +qed-. + +lemma tprs_ind_dx: ∀T2. ∀R:predicate term. R T2 → + (∀T1,T. T1 ➡ T → T ➡* T2 → R T → R T1) → + ∀T1. T1 ➡* T2 → R T1. +#T2 #R #HT2 #IHT2 #T1 #HT12 +@(TC_star_ind_dx … HT2 IHT2 … HT12) // +qed-. + +(* Basic properties *********************************************************) + +lemma tprs_refl: reflexive … tprs. +/2 width=1/ qed. + +lemma tpr_tprs: ∀T1,T2. T1 ➡ T2 → T2 ➡* T2. +/2 width=1/ qed. + +lemma tprs_strap1: ∀T1,T,T2. T1 ➡* T → T ➡ T2 → T1 ➡* T2. +/2 width=3/ qed. + +lemma tprs_strap2: ∀T1,T,T2. T1 ➡ T → T ➡* T2 → T1 ➡* T2. +/2 width=3/ qed. + +(* Basic_1: was only: pr1_head_1 *) +lemma tprs_pair_sn: ∀I,T1,T2. T1 ➡ T2 → ∀V1,V2. V1 ➡* V2 → + ②{I} V1. T1 ➡* ②{I} V2. T2. +* [ #a ] #I #T1 #T2 #HT12 #V1 #V2 #H @(tprs_ind … H) -V2 +[1,3: /3 width=1/ +|2,4: #V #V2 #_ #HV2 #IHV1 + @(tprs_strap1 … IHV1) -IHV1 /2 width=1/ +] +qed. + +(* Basic_1: was only: pr1_head_2 *) +lemma tprs_pair_dx: ∀I,V1,V2. V1 ➡ V2 → ∀T1,T2. T1 ➡* T2 → + ②{I} V1. T1 ➡* ②{I} V2. T2. +* [ #a ] #I #V1 #V2 #HV12 #T1 #T2 #H @(tprs_ind … H) -T2 +[1,3: /3 width=1/ +|2,4: #T #T2 #_ #HT2 #IHT1 + @(tprs_strap1 … IHT1) -IHT1 /2 width=1/ +] +qed. + +(* Basic inversion lemmas ***************************************************) + +lemma tprs_inv_atom1: ∀U2,k. ⋆k ➡* U2 → U2 = ⋆k. +#U2 #k #H @(tprs_ind … H) -U2 // +#U #U2 #_ #HU2 #IHU1 destruct +>(tpr_inv_atom1 … HU2) -HU2 // +qed-. + +lemma tprs_inv_cast1: ∀W1,T1,U2. ⓝW1.T1 ➡* U2 → T1 ➡* U2 ∨ + ∃∃W2,T2. W1 ➡* W2 & T1 ➡* T2 & U2 = ⓝW2.T2. +#W1 #T1 #U2 #H @(tprs_ind … H) -U2 /3 width=5/ +#U #U2 #_ #HU2 * /3 width=3/ * +#W #T #HW1 #HT1 #H destruct +elim (tpr_inv_cast1 … HU2) -HU2 /3 width=3/ * +#W2 #T2 #HW2 #HT2 #H destruct /4 width=5/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tprs_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tprs_lift.etc new file mode 100644 index 000000000..d0d173470 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tprs_lift.etc @@ -0,0 +1,43 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/tpr_lift.ma". +include "basic_2/computation/tprs.ma". + +(* CONTEXT-FREE PARALLEL COMPUTATION ON TERMS *******************************) + +(* Advanced inversion lemmas ************************************************) + +lemma tprs_inv_abst1: ∀a,V1,T1,U2. ⓛ{a}V1. T1 ➡* U2 → + ∃∃V2,T2. V1 ➡* V2 & T1 ➡* T2 & U2 = ⓛ{a}V2. T2. +#a #V1 #T1 #U2 #H @(tprs_ind … H) -U2 /2 width=5/ +#U #U2 #_ #HU2 * #V #T #HV1 #HT1 #H destruct +elim (tpr_inv_abst1 … HU2) -HU2 #V2 #T2 #HV2 #HT2 #H destruct /3 width=5/ +qed-. + +lemma tprs_inv_abst: ∀a,V1,V2,T1,T2. ⓛ{a}V1. T1 ➡* ⓛ{a}V2. T2 → + V1 ➡* V2 ∧ T1 ➡* T2. +#a #V1 #V2 #T1 #T2 #H +elim (tprs_inv_abst1 … H) -H #V #T #HV1 #HT1 #H destruct /2 width=1/ +qed-. + +(* Relocation properties ****************************************************) + +(* Note: this was missing in basic_1 *) +lemma tprs_lift: t_liftable tprs. +/3 width=7/ qed. + +(* Note: this was missing in basic_1 *) +lemma tprs_inv_lift1: t_deliftable_sn tprs. +/3 width=3 by tpr_inv_lift1, t_deliftable_sn_TC/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tprs_tprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tprs_tprs.etc new file mode 100644 index 000000000..87a4a71ab --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tprs_tprs.etc @@ -0,0 +1,43 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/tpr_tpr.ma". +include "basic_2/computation/tprs.ma". + +(* CONTEXT-FREE PARALLEL COMPUTATION ON TERMS *******************************) + +(* Advanced properties ******************************************************) + +(* Basic_1: was: pr1_strip *) +lemma tprs_strip: ∀T1,T. T ➡* T1 → ∀T2. T ➡ T2 → + ∃∃T0. T1 ➡ T0 & T2 ➡* T0. +/3 width=3 by TC_strip1, tpr_conf/ qed. + +(* Main propertis ***********************************************************) + +(* Basic_1: was: pr1_confluence *) +theorem tprs_conf: confluent … tprs. +/3 width=3/ qed. + +(* Basic_1: was: pr1_t *) +theorem tprs_trans: Transitive … tprs. +/2 width=3/ qed. + +(* Basic_1: was: pr1_comp *) +lemma tprs_pair: ∀I,V1,V2. V1 ➡* V2 → ∀T1,T2. T1 ➡* T2 → + ②{I} V1. T1 ➡* ②{I} V2. T2. +#I #V1 #V2 #H @(tprs_ind … H) -V2 /2 width=1/ +#V #V2 #_ #HV2 #IHV1 #T1 #T2 #HT12 +@(tprs_trans … (②{I}V.T2)) /2 width=1/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tps.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tps.etc new file mode 100644 index 000000000..7d89243d5 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tps.etc @@ -0,0 +1,288 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( L ⊢ break term 46 T1 break ▶ [ term 46 d , break term 46 e ] break term 46 T2 )" + non associative with precedence 45 + for @{ 'PSubst $L $T1 $d $e $T2 }. + +include "basic_2/substitution/ldrop_append.ma". + +(* PARALLEL SUBSTITUTION ON TERMS *******************************************) + +inductive tps: nat → nat → lenv → relation term ≝ +| tps_atom : ∀L,I,d,e. tps d e L (⓪{I}) (⓪{I}) +| tps_subst: ∀L,K,V,W,i,d,e. d ≤ i → i < d + e → + ⇩[0, i] L ≡ K. ⓓV → ⇧[0, i + 1] V ≡ W → tps d e L (#i) W +| tps_bind : ∀L,a,I,V1,V2,T1,T2,d,e. + tps d e L V1 V2 → tps (d + 1) e (L. ⓑ{I} V2) T1 T2 → + tps d e L (ⓑ{a,I} V1. T1) (ⓑ{a,I} V2. T2) +| tps_flat : ∀L,I,V1,V2,T1,T2,d,e. + tps d e L V1 V2 → tps d e L T1 T2 → + tps d e L (ⓕ{I} V1. T1) (ⓕ{I} V2. T2) +. + +interpretation "parallel substritution (term)" + 'PSubst L T1 d e T2 = (tps d e L T1 T2). + +(* Basic properties *********************************************************) + +lemma tps_lsubr_trans: ∀L1,T1,T2,d,e. L1 ⊢ T1 ▶ [d, e] T2 → + ∀L2. L2 ⊑ [d, e] L1 → L2 ⊢ T1 ▶ [d, e] T2. +#L1 #T1 #T2 #d #e #H elim H -L1 -T1 -T2 -d -e +[ // +| #L1 #K1 #V #W #i #d #e #Hdi #Hide #HLK1 #HVW #L2 #HL12 + elim (ldrop_lsubr_ldrop2_abbr … HL12 … HLK1 ? ?) -HL12 -HLK1 // /2 width=4/ +| /4 width=1/ +| /3 width=1/ +] +qed. + +lemma tps_refl: ∀T,L,d,e. L ⊢ T ▶ [d, e] T. +#T elim T -T // +#I elim I -I /2 width=1/ +qed. + +(* Basic_1: was: subst1_ex *) +lemma tps_full: ∀K,V,T1,L,d. ⇩[0, d] L ≡ (K. ⓓV) → + ∃∃T2,T. L ⊢ T1 ▶ [d, 1] T2 & ⇧[d, 1] T ≡ T2. +#K #V #T1 elim T1 -T1 +[ * #i #L #d #HLK /2 width=4/ + elim (lt_or_eq_or_gt i d) #Hid /3 width=4/ + destruct + elim (lift_total V 0 (i+1)) #W #HVW + elim (lift_split … HVW i i ? ? ?) // /3 width=4/ +| * [ #a ] #I #W1 #U1 #IHW1 #IHU1 #L #d #HLK + elim (IHW1 … HLK) -IHW1 #W2 #W #HW12 #HW2 + [ elim (IHU1 (L. ⓑ{I} W2) (d+1) ?) -IHU1 /2 width=1/ -HLK /3 width=9/ + | elim (IHU1 … HLK) -IHU1 -HLK /3 width=8/ + ] +] +qed. + +lemma tps_weak: ∀L,T1,T2,d1,e1. L ⊢ T1 ▶ [d1, e1] T2 → + ∀d2,e2. d2 ≤ d1 → d1 + e1 ≤ d2 + e2 → + L ⊢ T1 ▶ [d2, e2] T2. +#L #T1 #T2 #d1 #e1 #H elim H -L -T1 -T2 -d1 -e1 +[ // +| #L #K #V #W #i #d1 #e1 #Hid1 #Hide1 #HLK #HVW #d2 #e2 #Hd12 #Hde12 + lapply (transitive_le … Hd12 … Hid1) -Hd12 -Hid1 #Hid2 + lapply (lt_to_le_to_lt … Hide1 … Hde12) -Hide1 /2 width=4/ +| /4 width=3/ +| /4 width=1/ +] +qed. + +lemma tps_weak_top: ∀L,T1,T2,d,e. + L ⊢ T1 ▶ [d, e] T2 → L ⊢ T1 ▶ [d, |L| - d] T2. +#L #T1 #T2 #d #e #H elim H -L -T1 -T2 -d -e +[ // +| #L #K #V #W #i #d #e #Hdi #_ #HLK #HVW + lapply (ldrop_fwd_ldrop2_length … HLK) #Hi + lapply (le_to_lt_to_lt … Hdi Hi) /3 width=4/ +| normalize /2 width=1/ +| /2 width=1/ +] +qed. + +lemma tps_weak_full: ∀L,T1,T2,d,e. + L ⊢ T1 ▶ [d, e] T2 → L ⊢ T1 ▶ [0, |L|] T2. +#L #T1 #T2 #d #e #HT12 +lapply (tps_weak … HT12 0 (d + e) ? ?) -HT12 // #HT12 +lapply (tps_weak_top … HT12) // +qed. + +lemma tps_split_up: ∀L,T1,T2,d,e. L ⊢ T1 ▶ [d, e] T2 → ∀i. d ≤ i → i ≤ d + e → + ∃∃T. L ⊢ T1 ▶ [d, i - d] T & L ⊢ T ▶ [i, d + e - i] T2. +#L #T1 #T2 #d #e #H elim H -L -T1 -T2 -d -e +[ /2 width=3/ +| #L #K #V #W #i #d #e #Hdi #Hide #HLK #HVW #j #Hdj #Hjde + elim (lt_or_ge i j) + [ -Hide -Hjde + >(plus_minus_m_m j d) in ⊢ (% → ?); // -Hdj /3 width=4/ + | -Hdi -Hdj #Hij + lapply (plus_minus_m_m … Hjde) -Hjde /3 width=8/ + ] +| #L #a #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #i #Hdi #Hide + elim (IHV12 i ? ?) -IHV12 // #V #HV1 #HV2 + elim (IHT12 (i + 1) ? ?) -IHT12 /2 width=1/ + -Hdi -Hide >arith_c1x #T #HT1 #HT2 + lapply (tps_lsubr_trans … HT1 (L. ⓑ{I} V) ?) -HT1 /3 width=5/ +| #L #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #i #Hdi #Hide + elim (IHV12 i ? ?) -IHV12 // elim (IHT12 i ? ?) -IHT12 // + -Hdi -Hide /3 width=5/ +] +qed. + +lemma tps_split_down: ∀L,T1,T2,d,e. L ⊢ T1 ▶ [d, e] T2 → + ∀i. d ≤ i → i ≤ d + e → + ∃∃T. L ⊢ T1 ▶ [i, d + e - i] T & + L ⊢ T ▶ [d, i - d] T2. +#L #T1 #T2 #d #e #H elim H -L -T1 -T2 -d -e +[ /2 width=3/ +| #L #K #V #W #i #d #e #Hdi #Hide #HLK #HVW #j #Hdj #Hjde + elim (lt_or_ge i j) + [ -Hide -Hjde >(plus_minus_m_m j d) in ⊢ (% → ?); // -Hdj /3 width=8/ + | -Hdi -Hdj + >(plus_minus_m_m (d+e) j) in Hide; // -Hjde /3 width=4/ + ] +| #L #a #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #i #Hdi #Hide + elim (IHV12 i ? ?) -IHV12 // #V #HV1 #HV2 + elim (IHT12 (i + 1) ? ?) -IHT12 /2 width=1/ + -Hdi -Hide >arith_c1x #T #HT1 #HT2 + lapply (tps_lsubr_trans … HT1 (L. ⓑ{I} V) ?) -HT1 /3 width=5/ +| #L #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #i #Hdi #Hide + elim (IHV12 i ? ?) -IHV12 // elim (IHT12 i ? ?) -IHT12 // + -Hdi -Hide /3 width=5/ +] +qed. + +lemma tps_append: ∀K,T1,T2,d,e. K ⊢ T1 ▶ [d, e] T2 → + ∀L. L @@ K ⊢ T1 ▶ [d, e] T2. +#K #T1 #T2 #d #e #H elim H -K -T1 -T2 -d -e // /2 width=1/ +#K #K0 #V #W #i #d #e #Hdi #Hide #HK0 #HVW #L +lapply (ldrop_fwd_ldrop2_length … HK0) #H +@(tps_subst … (L@@K0) … HVW) // (**) (* /3/ does not work *) +@(ldrop_O1_append_sn_le … HK0) /2 width=2/ +qed. + +(* Basic inversion lemmas ***************************************************) + +fact tps_inv_atom1_aux: ∀L,T1,T2,d,e. L ⊢ T1 ▶ [d, e] T2 → ∀I. T1 = ⓪{I} → + T2 = ⓪{I} ∨ + ∃∃K,V,i. d ≤ i & i < d + e & + ⇩[O, i] L ≡ K. ⓓV & + ⇧[O, i + 1] V ≡ T2 & + I = LRef i. +#L #T1 #T2 #d #e * -L -T1 -T2 -d -e +[ #L #I #d #e #J #H destruct /2 width=1/ +| #L #K #V #T2 #i #d #e #Hdi #Hide #HLK #HVT2 #I #H destruct /3 width=8/ +| #L #a #I #V1 #V2 #T1 #T2 #d #e #_ #_ #J #H destruct +| #L #I #V1 #V2 #T1 #T2 #d #e #_ #_ #J #H destruct +] +qed. + +lemma tps_inv_atom1: ∀L,T2,I,d,e. L ⊢ ⓪{I} ▶ [d, e] T2 → + T2 = ⓪{I} ∨ + ∃∃K,V,i. d ≤ i & i < d + e & + ⇩[O, i] L ≡ K. ⓓV & + ⇧[O, i + 1] V ≡ T2 & + I = LRef i. +/2 width=3/ qed-. + + +(* Basic_1: was: subst1_gen_sort *) +lemma tps_inv_sort1: ∀L,T2,k,d,e. L ⊢ ⋆k ▶ [d, e] T2 → T2 = ⋆k. +#L #T2 #k #d #e #H +elim (tps_inv_atom1 … H) -H // +* #K #V #i #_ #_ #_ #_ #H destruct +qed-. + +(* Basic_1: was: subst1_gen_lref *) +lemma tps_inv_lref1: ∀L,T2,i,d,e. L ⊢ #i ▶ [d, e] T2 → + T2 = #i ∨ + ∃∃K,V. d ≤ i & i < d + e & + ⇩[O, i] L ≡ K. ⓓV & + ⇧[O, i + 1] V ≡ T2. +#L #T2 #i #d #e #H +elim (tps_inv_atom1 … H) -H /2 width=1/ +* #K #V #j #Hdj #Hjde #HLK #HVT2 #H destruct /3 width=4/ +qed-. + +lemma tps_inv_gref1: ∀L,T2,p,d,e. L ⊢ §p ▶ [d, e] T2 → T2 = §p. +#L #T2 #p #d #e #H +elim (tps_inv_atom1 … H) -H // +* #K #V #i #_ #_ #_ #_ #H destruct +qed-. + +fact tps_inv_bind1_aux: ∀d,e,L,U1,U2. L ⊢ U1 ▶ [d, e] U2 → + ∀a,I,V1,T1. U1 = ⓑ{a,I} V1. T1 → + ∃∃V2,T2. L ⊢ V1 ▶ [d, e] V2 & + L. ⓑ{I} V2 ⊢ T1 ▶ [d + 1, e] T2 & + U2 = ⓑ{a,I} V2. T2. +#d #e #L #U1 #U2 * -d -e -L -U1 -U2 +[ #L #k #d #e #a #I #V1 #T1 #H destruct +| #L #K #V #W #i #d #e #_ #_ #_ #_ #a #I #V1 #T1 #H destruct +| #L #b #J #V1 #V2 #T1 #T2 #d #e #HV12 #HT12 #a #I #V #T #H destruct /2 width=5/ +| #L #J #V1 #V2 #T1 #T2 #d #e #_ #_ #a #I #V #T #H destruct +] +qed. + +lemma tps_inv_bind1: ∀d,e,L,a,I,V1,T1,U2. L ⊢ ⓑ{a,I} V1. T1 ▶ [d, e] U2 → + ∃∃V2,T2. L ⊢ V1 ▶ [d, e] V2 & + L. ⓑ{I} V2 ⊢ T1 ▶ [d + 1, e] T2 & + U2 = ⓑ{a,I} V2. T2. +/2 width=3/ qed-. + +fact tps_inv_flat1_aux: ∀d,e,L,U1,U2. L ⊢ U1 ▶ [d, e] U2 → + ∀I,V1,T1. U1 = ⓕ{I} V1. T1 → + ∃∃V2,T2. L ⊢ V1 ▶ [d, e] V2 & L ⊢ T1 ▶ [d, e] T2 & + U2 = ⓕ{I} V2. T2. +#d #e #L #U1 #U2 * -d -e -L -U1 -U2 +[ #L #k #d #e #I #V1 #T1 #H destruct +| #L #K #V #W #i #d #e #_ #_ #_ #_ #I #V1 #T1 #H destruct +| #L #a #J #V1 #V2 #T1 #T2 #d #e #_ #_ #I #V #T #H destruct +| #L #J #V1 #V2 #T1 #T2 #d #e #HV12 #HT12 #I #V #T #H destruct /2 width=5/ +] +qed. + +lemma tps_inv_flat1: ∀d,e,L,I,V1,T1,U2. L ⊢ ⓕ{I} V1. T1 ▶ [d, e] U2 → + ∃∃V2,T2. L ⊢ V1 ▶ [d, e] V2 & L ⊢ T1 ▶ [d, e] T2 & + U2 = ⓕ{I} V2. T2. +/2 width=3/ qed-. + +fact tps_inv_refl_O2_aux: ∀L,T1,T2,d,e. L ⊢ T1 ▶ [d, e] T2 → e = 0 → T1 = T2. +#L #T1 #T2 #d #e #H elim H -L -T1 -T2 -d -e +[ // +| #L #K #V #W #i #d #e #Hdi #Hide #_ #_ #H destruct + lapply (le_to_lt_to_lt … Hdi … Hide) -Hdi -Hide shift_append_assoc normalize #H + elim (tps_inv_bind1 … H) -H + #V0 #T0 #_ #HT10 #H destruct + elim (IH … HT10) -IH -HT10 #L2 #T2 #HL12 #H destruct + >append_length >HL12 -HL12 + @(ex2_2_intro … (⋆.ⓑ{I}V0@@L2) T2) [ >append_length ] // /2 width=3/ (**) (* explicit constructor *) +] +qed-. + +(* Basic_1: removed theorems 25: + subst0_gen_sort subst0_gen_lref subst0_gen_head subst0_gen_lift_lt + subst0_gen_lift_false subst0_gen_lift_ge subst0_refl subst0_trans + subst0_lift_lt subst0_lift_ge subst0_lift_ge_S subst0_lift_ge_s + subst0_subst0 subst0_subst0_back subst0_weight_le subst0_weight_lt + subst0_confluence_neq subst0_confluence_eq subst0_tlt_head + subst0_confluence_lift subst0_tlt + subst1_head subst1_gen_head subst1_lift_S subst1_confluence_lift +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tps_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tps_lift.etc new file mode 100644 index 000000000..1d65d8d63 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tps_lift.etc @@ -0,0 +1,294 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/ldrop_ldrop.ma". +include "basic_2/substitution/tps.ma". + +(* PARTIAL SUBSTITUTION ON TERMS ********************************************) + +(* Advanced inversion lemmas ************************************************) + +fact tps_inv_S2_aux: ∀L,T1,T2,d,e1. L ⊢ T1 ▶ [d, e1] T2 → ∀e2. e1 = e2 + 1 → + ∀K,V. ⇩[0, d] L ≡ K. ⓛV → L ⊢ T1 ▶ [d + 1, e2] T2. +#L #T1 #T2 #d #e1 #H elim H -L -T1 -T2 -d -e1 +[ // +| #L #K0 #V0 #W #i #d #e1 #Hdi #Hide1 #HLK0 #HV0 #e2 #He12 #K #V #HLK destruct + elim (lt_or_ge i (d+1)) #HiSd + [ -Hide1 -HV0 + lapply (le_to_le_to_eq … Hdi ?) /2 width=1/ #H destruct + lapply (ldrop_mono … HLK0 … HLK) #H destruct + | -V -Hdi /2 width=4/ + ] +| /4 width=3/ +| /3 width=3/ +] +qed. + +lemma tps_inv_S2: ∀L,T1,T2,d,e. L ⊢ T1 ▶ [d, e + 1] T2 → + ∀K,V. ⇩[0, d] L ≡ K. ⓛV → L ⊢ T1 ▶ [d + 1, e] T2. +/2 width=3/ qed-. + +lemma tps_inv_refl_SO2: ∀L,T1,T2,d. L ⊢ T1 ▶ [d, 1] T2 → + ∀K,V. ⇩[0, d] L ≡ K. ⓛV → T1 = T2. +#L #T1 #T2 #d #HT12 #K #V #HLK +lapply (tps_inv_S2 … T1 T2 … 0 … HLK) -K // -HT12 #HT12 +lapply (tps_inv_refl_O2 … HT12) -HT12 // +qed-. + +(* Relocation properties ****************************************************) + +(* Basic_1: was: subst1_lift_lt *) +lemma tps_lift_le: ∀K,T1,T2,dt,et. K ⊢ T1 ▶ [dt, et] T2 → + ∀L,U1,U2,d,e. ⇩[d, e] L ≡ K → + ⇧[d, e] T1 ≡ U1 → ⇧[d, e] T2 ≡ U2 → + dt + et ≤ d → + L ⊢ U1 ▶ [dt, et] U2. +#K #T1 #T2 #dt #et #H elim H -K -T1 -T2 -dt -et +[ #K #I #dt #et #L #U1 #U2 #d #e #_ #H1 #H2 #_ + >(lift_mono … H1 … H2) -H1 -H2 // +| #K #KV #V #W #i #dt #et #Hdti #Hidet #HKV #HVW #L #U1 #U2 #d #e #HLK #H #HWU2 #Hdetd + lapply (lt_to_le_to_lt … Hidet … Hdetd) -Hdetd #Hid + lapply (lift_inv_lref1_lt … H … Hid) -H #H destruct + elim (lift_trans_ge … HVW … HWU2 ?) -W // (lift_mono … HVY … HVW) -Y -HVW #H destruct /2 width=4/ +| #K #a #I #V1 #V2 #T1 #T2 #dt #et #_ #_ #IHV12 #IHT12 #L #U1 #U2 #d #e #HLK #H1 #H2 #Hdetd + elim (lift_inv_bind1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 + elim (lift_inv_bind1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct + @tps_bind [ /2 width=6/ | @IHT12 /2 width=6/ ] (**) (* /3 width=6/ is too slow, arith3 needed to avoid crash *) +| #K #I #V1 #V2 #T1 #T2 #dt #et #_ #_ #IHV12 #IHT12 #L #U1 #U2 #d #e #HLK #H1 #H2 #Hdetd + elim (lift_inv_flat1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 + elim (lift_inv_flat1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /3 width=6/ +] +qed. + +lemma tps_lift_be: ∀K,T1,T2,dt,et. K ⊢ T1 ▶ [dt, et] T2 → + ∀L,U1,U2,d,e. ⇩[d, e] L ≡ K → + ⇧[d, e] T1 ≡ U1 → ⇧[d, e] T2 ≡ U2 → + dt ≤ d → d ≤ dt + et → + L ⊢ U1 ▶ [dt, et + e] U2. +#K #T1 #T2 #dt #et #H elim H -K -T1 -T2 -dt -et +[ #K #I #dt #et #L #U1 #U2 #d #e #_ #H1 #H2 #_ #_ + >(lift_mono … H1 … H2) -H1 -H2 // +| #K #KV #V #W #i #dt #et #Hdti #Hidet #HKV #HVW #L #U1 #U2 #d #e #HLK #H #HWU2 #Hdtd #_ + elim (lift_inv_lref1 … H) -H * #Hid #H destruct + [ -Hdtd + lapply (lt_to_le_to_lt … (dt+et+e) Hidet ?) // -Hidet #Hidete + elim (lift_trans_ge … HVW … HWU2 ?) -W // (lift_mono … HVY … HVW) -V #H destruct /2 width=4/ + | -Hdti + lapply (transitive_le … Hdtd Hid) -Hdtd #Hdti + lapply (lift_trans_be … HVW … HWU2 ? ?) -W // /2 width=1/ >plus_plus_comm_23 #HVU2 + lapply (ldrop_trans_ge_comm … HLK … HKV ?) -K // -Hid /3 width=4/ + ] +| #K #a #I #V1 #V2 #T1 #T2 #dt #et #_ #_ #IHV12 #IHT12 #L #U1 #U2 #d #e #HLK #H1 #H2 #Hdtd #Hddet + elim (lift_inv_bind1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 + elim (lift_inv_bind1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct + @tps_bind [ /2 width=6/ | @IHT12 [3,4: // | skip |5,6: /2 width=1/ | /2 width=1/ ] + ] (**) (* /3 width=6/ is too slow, simplification like tps_lift_le is too slow *) +| #K #I #V1 #V2 #T1 #T2 #dt #et #_ #_ #IHV12 #IHT12 #L #U1 #U2 #d #e #HLK #H1 #H2 #Hdetd + elim (lift_inv_flat1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 + elim (lift_inv_flat1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /3 width=6/ +] +qed. + +(* Basic_1: was: subst1_lift_ge *) +lemma tps_lift_ge: ∀K,T1,T2,dt,et. K ⊢ T1 ▶ [dt, et] T2 → + ∀L,U1,U2,d,e. ⇩[d, e] L ≡ K → + ⇧[d, e] T1 ≡ U1 → ⇧[d, e] T2 ≡ U2 → + d ≤ dt → + L ⊢ U1 ▶ [dt + e, et] U2. +#K #T1 #T2 #dt #et #H elim H -K -T1 -T2 -dt -et +[ #K #I #dt #et #L #U1 #U2 #d #e #_ #H1 #H2 #_ + >(lift_mono … H1 … H2) -H1 -H2 // +| #K #KV #V #W #i #dt #et #Hdti #Hidet #HKV #HVW #L #U1 #U2 #d #e #HLK #H #HWU2 #Hddt + lapply (transitive_le … Hddt … Hdti) -Hddt #Hid + lapply (lift_inv_lref1_ge … H … Hid) -H #H destruct + lapply (lift_trans_be … HVW … HWU2 ? ?) -W // /2 width=1/ >plus_plus_comm_23 #HVU2 + lapply (ldrop_trans_ge_comm … HLK … HKV ?) -K // -Hid /3 width=4/ +| #K #a #I #V1 #V2 #T1 #T2 #dt #et #_ #_ #IHV12 #IHT12 #L #U1 #U2 #d #e #HLK #H1 #H2 #Hddt + elim (lift_inv_bind1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 + elim (lift_inv_bind1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct + @tps_bind [ /2 width=5/ | /3 width=5/ ] (**) (* explicit constructor *) +| #K #I #V1 #V2 #T1 #T2 #dt #et #_ #_ #IHV12 #IHT12 #L #U1 #U2 #d #e #HLK #H1 #H2 #Hddt + elim (lift_inv_flat1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 + elim (lift_inv_flat1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /3 width=5/ +] +qed. + +(* Basic_1: was: subst1_gen_lift_lt *) +lemma tps_inv_lift1_le: ∀L,U1,U2,dt,et. L ⊢ U1 ▶ [dt, et] U2 → + ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → + dt + et ≤ d → + ∃∃T2. K ⊢ T1 ▶ [dt, et] T2 & ⇧[d, e] T2 ≡ U2. +#L #U1 #U2 #dt #et #H elim H -L -U1 -U2 -dt -et +[ #L * #i #dt #et #K #d #e #_ #T1 #H #_ + [ lapply (lift_inv_sort2 … H) -H #H destruct /2 width=3/ + | elim (lift_inv_lref2 … H) -H * #Hid #H destruct /3 width=3/ + | lapply (lift_inv_gref2 … H) -H #H destruct /2 width=3/ + ] +| #L #KV #V #W #i #dt #et #Hdti #Hidet #HLKV #HVW #K #d #e #HLK #T1 #H #Hdetd + lapply (lt_to_le_to_lt … Hidet … Hdetd) -Hdetd #Hid + lapply (lift_inv_lref2_lt … H … Hid) -H #H destruct + elim (ldrop_conf_lt … HLK … HLKV ?) -L // #L #U #HKL #_ #HUV + elim (lift_trans_le … HUV … HVW ?) -V // >minus_plus minus_plus plus_minus // commutative_plus >plus_minus // /2 width=1/ ] ] (**) (* explicit constructor, uses monotonic_lt_minus_l *) + ] +| #L #a #I #V1 #V2 #U1 #U2 #dt #et #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H #Hdtd #Hdedet + elim (lift_inv_bind2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct + elim (IHV12 … HLK … HWV1 ? ?) -V1 // #W2 #HW12 #HWV2 + elim (IHU12 … HTU1 ? ?) -U1 [5: @ldrop_skip // |2: skip |3: >plus_plus_comm_23 >(plus_plus_comm_23 dt) /2 width=1/ |4: /2 width=1/ ] (**) (* 29s without the rewrites *) + /3 width=5/ +| #L #I #V1 #V2 #U1 #U2 #dt #et #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H #Hdtd #Hdedet + elim (lift_inv_flat2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct + elim (IHV12 … HLK … HWV1 ? ?) -V1 // + elim (IHU12 … HLK … HTU1 ? ?) -U1 -HLK // /3 width=5/ +] +qed. + +(* Basic_1: was: subst1_gen_lift_ge *) +lemma tps_inv_lift1_ge: ∀L,U1,U2,dt,et. L ⊢ U1 ▶ [dt, et] U2 → + ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → + d + e ≤ dt → + ∃∃T2. K ⊢ T1 ▶ [dt - e, et] T2 & ⇧[d, e] T2 ≡ U2. +#L #U1 #U2 #dt #et #H elim H -L -U1 -U2 -dt -et +[ #L * #i #dt #et #K #d #e #_ #T1 #H #_ + [ lapply (lift_inv_sort2 … H) -H #H destruct /2 width=3/ + | elim (lift_inv_lref2 … H) -H * #Hid #H destruct /3 width=3/ + | lapply (lift_inv_gref2 … H) -H #H destruct /2 width=3/ + ] +| #L #KV #V #W #i #dt #et #Hdti #Hidet #HLKV #HVW #K #d #e #HLK #T1 #H #Hdedt + lapply (transitive_le … Hdedt … Hdti) #Hdei + elim (le_inv_plus_l … Hdedt) -Hdedt #_ #Hedt + elim (le_inv_plus_l … Hdei) #Hdie #Hei + lapply (lift_inv_lref2_ge … H … Hdei) -H #H destruct + lapply (ldrop_conf_ge … HLK … HLKV ?) -L // #HKV + elim (lift_split … HVW d (i - e + 1) ? ? ?) -HVW [4: // |3: /2 width=1/ |2: /3 width=1/ ] -Hdei -Hdie + #V0 #HV10 >plus_minus // plus_minus // /2 width=1/ ] ] (**) (* explicit constructor, uses monotonic_lt_minus_l *) +| #L #a #I #V1 #V2 #U1 #U2 #dt #et #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H #Hdetd + elim (lift_inv_bind2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct + elim (le_inv_plus_l … Hdetd) #_ #Hedt + elim (IHV12 … HLK … HWV1 ?) -V1 // #W2 #HW12 #HWV2 + elim (IHU12 … HTU1 ?) -U1 [4: @ldrop_skip // |2: skip |3: /2 width=1/ ] + IHV12 // >IHT12 // +| #L #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #X #HX + elim (lift_inv_flat2 … HX) -HX #V #T #HV1 #HT1 #H destruct + >IHV12 // >IHT12 // +] +qed. +(* + Theorem subst0_gen_lift_rev_ge: (t1,v,u2,i,h,d:?) + (subst0 i v t1 (lift h d u2)) -> + (le (plus d h) i) -> + (EX u1 | (subst0 (minus i h) v u1 u2) & + t1 = (lift h d u1) + ). + + + Theorem subst0_gen_lift_rev_lelt: (t1,v,u2,i,h,d:?) + (subst0 i v t1 (lift h d u2)) -> + (le d i) -> (lt i (plus d h)) -> + (EX u1 | t1 = (lift (minus (plus d h) (S i)) (S i) u1)). +*) +lemma tps_inv_lift1_ge_up: ∀L,U1,U2,dt,et. L ⊢ U1 ▶ [dt, et] U2 → + ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → + d ≤ dt → dt ≤ d + e → d + e ≤ dt + et → + ∃∃T2. K ⊢ T1 ▶ [d, dt + et - (d + e)] T2 & ⇧[d, e] T2 ≡ U2. +#L #U1 #U2 #dt #et #HU12 #K #d #e #HLK #T1 #HTU1 #Hddt #Hdtde #Hdedet +elim (tps_split_up … HU12 (d + e) ? ?) -HU12 // -Hdedet #U #HU1 #HU2 +lapply (tps_weak … HU1 d e ? ?) -HU1 // [ >commutative_plus /2 width=1/ ] -Hddt -Hdtde #HU1 +lapply (tps_inv_lift1_eq … HU1 … HTU1) -HU1 #HU1 destruct +elim (tps_inv_lift1_ge … HU2 … HLK … HTU1 ?) -U -L // commutative_plus /2 width=1/ ] -Hdtd #T #HT1 #HTU +lapply (tps_weak … HU2 d e ? ?) -HU2 // [ >commutative_plus (lift_mono … HVT1 … HVT2) -HVT1 -HVT2 /2 width=3/ + ] +| #L #a #I #V0 #V1 #T0 #T1 #d1 #e1 #_ #_ #IHV01 #IHT01 #X #d2 #e2 #HX + elim (tps_inv_bind1 … HX) -HX #V2 #T2 #HV02 #HT02 #HX destruct + lapply (tps_lsubr_trans … HT02 (L. ⓑ{I} V1) ?) -HT02 /2 width=1/ #HT02 + elim (IHV01 … HV02) -V0 #V #HV1 #HV2 + elim (IHT01 … HT02) -T0 #T #HT1 #HT2 + lapply (tps_lsubr_trans … HT1 (L. ⓑ{I} V) ?) -HT1 /2 width=1/ + lapply (tps_lsubr_trans … HT2 (L. ⓑ{I} V) ?) -HT2 /3 width=5/ +| #L #I #V0 #V1 #T0 #T1 #d1 #e1 #_ #_ #IHV01 #IHT01 #X #d2 #e2 #HX + elim (tps_inv_flat1 … HX) -HX #V2 #T2 #HV02 #HT02 #HX destruct + elim (IHV01 … HV02) -V0 + elim (IHT01 … HT02) -T0 /3 width=5/ +] +qed. + +(* Basic_1: was: subst1_confluence_neq *) +theorem tps_conf_neq: ∀L1,T0,T1,d1,e1. L1 ⊢ T0 ▶ [d1, e1] T1 → + ∀L2,T2,d2,e2. L2 ⊢ T0 ▶ [d2, e2] T2 → + (d1 + e1 ≤ d2 ∨ d2 + e2 ≤ d1) → + ∃∃T. L2 ⊢ T1 ▶ [d2, e2] T & L1 ⊢ T2 ▶ [d1, e1] T. +#L1 #T0 #T1 #d1 #e1 #H elim H -L1 -T0 -T1 -d1 -e1 +[ /2 width=3/ +| #L1 #K1 #V1 #T1 #i0 #d1 #e1 #Hd1 #Hde1 #HLK1 #HVT1 #L2 #T2 #d2 #e2 #H1 #H2 + elim (tps_inv_lref1 … H1) -H1 + [ #H destruct /3 width=6/ + | -HLK1 -HVT1 * #K2 #V2 #Hd2 #Hde2 #_ #_ elim H2 -H2 #Hded + [ -Hd1 -Hde2 + lapply (transitive_le … Hded Hd2) -Hded -Hd2 #H + lapply (lt_to_le_to_lt … Hde1 H) -Hde1 -H #H + elim (lt_refl_false … H) + | -Hd2 -Hde1 + lapply (transitive_le … Hded Hd1) -Hded -Hd1 #H + lapply (lt_to_le_to_lt … Hde2 H) -Hde2 -H #H + elim (lt_refl_false … H) + ] + ] +| #L1 #a #I #V0 #V1 #T0 #T1 #d1 #e1 #_ #_ #IHV01 #IHT01 #L2 #X #d2 #e2 #HX #H + elim (tps_inv_bind1 … HX) -HX #V2 #T2 #HV02 #HT02 #HX destruct + elim (IHV01 … HV02 H) -V0 #V #HV1 #HV2 + elim (IHT01 … HT02 ?) -T0 + [ -H #T #HT1 #HT2 + lapply (tps_lsubr_trans … HT1 (L2. ⓑ{I} V) ?) -HT1 /2 width=1/ + lapply (tps_lsubr_trans … HT2 (L1. ⓑ{I} V) ?) -HT2 /2 width=1/ /3 width=5/ + | -HV1 -HV2 >plus_plus_comm_23 >plus_plus_comm_23 in ⊢ (? ? %); elim H -H #H + [ @or_introl | @or_intror ] /2 by monotonic_le_plus_l/ (**) (* /3 / is too slow *) + ] +| #L1 #I #V0 #V1 #T0 #T1 #d1 #e1 #_ #_ #IHV01 #IHT01 #L2 #X #d2 #e2 #HX #H + elim (tps_inv_flat1 … HX) -HX #V2 #T2 #HV02 #HT02 #HX destruct + elim (IHV01 … HV02 H) -V0 + elim (IHT01 … HT02 H) -T0 -H /3 width=5/ +] +qed. + +(* Note: the constant 1 comes from tps_subst *) +(* Basic_1: was: subst1_trans *) +theorem tps_trans_ge: ∀L,T1,T0,d,e. L ⊢ T1 ▶ [d, e] T0 → + ∀T2. L ⊢ T0 ▶ [d, 1] T2 → 1 ≤ e → + L ⊢ T1 ▶ [d, e] T2. +#L #T1 #T0 #d #e #H elim H -L -T1 -T0 -d -e +[ #L #I #d #e #T2 #H #He + elim (tps_inv_atom1 … H) -H + [ #H destruct // + | * #K #V #i #Hd2i #Hide2 #HLK #HVT2 #H destruct + lapply (lt_to_le_to_lt … (d + e) Hide2 ?) /2 width=4/ + ] +| #L #K #V #V2 #i #d #e #Hdi #Hide #HLK #HVW #T2 #HVT2 #He + lapply (tps_weak … HVT2 0 (i +1) ? ?) -HVT2 /2 width=1/ #HVT2 + <(tps_inv_lift1_eq … HVT2 … HVW) -HVT2 /2 width=4/ +| #L #a #I #V1 #V0 #T1 #T0 #d #e #_ #_ #IHV10 #IHT10 #X #H #He + elim (tps_inv_bind1 … H) -H #V2 #T2 #HV02 #HT02 #H destruct + lapply (tps_lsubr_trans … HT02 (L. ⓑ{I} V0) ?) -HT02 /2 width=1/ #HT02 + lapply (IHT10 … HT02 He) -T0 #HT12 + lapply (tps_lsubr_trans … HT12 (L. ⓑ{I} V2) ?) -HT12 /2 width=1/ /3 width=1/ +| #L #I #V1 #V0 #T1 #T0 #d #e #_ #_ #IHV10 #IHT10 #X #H #He + elim (tps_inv_flat1 … H) -H #V2 #T2 #HV02 #HT02 #H destruct /3 width=1/ +] +qed. + +theorem tps_trans_down: ∀L,T1,T0,d1,e1. L ⊢ T1 ▶ [d1, e1] T0 → + ∀T2,d2,e2. L ⊢ T0 ▶ [d2, e2] T2 → d2 + e2 ≤ d1 → + ∃∃T. L ⊢ T1 ▶ [d2, e2] T & L ⊢ T ▶ [d1, e1] T2. +#L #T1 #T0 #d1 #e1 #H elim H -L -T1 -T0 -d1 -e1 +[ /2 width=3/ +| #L #K #V #W #i1 #d1 #e1 #Hdi1 #Hide1 #HLK #HVW #T2 #d2 #e2 #HWT2 #Hde2d1 + lapply (transitive_le … Hde2d1 Hdi1) -Hde2d1 #Hde2i1 + lapply (tps_weak … HWT2 0 (i1 + 1) ? ?) -HWT2 normalize /2 width=1/ -Hde2i1 #HWT2 + <(tps_inv_lift1_eq … HWT2 … HVW) -HWT2 /3 width=8/ +| #L #a #I #V1 #V0 #T1 #T0 #d1 #e1 #_ #_ #IHV10 #IHT10 #X #d2 #e2 #HX #de2d1 + elim (tps_inv_bind1 … HX) -HX #V2 #T2 #HV02 #HT02 #HX destruct + lapply (tps_lsubr_trans … HT02 (L. ⓑ{I} V0) ?) -HT02 /2 width=1/ #HT02 + elim (IHV10 … HV02 ?) -IHV10 -HV02 // #V + elim (IHT10 … HT02 ?) -T0 /2 width=1/ #T #HT1 #HT2 + lapply (tps_lsubr_trans … HT1 (L. ⓑ{I} V) ?) -HT1 /2 width=1/ + lapply (tps_lsubr_trans … HT2 (L. ⓑ{I} V2) ?) -HT2 /2 width=1/ /3 width=6/ +| #L #I #V1 #V0 #T1 #T0 #d1 #e1 #_ #_ #IHV10 #IHT10 #X #d2 #e2 #HX #de2d1 + elim (tps_inv_flat1 … HX) -HX #V2 #T2 #HV02 #HT02 #HX destruct + elim (IHV10 … HV02 ?) -V0 // + elim (IHT10 … HT02 ?) -T0 // /3 width=6/ +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tpss.etc new file mode 100644 index 000000000..433718803 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tpss.etc @@ -0,0 +1,188 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( L ⊢ break term 46 T1 break ▶ * [ term 46 d , break term 46 e ] break term 46 T2 )" + non associative with precedence 45 + for @{ 'PSubstStar $L $T1 $d $e $T2 }. + +include "basic_2/substitution/tps.ma". + +(* PARTIAL UNFOLD ON TERMS **************************************************) + +definition tpss: nat → nat → lenv → relation term ≝ + λd,e,L. TC … (tps d e L). + +interpretation "partial unfold (term)" + 'PSubstStar L T1 d e T2 = (tpss d e L T1 T2). + +(* Basic eliminators ********************************************************) + +lemma tpss_ind: ∀d,e,L,T1. ∀R:predicate term. R T1 → + (∀T,T2. L ⊢ T1 ▶* [d, e] T → L ⊢ T ▶ [d, e] T2 → R T → R T2) → + ∀T2. L ⊢ T1 ▶* [d, e] T2 → R T2. +#d #e #L #T1 #R #HT1 #IHT1 #T2 #HT12 +@(TC_star_ind … HT1 IHT1 … HT12) // +qed-. + +lemma tpss_ind_dx: ∀d,e,L,T2. ∀R:predicate term. R T2 → + (∀T1,T. L ⊢ T1 ▶ [d, e] T → L ⊢ T ▶* [d, e] T2 → R T → R T1) → + ∀T1. L ⊢ T1 ▶* [d, e] T2 → R T1. +#d #e #L #T2 #R #HT2 #IHT2 #T1 #HT12 +@(TC_star_ind_dx … HT2 IHT2 … HT12) // +qed-. + +(* Basic properties *********************************************************) + +lemma tps_tpss: ∀L,T1,T2,d,e. L ⊢ T1 ▶ [d, e] T2 → L ⊢ T1 ▶* [d, e] T2. +/2 width=1/ qed. + +lemma tpss_strap1: ∀L,T1,T,T2,d,e. + L ⊢ T1 ▶* [d, e] T → L ⊢ T ▶ [d, e] T2 → L ⊢ T1 ▶* [d, e] T2. +/2 width=3/ qed. + +lemma tpss_strap2: ∀L,T1,T,T2,d,e. + L ⊢ T1 ▶ [d, e] T → L ⊢ T ▶* [d, e] T2 → L ⊢ T1 ▶* [d, e] T2. +/2 width=3/ qed. + +lemma tpss_lsubr_trans: ∀L1,T1,T2,d,e. L1 ⊢ T1 ▶* [d, e] T2 → + ∀L2. L2 ⊑ [d, e] L1 → L2 ⊢ T1 ▶* [d, e] T2. +/3 width=3/ qed. + +lemma tpss_refl: ∀d,e,L,T. L ⊢ T ▶* [d, e] T. +/2 width=1/ qed. + +lemma tpss_bind: ∀L,V1,V2,d,e. L ⊢ V1 ▶* [d, e] V2 → + ∀a,I,T1,T2. L. ⓑ{I} V2 ⊢ T1 ▶* [d + 1, e] T2 → + L ⊢ ⓑ{a,I} V1. T1 ▶* [d, e] ⓑ{a,I} V2. T2. +#L #V1 #V2 #d #e #HV12 elim HV12 -V2 +[ #V2 #HV12 #a #I #T1 #T2 #HT12 elim HT12 -T2 + [ /3 width=5/ + | #T #T2 #_ #HT2 #IHT @step /2 width=5/ (**) (* /3 width=5/ is too slow *) + ] +| #V #V2 #_ #HV12 #IHV #a #I #T1 #T2 #HT12 + lapply (tpss_lsubr_trans … HT12 (L. ⓑ{I} V) ?) -HT12 /2 width=1/ #HT12 + lapply (IHV a … HT12) -IHV -HT12 #HT12 @step /2 width=5/ (**) (* /3 width=5/ is too slow *) +] +qed. + +lemma tpss_flat: ∀L,I,V1,V2,T1,T2,d,e. + L ⊢ V1 ▶* [d, e] V2 → L ⊢ T1 ▶* [d, e] T2 → + L ⊢ ⓕ{I} V1. T1 ▶* [d, e] ⓕ{I} V2. T2. +#L #I #V1 #V2 #T1 #T2 #d #e #HV12 elim HV12 -V2 +[ #V2 #HV12 #HT12 elim HT12 -T2 + [ /3 width=1/ + | #T #T2 #_ #HT2 #IHT @step /2 width=5/ (**) (* /3 width=5/ is too slow *) + ] +| #V #V2 #_ #HV12 #IHV #HT12 + lapply (IHV … HT12) -IHV -HT12 #HT12 @step /2 width=5/ (**) (* /3 width=5/ is too slow *) +] +qed. + +lemma tpss_weak: ∀L,T1,T2,d1,e1. L ⊢ T1 ▶* [d1, e1] T2 → + ∀d2,e2. d2 ≤ d1 → d1 + e1 ≤ d2 + e2 → + L ⊢ T1 ▶* [d2, e2] T2. +#L #T1 #T2 #d1 #e1 #H #d1 #d2 #Hd21 #Hde12 @(tpss_ind … H) -T2 +[ // +| #T #T2 #_ #HT12 #IHT + lapply (tps_weak … HT12 … Hd21 Hde12) -HT12 -Hd21 -Hde12 /2 width=3/ +] +qed. + +lemma tpss_weak_top: ∀L,T1,T2,d,e. + L ⊢ T1 ▶* [d, e] T2 → L ⊢ T1 ▶* [d, |L| - d] T2. +#L #T1 #T2 #d #e #H @(tpss_ind … H) -T2 +[ // +| #T #T2 #_ #HT12 #IHT + lapply (tps_weak_top … HT12) -HT12 /2 width=3/ +] +qed. + +lemma tpss_weak_full: ∀L,T1,T2,d,e. + L ⊢ T1 ▶* [d, e] T2 → L ⊢ T1 ▶* [0, |L|] T2. +#L #T1 #T2 #d #e #HT12 +lapply (tpss_weak … HT12 0 (d + e) ? ?) -HT12 // #HT12 +lapply (tpss_weak_top … HT12) // +qed. + +lemma tpss_append: ∀K,T1,T2,d,e. K ⊢ T1 ▶* [d, e] T2 → + ∀L. L @@ K ⊢ T1 ▶* [d, e] T2. +#K #T1 #T2 #d #e #H @(tpss_ind … H) -T2 // /3 width=3/ +qed. + +(* Basic inversion lemmas ***************************************************) + +(* Note: this can be derived from tpss_inv_atom1 *) +lemma tpss_inv_sort1: ∀L,T2,k,d,e. L ⊢ ⋆k ▶* [d, e] T2 → T2 = ⋆k. +#L #T2 #k #d #e #H @(tpss_ind … H) -T2 +[ // +| #T #T2 #_ #HT2 #IHT destruct + >(tps_inv_sort1 … HT2) -HT2 // +] +qed-. + +(* Note: this can be derived from tpss_inv_atom1 *) +lemma tpss_inv_gref1: ∀L,T2,p,d,e. L ⊢ §p ▶* [d, e] T2 → T2 = §p. +#L #T2 #p #d #e #H @(tpss_ind … H) -T2 +[ // +| #T #T2 #_ #HT2 #IHT destruct + >(tps_inv_gref1 … HT2) -HT2 // +] +qed-. + +lemma tpss_inv_bind1: ∀d,e,L,a,I,V1,T1,U2. L ⊢ ⓑ{a,I} V1. T1 ▶* [d, e] U2 → + ∃∃V2,T2. L ⊢ V1 ▶* [d, e] V2 & + L. ⓑ{I} V2 ⊢ T1 ▶* [d + 1, e] T2 & + U2 = ⓑ{a,I} V2. T2. +#d #e #L #a #I #V1 #T1 #U2 #H @(tpss_ind … H) -U2 +[ /2 width=5/ +| #U #U2 #_ #HU2 * #V #T #HV1 #HT1 #H destruct + elim (tps_inv_bind1 … HU2) -HU2 #V2 #T2 #HV2 #HT2 #H + lapply (tpss_lsubr_trans … HT1 (L. ⓑ{I} V2) ?) -HT1 /2 width=1/ /3 width=5/ +] +qed-. + +lemma tpss_inv_flat1: ∀d,e,L,I,V1,T1,U2. L ⊢ ⓕ{I} V1. T1 ▶* [d, e] U2 → + ∃∃V2,T2. L ⊢ V1 ▶* [d, e] V2 & L ⊢ T1 ▶* [d, e] T2 & + U2 = ⓕ{I} V2. T2. +#d #e #L #I #V1 #T1 #U2 #H @(tpss_ind … H) -U2 +[ /2 width=5/ +| #U #U2 #_ #HU2 * #V #T #HV1 #HT1 #H destruct + elim (tps_inv_flat1 … HU2) -HU2 /3 width=5/ +] +qed-. + +lemma tpss_inv_refl_O2: ∀L,T1,T2,d. L ⊢ T1 ▶* [d, 0] T2 → T1 = T2. +#L #T1 #T2 #d #H @(tpss_ind … H) -T2 +[ // +| #T #T2 #_ #HT2 #IHT <(tps_inv_refl_O2 … HT2) -HT2 // +] +qed-. + +(* Basic forward lemmas *****************************************************) + +lemma tpss_fwd_tw: ∀L,T1,T2,d,e. L ⊢ T1 ▶* [d, e] T2 → ♯{T1} ≤ ♯{T2}. +#L #T1 #T2 #d #e #H @(tpss_ind … H) -T2 // +#T #T2 #_ #HT2 #IHT1 +lapply (tps_fwd_tw … HT2) -HT2 #HT2 +@(transitive_le … IHT1) // +qed-. + +lemma tpss_fwd_shift1: ∀L,L1,T1,T,d,e. L ⊢ L1 @@ T1 ▶*[d, e] T → + ∃∃L2,T2. |L1| = |L2| & T = L2 @@ T2. +#L #L1 #T1 #T #d #e #H @(tpss_ind … H) -T +[ /2 width=4/ +| #T #X #_ #H0 * #L0 #T0 #HL10 #H destruct + elim (tps_fwd_shift1 … H0) -H0 #L2 #T2 #HL02 #H destruct /2 width=4/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tpss_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tpss_alt.etc new file mode 100644 index 000000000..f7670eaa8 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tpss_alt.etc @@ -0,0 +1,105 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( L ⊢ break term 46 T1 break ▶ ▶ * [ term 46 d , break term 46 e ] break term 46 T2 )" + non associative with precedence 45 + for @{ 'PSubstStarAlt $L $T1 $d $e $T2 }. + +include "basic_2/unfold/tpss_lift.ma". + +(* PARALLEL UNFOLD ON TERMS *************************************************) + +(* alternative definition of tpss *) +inductive tpssa: nat → nat → lenv → relation term ≝ +| tpssa_atom : ∀L,I,d,e. tpssa d e L (⓪{I}) (⓪{I}) +| tpssa_subst: ∀L,K,V1,V2,W2,i,d,e. d ≤ i → i < d + e → + ⇩[0, i] L ≡ K. ⓓV1 → tpssa 0 (d + e - i - 1) K V1 V2 → + ⇧[0, i + 1] V2 ≡ W2 → tpssa d e L (#i) W2 +| tpssa_bind : ∀L,a,I,V1,V2,T1,T2,d,e. + tpssa d e L V1 V2 → tpssa (d + 1) e (L. ⓑ{I} V2) T1 T2 → + tpssa d e L (ⓑ{a,I} V1. T1) (ⓑ{a,I} V2. T2) +| tpssa_flat : ∀L,I,V1,V2,T1,T2,d,e. + tpssa d e L V1 V2 → tpssa d e L T1 T2 → + tpssa d e L (ⓕ{I} V1. T1) (ⓕ{I} V2. T2) +. + +interpretation "parallel unfold (term) alternative" + 'PSubstStarAlt L T1 d e T2 = (tpssa d e L T1 T2). + +(* Basic properties *********************************************************) + +lemma tpssa_lsubr_trans: ∀L1,T1,T2,d,e. L1 ⊢ T1 ▶▶* [d, e] T2 → + ∀L2. L2 ⊑ [d, e] L1 → L2 ⊢ T1 ▶▶* [d, e] T2. +#L1 #T1 #T2 #d #e #H elim H -L1 -T1 -T2 -d -e +[ // +| #L1 #K1 #V1 #V2 #W2 #i #d #e #Hdi #Hide #HLK1 #_ #HVW2 #IHV12 #L2 #HL12 + elim (ldrop_lsubr_ldrop2_abbr … HL12 … HLK1 ? ?) -HL12 -HLK1 // /3 width=6/ +| /4 width=1/ +| /3 width=1/ +] +qed. + +lemma tpssa_refl: ∀T,L,d,e. L ⊢ T ▶▶* [d, e] T. +#T elim T -T // +#I elim I -I /2 width=1/ +qed. + +lemma tpssa_tps_trans: ∀L,T1,T,d,e. L ⊢ T1 ▶▶* [d, e] T → + ∀T2. L ⊢ T ▶ [d, e] T2 → L ⊢ T1 ▶▶* [d, e] T2. +#L #T1 #T #d #e #H elim H -L -T1 -T -d -e +[ #L #I #d #e #X #H + elim (tps_inv_atom1 … H) -H // * /2 width=6/ +| #L #K #V1 #V2 #W2 #i #d #e #Hdi #Hide #HLK #_ #HVW2 #IHV12 #T2 #H + lapply (ldrop_fwd_ldrop2 … HLK) #H0LK + lapply (tps_weak … H 0 (d+e) ? ?) -H // #H + elim (tps_inv_lift1_be … H … H0LK … HVW2 ? ?) -H -H0LK -HVW2 // /3 width=6/ +| #L #a #I #V1 #V #T1 #T #d #e #_ #_ #IHV1 #IHT1 #X #H + elim (tps_inv_bind1 … H) -H #V2 #T2 #HV2 #HT2 #H destruct + lapply (tps_lsubr_trans … HT2 (L.ⓑ{I}V) ?) -HT2 /2 width=1/ #HT2 + lapply (IHV1 … HV2) -IHV1 -HV2 #HV12 + lapply (IHT1 … HT2) -IHT1 -HT2 #HT12 + lapply (tpssa_lsubr_trans … HT12 (L.ⓑ{I}V2) ?) -HT12 /2 width=1/ +| #L #I #V1 #V #T1 #T #d #e #_ #_ #IHV1 #IHT1 #X #H + elim (tps_inv_flat1 … H) -H #V2 #T2 #HV2 #HT2 #H destruct /3 width=1/ +] +qed. + +lemma tpss_tpssa: ∀L,T1,T2,d,e. L ⊢ T1 ▶* [d, e] T2 → L ⊢ T1 ▶▶* [d, e] T2. +#L #T1 #T2 #d #e #H @(tpss_ind … H) -T2 // /2 width=3/ +qed. + +(* Basic inversion lemmas ***************************************************) + +lemma tpssa_tpss: ∀L,T1,T2,d,e. L ⊢ T1 ▶▶* [d, e] T2 → L ⊢ T1 ▶* [d, e] T2. +#L #T1 #T2 #d #e #H elim H -L -T1 -T2 -d -e // /2 width=6/ +qed-. + +lemma tpss_ind_alt: ∀R:nat→nat→lenv→relation term. + (∀L,I,d,e. R d e L (⓪{I}) (⓪{I})) → + (∀L,K,V1,V2,W2,i,d,e. d ≤ i → i < d + e → + ⇩[O, i] L ≡ K.ⓓV1 → K ⊢ V1 ▶* [O, d + e - i - 1] V2 → + ⇧[O, i + 1] V2 ≡ W2 → R O (d+e-i-1) K V1 V2 → R d e L (#i) W2 + ) → + (∀L,a,I,V1,V2,T1,T2,d,e. L ⊢ V1 ▶* [d, e] V2 → + L.ⓑ{I}V2 ⊢ T1 ▶* [d + 1, e] T2 → R d e L V1 V2 → + R (d+1) e (L.ⓑ{I}V2) T1 T2 → R d e L (ⓑ{a,I}V1.T1) (ⓑ{a,I}V2.T2) + ) → + (∀L,I,V1,V2,T1,T2,d,e. L ⊢ V1 ▶* [d, e] V2 → + L ⊢ T1 ▶* [d, e] T2 → R d e L V1 V2 → + R d e L T1 T2 → R d e L (ⓕ{I}V1.T1) (ⓕ{I}V2.T2) + ) → + ∀d,e,L,T1,T2. L ⊢ T1 ▶* [d, e] T2 → R d e L T1 T2. +#R #H1 #H2 #H3 #H4 #d #e #L #T1 #T2 #H elim (tpss_tpssa … H) -L -T1 -T2 -d -e +// /3 width=1 by tpssa_tpss/ /3 width=7 by tpssa_tpss/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tpss_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tpss_lift.etc new file mode 100644 index 000000000..a68f86e32 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tpss_lift.etc @@ -0,0 +1,196 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/tps_lift.ma". +include "basic_2/unfold/tpss.ma". + +(* PARTIAL UNFOLD ON TERMS **************************************************) + +(* Advanced properties ******************************************************) + +lemma tpss_subst: ∀L,K,V,U1,i,d,e. + d ≤ i → i < d + e → + ⇩[0, i] L ≡ K. ⓓV → K ⊢ V ▶* [0, d + e - i - 1] U1 → + ∀U2. ⇧[0, i + 1] U1 ≡ U2 → L ⊢ #i ▶* [d, e] U2. +#L #K #V #U1 #i #d #e #Hdi #Hide #HLK #H @(tpss_ind … H) -U1 +[ /3 width=4/ +| #U #U1 #_ #HU1 #IHU #U2 #HU12 + elim (lift_total U 0 (i+1)) #U0 #HU0 + lapply (IHU … HU0) -IHU #H + lapply (ldrop_fwd_ldrop2 … HLK) -HLK #HLK + lapply (tps_lift_ge … HU1 … HLK HU0 HU12 ?) -HU1 -HLK -HU0 -HU12 // normalize #HU02 + lapply (tps_weak … HU02 d e ? ?) -HU02 [ >minus_plus >commutative_plus /2 width=1/ | /2 width=1/ | /2 width=3/ ] +] +qed. + +(* Advanced inverion lemmas *************************************************) + +lemma tpss_inv_atom1: ∀L,T2,I,d,e. L ⊢ ⓪{I} ▶* [d, e] T2 → + T2 = ⓪{I} ∨ + ∃∃K,V1,V2,i. d ≤ i & i < d + e & + ⇩[O, i] L ≡ K. ⓓV1 & + K ⊢ V1 ▶* [0, d + e - i - 1] V2 & + ⇧[O, i + 1] V2 ≡ T2 & + I = LRef i. +#L #T2 #I #d #e #H @(tpss_ind … H) -T2 +[ /2 width=1/ +| #T #T2 #_ #HT2 * + [ #H destruct + elim (tps_inv_atom1 … HT2) -HT2 [ /2 width=1/ | * /3 width=10/ ] + | * #K #V1 #V #i #Hdi #Hide #HLK #HV1 #HVT #HI + lapply (ldrop_fwd_ldrop2 … HLK) #H + elim (tps_inv_lift1_ge_up … HT2 … H … HVT ? ? ?) normalize -HT2 -H -HVT [2,3,4: /2 width=1/ ] #V2 (lift_mono … HTU1 … H) -H // +| -HTU1 #T #T2 #_ #HT2 #IHT #U2 #HTU2 + elim (lift_total T d e) #U #HTU + lapply (IHT … HTU) -IHT #HU1 + lapply (tps_lift_le … HT2 … HLK HTU HTU2 ?) -HT2 -HLK -HTU -HTU2 // /2 width=3/ +] +qed. + +lemma tpss_lift_be: ∀K,T1,T2,dt,et. K ⊢ T1 ▶* [dt, et] T2 → + ∀L,U1,d,e. dt ≤ d → d ≤ dt + et → + ⇩[d, e] L ≡ K → ⇧[d, e] T1 ≡ U1 → + ∀U2. ⇧[d, e] T2 ≡ U2 → L ⊢ U1 ▶* [dt, et + e] U2. +#K #T1 #T2 #dt #et #H #L #U1 #d #e #Hdtd #Hddet #HLK #HTU1 @(tpss_ind … H) -T2 +[ #U2 #H >(lift_mono … HTU1 … H) -H // +| -HTU1 #T #T2 #_ #HT2 #IHT #U2 #HTU2 + elim (lift_total T d e) #U #HTU + lapply (IHT … HTU) -IHT #HU1 + lapply (tps_lift_be … HT2 … HLK HTU HTU2 ? ?) -HT2 -HLK -HTU -HTU2 // /2 width=3/ +] +qed. + +lemma tpss_lift_ge: ∀K,T1,T2,dt,et. K ⊢ T1 ▶* [dt, et] T2 → + ∀L,U1,d,e. d ≤ dt → ⇩[d, e] L ≡ K → + ⇧[d, e] T1 ≡ U1 → ∀U2. ⇧[d, e] T2 ≡ U2 → + L ⊢ U1 ▶* [dt + e, et] U2. +#K #T1 #T2 #dt #et #H #L #U1 #d #e #Hddt #HLK #HTU1 @(tpss_ind … H) -T2 +[ #U2 #H >(lift_mono … HTU1 … H) -H // +| -HTU1 #T #T2 #_ #HT2 #IHT #U2 #HTU2 + elim (lift_total T d e) #U #HTU + lapply (IHT … HTU) -IHT #HU1 + lapply (tps_lift_ge … HT2 … HLK HTU HTU2 ?) -HT2 -HLK -HTU -HTU2 // /2 width=3/ +] +qed. + +lemma tpss_inv_lift1_le: ∀L,U1,U2,dt,et. L ⊢ U1 ▶* [dt, et] U2 → + ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → + dt + et ≤ d → + ∃∃T2. K ⊢ T1 ▶* [dt, et] T2 & ⇧[d, e] T2 ≡ U2. +#L #U1 #U2 #dt #et #H #K #d #e #HLK #T1 #HTU1 #Hdetd @(tpss_ind … H) -U2 +[ /2 width=3/ +| -HTU1 #U #U2 #_ #HU2 * #T #HT1 #HTU + elim (tps_inv_lift1_le … HU2 … HLK … HTU ?) -HU2 -HLK -HTU // /3 width=3/ +] +qed. + +lemma tpss_inv_lift1_be: ∀L,U1,U2,dt,et. L ⊢ U1 ▶* [dt, et] U2 → + ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → + dt ≤ d → d + e ≤ dt + et → + ∃∃T2. K ⊢ T1 ▶* [dt, et - e] T2 & ⇧[d, e] T2 ≡ U2. +#L #U1 #U2 #dt #et #H #K #d #e #HLK #T1 #HTU1 #Hdtd #Hdedet @(tpss_ind … H) -U2 +[ /2 width=3/ +| -HTU1 #U #U2 #_ #HU2 * #T #HT1 #HTU + elim (tps_inv_lift1_be … HU2 … HLK … HTU ? ?) -HU2 -HLK -HTU // /3 width=3/ +] +qed. + +lemma tpss_inv_lift1_ge: ∀L,U1,U2,dt,et. L ⊢ U1 ▶* [dt, et] U2 → + ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → + d + e ≤ dt → + ∃∃T2. K ⊢ T1 ▶* [dt - e, et] T2 & ⇧[d, e] T2 ≡ U2. +#L #U1 #U2 #dt #et #H #K #d #e #HLK #T1 #HTU1 #Hdedt @(tpss_ind … H) -U2 +[ /2 width=3/ +| -HTU1 #U #U2 #_ #HU2 * #T #HT1 #HTU + elim (tps_inv_lift1_ge … HU2 … HLK … HTU ?) -HU2 -HLK -HTU // /3 width=3/ +] +qed. + +lemma tpss_inv_lift1_eq: ∀L,U1,U2,d,e. + L ⊢ U1 ▶* [d, e] U2 → ∀T1. ⇧[d, e] T1 ≡ U1 → U1 = U2. +#L #U1 #U2 #d #e #H #T1 #HTU1 @(tpss_ind … H) -U2 // +#U #U2 #_ #HU2 #IHU destruct +<(tps_inv_lift1_eq … HU2 … HTU1) -HU2 -HTU1 // +qed. + +lemma tpss_inv_lift1_ge_up: ∀L,U1,U2,dt,et. L ⊢ U1 ▶* [dt, et] U2 → + ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → + d ≤ dt → dt ≤ d + e → d + e ≤ dt + et → + ∃∃T2. K ⊢ T1 ▶* [d, dt + et - (d + e)] T2 & + ⇧[d, e] T2 ≡ U2. +#L #U1 #U2 #dt #et #H #K #d #e #HLK #T1 #HTU1 #Hddt #Hdtde #Hdedet @(tpss_ind … H) -U2 +[ /2 width=3/ +| -HTU1 #U #U2 #_ #HU2 * #T #HT1 #HTU + elim (tps_inv_lift1_ge_up … HU2 … HLK … HTU ? ? ?) -HU2 -HLK -HTU // /3 width=3/ +] +qed. + +lemma tpss_inv_lift1_be_up: ∀L,U1,U2,dt,et. L ⊢ U1 ▶* [dt, et] U2 → + ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → + dt ≤ d → dt + et ≤ d + e → + ∃∃T2. K ⊢ T1 ▶* [dt, d - dt] T2 & ⇧[d, e] T2 ≡ U2. +#L #U1 #U2 #dt #et #H #K #d #e #HLK #T1 #HTU1 #Hdtd #Hdetde @(tpss_ind … H) -U2 +[ /2 width=3/ +| -HTU1 #U #U2 #_ #HU2 * #T #HT1 #HTU + elim (tps_inv_lift1_be_up … HU2 … HLK … HTU ? ?) -HU2 -HLK -HTU // /3 width=3/ +] +qed. + +lemma tpss_inv_lift1_le_up: ∀L,U1,U2,dt,et. L ⊢ U1 ▶* [dt, et] U2 → + ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → + dt ≤ d → d ≤ dt + et → dt + et ≤ d + e → + ∃∃T2. K ⊢ T1 ▶* [dt, d - dt] T2 & ⇧[d, e] T2 ≡ U2. +#L #U1 #U2 #dt #et #H #K #d #e #HLK #T1 #HTU1 #Hdtd #Hddet #Hdetde @(tpss_ind … H) -U2 +[ /2 width=3/ +| -HTU1 #U #U2 #_ #HU2 * #T #HT1 #HTU + elim (tps_inv_lift1_le_up … HU2 … HLK … HTU ? ? ?) -HU2 -HLK -HTU // /3 width=3/ +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tpss_tpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tpss_tpss.etc new file mode 100644 index 000000000..d124bb32c --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpr/tpss_tpss.etc @@ -0,0 +1,96 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/tps_tps.ma". +include "basic_2/unfold/tpss_lift.ma". + +(* PARTIAL UNFOLD ON TERMS **************************************************) + +(* Advanced inversion lemmas ************************************************) + +lemma tpss_inv_SO2: ∀L,T1,T2,d. L ⊢ T1 ▶* [d, 1] T2 → L ⊢ T1 ▶ [d, 1] T2. +#L #T1 #T2 #d #H @(tpss_ind … H) -T2 // +#T #T2 #_ #HT2 #IHT1 +lapply (tps_trans_ge … IHT1 … HT2 ?) // +qed-. + +(* Advanced properties ******************************************************) + +lemma tpss_strip_eq: ∀L,T0,T1,d1,e1. L ⊢ T0 ▶* [d1, e1] T1 → + ∀T2,d2,e2. L ⊢ T0 ▶ [d2, e2] T2 → + ∃∃T. L ⊢ T1 ▶ [d2, e2] T & L ⊢ T2 ▶* [d1, e1] T. +/3 width=3/ qed. + +lemma tpss_strip_neq: ∀L1,T0,T1,d1,e1. L1 ⊢ T0 ▶* [d1, e1] T1 → + ∀L2,T2,d2,e2. L2 ⊢ T0 ▶ [d2, e2] T2 → + (d1 + e1 ≤ d2 ∨ d2 + e2 ≤ d1) → + ∃∃T. L2 ⊢ T1 ▶ [d2, e2] T & L1 ⊢ T2 ▶* [d1, e1] T. +/3 width=3/ qed. + +lemma tpss_strap1_down: ∀L,T1,T0,d1,e1. L ⊢ T1 ▶* [d1, e1] T0 → + ∀T2,d2,e2. L ⊢ T0 ▶ [d2, e2] T2 → d2 + e2 ≤ d1 → + ∃∃T. L ⊢ T1 ▶ [d2, e2] T & L ⊢ T ▶* [d1, e1] T2. +/3 width=3/ qed. + +lemma tpss_strap2_down: ∀L,T1,T0,d1,e1. L ⊢ T1 ▶ [d1, e1] T0 → + ∀T2,d2,e2. L ⊢ T0 ▶* [d2, e2] T2 → d2 + e2 ≤ d1 → + ∃∃T. L ⊢ T1 ▶* [d2, e2] T & L ⊢ T ▶ [d1, e1] T2. +/3 width=3/ qed. + +lemma tpss_split_up: ∀L,T1,T2,d,e. L ⊢ T1 ▶* [d, e] T2 → + ∀i. d ≤ i → i ≤ d + e → + ∃∃T. L ⊢ T1 ▶* [d, i - d] T & L ⊢ T ▶* [i, d + e - i] T2. +#L #T1 #T2 #d #e #H #i #Hdi #Hide @(tpss_ind … H) -T2 +[ /2 width=3/ +| #T #T2 #_ #HT12 * #T3 #HT13 #HT3 + elim (tps_split_up … HT12 … Hdi Hide) -HT12 -Hide #T0 #HT0 #HT02 + elim (tpss_strap1_down … HT3 … HT0 ?) -T [2: >commutative_plus /2 width=1/ ] + /3 width=7 by ex2_intro, step/ (**) (* just /3 width=7/ is too slow *) +] +qed. + +lemma tpss_inv_lift1_up: ∀L,U1,U2,dt,et. L ⊢ U1 ▶* [dt, et] U2 → + ∀K,d,e. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → + d ≤ dt → dt ≤ d + e → d + e ≤ dt + et → + ∃∃T2. K ⊢ T1 ▶* [d, dt + et - (d + e)] T2 & + ⇧[d, e] T2 ≡ U2. +#L #U1 #U2 #dt #et #HU12 #K #d #e #HLK #T1 #HTU1 #Hddt #Hdtde #Hdedet +elim (tpss_split_up … HU12 (d + e) ? ?) -HU12 // -Hdedet #U #HU1 #HU2 +lapply (tpss_weak … HU1 d e ? ?) -HU1 // [ >commutative_plus /2 width=1/ ] -Hddt -Hdtde #HU1 +lapply (tpss_inv_lift1_eq … HU1 … HTU1) -HU1 #HU1 destruct +elim (tpss_inv_lift1_ge … HU2 … HLK … HTU1 ?) -HU2 -HLK -HTU1 // (lift_mono … H1 … H2) -H1 -H2 // +| #I #G #K #KV #V #V2 #W2 #i #HKV #HV2 #HVW2 #IHV2 #L #s #d #e #HLK #U1 #H #U2 #HWU2 + elim (lift_inv_lref1 … H) * #Hid #H destruct + [ elim (lift_trans_ge … HVW2 … HWU2) -W2 // plus_plus_comm_23 #HVU2 + lapply (ldrop_trans_ge_comm … HLK … HKV ?) -K /3 width=7 by cpys_delta, ldrop_inv_gen/ + ] +| #a #I #G #K #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #s #d #e #HLK #U1 #H1 #U2 #H2 + elim (lift_inv_bind1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 destruct + elim (lift_inv_bind1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /4 width=6 by cpys_bind, ldrop_skip/ +| #I #G #K #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #s #d #e #HLK #U1 #H1 #U2 #H2 + elim (lift_inv_flat1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 destruct + elim (lift_inv_flat1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /3 width=6 by cpys_flat/ +] +qed. + +lemma cpys_inv_lift1: ∀G. l_deliftable_sn (cpys G). +#G #L #U1 #U2 #H elim H -G -L -U1 -U2 +[ * #G #L #i #K #s #d #e #_ #T1 #H + [ lapply (lift_inv_sort2 … H) -H #H destruct /2 width=3 by cpys_atom, lift_sort, ex2_intro/ + | elim (lift_inv_lref2 … H) -H * #Hid #H destruct /3 width=3 by cpys_atom, lift_lref_ge_minus, lift_lref_lt, ex2_intro/ + | lapply (lift_inv_gref2 … H) -H #H destruct /2 width=3 by cpys_atom, lift_gref, ex2_intro/ + ] +| #I #G #L #LV #V #V2 #W2 #i #HLV #HV2 #HVW2 #IHV2 #K #s #d #e #HLK #T1 #H + elim (lift_inv_lref2 … H) -H * #Hid #H destruct + [ elim (ldrop_conf_lt … HLK … HLV) -L // #L #U #HKL #HLV #HUV + elim (IHV2 … HLV … HUV) -V #U2 #HUV2 #HU2 + elim (lift_trans_le … HUV2 … HVW2) -V2 // >minus_plus plus_minus // (length_inv_zero_dx … H) -L1 // +| #I1 #I2 #L1 #L2 #V #_ #IHL12 #H lapply (injective_plus_l … H) -H + /3 width=1 by lsuby_pair/ +] +qed-. + +(* Basic inversion lemmas ***************************************************) + +fact lsuby_inv_atom1_aux: ∀L1,L2. L1 ⊆ L2 → L1 = ⋆ → L2 = ⋆. +#L1 #L2 * -L1 -L2 // +#I1 #I2 #L1 #L2 #V #_ #H destruct +qed-. + +lemma lsuby_inv_atom1: ∀L2. ⋆ ⊆ L2 → L2 = ⋆. +/2 width=3 by lsuby_inv_atom1_aux/ qed-. + +fact lsuby_inv_pair1_aux: ∀L1,L2. L1 ⊆ L2 → ∀J1,K1,W. L1 = K1.ⓑ{J1}W → + L2 = ⋆ ∨ ∃∃I2,K2. K1 ⊆ K2 & L2 = K2.ⓑ{I2}W. +#L1 #L2 * -L1 -L2 +[ #L #J1 #K1 #W #H destruct /2 width=1 by or_introl/ +| #I1 #I2 #L1 #L2 #V #HL12 #J1 #K1 #W #H destruct /3 width=4 by ex2_2_intro, or_intror/ +] +qed-. + +lemma lsuby_inv_pair1: ∀I1,K1,L2,W. K1.ⓑ{I1}W ⊆ L2 → + L2 = ⋆ ∨ ∃∃I2,K2. K1 ⊆ K2 & L2 = K2.ⓑ{I2}W. +/2 width=4 by lsuby_inv_pair1_aux/ qed-. + +fact lsuby_inv_pair2_aux: ∀L1,L2. L1 ⊆ L2 → ∀J2,K2,W. L2 = K2.ⓑ{J2}W → + ∃∃I1,K1. K1 ⊆ K2 & L1 = K1.ⓑ{I1}W. +#L1 #L2 * -L1 -L2 +[ #L #J2 #K2 #W #H destruct +| #I1 #I2 #L1 #L2 #V #HL12 #J2 #K2 #W #H destruct /2 width=4 by ex2_2_intro/ +] +qed-. + +lemma lsuby_inv_pair2: ∀I2,L1,K2,W. L1 ⊆ K2.ⓑ{I2}W → + ∃∃I1,K1. K1 ⊆ K2 & L1 = K1.ⓑ{I1}W. +/2 width=4 by lsuby_inv_pair2_aux/ qed-. + +(* Basic forward lemmas *****************************************************) + +lemma lsuby_fwd_length: ∀L1,L2. L1 ⊆ L2 → |L2| ≤ |L1|. +#L1 #L2 #H elim H -L1 -L2 /2 width=1 by monotonic_le_plus_l/ +qed-. + +lemma lsuby_ldrop_trans: ∀L1,L2. L1 ⊆ L2 → + ∀I2,K2,W,s,i. ⇩[s, 0, i] L2 ≡ K2.ⓑ{I2}W → + ∃∃I1,K1. K1 ⊆ K2 & ⇩[s, 0, i] L1 ≡ K1.ⓑ{I1}W. +#L1 #L2 #H elim H -L1 -L2 +[ #L #J2 #K2 #W #s #i #H + elim (ldrop_inv_atom1 … H) -H #H destruct +| #I1 #I2 #L1 #L2 #V #HL12 #IHL12 #J2 #K2 #W #s #i #H + elim (ldrop_inv_O1_pair1 … H) -H * #Hi #HLK2 destruct [ -IHL12 | -HL12 ] + [ /3 width=4 by ldrop_pair, ex2_2_intro/ + | elim (IHL12 … HLK2) -IHL12 -HLK2 * /3 width=4 by ldrop_drop_lt, ex2_2_intro/ + ] +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys0/lsuby_lsuby.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys0/lsuby_lsuby.etc new file mode 100644 index 000000000..254d62928 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys0/lsuby_lsuby.etc @@ -0,0 +1,27 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/lsuby.ma". + +(* LOCAL ENVIRONMENT REFINEMENT FOR EXTENDED SUBSTITUTION *******************) + +(* Main properties **********************************************************) + +theorem lsuby_trans: Transitive … lsuby. +#L1 #L #H elim H -L1 -L +[ #L1 #X #H lapply (lsuby_inv_atom1 … H) -H // +| #I1 #I #L1 #L #V #_ #IHL1 #X #H elim (lsuby_inv_pair1 … H) -H // * + #I2 #L2 #HL2 #H destruct /3 width=1 by lsuby_pair/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys0/psubstsnstar_3.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys0/psubstsnstar_3.etc new file mode 100644 index 000000000..0d6dffee6 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys0/psubstsnstar_3.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G , break term 46 L1 ⦄ ⊢ ▶ * break term 46 L2 )" + non associative with precedence 45 + for @{ 'PSubstSnStar $G $L1 $L2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys0/psubststar_4.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys0/psubststar_4.etc new file mode 100644 index 000000000..0e76c6f71 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys0/psubststar_4.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 break ▶ * break term 46 T2 )" + non associative with precedence 45 + for @{ 'PSubstStar $G $L $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys2/cpx_cpys.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys2/cpx_cpys.etc new file mode 100644 index 000000000..3b38ee6ab --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys2/cpx_cpys.etc @@ -0,0 +1,42 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/cpys_alt.ma". +include "basic_2/reduction/cpx.ma". + +(* CONTEXT-SENSITIVE EXTENDED PARALLEL REDUCTION FOR TERMS ******************) + +(* Properties on local environment refinement for extended substitution *****) + +lemma lsuby_cpx_trans: ∀h,g,G. lsub_trans … (cpx h g G) (lsuby 0 (∞)). +#h #g #G #L1 #T1 #T2 #H elim H -G -L1 -T1 -T2 +[ // +| /2 width=2 by cpx_sort/ +| #I #G #L1 #K1 #V1 #V2 #W2 #i #HLK1 #_ #HVW2 #IHV12 #L2 #HL12 + elim (lsuby_ldrop_trans_be … HL12 … HLK1) // -HL12 -HLK1 /3 width=7 by cpx_delta/ +|4,9: /4 width=1 by cpx_bind, cpx_beta, lsuby_pair_O_Y/ +|5,7,8: /3 width=1 by cpx_flat, cpx_tau, cpx_ti/ +|6,10: /4 width=3 by cpx_zeta, cpx_theta, lsuby_pair_O_Y/ +] +qed-. + +(* Properties on context-sensitive extended multiple substitution for terms *) + +lemma cpys_cpx: ∀h,g,G,L,T1,T2,d,e. ⦃G, L⦄ ⊢ T1 ▶*[d, e] T2 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2. +#h #g #G #L #T1 #T2 #d #e #H @(cpys_ind_alt … H) -G -L -T1 -T2 -d -e +/2 width=7 by cpx_delta, cpx_bind, cpx_flat/ +qed. + +lemma cpy_cpx: ∀h,g,G,L,T1,T2,d,e. ⦃G, L⦄ ⊢ T1 ▶[d, e] T2 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2. +/3 width=3 by cpy_cpys, cpys_cpx/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys2/cpx_cpys2.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys2/cpx_cpys2.etc new file mode 100644 index 000000000..46abd5464 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys2/cpx_cpys2.etc @@ -0,0 +1,70 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/cpys_alt.ma". +include "basic_2/reduction/cpx.ma". + +(* CONTEXT-SENSITIVE EXTENDED PARALLEL REDUCTION FOR TERMS ******************) + +(* Properties on context-sensitive extended multiple substitution for terms *) + +lemma cpys_cpx: ∀h,g,G,L,T1,T2,d,e. ⦃G, L⦄ ⊢ T1 ▶*[d, e] T2 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2. +#h #g #G #L #T1 #T2 #d #e #H @(cpys_ind_alt … H) -G -L -T1 -T2 -d -e +/2 width=7 by cpx_delta, cpx_bind, cpx_flat/ +qed. + +lemma cpy_cpx: ∀h,g,G,L,T1,T2,d,e. ⦃G, L⦄ ⊢ T1 ▶[d, e] T2 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2. +/3 width=3 by cpy_cpys, cpys_cpx/ qed. + +lemma cpx_cpy_trans: ∀h,g,G,L,T1,T. ⦃G, L⦄ ⊢ T1 ➡[h, g] T → + ∀T2,d,e. ⦃G, L⦄ ⊢ T ▶[d, e] T2 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2. +#h #g #G #L #T1 #T #H elim H -G -L -T1 -T +[ #I #G #L #X #d #e #H elim (cpy_inv_atom1 … H) // + * /2 width=3 by cpy_cpx/ +| #G #L #k #l #Hkl #X #d #e #H >(cpy_inv_sort1 … H) -X /2 width=2 by cpx_sort/ +| #I #G #L #K #V1 #V #W #i #HLK #_ #HVW #IHV1 #X #d #e #H + lapply (ldrop_fwd_drop2 … HLK) #H0 + lapply (cpy_weak … H 0 (∞) ? ?) -H // #H + elim (cpy_inv_lift1_be … H … H0 … HVW) -H -H0 -HVW + /3 width=7 by cpx_delta/ +| #a #I #G #L #V1 #V #T1 #T #_ #_ #IHV1 #IHT1 #X #d #e #H elim (cpy_inv_bind1 … H) -H + #V2 #T2 #HV2 #HT2 #H destruct + /5 width=7 by cpx_bind, lsuby_cpy_trans, lsuby_succ/ +| #I #G #L #V1 #V #T1 #T #_ #_ #IHV1 #IHT1 #X #d #e #H elim (cpy_inv_flat1 … H) -H + #V2 #T2 #HV2 #HT2 #H destruct /3 width=3 by cpx_flat/ +| #G #L #V1 #U1 #U #T #_ #HTU #IHU1 #T2 #d #e #HT2 + lapply (cpy_weak … HT2 0 (∞) ? ?) -HT2 // #HT2 + elim (lift_total T2 0 1) #U2 #HTU2 + lapply (cpy_lift_be … HT2 (L.ⓓV1) … (Ⓕ) … HTU … HTU2 ? ?) -T + /3 width=3 by cpx_zeta, ldrop_drop/ +| /3 width=3 by cpx_tau/ +| /3 width=3 by cpx_ti/ +| #a #G #L #V1 #V #W1 #W #T1 #T #_ #_ #_ #IHV1 #IHW1 #IHT1 #X #d #e #HX + elim (cpy_inv_bind1 … HX) -HX #Y #T2 #HY #HT2 #H destruct + elim (cpy_inv_flat1 … HY) -HY #W2 #V2 #HW2 #HV2 #H destruct + /5 width=7 by cpx_beta, lsuby_cpy_trans, lsuby_succ/ +| #a #G #L #V1 #V #U #W1 #W #T1 #T #_ #HVU #_ #_ #IHV1 #IHW1 #IHT1 #X #d #e #HX + elim (cpy_inv_bind1 … HX) -HX #W2 #Y #HW2 #HY #H destruct + elim (cpy_inv_flat1 … HY) -HY #U2 #T2 #HU2 #HT2 #H destruct + lapply (cpy_weak … HU2 0 (∞) ? ?) -HU2 // #HU2 + elim (cpy_inv_lift1_be … HU2 L … HVU) -U + /5 width=7 by cpx_theta, lsuby_cpy_trans, lsuby_succ, ldrop_drop/ +] +qed-. + +lemma cpx_cpys_trans: ∀h,g,G,L,T1,T. ⦃G, L⦄ ⊢ T1 ➡[h, g] T → + ∀T2,d,e. ⦃G, L⦄ ⊢ T ▶*[d, e] T2 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2. +#h #g #G #L #T1 #T #HT1 #T2 #d #e #H @(cpys_ind … H) -T2 +/2 width=5 by cpx_cpy_trans/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys2/cpxs_cpys.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys2/cpxs_cpys.etc new file mode 100644 index 000000000..881030572 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys2/cpxs_cpys.etc @@ -0,0 +1,24 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reduction/cpx_cpys.ma". +include "basic_2/computation/cpxs.ma". + +(* CONTEXT-SENSITIVE EXTENDED PARALLEL COMPUTATION ON TERMS *****************) + +(* Properties on local environment refinement for extended substitution *****) + +lemma lsuby_cpxs_trans: ∀h,g,G. lsub_trans … (cpxs h g G) (lsuby 0 (∞)). +/3 width=5 by lsuby_cpx_trans, LTC_lsub_trans/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys2/lpx_cpys.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys2/lpx_cpys.etc new file mode 100644 index 000000000..d3c490a89 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys2/lpx_cpys.etc @@ -0,0 +1,69 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/cpy_lift.ma". +include "basic_2/substitution/cpys.ma". +include "basic_2/reduction/lpx_ldrop.ma". + +(* SN EXTENDED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ********************) + +(* Properties on context-sensitive extended substitution for terms **********) + +lemma cpx_cpy_trans_lpx: ∀h,g,G,L1,T1,T. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T → + ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → + ∀T2,d,e. ⦃G, L2⦄ ⊢ T ▶[d, e] T2 → ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2. +#h #g #G #L1 #T1 #T #H elim H -G -L1 -T1 -T +[ #J #G #L1 #L2 #HL12 #T2 #d #e #H elim (cpy_inv_atom1 … H) -H // + * #I #K2 #V2 #i #_ #_ #HLK2 #HVT2 #H destruct + elim (lpx_ldrop_trans_O1 … HL12 … HLK2) -L2 #X #HLK1 #H + elim (lpx_inv_pair2 … H) -H #K1 #V1 #_ #HV12 #H destruct + /2 width=7 by cpx_delta/ +| #G #L1 #k #l #Hkl #L2 #_ #X #d #e #H >(cpy_inv_sort1 … H) -X /2 width=2 by cpx_sort/ +| #I #G #L1 #K1 #V1 #V #T #i #HLK1 #_ #HVT #IHV1 #L2 #HL12 #T2 #d #e #HT2 + elim (lpx_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2 + elim (lpx_inv_pair1 … H) -H #K2 #V0 #HK12 #_ #H destruct + lapply (ldrop_fwd_drop2 … HLK2) -V0 #HLK2 + lapply (cpy_weak … HT2 0 (∞) ? ?) -HT2 // #HT2 + elim (cpy_inv_lift1_be … HT2 … HLK2 … HVT) -HT2 -HLK2 -HVT + /3 width=7 by cpx_delta/ +| #a #I #G #L1 #V1 #V #T1 #T #HV1 #_ #IHV1 #IHT1 #L2 #HL12 #X #d #e #H elim (cpy_inv_bind1 … H) -H + #V2 #T2 #HV2 #HT2 #H destruct /4 width=5 by lpx_pair, cpx_bind/ +| #I #G #L1 #V1 #V #T1 #T #_ #_ #IHV1 #IHT1 #L2 #HL12 #X #d #e #H elim (cpy_inv_flat1 … H) -H + #V2 #T2 #HV2 #HT2 #H destruct /3 width=5 by cpx_flat/ +| #G #L1 #V1 #U1 #U #T #_ #HTU #IHU1 #L2 #HL12 #T2 #d #e #HT2 + lapply (cpy_weak … HT2 0 (∞) ? ?) -HT2 // #HT2 + elim (lift_total T2 0 1) #U2 #HTU2 + lapply (cpy_lift_be … HT2 (L2.ⓓV1) … (Ⓕ) … HTU … HTU2 ? ?) -T + /4 width=5 by cpx_zeta, lpx_pair, ldrop_drop/ +| /3 width=5 by cpx_tau/ +| /3 width=5 by cpx_ti/ +| #a #G #L1 #V1 #V #W1 #W #T1 #T #HV1 #HW1 #_ #IHV1 #IHW1 #IHT1 #L2 #HL12 #X #d #e #HX + elim (cpy_inv_bind1 … HX) -HX #Y #T2 #HY #HT2 #H destruct + elim (cpy_inv_flat1 … HY) -HY #W2 #V2 #HW2 #HV2 #H destruct + /5 width=11 by lpx_pair, cpx_beta, lsuby_cpy_trans, lsuby_succ/ +| #a #G #L1 #V1 #V #U #W1 #W #T1 #T #_ #HVU #HW1 #_ #IHV1 #IHW1 #IHT1 #L2 #HL12 #X #d #e #HX + elim (cpy_inv_bind1 … HX) -HX #W2 #Y #HW2 #HY #H destruct + elim (cpy_inv_flat1 … HY) -HY #U2 #T2 #HU2 #HT2 #H destruct + lapply (cpy_weak … HU2 0 (∞) ? ?) -HU2 // #HU2 + elim (cpy_inv_lift1_be … HU2 L2 … HVU) -U + /4 width=7 by lpx_pair, cpx_theta, ldrop_drop/ +] +qed-. + +lemma cpx_cpys_trans_lpx: ∀h,g,G,L1,T1,T. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T → + ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → + ∀T2,d,e. ⦃G, L2⦄ ⊢ T ▶*[d, e] T2 → ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2. +#h #g #G #L1 #T1 #T #HT1 #L2 #HL12 #T2 #d #e #H @(cpys_ind … H) -T2 +/2 width=7 by cpx_cpy_trans_lpx/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys2/lsuby.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys2/lsuby.etc new file mode 100644 index 000000000..657ad6b6e --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys2/lsuby.etc @@ -0,0 +1,15 @@ +(* +lemma lsuby_weak: ∀L1,L2,d1,e1. L1 ⊑×[d1, e1] L2 → + ∀d2,e2. d1 ≤ d2 → e2 ≤ e1 → L1 ⊑×[d2, e2] L2. +#L1 #L2 #d1 #e1 #H elim H -L1 -L2 -d1 -e1 // +[ #I1 #I2 #L1 #L2 #V1 #V2 #HL12 #_ #d2 #e2 #_ #He21 + >(yle_inv_O2 … He21) -He21 + /4 width=3 by lsuby_fwd_length, lsuby_O1, monotonic_le_plus_l/ +| #I1 #I2 #L1 #L2 #V #e #HL12 #IHL12 #d2 #e2 #_ #He21 + elim (ynat_cases e2) /4 width=3 by lsuby_fwd_length, lsuby_O1, monotonic_le_plus_l/ + * #e0 #H destruct lapply (yle_inv_succ … He21) -He21 #He21 + elim (ynat_cases d2) /3 width=1 by lsuby_pair/ + * #d0 #H destruct @lsuby_succ @IHL12 // + [ destruct + +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/csup/csup.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/csup/csup.etc new file mode 100644 index 000000000..0a980f6a7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/csup/csup.etc @@ -0,0 +1,88 @@ +(* Basic forward lemmas *****************************************************) + +lemma csup_fwd_ldrop: ∀L1,L2,T1,T2. ⦃L1, T1⦄ > ⦃L2, T2⦄ → + ∃i. ⇩[0, i] L1 ≡ L2 ∨ ⇩[0, i] L2 ≡ L1. +#L1 #L2 #T1 #T2 * -L1 -L2 -T1 -T2 /3 width=2/ /4 width=2/ +#I #L1 #K1 #V1 #i #HLK1 +lapply (ldrop_fwd_ldrop2 … HLK1) -HLK1 /3 width=2/ +qed-. + +(* Advanced forward lemmas **************************************************) + +lemma lift_csup_trans_eq: ∀T1,U1,d,e. ⇧[d, e] T1 ≡ U1 → + ∀L,U2. ⦃L, U1⦄ > ⦃L, U2⦄ → + ∃T2. ⇧[d, e] T2 ≡ U2. +#T1 #U1 #d #e * -T1 -U1 -d -e +[5: #a #I #V1 #W1 #T1 #U1 #d #e #HVW1 #_ #L #X #H + elim (csup_inv_bind1 … H) -H * + [ #_ #H destruct /2 width=2/ + | #H elim (discr_lpair_x_xy … H) + ] +|6: #I #V1 #W1 #T1 #U1 #d #e #HVW1 #HUT1 #L #X #H + elim (csup_inv_flat1 … H) -H #_ * #H destruct /2 width=2/ +] +#i #d #e [2,3: #_ ] #L #X #H +elim (csup_inv_atom1 … H) -H #I #j #HL #H destruct +lapply (ldrop_pair2_fwd_cw … HL X) -HL #H +elim (lt_refl_false … H) +qed-. +(* +lemma lift_csup_trans_gt: ∀L1,L2,U1,U2. ⦃L1, U1⦄ > ⦃L2, U2⦄ → + ⇩[0, 1] L2 ≡ L1 → ∀T1,d,e. ⇧[d, e] T1 ≡ U1 → + ∃T2. ⇧[d + 1, e] T2 ≡ U2. +#L1 #L2 #U1 #U2 * -L1 -L2 -U1 -U2 +[ #I #L1 #K1 #V #i #HLK1 #HKL1 + lapply (ldrop_fwd_lw … HLK1) -HLK1 #HLK1 + lapply (ldrop_fwd_lw … HKL1) -HKL1 #HKL1 + lapply (transitive_le … HLK1 HKL1) -L1 normalize #H + + +| #a +| #a +] +#I #L1 #W1 #U1 #HL1 + + + + #X #d #e #H + lapply (ldrop_inv_refl … HL1) -HL1 +| #a #I #L1 #W1 #U1 #j #HL1 #X #d #e #H + lapply (ldrop_inv_ldrop1 … HL1) + + elim (lift_inv_bind2 … H) -H #W2 #U2 #HW21 #HU21 #H destruct + + + /3 width=2/ /4 width=2/ + +*) + + + +(* Advanced inversion lemmas ************************************************) + +lemma csup_inv_lref2_be: ∀L,U,i. ⦃L, U⦄ > ⦃L, #i⦄ → + ∀T,d,e. ⇧[d, e] T ≡ U → d ≤ i → i < d + e → ⊥. +#L #U #i #H #T #d #e #HTU #Hdi #Hide +elim (lift_csup_trans_eq … HTU … H) -H -T #T #H +elim (lift_inv_lref2_be … H ? ?) // +qed-. + + +fact csup_inv_all4_refl_aux: ∀L1,L2,T1,T2. ⦃L1, T1⦄ > ⦃L2, T2⦄ → L1 = L2 → + ∨∨ ∃∃a,I,U. T1 = ⓑ{a,I}T2.U + | ∃∃I,W. T1 = ⓕ{I}W.T2 + | ∃∃I,U. T1 = ⓕ{I}T2.U. +#L1 #L2 #T1 #T2 * -L1 -L2 -T1 -T2 /3 width=3/ /3 width=4/ +[ #I #L #K #V #i #HLK #H destruct + lapply (ldrop_pair2_fwd_cw … HLK V) -HLK #H + elim (lt_refl_false … H) +| #a #I #L #V #T #H + elim (discr_lpair_x_xy … H) +] +qed-. + +lemma csup_inv_all4_refl: ∀L,T1,T2. ⦃L, T1⦄ > ⦃L, T2⦄ → + ∨∨ ∃∃a,I,U. T1 = ⓑ{a,I}T2.U + | ∃∃I,W. T1 = ⓕ{I}W.T2 + | ∃∃I,U. T1 = ⓕ{I}T2.U. +/2 width=4 by csup_inv_all4_refl_aux/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/csup/csup_csup.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/csup/csup_csup.etc new file mode 100644 index 000000000..661d89697 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/csup/csup_csup.etc @@ -0,0 +1,33 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/ldrop_ldrop.ma". +include "basic_2/substitution/csup.ma". + +(* SUPCLOSURE ***************************************************************) + +(* Main forward lemmas ******************************************************) + +theorem csup_trans_fwd_refl: ∀L,L0,T1,T2. ⦃L, T1⦄ > ⦃L0, T2⦄ → + ∀T3. ⦃L0, T2⦄ > ⦃L, T3⦄ → + L = L0 ∨ ⦃L, T1⦄ > ⦃L, T3⦄. +#L #L0 #T1 #T2 * -L -L0 -T1 -T2 /2 width=1/ +[ #I #L0 #K0 #V0 #i #HLK0 #T3 #H + lapply (ldrop_pair2_fwd_cw … HLK0 T3) -HLK0 #H1 + lapply (csup_fwd_cw … H) -H #H2 + lapply (transitive_lt … H1 H2) -H1 -H2 #H + elim (lt_refl_false … H) +| #a #I #L0 #V2 #T2 #T3 #HT23 + elim (csup_inv_ldrop … HT23 I V2 0 ?) -HT23 // #H1 #H2 destruct /2 width=1/ + qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/csup/csups_csups.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/csup/csups_csups.etc new file mode 100644 index 000000000..9978429d7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/csup/csups_csups.etc @@ -0,0 +1,57 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/csup_csup.ma". +include "basic_2/unfold/csups.ma". + +(* STAR-ITERATED SUPCLOSURE *************************************************) + +(* Advanced forward lemmas **************************************************) + +(* +lemma csupp_strap2_fwd_refl: ∀L,L0,T1,T2. ⦃L, T1⦄ > ⦃L0, T2⦄ → + ∀T3. ⦃L0, T2⦄ >+ ⦃L, T3⦄ → + L = L0 ∨ ⦃L, T1⦄ >+ ⦃L, T3⦄. +#L #L0 #T1 #T2 * -L -L0 -T1 -T2 /2 width=1/ +[ #I #L0 #K0 #V0 #i #HLK0 #T3 #H + lapply (ldrop_pair2_fwd_cw … HLK0 T3) -HLK0 #H1 + lapply (csupp_fwd_cw … H) -H #H2 + lapply (transitive_lt … H1 H2) -H1 -H2 #H + elim (lt_refl_false … H) +| #a #I #L0 #V2 #T2 #T3 #HT23 + /3 width=5/ + + elim (csup_inv_ldrop … HT23 I V2 0 ?) -HT23 // #H1 #H2 destruct /2 width=1/ + qed-. + + + + + + + + +lemma csups_strap1_fwd_refl: ∀L,L0,T1,T2. ⦃L, T1⦄ >* ⦃L0, T2⦄ → + ∀T3. ⦃L0, T2⦄ > ⦃L, T3⦄ → L = L0. +#L #L0 #T1 #T2 #H @(csups_ind_dx … H) -L -T1 // +#L1 #L #T1 #T #HL1 #_ #IHL0 #T3 #HL0 +lapply (csup_trans_fwd_refl … HL10) … HL0) -T2 +*) +lemma lift_csups_trans_aux: ∀T1,U1,d,e. ⇧[d, e] T1 ≡ U1 → + ∀L1,L2,U2. ⦃L1, U1⦄ >* ⦃L2, U2⦄ → L1 = L2 → + ∃T2. ⇧[d, e] T2 ≡ U2. +#T1 #U1 #d #e #HTU1 #L1 #L2 #U2 #H @(csups_ind … H) -L2 -U2 /2 width=2/ -T1 +#L #L2 #U #U2 #HL1 #HL2 #IHL1 #H destruct + +* -T1 -U1 -d -e diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/cpcs_delift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/cpcs_delift.etc new file mode 100644 index 000000000..7012ec11e --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/cpcs_delift.etc @@ -0,0 +1,37 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/delift_lift.ma". +include "basic_2/unfold/delift_delift.ma". +include "basic_2/computation/cprs_delift.ma". +include "basic_2/equivalence/cpcs_cpcs.ma". + +(* CONTEXT-SENSITIVE PARALLEL EQUIVALENCE ON TERMS **************************) + +(* Properties on inverse basic term relocation ******************************) + +lemma cpcs_zeta_delift_comm: ∀L,V,T1,T2. L.ⓓV ⊢ ▼*[O, 1] T1 ≡ T2 → + L ⊢ T2 ⬌* +ⓓV.T1. +/3 width=1/ qed. + +(* Basic_1: was only: pc3_gen_cabbr *) +lemma thin_cpcs_delift_mono: ∀L,U1,U2. L ⊢ U1 ⬌* U2 → + ∀K,d,e. ▼*[d, e] L ≡ K → ∀T1. L ⊢ ▼*[d, e] U1 ≡ T1 → + ∀T2. L ⊢ ▼*[d, e] U2 ≡ T2 → K ⊢ T1 ⬌* T2. +#L #U1 #U2 #H #K #d #e #HLK #T1 #HTU1 #T2 #HTU2 +elim (cpcs_inv_cprs … H) -H #U #HU1 #HU2 +elim (thin_cprs_delift_conf … HU1 … HLK … HTU1) -U1 #T #HT1 #HUT +elim (thin_cprs_delift_conf … HU2 … HLK … HTU2) -U2 -HLK #X #HT2 #H +lapply (delift_mono … H … HUT) -L #H destruct /2 width=3/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/cpr_delift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/cpr_delift.etc new file mode 100644 index 000000000..04eb4ae23 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/cpr_delift.etc @@ -0,0 +1,37 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/thin_delift.ma". +include "basic_2/reducibility/tpr_delift.ma". +include "basic_2/reducibility/cpr.ma". + +(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS ****************************) + +(* Properties on inverse basic term relocation ******************************) + +(* Basic_1: was only: pr2_gen_cabbr *) +lemma thin_cpr_delift_conf: ∀L,U1,U2. L ⊢ U1 ➡ U2 → + ∀K,d,e. ▼*[d, e] L ≡ K → ∀T1. L ⊢ ▼*[d, e] U1 ≡ T1 → + ∃∃T2. K ⊢ T1 ➡ T2 & L ⊢ ▼*[d, e] U2 ≡ T2. +#L #U1 #U2 * #U #HU1 #HU2 #K #d #e #HLK #T1 #HTU1 +elim (tpr_delift_conf … HU1 … HTU1) -U1 #T #HT1 #HUT +elim (le_or_ge (|L|) d) #Hd +[ elim (thin_delift_tpss_conf_le … HU2 … HUT … HLK ?) +| elim (le_or_ge (|L|) (d+e)) #Hde + [ elim (thin_delift_tpss_conf_le_up … HU2 … HUT … HLK ? ? ?) + | elim (thin_delift_tpss_conf_be … HU2 … HUT … HLK ? ?) + ] +] -U -HLK // -Hd [2,3: -Hde] #T2 #HT2 +lapply (cpr_intro … HT1 HT2) -T /2 width=3/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/cprs_delift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/cprs_delift.etc new file mode 100644 index 000000000..6b7892611 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/cprs_delift.etc @@ -0,0 +1,37 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/cpr_delift.ma". +include "basic_2/reducibility/cpr_cpr.ma". +include "basic_2/computation/cprs.ma". + +(* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************) + +(* Properties on inverse basic term relocation ******************************) + +(* Note: this should be stated with tprs *) +lemma cprs_zeta_delift: ∀L,V,T1,T2. L.ⓓV ⊢ ▼*[O, 1] T1 ≡ T2 → L ⊢ +ⓓV.T1 ➡* T2. +#L #V #T1 #T2 * #T #HT1 #HT2 +@(cprs_strap2 … (+ⓓV.T)) [ /3 width=3/ | @inj /3 width=3/ ] (**) (* explicit constructor, /5 width=3/ is too slow *) +qed. + +(* Basic_1: was only: pr3_gen_cabbr *) +lemma thin_cprs_delift_conf: ∀L,U1,U2. L ⊢ U1 ➡* U2 → + ∀K,d,e. ▼*[d, e] L ≡ K → ∀T1. L ⊢ ▼*[d, e] U1 ≡ T1 → + ∃∃T2. K ⊢ T1 ➡* T2 & L ⊢ ▼*[d, e] U2 ≡ T2. +#L #U1 #U2 #H @(cprs_ind … H) -U2 /2 width=3/ +#U #U2 #_ #HU2 #IHU1 #K #d #e #HLK #T1 #HTU1 +elim (IHU1 … HLK … HTU1) -U1 #T #HT1 #HUT +elim (thin_cpr_delift_conf … HU2 … HLK … HUT) -U -HLK /3 width=3/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/delift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/delift.etc new file mode 100644 index 000000000..eda839607 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/delift.etc @@ -0,0 +1,112 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( L ⊢ break ▼ * [ term 46 d , break term 46 e ] break term 46 T1 ≡ break term 46 T2 )" + non associative with precedence 45 + for @{ 'TSubst $L $T1 $d $e $T2 }. + +include "basic_2/unfold/tpss.ma". + +(* INVERSE BASIC TERM RELOCATION *******************************************) + +definition delift: nat → nat → lenv → relation term ≝ + λd,e,L,T1,T2. ∃∃T. L ⊢ T1 ▶* [d, e] T & ⇧[d, e] T2 ≡ T. + +interpretation "inverse basic relocation (term)" + 'TSubst L T1 d e T2 = (delift d e L T1 T2). + +(* Basic properties *********************************************************) + +lemma lift_delift: ∀T1,T2,d,e. ⇧[d, e] T1 ≡ T2 → + ∀L. L ⊢ ▼*[d, e] T2 ≡ T1. +/2 width=3/ qed. + +lemma delift_refl_O2: ∀L,T,d. L ⊢ ▼*[d, 0] T ≡ T. +/2 width=3/ qed. + +lemma delift_lsubr_trans: ∀L1,T1,T2,d,e. L1 ⊢ ▼*[d, e] T1 ≡ T2 → + ∀L2. L2 ⊑ [d, e] L1 → L2 ⊢ ▼*[d, e] T1 ≡ T2. +#L1 #T1 #T2 #d #e * /3 width=3/ +qed. + +lemma delift_sort: ∀L,d,e,k. L ⊢ ▼*[d, e] ⋆k ≡ ⋆k. +/2 width=3/ qed. + +lemma delift_lref_lt: ∀L,d,e,i. i < d → L ⊢ ▼*[d, e] #i ≡ #i. +/3 width=3/ qed. + +lemma delift_lref_ge: ∀L,d,e,i. d + e ≤ i → L ⊢ ▼*[d, e] #i ≡ #(i - e). +/3 width=3/ qed. + +lemma delift_gref: ∀L,d,e,p. L ⊢ ▼*[d, e] §p ≡ §p. +/2 width=3/ qed. + +lemma delift_bind: ∀a,I,L,V1,V2,T1,T2,d,e. + L ⊢ ▼*[d, e] V1 ≡ V2 → L. ⓑ{I} V2 ⊢ ▼*[d+1, e] T1 ≡ T2 → + L ⊢ ▼*[d, e] ⓑ{a,I} V1. T1 ≡ ⓑ{a,I} V2. T2. +#a #I #L #V1 #V2 #T1 #T2 #d #e * #V #HV1 #HV2 * #T #HT1 #HT2 +lapply (tpss_lsubr_trans … HT1 (L. ⓑ{I} V) ?) -HT1 /2 width=1/ /3 width=5/ +qed. + +lemma delift_flat: ∀I,L,V1,V2,T1,T2,d,e. + L ⊢ ▼*[d, e] V1 ≡ V2 → L ⊢ ▼*[d, e] T1 ≡ T2 → + L ⊢ ▼*[d, e] ⓕ{I} V1. T1 ≡ ⓕ{I} V2. T2. +#I #L #V1 #V2 #T1 #T2 #d #e * #V #HV1 #HV2 * /3 width=5/ +qed. + +(* Basic inversion lemmas ***************************************************) + +lemma delift_inv_sort1: ∀L,U2,d,e,k. L ⊢ ▼*[d, e] ⋆k ≡ U2 → U2 = ⋆k. +#L #U2 #d #e #k * #U #HU +>(tpss_inv_sort1 … HU) -HU #HU2 +>(lift_inv_sort2 … HU2) -HU2 // +qed-. + +lemma delift_inv_gref1: ∀L,U2,d,e,p. L ⊢ ▼*[d, e] §p ≡ U2 → U2 = §p. +#L #U #d #e #p * #U #HU +>(tpss_inv_gref1 … HU) -HU #HU2 +>(lift_inv_gref2 … HU2) -HU2 // +qed-. + +lemma delift_inv_bind1: ∀a,I,L,V1,T1,U2,d,e. L ⊢ ▼*[d, e] ⓑ{a,I} V1. T1 ≡ U2 → + ∃∃V2,T2. L ⊢ ▼*[d, e] V1 ≡ V2 & + L. ⓑ{I} V2 ⊢ ▼*[d+1, e] T1 ≡ T2 & + U2 = ⓑ{a,I} V2. T2. +#a #I #L #V1 #T1 #U2 #d #e * #U #HU #HU2 +elim (tpss_inv_bind1 … HU) -HU #V #T #HV1 #HT1 #X destruct +elim (lift_inv_bind2 … HU2) -HU2 #V2 #T2 #HV2 #HT2 +lapply (tpss_lsubr_trans … HT1 (L. ⓑ{I} V2) ?) -HT1 /2 width=1/ /3 width=5/ +qed-. + +lemma delift_inv_flat1: ∀I,L,V1,T1,U2,d,e. L ⊢ ▼*[d, e] ⓕ{I} V1. T1 ≡ U2 → + ∃∃V2,T2. L ⊢ ▼*[d, e] V1 ≡ V2 & + L ⊢ ▼*[d, e] T1 ≡ T2 & + U2 = ⓕ{I} V2. T2. +#I #L #V1 #T1 #U2 #d #e * #U #HU #HU2 +elim (tpss_inv_flat1 … HU) -HU #V #T #HV1 #HT1 #X destruct +elim (lift_inv_flat2 … HU2) -HU2 /3 width=5/ +qed-. + +lemma delift_inv_refl_O2: ∀L,T1,T2,d. L ⊢ ▼*[d, 0] T1 ≡ T2 → T1 = T2. +#L #T1 #T2 #d * #T #HT1 +>(tpss_inv_refl_O2 … HT1) -HT1 #HT2 +>(lift_inv_refl_O2 … HT2) -HT2 // +qed-. + +(* Basic forward lemmas *****************************************************) + +lemma delift_fwd_tw: ∀L,T1,T2,d,e. L ⊢ ▼*[d, e] T1 ≡ T2 → ♯{T1} ≤ ♯{T2}. +#L #T1 #T2 #d #e * #T #HT1 #HT2 +>(lift_fwd_tw … HT2) -T2 /2 width=4 by tpss_fwd_tw/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/delift_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/delift_alt.etc new file mode 100644 index 000000000..e22911032 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/delift_alt.etc @@ -0,0 +1,104 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( L ⊢ break ▼ ▼ * [ term 46 d , break term 46 e ] break term 46 T1 ≡ break term 46 T2 )" + non associative with precedence 45 + for @{ 'TSubstAlt $L $T1 $d $e $T2 }. + +include "basic_2/unfold/delift_lift.ma". + +(* INVERSE BASIC TERM RELOCATION *******************************************) + +(* alternative definition of inverse basic term relocation *) +inductive delifta: nat → nat → lenv → relation term ≝ +| delifta_sort : ∀L,d,e,k. delifta d e L (⋆k) (⋆k) +| delifta_lref_lt: ∀L,d,e,i. i < d → delifta d e L (#i) (#i) +| delifta_lref_be: ∀L,K,V1,V2,W2,i,d,e. d ≤ i → i < d + e → + ⇩[0, i] L ≡ K. ⓓV1 → delifta 0 (d + e - i - 1) K V1 V2 → + ⇧[0, d] V2 ≡ W2 → delifta d e L (#i) W2 +| delifta_lref_ge: ∀L,d,e,i. d + e ≤ i → delifta d e L (#i) (#(i - e)) +| delifta_gref : ∀L,d,e,p. delifta d e L (§p) (§p) +| delifta_bind : ∀L,a,I,V1,V2,T1,T2,d,e. + delifta d e L V1 V2 → delifta (d + 1) e (L. ⓑ{I} V2) T1 T2 → + delifta d e L (ⓑ{a,I} V1. T1) (ⓑ{a,I} V2. T2) +| delifta_flat : ∀L,I,V1,V2,T1,T2,d,e. + delifta d e L V1 V2 → delifta d e L T1 T2 → + delifta d e L (ⓕ{I} V1. T1) (ⓕ{I} V2. T2) +. + +interpretation "inverse basic relocation (term) alternative" + 'TSubstAlt L T1 d e T2 = (delifta d e L T1 T2). + +(* Basic properties *********************************************************) + +lemma delifta_lsubr_trans: ∀L1,T1,T2,d,e. L1 ⊢ ▼▼*[d, e] T1 ≡ T2 → + ∀L2. L2 ⊑ [d, e] L1 → L2 ⊢ ▼▼*[d, e] T1 ≡ T2. +#L1 #T1 #T2 #d #e #H elim H -L1 -T1 -T2 -d -e // /2 width=1/ +[ #L1 #K1 #V1 #V2 #W2 #i #d #e #Hdi #Hide #HLK1 #_ #HVW2 #IHV12 #L2 #HL12 + elim (ldrop_lsubr_ldrop2_abbr … HL12 … HLK1 ? ?) -HL12 -HLK1 // /3 width=6/ +| /4 width=1/ +| /3 width=1/ +] +qed. + +lemma delift_delifta: ∀L,T1,T2,d,e. L ⊢ ▼*[d, e] T1 ≡ T2 → L ⊢ ▼▼*[d, e] T1 ≡ T2. +#L #T1 @(f2_ind … fw … L T1) -L -T1 #n #IH #L * +[ * #i #Hn #T2 #d #e #H destruct + [ >(delift_inv_sort1 … H) -H // + | elim (delift_inv_lref1 … H) -H * /2 width=1/ + #K #V1 #V2 #Hdi #Hide #HLK #HV12 #HVT2 + lapply (ldrop_pair2_fwd_fw … HLK) #H + lapply (IH … HV12) // -H /2 width=6/ + | >(delift_inv_gref1 … H) -H // + ] +| * [ #a ] #I #V1 #T1 #Hn #X #d #e #H + [ elim (delift_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct + lapply (delift_lsubr_trans … HT12 (L.ⓑ{I}V1) ?) -HT12 /2 width=1/ #HT12 + lapply (IH … HV12) -HV12 // #HV12 + lapply (IH … HT12) -IH -HT12 /2 width=1/ #HT12 + lapply (delifta_lsubr_trans … HT12 (L.ⓑ{I}V2) ?) -HT12 /2 width=1/ + | elim (delift_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct + lapply (IH … HV12) -HV12 // + lapply (IH … HT12) -IH -HT12 // /2 width=1/ + ] +] +qed. + +(* Basic inversion lemmas ***************************************************) + +lemma delifta_delift: ∀L,T1,T2,d,e. L ⊢ ▼▼*[d, e] T1 ≡ T2 → L ⊢ ▼*[d, e] T1 ≡ T2. +#L #T1 #T2 #d #e #H elim H -L -T1 -T2 -d -e // /2 width=1/ /2 width=6/ +qed-. + +lemma delift_ind_alt: ∀R:ℕ→ℕ→lenv→relation term. + (∀L,d,e,k. R d e L (⋆k) (⋆k)) → + (∀L,d,e,i. i < d → R d e L (#i) (#i)) → + (∀L,K,V1,V2,W2,i,d,e. d ≤ i → i < d + e → + ⇩[O, i] L ≡ K.ⓓV1 → K ⊢ ▼*[O, d + e - i - 1] V1 ≡ V2 → + ⇧[O, d] V2 ≡ W2 → R O (d+e-i-1) K V1 V2 → R d e L (#i) W2 + ) → + (∀L,d,e,i. d + e ≤ i → R d e L (#i) (#(i - e))) → + (∀L,d,e,p. R d e L (§p) (§p)) → + (∀L,a,I,V1,V2,T1,T2,d,e. L ⊢ ▼*[d, e] V1 ≡ V2 → + L.ⓑ{I}V2 ⊢ ▼*[d + 1, e] T1 ≡ T2 → R d e L V1 V2 → + R (d+1) e (L.ⓑ{I}V2) T1 T2 → R d e L (ⓑ{a,I}V1.T1) (ⓑ{a,I}V2.T2) + ) → + (∀L,I,V1,V2,T1,T2,d,e. L ⊢ ▼*[d, e] V1 ≡ V2 → + L⊢ ▼*[d, e] T1 ≡ T2 → R d e L V1 V2 → + R d e L T1 T2 → R d e L (ⓕ{I}V1.T1) (ⓕ{I}V2.T2) + ) → + ∀d,e,L,T1,T2. L ⊢ ▼*[d, e] T1 ≡ T2 → R d e L T1 T2. +#R #H1 #H2 #H3 #H4 #H5 #H6 #H7 #d #e #L #T1 #T2 #H elim (delift_delifta … H) -L -T1 -T2 -d -e +// /2 width=1 by delifta_delift/ /3 width=1 by delifta_delift/ /3 width=7 by delifta_delift/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/delift_delift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/delift_delift.etc new file mode 100644 index 000000000..a5c563565 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/delift_delift.etc @@ -0,0 +1,29 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/tpss_tpss.ma". +include "basic_2/unfold/delift.ma". + +(* INVERSE BASIC TERM RELOCATION *******************************************) + +(* Main properties **********************************************************) + +theorem delift_mono: ∀L,T,T1,T2,d,e. + L ⊢ ▼*[d, e] T ≡ T1 → L ⊢ ▼*[d, e] T ≡ T2 → T1 = T2. +#L #T #T1 #T2 #d #e * #U1 #H1TU1 #H2TU1 * #U2 #H1TU2 #H2TU2 +elim (tpss_conf_eq … H1TU1 … H1TU2) -T #U #HU1 #HU2 +lapply (tpss_inv_lift1_eq … HU1 … H2TU1) -HU1 #H destruct +lapply (tpss_inv_lift1_eq … HU2 … H2TU2) -HU2 #H destruct +lapply (lift_inj … H2TU1 … H2TU2) // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/delift_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/delift_lift.etc new file mode 100644 index 000000000..8abaeb9f9 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/delift/delift_lift.etc @@ -0,0 +1,164 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/ldrop_lbotr.ma". +include "basic_2/unfold/tpss_lift.ma". +include "basic_2/unfold/delift.ma". + +(* INVERSE BASIC TERM RELOCATION *******************************************) + +(* Advanced properties ******************************************************) + +lemma delift_lref_be: ∀L,K,V1,V2,U2,i,d,e. d ≤ i → i < d + e → + ⇩[0, i] L ≡ K. ⓓV1 → K ⊢ ▼*[0, d + e - i - 1] V1 ≡ V2 → + ⇧[0, d] V2 ≡ U2 → L ⊢ ▼*[d, e] #i ≡ U2. +#L #K #V1 #V2 #U2 #i #d #e #Hdi #Hide #HLK * #V #HV1 #HV2 #HVU2 +elim (lift_total V 0 (i+1)) #U #HVU +lapply (lift_trans_be … HV2 … HVU ? ?) -HV2 // >minus_plus commutative_plus in ⊢ (??%??→?); H -H /2 width=1/ ] -Hde -H #V2 #V12 (**) (* H erased two times *) + elim (lift_total V2 0 d) /3 width=7/ +| #a #I #V1 #T1 #H #d #e #Hde #HL destruct + elim (IH … V1 … Hde HL) // #V2 #HV12 + elim (IH (L.ⓑ{I}V1) T1 … (d+1) e ??) -IH // [2,3: /2 width=1/ ] -Hde -HL #T2 #HT12 + lapply (delift_lsubr_trans … HT12 (L.ⓑ{I}V2) ?) -HT12 /2 width=1/ /3 width=4/ +| #I #V1 #T1 #H #d #e #Hde #HL destruct + elim (IH … V1 … Hde HL) // #V2 #HV12 + elim (IH … T1 … Hde HL) -IH -Hde -HL // /3 width=2/ +] +qed-. + +(* Advanced inversion lemmas ************************************************) + +lemma delift_inv_lref1_lt: ∀L,U2,i,d,e. L ⊢ ▼*[d, e] #i ≡ U2 → i < d → U2 = #i. +#L #U2 #i #d #e * #U #HU #HU2 #Hid +elim (tpss_inv_lref1 … HU) -HU +[ #H destruct >(lift_inv_lref2_lt … HU2) // +| * #K #V1 #V2 #Hdi + lapply (lt_to_le_to_lt … Hid Hdi) -Hid -Hdi #Hi + elim (lt_refl_false … Hi) +] +qed-. + +lemma delift_inv_lref1_be: ∀L,U2,d,e,i. L ⊢ ▼*[d, e] #i ≡ U2 → + d ≤ i → i < d + e → + ∃∃K,V1,V2. ⇩[0, i] L ≡ K. ⓓV1 & + K ⊢ ▼*[0, d + e - i - 1] V1 ≡ V2 & + ⇧[0, d] V2 ≡ U2. +#L #U2 #d #e #i * #U #HU #HU2 #Hdi #Hide +elim (tpss_inv_lref1 … HU) -HU +[ #H destruct elim (lift_inv_lref2_be … HU2 ? ?) // +| * #K #V1 #V #_ #_ #HLK #HV1 #HVU + elim (lift_div_be … HVU … HU2 ? ?) -U // /2 width=1/ /3 width=6/ +] +qed-. + +lemma delift_inv_lref1_ge: ∀L,U2,i,d,e. L ⊢ ▼*[d, e] #i ≡ U2 → + d + e ≤ i → U2 = #(i - e). +#L #U2 #i #d #e * #U #HU #HU2 #Hdei +elim (tpss_inv_lref1 … HU) -HU +[ #H destruct >(lift_inv_lref2_ge … HU2) // +| * #K #V1 #V2 #_ #Hide + lapply (lt_to_le_to_lt … Hide Hdei) -Hide -Hdei #Hi + elim (lt_refl_false … Hi) +] +qed-. + +lemma delift_inv_lref1: ∀L,U2,i,d,e. L ⊢ ▼*[d, e] #i ≡ U2 → + ∨∨ (i < d ∧ U2 = #i) + | (∃∃K,V1,V2. d ≤ i & i < d + e & + ⇩[0, i] L ≡ K. ⓓV1 & + K ⊢ ▼*[0, d + e - i - 1] V1 ≡ V2 & + ⇧[0, d] V2 ≡ U2 + ) + | (d + e ≤ i ∧ U2 = #(i - e)). +#L #U2 #i #d #e #H +elim (lt_or_ge i d) #Hdi +[ elim (delift_inv_lref1_lt … H Hdi) -H /3 width=1/ +| elim (lt_or_ge i (d+e)) #Hide + [ elim (delift_inv_lref1_be … H Hdi Hide) -H /3 width=6/ + | elim (delift_inv_lref1_ge … H Hide) -H /3 width=1/ + ] +] +qed-. + +(* Properties on basic term relocation **************************************) + +lemma delift_lift_le: ∀K,T1,T2,dt,et. K ⊢ ▼*[dt, et] T1 ≡ T2 → + ∀L,U1,d,e. dt + et ≤ d → ⇩[d, e] L ≡ K → + ⇧[d, e] T1 ≡ U1 → ∀U2. ⇧[d - et, e] T2 ≡ U2 → + L ⊢ ▼*[dt, et] U1 ≡ U2. +#K #T1 #T2 #dt #et * #T #HT1 #HT2 #L #U1 #d #e #Hdetd #HLK #HTU1 #U2 #HTU2 +elim (lift_total T d e) #U #HTU +lapply (tpss_lift_le … HT1 … HLK HTU1 … HTU) -T1 -HLK // #HU1 +elim (lift_trans_ge … HT2 … HTU ?) -T // -Hdetd #T #HT2 #HTU +>(lift_mono … HTU2 … HT2) -T2 /2 width=3/ +qed. + +lemma delift_lift_be: ∀K,T1,T2,dt,et. K ⊢ ▼*[dt, et] T1 ≡ T2 → + ∀L,U1,d,e. dt ≤ d → d ≤ dt + et → + ⇩[d, e] L ≡ K → ⇧[d, e] T1 ≡ U1 → + L ⊢ ▼*[dt, et + e] U1 ≡ T2. +#K #T1 #T2 #dt #et * #T #HT1 #HT2 #L #U1 #d #e #Hdtd #Hddet #HLK #HTU1 +elim (lift_total T d e) #U #HTU +lapply (tpss_lift_be … HT1 … HLK HTU1 … HTU) -T1 -HLK // #HU1 +lapply (lift_trans_be … HT2 … HTU ? ?) -T // -Hdtd -Hddet /2 width=3/ +qed. + +lemma delift_lift_ge: ∀K,T1,T2,dt,et. K ⊢ ▼*[dt, et] T1 ≡ T2 → + ∀L,U1,d,e. d ≤ dt → ⇩[d, e] L ≡ K → + ⇧[d, e] T1 ≡ U1 → ∀U2. ⇧[d, e] T2 ≡ U2 → + L ⊢ ▼*[dt + e, et] U1 ≡ U2. +#K #T1 #T2 #dt #et * #T #HT1 #HT2 #L #U1 #d #e #Hddt #HLK #HTU1 #U2 #HTU2 +elim (lift_total T d e) #U #HTU +lapply (tpss_lift_ge … HT1 … HLK HTU1 … HTU) -T1 -HLK // #HU1 +elim (lift_trans_le … HT2 … HTU ?) -T // -Hddt #T #HT2 #HTU +>(lift_mono … HTU2 … HT2) -T2 /2 width=3/ +qed. + +lemma delift_inv_lift1_eq: ∀L,U1,T2,d,e. L ⊢ ▼*[d, e] U1 ≡ T2 → + ∀K. ⇩[d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → T1 = T2. +#L #U1 #T2 #d #e * #U2 #HU12 #HTU2 #K #HLK #T1 #HTU1 +lapply (tpss_inv_lift1_eq … HU12 … HTU1) -L -K #H destruct +lapply (lift_inj … HTU1 … HTU2) -U2 // +qed-. + +lemma delift_lift_div_be: ∀L,T1,T,d,e,i. L ⊢ ▼*[i, d + e - i] T1 ≡ T → + ∀T2. ⇧[d, i - d] T2 ≡ T → d ≤ i → i ≤ d + e → + L ⊢ ▼*[d, e] T1 ≡ T2. +#L #T1 #T #d #e #i * #T0 #HT10 #HT0 #T2 #HT2 #Hdi #Hide +lapply (tpss_weak … HT10 d e ? ?) -HT10 // [ >commutative_plus /2 width=1/ ] #HT10 +lapply (lift_trans_be … HT2 … HT0 ? ?) -T // +>commutative_plus >commutative_plus in ⊢ (? ? (? % ?) ? ? → ?); +commutative_plus in H; >plus_plus_comm_23 #H + elim (le_plus_xySz_x_false … H) + ] + ] +| #a #I #V1 #T1 #Hn #X1 #H1 #L2 #HL12 #X2 #H2 + elim (cpr_inv_bind1 … H1) -H1 * + [ #V #T #HV1 #HT1 #H destruct + elim (cpr_inv_bind1 … H2) -H2 * + [ #V2 #T2 #HV2 #HT2 #H destruct + elim (IH … HV1 … HV2) // #HV12 destruct + [ @or_introl #H destruct /2 width=1/ + | elim (IH … HT1 … HT2) // /2 width=1/ -L1 -L2 #HT12 destruct + @or_introl #H destruct /2 width=1/ + ] + | #T2 #HT2 #HXT2 #H1 #H2 destruct + elim (IH … HT1 … HT2) // /2 width=1/ -L1 -L2 #HT12 destruct + | elim (term_eq_dec V1 V) #HV1 destruct + + ] + | #Y1 #HTY1 #HXY1 #H11 #H12 destruct + elim (lift_total (+ⓓV1.T1) 0 1) #Y2 #HXY2 + lapply (cpr_lift … H2 (L2.ⓓV1) … HXY1 … HXY2) /2 width=1/ -X1 /4 width=5/ + ] +| #I #V1 #T1 #Hn #X1 #H1 #L2 #HL12 #X2 #H2 + elim (cpr_inv_flat1 … H1) -H1 * + [ #V #T #HV1 #HT1 #H destruct + elim (cpr_inv_flat1 … H2) -H2 * + [ #V2 #T2 #HV2 #HT2 #H destruct /3 width=5/ + | #HX2 #H destruct /3 width=5/ + ] + | #HX1 #H destruct /3 width=5/ +] +qed-. +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/etc/ldrop.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/etc/ldrop.etc new file mode 100644 index 000000000..e4caef0c8 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/etc/ldrop.etc @@ -0,0 +1,11 @@ +lemma ldrop_bor1: ∀L1,L2,s1,s2,d,e. ⇩[s1, d, e] L1 ≡ L2 → ⇩[s1 ∨ s2, d, e] L1 ≡ L2. +#L1 #L2 * /2 width=1 by ldrop_gen/ +qed. + +lemma ldrop_bor2: ∀L1,L2,s1,s2,d,e. ⇩[s2, d, e] L1 ≡ L2 → ⇩[s1 ∨ s2, d, e] L1 ≡ L2. +#L1 #L2 #s1 #s2 >commutative_orb /2 width=1 by ldrop_bor1/ +qed. + +(* Basic_1: was: drop_conf_rev *) +axiom ldrop_div: ∀e1,L1,L. ⇩[0, e1] L1 ≡ L → ∀e2,L2. ⇩[0, e2] L2 ≡ L → + ∃∃L0. ⇩[0, e1] L0 ≡ L2 & ⇩[e1, e2] L0 ≡ L1. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fleq/fpbc_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fleq/fpbc_lift.etc new file mode 100644 index 000000000..286290135 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fleq/fpbc_lift.etc @@ -0,0 +1,9 @@ +include "basic_2/reduction/lpx_ldrop.ma". + +lemma lpx_fpbc_trans: ∀h,g,G1,G2,K1,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≻[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, K1⦄ ⊢ ➡[h, g] L1 → + ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡[h, g] T & ⦃G1, K1, T⦄ ≻[h, g] ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g] L2. +#h #g #G1 #G2 #K1 #L1 #L2 #T1 #T2 * -G2 -L2 -T2 +[ #G2 #L2 #T2 #H12 #HKL1 elim (lpx_fqu_trans … H12 … HKL1) -L1 + /3 width=5 by fpbc_fqu, ex3_2_intro/ +| #T2 #HT12 #H #HKL1 diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fleq/fpbs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fleq/fpbs.etc new file mode 100644 index 000000000..017421feb --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fleq/fpbs.etc @@ -0,0 +1,49 @@ +lemma fpbs_fpbu_sn: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ ≡[0] ⦃G2, L2, T2⦄ ∨ + ∃∃G,L,T. ⦃G1, L1, T1⦄ ≻[h, g] ⦃G, L, T⦄ & ⦃G, L, T⦄ ≥[h, g] ⦃G2, L2, T2⦄. +(* ALTERNATIVE PROOF +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbs_ind_dx … H) -G1 -L1 -T1 +[ /2 width=1 by or_introl/ +| #G1 #G #L1 #L #T1 #T #H1 #_ * [ #H2 | * #G0 #L0 #T0 #H0 #H02 ] + elim (fpb_fpbu … H1) -H1 #H1 + [ /3 width=1 by +*) +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H elim(fpbs_inv_alt … H) -H +#L0 #L #T #HT1 #HT2 #HL0 #HL2 elim (eq_term_dec T1 T) #H destruct +[ -HT1 elim (fqus_inv_gen … HT2) -HT2 + [ #H elim (fqup_inv_step_sn … H) -H + /4 width=11 by fpbs_intro_alt, fpbu_fqu, ex2_3_intro, or_intror/ + | * #HG #HL #HT destruct elim (lleq_dec T2 L0 L 0) #H + [ /4 width=3 by fleq_intro, lleq_trans, or_introl/ + | elim (lpxs_nlleq_inv_step_sn … HL0 H) -HL0 -H + /5 width=7 by lpxs_lleq_fpbs, fpbu_lpx, lleq_trans, ex2_3_intro, or_intror/ + ] + ] +| elim (cpxs_neq_inv_step_sn … HT1 H) -HT1 -H + /5 width=11 by fpbs_intro_alt, fpbu_cpx, ex2_3_intro, or_intror/ +] +qed-. + +(* alternative proof that needs decidability of bteq to go in fpbs.ma + * or lpx_fpbc_trans to go in fpbs_lift.ma (possibly) +*) + +axiom lpx_bteq_trans: ∀h,g,G1,G2,L1,L,L2,T1,T2. ⦃G1, L1⦄ ⊢➡ [h, g] L → + ⦃G1, L, T1⦄ ⋕[h, g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⋕[h, g] ⦃G2, L2, T2⦄. + +lemma fpbs_fwd_fpb_sn: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ ⋕[h, g] ⦃G2, L2, T2⦄ ∨ + ∃∃G,L,T. ⦃G1, L1, T1⦄ ≻[h, g] ⦃G, L, T⦄ & ⦃G, L, T⦄ ≥[h, g] ⦃G2, L2, T2⦄. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbs_ind_dx … H) -G1 -L1 -T1 [ /2 width=1 by or_introl/ ] (**) (* auto fails without brackets *) +#G1 #G #L1 #L #T1 #T * +[ #G0 #L0 #T0 #H #H02 #IH1 elim (fquq_inv_gen … H) -H + [ -IH1 /4 width=5 by fpbc_fqu, ex2_3_intro, or_intror/ + | -H02 * #HG #HL #HT destruct /2 width=1 by/ + ] +| #T0 #HT10 #H02 #IH02 elim (eq_term_dec T1 T0) #H destruct + [ -H02 /2 width=1 by/ + | -IH02 /5 width=5 by fpbc_cpx, ex2_3_intro, or_intror/ + ] +| #L0 #HL10 #_ * [ /3 width=3 by or_introl, lpx_bteq_trans/ ] + * #G3 #L3 #T3 #H13 #H32 + diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/fpa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/fpa.etc new file mode 100644 index 000000000..8f72937c4 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/fpa.etc @@ -0,0 +1,36 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/rajust_5.ma". +include "basic_2/substitution/drop.ma". + +(* AJUSTMENT ****************************************************************) + +inductive fpa (s:bool): bi_relation lenv term ≝ +| fpa_fwd: ∀L,K,T,U,d,e. ⇩[s, d, e] L ≡ K → ⇧[d, e] T ≡ U → fpa s K T L U +| fpa_bwd: ∀L,K,T,U,d,e. ⇩[s, d, e] L ≡ K → ⇧[d, e] T ≡ U → fpa s L U K T +. + +interpretation + "ajustment (restricted closure)" + 'RAjust L1 T1 s L2 T2 = (fpa s L1 T1 L2 T2). + +(* Basic properties *********************************************************) + +lemma fpa_refl: ∀s. bi_reflexive … (fpa s). +/2 width=4 by fpa_fwd/ qed. + +lemma fpa_sym: ∀s. bi_symmetric … (fpa s). +#s #L1 #L2 #T1 #T2 * /2 width=4 by fpa_fwd, fpa_bwd/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/fpa_fpa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/fpa_fpa.etc new file mode 100644 index 000000000..c62b8bfb9 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/fpa_fpa.etc @@ -0,0 +1,22 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/fpa.ma". + +(* AJUSTMENT ****************************************************************) + +(* Main properties **********************************************************) + +theorem fpa_conf: ∀s. bi_confluent … (fpa s). +/3 width=4 by fpa_sym, ex2_2_intro/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/fpas.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/fpas.etc new file mode 100644 index 000000000..6817d8c90 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/fpas.etc @@ -0,0 +1,59 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/rajuststar_5.ma". +include "basic_2/substitution/fpa.ma". + +(* MULTIPLE AJUSTMENT *******************************************************) + +definition fpas: bool → bi_relation lenv term ≝ λs. bi_TC … (fpa s). + +interpretation + "multiple ajustment (restricted closure)" + 'RAjustStar L1 T1 s L2 T2 = (fpas s L1 T1 L2 T2). + +(* Basic eliminators ********************************************************) + +lemma fpas_ind: ∀L1,T1,s. ∀R:relation2 …. R L1 T1 → + (∀L,L2,T,T2. ⦃L1, T1⦄ ⇳*[s] ⦃L, T⦄ → ⦃L, T⦄ ⇳[s] ⦃L2, T2⦄ → R L T → R L2 T2) → + ∀L2,T2. ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄ → R L2 T2. +#L1 #T1 #s #R #IH1 #IH2 #L2 #T2 #H +@(bi_TC_star_ind … IH1 IH2 L2 T2 H) // +qed-. + +lemma fpas_ind_dx: ∀L2,T2,s. ∀R:relation2 …. R L2 T2 → + (∀L1,L,T1,T. ⦃L1, T1⦄ ⇳[s] ⦃L, T⦄ → ⦃L, T⦄ ⇳*[s] ⦃L2, T2⦄ → R L T → R L1 T1) → + ∀L1,T1. ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄ → R L1 T1. +#L2 #T2 #s #R #IH1 #IH2 #L1 #T1 #H +@(bi_TC_star_ind_dx … IH1 IH2 L1 T1 H) // +qed-. + +(* Basic properties *********************************************************) + +lemma fpas_refl: ∀s. bi_reflexive … (fpas s). +/2 width=1 by bi_inj/ qed. + +lemma fpas_sym: ∀s. bi_symmetric … (fpas s). +/3 width=1 by fpa_sym, bi_TC_symmetric/ qed-. + +lemma fpa_fpas: ∀L1,L2,T1,T2,s. ⦃L1, T1⦄ ⇳[s] ⦃L2, T2⦄ → ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄. +/2 width=1 by bi_inj/ qed. + +lemma fpas_strap1: ∀L1,L,L2,T1,T,T2,s. ⦃L1, T1⦄ ⇳*[s] ⦃L, T⦄ → ⦃L, T⦄ ⇳[s] ⦃L2, T2⦄ → + ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄. +/2 width=4 by bi_step/ qed-. + +lemma fpas_strap2: ∀L1,L,L2,T1,T,T2,s. ⦃L1, T1⦄ ⇳[s] ⦃L, T⦄ → ⦃L, T⦄ ⇳*[s] ⦃L2, T2⦄ → + ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄. +/2 width=4 by bi_TC_strap/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/fpas_fpas.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/fpas_fpas.etc new file mode 100644 index 000000000..28d648e7b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/fpas_fpas.etc @@ -0,0 +1,40 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/fpa_fpa.ma". +include "basic_2/multiple/fpas.ma". + +(* MULTIPLE AJUSTMENT *******************************************************) + +(* Advanced properties ******************************************************) + +lemma fpas_strip: ∀L0,L1,L2,T0,T1,T2,s. ⦃L0, T0⦄ ⇳[s] ⦃L1, T1⦄ → ⦃L0, T0⦄ ⇳*[s] ⦃L2, T2⦄ → + ∃∃L,T. ⦃L1, T1⦄ ⇳*[s] ⦃L, T⦄ & ⦃L2, T2⦄ ⇳[s] ⦃L, T⦄. +/3 width=4 by fpa_conf, bi_TC_strip/ qed-. + +(* Main properties **********************************************************) + +theorem fpas_conf: ∀s. bi_confluent … (fpas s). +/3 width=4 by fpa_conf, bi_TC_confluent/ qed-. + +theorem fpas_trans: ∀s. bi_transitive … (fpas s). +/2 width=4 by bi_TC_transitive/ qed-. + +theorem fpas_canc_sn: ∀L,L1,L2,T,T1,T2,s. + ⦃L, T⦄ ⇳*[s] ⦃L1, T1⦄→ ⦃L, T⦄ ⇳*[s] ⦃L2, T2⦄ → ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄. +/3 width=4 by fpas_trans, fpas_sym/ qed-. + +theorem fpas_canc_dx: ∀L1,L2,L,T1,T2,T,s. + ⦃L1, T1⦄ ⇳*[s] ⦃L, T⦄ → ⦃L2, T2⦄ ⇳*[s] ⦃L, T⦄ → ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄. +/3 width=4 by fpas_trans, fpas_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/fpas_vector.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/fpas_vector.etc new file mode 100644 index 000000000..65e8190e4 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/fpas_vector.etc @@ -0,0 +1,56 @@ +(**************************************************************************) +(* ___ *) +(* ||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/grammar/term_vector.ma". +include "basic_2/multiple/fpas.ma". + +(* MULTIPLE VECTOR AJUSTMENT ************************************************) + +inductive fpasv (s:bool): bi_relation lenv (list term) ≝ +| fpasv_nil : ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄ → fpasv s L1 (◊) L2 (◊) +| fpasv_cons: ∀L1,L2,T1s,T2s,T1,T2. ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄ → + fpasv s L1 T1s L2 T2s → + fpasv s L1 (T1 @ T1s) L2 (T2 @ T2s) +. + +interpretation + "multiple vector ajustment (restricted closure)" + 'RAjustStar L1 T1s s L2 T2s = (fpasv s L1 T1s L2 T2s). + +(* Basic inversion lemmas ***************************************************) + + + +(* Basic_1: was just: lifts1_flat (left to right) *) +lemma fpas_inv_applv1: ∀L1,L2,V1s,T1,X,s. ⦃L1, Ⓐ V1s.T1⦄ ⇳*[s] ⦃L2, X⦄ → + ∃∃V2s,T2. ⦃L1, V1s⦄ ⇳*[s] ⦃L2, V2s⦄ & ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄ & + X = Ⓐ V2s.T2. +#L1 #L2 #V1s elim V1s -V1s +[ #T1 #X #s #H + @(ex3_2_intro … (◊) X) /2 width=3 by fpasv_nil/ (**) (* explicit constructor *) +| #V1 #V1s #IHV1s #T1 #X #s #H + elim (lifts_inv_flat1 … H) -H #V2 #Y #HV12 #HY #H destruct + elim (IHV1s … HY) -IHV1s -HY #V2s #T2 #HV12s #HT12 #H destruct + @(ex3_2_intro) [4: // |3: /2 width=2 by liftsv_cons/ |1,2: skip | // ] (**) (* explicit constructor *) +] +qed-. + +(* Basic properties *********************************************************) + +(* Basic_1: was just: lifts1_flat (right to left) *) +lemma lifts_applv: ∀V1s,V2s,des. ⇧*[des] V1s ≡ V2s → + ∀T1,T2. ⇧*[des] T1 ≡ T2 → + ⇧*[des] Ⓐ V1s. T1 ≡ Ⓐ V2s. T2. +#V1s #V2s #des #H elim H -V1s -V2s /3 width=1 by lifts_flat/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/gcp.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/gcp.etc new file mode 100644 index 000000000..b9b2db820 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/gcp.etc @@ -0,0 +1,48 @@ +(**************************************************************************) +(* ___ *) +(* ||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/grammar/genv.ma". +include "basic_2/multiple/fpas.ma". + +(* GENERIC COMPUTATION PROPERTIES *******************************************) + +definition candidate: Type[0] ≝ relation3 genv lenv term. + +definition CP0 ≝ λRR:relation4 genv lenv term term. λRS:relation term. + ∀G,L1,L2,T1,T2,s. ⦃L1, T1⦄ ⇳[s] ⦃L2, T2⦄ → + NF … (RR G L1) RS T1 → NF … (RR G L2) RS T2. + +definition CP0s ≝ λRR:relation4 genv lenv term term. λRS:relation term. + ∀G,L1,L2,T1,T2,s. ⦃L1, T1⦄ ⇳*[s] ⦃L2, T2⦄ → + NF … (RR G L1) RS T1 → NF … (RR G L2) RS T2. + +definition CP1 ≝ λRR:relation4 genv lenv term term. λRS:relation term. + ∀G,L. ∃k. NF … (RR G L) RS (⋆k). + +definition CP2 ≝ λRP:candidate. + ∀G,L,T,k. RP G L (ⓐ⋆k.T) → RP G L T. + +(* requirements for generic computation properties *) +record gcp (RR:relation4 genv lenv term term) (RS:relation term) (RP:candidate) : Prop ≝ +{ cp0: CP0 RR RS; + cp1: CP1 RR RS; + cp2: CP2 RP +}. + +(* Basic properties *********************************************************) + +(* Basic_1: was just: nf2_lift1 *) +lemma gcp_fpas: ∀RR,RS. CP0 RR RS → CP0s RR RS. +#RR #RS #HRR #G #L1 #L2 #T1 #T2 #s #H @(fpas_ind … H) -L2 -T2 /3 width=5 by/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/gcp_cr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/gcp_cr.etc new file mode 100644 index 000000000..76490987f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/gcp_cr.etc @@ -0,0 +1,185 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/ineint_5.ma". +include "basic_2/grammar/aarity.ma". +include "basic_2/substitution/lift_vector.ma". +include "basic_2/computation/gcp.ma". + +(* GENERIC COMPUTATION PROPERTIES *******************************************) + +definition S0 ≝ λC:candidate. ∀G,L1,L2,T1,T2. ⦃L1, T1⦄ ⇳[Ⓕ] ⦃L2, T2⦄ → + C G L1 T1 → C G L2 T2. + +definition S0s ≝ λC:candidate. ∀G,L1,L2,T1,T2. ⦃L1, T1⦄ ⇳*[Ⓕ] ⦃L2, T2⦄ → + C G L1 T1 → C G L2 T2. + +(* Note: this is Girard's CR1 *) +definition S1 ≝ λRP,C:candidate. + ∀G,L,T. C G L T → RP G L T. + +(* Note: this is Tait's iii, or Girard's CR4 *) +definition S2 ≝ λRR:relation4 genv lenv term term. λRS:relation term. λRP,C:candidate. + ∀G,L,Vs. all … (RP G L) Vs → + ∀T. 𝐒⦃T⦄ → NF … (RR G L) RS T → C G L (ⒶVs.T). + +(* Note: this generalizes Tait's ii *) +definition S3 ≝ λC:candidate. + ∀a,G,L,Vs,V,T,W. + C G L (ⒶVs.ⓓ{a}ⓝW.V.T) → C G L (ⒶVs.ⓐV.ⓛ{a}W.T). + +definition S4 ≝ λRP,C:candidate. + ∀G,L,Vs. all … (RP G L) Vs → ∀k. C G L (ⒶVs.⋆k). + +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). + +definition S6 ≝ λRP,C:candidate. + ∀G,L,V1s,V2s. ⇧[0, 1] V1s ≡ V2s → + ∀a,V,T. C G (L.ⓓV) (ⒶV2s.T) → RP G L V → C G L (ⒶV1s.ⓓ{a}V.T). + +definition S7 ≝ λC:candidate. + ∀G,L,Vs,T,W. C G L (ⒶVs.T) → C G L (ⒶVs.W) → C G L (ⒶVs.ⓝW.T). + +(* requirements for the generic reducibility candidate *) +record gcr (RR:relation4 genv lenv term term) (RS:relation term) (RP,C:candidate) : Prop ≝ +{ s0: S0 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,V,U. ⦃K, T⦄ ⇳*[Ⓕ] ⦃L, U⦄ → + C1 G L V → C2 G L (ⓐV.U). + +(* the reducibility candidate associated to an atomic arity *) +let rec acr (RP:candidate) (A:aarity) on A: candidate ≝ +match A with +[ AAtom ⇒ RP +| APair B A ⇒ cfun (acr RP B) (acr RP A) +]. + +interpretation + "candidate of reducibility of an atomic arity (abstract)" + 'InEInt RP G L T A = (acr RP A G L T). + +(* Basic properties *********************************************************) + +(* Basic_1: was just: sc3_lift1 *) +lemma gcr_fpas: ∀C. S0 C → S0s C. +#C #HC #G #L1 #L2 #T1 #T2 #H @(fpas_ind … H) -L2 -T2 /3 width=5 by/ +qed. +(* +lemma rp_lifts: ∀RR,RS,RP. gcr RR RS RP RP → + ∀des,G,L0,L,V,V0. ⇩*[Ⓕ, des] L0 ≡ L → ⇧*[des] V ≡ V0 → + RP G L V → RP G L0 V0. +#RR #RS #RP #HRP #des #G #L0 #L #V #V0 #HL0 #HV0 #HV +@gcr_lifts /width=7 by/ +@(s0 … HRP) +qed. + +(* Basic_1: was only: sns3_lifts1 *) +lemma rp_liftsv_all: ∀RR,RS,RP. gcr RR RS RP RP → + ∀des,G,L0,L,Vs,V0s. ⇩*[Ⓕ, des] L0 ≡ L → ⇧*[des] Vs ≡ V0s → + all … (RP G L) Vs → all … (RP G L0) V0s. +#RR #RS #RP #HRP #des #G #L0 #L #Vs #V0s #HL0 #H elim H -Vs -V0s normalize // +#T1s #T2s #T1 #T2 #HT12 #_ #IHT2s * /3 width=7 by rp_lifts, conj/ +qed. +*) +(* Basic_1: was: + sc3_sn3 sc3_abst sc3_appl sc3_abbr sc3_bind sc3_cast sc3_lift +*) +lemma acr_gcr: ∀RR,RS,RP. gcp RR RS RP → gcr RR RS RP RP → + ∀A. gcr RR RS RP (acr RP A). +#RR #RS #RP #H1RP #H2RP #A elim A -A // +#B #A #IHB #IHA @mk_gcr +[ /3 width=4 by fpas_strap2/ +| #G #L #T #H + elim (cp1 … H1RP G L) #k #HK + lapply (H L (⋆k) T ? ?) -H // + [ @(s2 … IHB … (◊)) // + | #H @(cp2 … H1RP … k) @(s1 … IHA) // + ] +| #G #L #Vs #HVs #T #H1T #H2T #L0 #V0 #X #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=14 by rp_liftsv_all, gcp_lifts, cp0, lifts_simple_dx, conj/ +| #a #G #L #Vs #U #T #W #HA #L0 #V0 #X #des #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 + @(s3 … IHA … (V0 @ V0s)) /5 width=6 by lifts_applv, lifts_flat, lifts_bind/ +| #G #L #Vs #HVs #k #L0 #V0 #X #des #HL0 #H #HB + elim (lifts_inv_applv1 … H) -H #V0s #Y #HV0s #HY #H destruct + >(lifts_inv_sort1 … HY) -Y + lapply (s1 … IHB … HB) #HV0 + @(s4 … IHA … (V0 @ V0s)) /3 width=7 by rp_liftsv_all, conj/ +| #I #G #L #K #Vs #V1 #V2 #i #HA #HV12 #HLK #L0 #V0 #X #des #HL0 #H #HB + elim (lifts_inv_applv1 … H) -H #V0s #Y #HV0s #HY #H destruct + elim (lifts_inv_lref1 … HY) -HY #i0 #Hi0 #H destruct + elim (drops_drop_trans … HL0 … HLK) #X #des0 #i1 #HL02 #H #Hi1 #Hdes0 + >(at_mono … Hi1 … Hi0) in HL02; -i1 #HL02 + elim (drops_inv_skip2 … Hdes0 … H) -H -des0 #L2 #W1 #des0 #Hdes0 #HLK #HVW1 #H destruct + elim (lift_total W1 0 (i0 + 1)) #W2 #HW12 + elim (lifts_lift_trans … Hdes0 … HVW1 … HW12) // -Hdes0 -Hi0 #V3 #HV13 #HVW2 + >(lift_mono … HV13 … HV12) in HVW2; -V3 #HVW2 + @(s5 … IHA … (V0 @ V0s) … HW12 HL02) /3 width=5 by lifts_applv/ +| #G #L #V1s #V2s #HV12s #a #V #T #HA #HV #L0 #V10 #X #des #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 V10s) #V20s #HV120s + @(s6 … IHA … (V10 @ V10s) (V20 @ V20s)) /3 width=7 by rp_lifts, liftv_cons/ + @(HA … (des + 1)) /2 width=2 by drops_skip/ + [ @lifts_applv // + elim (liftsv_liftv_trans_le … HV10s … HV120s) -V10s #V10s #HV10s #HV120s + >(liftv_mono … HV12s … HV10s) -V1s // + | @(s0 … IHB … HB … HV120) /2 width=2 by drop_drop/ + ] +| #G #L #Vs #T #W #HA #HW #L0 #V0 #X #des #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 + @(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,des. ⇩*[Ⓕ, des] L0 ≡ L → ⇧*[des] W ≡ W0 → ⇧*[des + 1] 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 #des #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 … HL0 … HW0 HW) -HW [ @(s0 … HCB) ] #HW0 +@(s3 … HCA … (◊)) +@(s6 … HCA … (◊) (◊)) // +[ @(HA … HL0) // +| lapply (s1 … HCB) -HCB #HCB + @(s7 … H2RP … (◊)) /2 width=1 by/ +] +qed. + +(* Basic_1: removed theorems 2: sc3_arity_gen sc3_repl *) +(* Basic_1: removed local theorems 1: sc3_sn3_abst *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/rajust_5.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/rajust_5.etc new file mode 100644 index 000000000..ef0fbc49b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/rajust_5.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 L1, break term 46 T1 ⦄ ⇳ [ break term 46 s ] break ⦃ term 46 L2 , break term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'RAjust $L1 $T1 $s $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/rajuststar_5.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/rajuststar_5.etc new file mode 100644 index 000000000..7cf9191d6 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpa/rajuststar_5.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 L1, break term 46 T1 ⦄ ⇳ * [ break term 46 s ] break ⦃ term 46 L2 , break term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'RAjustStar $L1 $T1 $s $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbc.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbc.etc new file mode 100644 index 000000000..9c803f041 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbc.etc @@ -0,0 +1,33 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/lazybtpredproper_8.ma". +include "basic_2/multiple/fleq.ma". +include "basic_2/reduction/fpbu.ma". + +(* "QRST" PROPER PARALLEL REDUCTION FOR CLOSURES ****************************) + +definition fpbc: ∀h. sd h → tri_relation genv lenv term ≝ + λh,g,G1,L1,T1,G2,L2,T2. + ∃∃G,L,T. ⦃G1, L1, T1⦄ ≻[h, g] ⦃G, L, T⦄ & ⦃G, L, T⦄ ≡[0] ⦃G2, L2, T2⦄. + +interpretation + "'qrst' proper parallel reduction (closure)" + 'LazyBTPRedProper h g G1 L1 T1 G2 L2 T2 = (fpbc h g G1 L1 T1 G2 L2 T2). + +(* Baic properties **********************************************************) + +lemma fpbu_fpbc: ∀h,g,G1,G2,L1,L2,T1,T2. + ⦃G1, L1, T1⦄ ≻[h, g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G2, L2, T2⦄. +/2 width=5 by ex2_3_intro/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbc_fleq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbc_fleq.etc new file mode 100644 index 000000000..aa5cd7f2b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbc_fleq.etc @@ -0,0 +1,34 @@ +(**************************************************************************) +(* ___ *) +(* ||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/fleq_fleq.ma". +include "basic_2/reduction/fpbu_fleq.ma". +include "basic_2/reduction/fpbc.ma". + +(* "QRST" PROPER PARALLEL REDUCTION FOR CLOSURES ****************************) + +(* Properties on lazy equivalence on closures *******************************) + +lemma fpbc_fleq_trans: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G, L, T⦄ → + ⦃G, L, T⦄ ≡[0] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G2, L2, T2⦄. +#h #g #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 * +/3 width=9 by fleq_trans, ex2_3_intro/ +qed-. + +lemma fleq_fpbc_trans: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ≡[0] ⦃G, L, T⦄ → + ⦃G, L, T⦄ ≻≡[h, g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G2, L2, T2⦄. +#h #g #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 #H1 * +#G0 #L0 #T0 #H0 #H02 elim (fleq_fpbu_trans … H1 … H0) -G -L -T +/3 width=9 by fleq_trans, ex2_3_intro/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbg.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbg.etc new file mode 100644 index 000000000..574c35e10 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbg.etc @@ -0,0 +1,61 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/lazybtpredstarproper_8.ma". +include "basic_2/reduction/fpbc.ma". + +(* "QRST" PROPER PARALLEL COMPUTATION FOR CLOSURES **************************) + +definition fpbg: ∀h. sd h → tri_relation genv lenv term ≝ + λh,g. tri_TC … (fpbc h g). + +interpretation "'qrst' proper parallel computation (closure)" + 'LazyBTPRedStarProper h g G1 L1 T1 G2 L2 T2 = (fpbg h g G1 L1 T1 G2 L2 T2). + +(* Basic properties *********************************************************) + +lemma fpbc_fpbg: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. +/2 width=1 by tri_inj/ qed. + +lemma fpbg_strap1: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. + ⦃G1, L1, T1⦄ >≡[h, g] ⦃G, L, T⦄ → ⦃G, L, T⦄ ≻≡[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. +/2 width=5 by tri_step/ qed. + +lemma fpbg_strap2: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. + ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G, L, T⦄ → ⦃G, L, T⦄ >≡[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. +/2 width=5 by tri_TC_strap/ qed. + +lemma fpbu_fpbg: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≻[h,g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. +/3 width=1 by fpbu_fpbc, fpbc_fpbg/ qed. + +(* Basic eliminators ********************************************************) + +lemma fpbg_ind: ∀h,g,G1,L1,T1. ∀R:relation3 …. + (∀G2,L2,T2. ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G2, L2, T2⦄ → R G2 L2 T2) → + (∀G,G2,L,L2,T,T2. ⦃G1, L1, T1⦄ >≡[h, g] ⦃G, L, T⦄ → ⦃G, L, T⦄ ≻≡[h, g] ⦃G2, L2, T2⦄ → R G L T → R G2 L2 T2) → + ∀G2,L2,T2. ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄ → R G2 L2 T2. +#h #g #G1 #L1 #T1 #R #IH1 #IH2 #G2 #L2 #T2 #H +@(tri_TC_ind … IH1 IH2 G2 L2 T2 H) +qed-. + +lemma fpbg_ind_dx: ∀h,g,G2,L2,T2. ∀R:relation3 …. + (∀G1,L1,T1. ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G2, L2, T2⦄ → R G1 L1 T1) → + (∀G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G, L, T⦄ → ⦃G, L, T⦄ >≡[h, g] ⦃G2, L2, T2⦄ → R G L T → R G1 L1 T1) → + ∀G1,L1,T1. ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄ → R G1 L1 T1. +#h #g #G2 #L2 #T2 #R #IH1 #IH2 #G1 #L1 #T1 #H +@(tri_TC_ind_dx … IH1 IH2 G1 L1 T1 H) +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbg_fleq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbg_fleq.etc new file mode 100644 index 000000000..754811ec2 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbg_fleq.etc @@ -0,0 +1,36 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reduction/fpbc_fleq.ma". +include "basic_2/computation/fpbg.ma". + +(* "QRST" PROPER PARALLEL COMPUTATION FOR CLOSURES **************************) + +(* Properties on lazy equivalence for closures ******************************) + +lemma fpbg_fleq_trans: ∀h,g,G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ >≡[h, g] ⦃G, L, T⦄ → + ∀G2,L2,T2. ⦃G, L, T⦄ ≡[0] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. +#h #g #G1 #G #L1 #L #T1 #T #H @(fpbg_ind … H) -G -L -T +[ /3 width=5 by fpbc_fpbg, fpbc_fleq_trans/ +| /4 width=9 by fpbg_strap1, fpbc_fleq_trans/ +] +qed-. + +lemma fleq_fpbg_trans: ∀h,g,G,G2,L,L2,T,T2. ⦃G, L, T⦄ >≡[h, g] ⦃G2, L2, T2⦄ → + ∀G1,L1,T1. ⦃G1, L1, T1⦄ ≡[0] ⦃G, L, T⦄ → ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. +#h #g #G #G2 #L #L2 #T #T2 #H @(fpbg_ind_dx … H) -G -L -T +[ /3 width=5 by fpbc_fpbg, fleq_fpbc_trans/ +| /4 width=9 by fpbg_strap2, fleq_fpbc_trans/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbg_fpbg.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbg_fpbg.etc new file mode 100644 index 000000000..57dd5ebb4 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbg_fpbg.etc @@ -0,0 +1,53 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/fpbs_fpbu.ma". +include "basic_2/computation/fpbs_fpbc.ma". +include "basic_2/computation/fpbs_fpbs.ma". +include "basic_2/computation/fpbg_fpbs.ma". + +(* "QRST" PROPER PARALLEL COMPUTATION FOR CLOSURES **************************) + +(* Advanced inversion lemmas ************************************************) + +lemma fpbg_inv_fpbu_sn: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄ → + ∃∃G,L,T. ⦃G1, L1, T1⦄ ≻[h, g] ⦃G, L, T⦄ & ⦃G, L, T⦄ ≥[h, g] ⦃G2, L2, T2⦄. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbg_ind_dx … H) -G1 -L1 -T1 +[ #G1 #L1 #T1 * /3 width=5 by fleq_fpbs, ex2_3_intro/ +| #G1 #G #L1 #L #T1 #T * + #G0 #L0 #T0 #H10 #H0 #_ * + /5 width=9 by fpbu_fpbs, fpbs_trans, fleq_fpbs, ex2_3_intro/ +] +qed-. + +(* Advanced forward lemmas **************************************************) + +lemma fpbg_fwd_fpbs: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbg_ind … H) -G2 -L2 -T2 +[2: #G #G2 #L #L2 #T #T2 #_ #H2 #IH1 @(fpbs_trans … IH1) -IH1 ] (**) (* full auto fails *) +/2 width=1 by fpbc_fpbs/ +qed-. + +(* Advanced properties ******************************************************) + +lemma fpbs_fpbu_trans: ∀h,g,F1,F2,K1,K2,T1,T2. ⦃F1, K1, T1⦄ ≥[h, g] ⦃F2, K2, T2⦄ → + ∀G2,L2,U2. ⦃F2, K2, T2⦄ ≻[h, g] ⦃G2, L2, U2⦄ → + ∃∃G1,L1,U1. ⦃F1, K1, T1⦄ ≻[h, g] ⦃G1, L1, U1⦄ & ⦃G1, L1, U1⦄ ≥[h, g] ⦃G2, L2, U2⦄. +/5 width=5 by fpbg_inv_fpbu_sn, fpbs_fpbg_trans, fpbc_fpbg, fpbu_fpbc/ qed-. + +(* Man properties ***********************************************************) + +theorem fpbg_trans: ∀h,g. tri_transitive … (fpbg h g). +/2 width=5 by tri_TC_transitive/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbg_fpbs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbg_fpbs.etc new file mode 100644 index 000000000..4b8662295 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbg_fpbs.etc @@ -0,0 +1,88 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/lpxs_lleq.ma". +include "basic_2/computation/fpbs_lift.ma". +include "basic_2/computation/fpbg_fleq.ma". + +(* "QRST" PROPER PARALLEL COMPUTATION FOR CLOSURES **************************) + +(* Properties on "qrst" parallel reduction on closures **********************) + +lemma fpbg_fpb_trans: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. + ⦃G1, L1, T1⦄ >≡[h, g] ⦃G, L, T⦄ → ⦃G, L, T⦄ ≽[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. +#h #g #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 #H1 #H2 elim (fpb_fpbu … H2) -H2 +/3 width=5 by fpbg_fleq_trans, fpbg_strap1, fpbu_fpbc/ +qed-. + +lemma fpb_fpbg_trans: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. + ⦃G1, L1, T1⦄ ≽[h, g] ⦃G, L, T⦄ → ⦃G, L, T⦄ >≡[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. +#h #g #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 #H1 elim (fpb_fpbu … H1) -H1 +/3 width=5 by fleq_fpbg_trans, fpbg_strap2, fpbu_fpbc/ +qed-. + +(* Properties on "qrst" parallel compuutation on closures *******************) + +lemma fpbs_fpbg_trans: ∀h,g,G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G, L, T⦄ → + ∀G2,L2,T2. ⦃G, L, T⦄ >≡[h, g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. +#h #g #G1 #G #L1 #L #T1 #T #H @(fpbs_ind … H) -G -L -T /3 width=5 by fpb_fpbg_trans/ +qed-. + +(* Note: this is used in the closure proof *) +lemma fpbg_fpbs_trans: ∀h,g,G,G2,L,L2,T,T2. ⦃G, L, T⦄ ≥[h, g] ⦃G2, L2, T2⦄ → + ∀G1,L1,T1. ⦃G1, L1, T1⦄ >≡[h, g] ⦃G, L, T⦄ → ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. +#h #g #G #G2 #L #L2 #T #T2 #H @(fpbs_ind_dx … H) -G -L -T /3 width=5 by fpbg_fpb_trans/ +qed-. + +lemma fpbu_fpbs_fpbg: ∀h,g,G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ ≻[h, g] ⦃G, L, T⦄ → + ∀G2,L2,T2. ⦃G, L, T⦄ ≥[h, g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. +/3 width=5 by fpbg_fpbs_trans, fpbu_fpbg/ qed. + +(* Note: this is used in the closure proof *) +lemma fqup_fpbg: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H elim (fqup_inv_step_sn … H) -H +/3 width=5 by fqus_fpbs, fpbu_fqu, fpbu_fpbs_fpbg/ +qed. + +lemma cpxs_fpbg: ∀h,g,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡*[h, g] T2 → + (T1 = T2 → ⊥) → ⦃G, L, T1⦄ >≡[h, g] ⦃G, L, T2⦄. +#h #g #G #L #T1 #T2 #H #H0 elim (cpxs_neq_inv_step_sn … H … H0) -H -H0 +/4 width=5 by cpxs_fpbs, fpbu_cpx, fpbu_fpbs_fpbg/ +qed. + +lemma lstas_fpbg: ∀h,g,G,L,T1,T2,l2. ⦃G, L⦄ ⊢ T1 •*[h, l2] T2 → (T1 = T2 → ⊥) → + ∀l1. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 → ⦃G, L, T1⦄ >≡[h, g] ⦃G, L, T2⦄. +/3 width=5 by lstas_cpxs, cpxs_fpbg/ qed. + +lemma lpxs_fpbg: ∀h,g,G,L1,L2,T. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → + (L1 ≡[T, 0] L2 → ⊥) → ⦃G, L1, T⦄ >≡[h, g] ⦃G, L2, T⦄. +#h #g #G #L1 #L2 #T #H #H0 elim (lpxs_nlleq_inv_step_sn … H … H0) -H -H0 +/4 width=5 by fpbu_fpbs_fpbg, fpbu_lpx, lpxs_lleq_fpbs/ +qed. + +lemma fpbs_fpbg: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ ≡[0] ⦃G2, L2, T2⦄ ∨ + ⦃G1, L1, T1⦄ >≡[h, g] ⦃G2, L2, T2⦄. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbs_ind … H) -G2 -L2 -T2 +[ /2 width=1 by or_introl/ +| #G #G2 #L #L2 #T #T2 #_ #H2 * #H1 elim (fpb_fpbu … H2) -H2 #H2 + [ /3 width=5 by fleq_trans, or_introl/ + | /5 width=5 by fpbc_fpbg, fleq_fpbc_trans, fpbu_fpbc, or_intror/ + | /3 width=5 by fpbg_fleq_trans, or_intror/ + | /4 width=5 by fpbg_strap1, fpbu_fpbc, or_intror/ + ] +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbg_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbg_lift.etc new file mode 100644 index 000000000..58ecd1200 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbg_lift.etc @@ -0,0 +1,24 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reduction/fpbu_lift.ma". +include "basic_2/computation/fpbg.ma". + +(* "QRST" PARALLEL COMPUTATION FOR CLOSURES *********************************) + +(* Advanced properties ******************************************************) + +lemma sta_fpbg: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 → + ⦃G, L⦄ ⊢ T1 •*[h, 1] T2 → ⦃G, L, T1⦄ >≡[h, g] ⦃G, L, T2⦄. +/4 width=2 by fpbu_fpbg, sta_fpbu/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbs_fpbc.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbs_fpbc.etc new file mode 100644 index 000000000..a88d51925 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/fpbs_fpbc.etc @@ -0,0 +1,26 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reduction/fpbc.ma". +include "basic_2/computation/fpbs_fleq.ma". + +(* "QRST" PARALLEL COMPUTATION FOR CLOSURES *********************************) + +(* Properties on "qrst" proper parallel reduction for closures **************) + +lemma fpbc_fpbs: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≻≡[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 * +/3 width=5 by fpbu_fwd_fpb, fpbs_strap2, fleq_fpbs/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/lazybtpredproper_8.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/lazybtpredproper_8.etc new file mode 100644 index 000000000..6abdbeb59 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpbc/lazybtpredproper_8.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ≻≡ break [ term 46 h, break term 46 g ] break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'LazyBTPRedProper $h $g $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/bteq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/bteq.etc new file mode 100644 index 000000000..c909e2ed6 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/bteq.etc @@ -0,0 +1,46 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/bteq_6.ma". +include "basic_2/grammar/lenv_length.ma". +include "basic_2/grammar/genv.ma". + +(* EQUIVALENT "BIG TREE" NORMAL FORMS ***************************************) + +definition bteq: tri_relation genv lenv term ≝ + λG1,L1,T1,G2,L2,T2. + ∧∧ G1 = G2 & |L1| = |L2| & T1 = T2. + +interpretation + "equivalent 'big tree' normal forms (closure)" + 'BTEq G1 L1 T1 G2 L2 T2 = (bteq G1 L1 T1 G2 L2 T2). + +(* Basic_properties *********************************************************) + +lemma bteq_refl: tri_reflexive … bteq. +/2 width=1 by and3_intro/ qed. + +lemma bteq_sym: tri_symmetric … bteq. +#G1 #G2 #L1 #L2 #T1 #T2 * // +qed-. + +lemma bteq_dec: ∀G1,G2,L1,L2,T1,T2. Decidable (⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄). +#G1 #G2 #L1 #L2 #T1 #T2 elim (genv_eq_dec G1 G2) +#H1G [2: @or_intror * #H2G #H2L #H2T destruct /2 width=1 by/ ] +elim (eq_nat_dec (|L1|) (|L2|)) +#H1L [2: @or_intror * #H2G #H2L #H2T destruct /2 width=1 by/ ] +elim (term_eq_dec T1 T2) +#H1T [2: @or_intror * #H2G #H2L #H2T destruct /2 width=1 by/ ] +/3 width=1 by and3_intro, or_introl/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/bteq_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/bteq_6.etc new file mode 100644 index 000000000..5ee962fe5 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/bteq_6.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ⋕ break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'BTEq $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/bteq_bteq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/bteq_bteq.etc new file mode 100644 index 000000000..7870b2644 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/bteq_bteq.etc @@ -0,0 +1,31 @@ +(**************************************************************************) +(* ___ *) +(* ||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/grammar/bteq.ma". + +(* EQUIVALENT "BIG TREE" NORMAL FORMS ***************************************) + +(* Main properties **********************************************************) + +theorem bteq_trans: tri_transitive … bteq. +#G1 #G #L1 #L #T1 #T * // +qed-. + +theorem bteq_canc_sn: ∀G,G1,G2,L,L1,L2,T,T1,T2. ⦃G, L, T⦄ ⋕ ⦃G1, L1, T1⦄ → + ⦃G, L, T⦄ ⋕ ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄. +/3 width=5 by bteq_trans, bteq_sym/ qed-. + +theorem bteq_canc_dx: ∀G1,G2,G,L1,L2,L,T1,T2,T. ⦃G1, L1, T1⦄ ⋕ ⦃G, L, T⦄ → + ⦃G2, L2, T2⦄ ⋕ ⦃G, L, T⦄ → ⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄. +/3 width=5 by bteq_trans, bteq_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/btpredsn_8.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/btpredsn_8.etc new file mode 100644 index 000000000..0350d1495 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/btpredsn_8.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ⊢ ⋕ ➡ break [ term 46 h , break term 46 g ] break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'BTPRedSn $h $g $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpb.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpb.etc new file mode 100644 index 000000000..e6698349d --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpb.etc @@ -0,0 +1,14 @@ +include "basic_2/reduction/fpn.ma". + +(* Basic forward lemmas *****************************************************) + +lemma fpb_bteq_fwd_fpn: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≽[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊢ ➡[h, g] ⦃G2, L2, T2⦄. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 * -G2 -L2 -T2 /2 width=1 by and3_intro/ +[ #G2 #L2 #T2 #H elim (fquq_inv_gen … H) -H + [ #H1 #H2 elim (fqu_fwd_bteq … H1 H2) + | * #HG #HL #HT #_ destruct // + ] +| #T2 #HT12 * // +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpbc.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpbc.etc new file mode 100644 index 000000000..1ed366cdd --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpbc.etc @@ -0,0 +1,24 @@ +lemma fpb_fpbc_or_fpn: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≽[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ ≻[h, g] ⦃G2, L2, T2⦄ ∨ + ⦃G1, L1, T1⦄ ⊢ ➡[h,g] ⦃G2, L2, T2⦄. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 * -G2 -L2 -T2 +/3 width=1 by and3_intro, or_intror/ +[ #G2 #L2 #T2 #H elim (fquq_inv_gen … H) -H [| * ] + /3 width=1 by fpbc_fqu, and3_intro, or_introl, or_intror/ +| #T2 #HT12 elim (eq_term_dec T1 T2) #H destruct + /4 width=1 by and3_intro, or_introl, or_intror, fpbc_cpx/ +] +qed-. + +lemma fpb_fpbc: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≽[h, g] ⦃G2, L2, T2⦄ → + (⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⊥) → + ⦃G1, L1, T1⦄ ≻[h, g] ⦃G2, L2, T2⦄. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H #H0 elim (fpb_fpbc_or_fpn … H) -H // +#H elim H0 -H0 /2 width=3 by fpn_fwd_bteq/ +qed. + +lemma fpbc_fwd_bteq: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≻[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⊥. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 * -G2 -L2 -T2 /2 width=8 by fqu_fwd_bteq/ +#T2 #_ #HT12 * /2 width=1 by/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpbs_conj.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpbs_conj.etc new file mode 100644 index 000000000..8d0f137df --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpbs_conj.etc @@ -0,0 +1,34 @@ +(* +inclade "basic_2/computation/fpns.ma". +inclade "basic_2/computation/fpbs.ma". +inclade "basic_2/reduction/fpbc.ma". + +lemma fpn_dec: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≽[h, g] ⦃G2, L2, T2⦄ → + Decidable (⦃G1, L1, T1⦄ ⊢ ➡[h, g] ⦃G2, L2, T2⦄). +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H elim (fpb_fpbc_or_fpn … H) -H /2 width=1 by or_introl/ +#H12 @or_intror +#H @(fpbc_fwd_bteq … H12) -H12 @(fpn_fwd_bteq … H) +qed-. +*) +(* +lemma fpns_dec: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ → + Decidable (⦃G1, L1, T1⦄ ⊢ ➡*[h, g] ⦃G2, L2, T2⦄). +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbs_ind … H) -G2 -L2 -T2 /2 width=1 by or_introl/ +#G #G2 #L #L2 #T #T2 #H #H2 * +#H1 elim (fpn_dec … H2) -H2 #H2 /3 width=5 by fpns_strap1, or_introl/ +[ @or_intror #H12 +| @or_intror #H12 @H1 -H1 +*) +(* +inclade "basic_2/grammar/bteq_bteq.ma". +inclade "basic_2/computation/fpns.ma". + +(* Advanced forward lemmas **************************************************) + +lemma fpbs_bteq_fwd_fpns: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊢ ➡*[h, g] ⦃G2, L2, T2⦄. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbs_ind … H) -G2 -L2 -T2 // +#G #G2 #L #L2 #T #T2 #H1 #H2 #IH1 #H12 elim (bteq_dec G1 G L1 L T1 T) +[ -H1 /4 width=10 by fpns_strap1, fpb_bteq_fwd_fpn, bteq_canc_sn/ +| -IH1 #H +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpn.etc new file mode 100644 index 000000000..406e6eb8e --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpn.etc @@ -0,0 +1,39 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/btpredsn_8.ma". +include "basic_2/relocation/lleq.ma". +include "basic_2/reduction/lpx.ma". + +(* REDUCTION FOR "BIG TREE" NORMAL FORMS ************************************) + +inductive fpn (h) (g) (G) (L1) (T): relation3 genv lenv term ≝ +| fpn_intro: ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → L1 ⋕[T] L2 → fpn h g G L1 T G L2 T +. + +interpretation + "reduction for 'big tree' normal forms (closure)" + 'BTPRedSn h g G1 L1 T1 G2 L2 T2 = (fpn h g G1 L1 T1 G2 L2 T2). + +(* Basic_properties *********************************************************) + +lemma fpn_refl: ∀h,g. tri_reflexive … (fpn h g). +/2 width=1 by fpn_intro/ qed. + +(* Basic inversion lemmas ***************************************************) + +lemma fpn_inv_gen: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊢ ⋕➡[h, g] ⦃G2, L2, T2⦄ → + ∧∧ G1 = G2 & ⦃G1, L1⦄ ⊢ ➡[h, g] L2 & L1 ⋕[T1] L2 & T1 = T2. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 * -G2 -L2 -T2 /2 width=1 by and4_intro/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpn_fpn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpn_fpn.etc new file mode 100644 index 000000000..adda4b538 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpn_fpn.etc @@ -0,0 +1,52 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reduction/lpx_lpx.ma". +include "basic_2/reduction/fpn.ma". + +(* REDUCTION FOR "BIG TREE" NORMAL FORMS ************************************) + +(* Advanced properties ******************************************************) + +lemma fpn_fqu_trans: ∀h,g,F1,G1,K1,L1,V1,T1. ⦃F1, K1, V1⦄ ⊢ ⋕➡[h, g] ⦃G1, L1, T1⦄ → + ∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ → + ∃∃F2,K2,V2. ⦃F1, K1, V1⦄ ⊃ ⦃F2, K2, V2⦄ & ⦃F2, K2, V2⦄ ⊢ ⋕➡[h, g] ⦃G2, L2, T2⦄. +#h #g #F1 #G1 #K1 #L1 #V1 #T1 * -G1 -L1 -T1 +#L1 #HKL1 #HV1 #G2 #L2 #T2 #H12 elim (lpx_lleq_fqu_trans … H12 … HKL1 HV1) -L1 +/3 width=5 by fpn_intro, ex2_3_intro/ +qed-. + +lemma fpn_fquq_trans: ∀h,g,F1,G1,K1,L1,V1,T1. ⦃F1, K1, V1⦄ ⊢ ⋕➡[h, g] ⦃G1, L1, T1⦄ → + ∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ → + ∃∃F2,K2,V2. ⦃F1, K1, V1⦄ ⊃⸮ ⦃F2, K2, V2⦄ & ⦃F2, K2, V2⦄ ⊢ ⋕➡[h, g] ⦃G2, L2, T2⦄. +#h #g #F1 #G1 #K1 #L1 #V1 #T1 * -G1 -L1 -T1 +#L1 #HKL1 #HV1 #G2 #L2 #T2 #H12 elim (lpx_lleq_fquq_trans … H12 … HKL1 HV1) -L1 +/3 width=5 by fpn_intro, ex2_3_intro/ +qed-. + +lemma fpn_fqup_trans: ∀h,g,F1,G1,K1,L1,V1,T1. ⦃F1, K1, V1⦄ ⊢ ⋕➡[h, g] ⦃G1, L1, T1⦄ → + ∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊃+ ⦃G2, L2, T2⦄ → + ∃∃F2,K2,V2. ⦃F1, K1, V1⦄ ⊃+ ⦃F2, K2, V2⦄ & ⦃F2, K2, V2⦄ ⊢ ⋕➡[h, g] ⦃G2, L2, T2⦄. +#h #g #F1 #G1 #K1 #L1 #V1 #T1 * -G1 -L1 -T1 +#L1 #HKL1 #HV1 #G2 #L2 #T2 #H12 elim (lpx_lleq_fqup_trans … H12 … HKL1 HV1) -L1 +/3 width=5 by fpn_intro, ex2_3_intro/ +qed-. + +lemma fpn_fqus_trans: ∀h,g,F1,G1,K1,L1,V1,T1. ⦃F1, K1, V1⦄ ⊢ ⋕➡[h, g] ⦃G1, L1, T1⦄ → + ∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊃* ⦃G2, L2, T2⦄ → + ∃∃F2,K2,V2. ⦃F1, K1, V1⦄ ⊃* ⦃F2, K2, V2⦄ & ⦃F2, K2, V2⦄ ⊢ ⋕➡[h, g] ⦃G2, L2, T2⦄. +#h #g #F1 #G1 #K1 #L1 #V1 #T1 * -G1 -L1 -T1 +#L1 #HKL1 #HV1 #G2 #L2 #T2 #H12 elim (lpx_lleq_fqus_trans … H12 … HKL1 HV1) -L1 +/3 width=5 by fpn_intro, ex2_3_intro/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpns.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpns.etc new file mode 100644 index 000000000..0a208fedf --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpns.etc @@ -0,0 +1,58 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/btpredsnstar_8.ma". +include "basic_2/reduction/fpn.ma". + +(* COMPUTATION FOR "BIG TREE" NORMAL FORMS **********************************) + +definition fpns: ∀h. sd h → tri_relation genv lenv term ≝ + λh,g. tri_TC … (fpn h g). + +interpretation + "computation for 'big tree' normal forms (closure)" + 'BTPRedSnStar h g G1 L1 T1 G2 L2 T2 = (fpns h g G1 L1 T1 G2 L2 T2). + +(* Basic eliminators ********************************************************) + +lemma fpns_ind: ∀h,g,G1,L1,T1. ∀R:relation3 …. R G1 L1 T1 → + (∀G,G2,L,L2,T,T2. ⦃G1, L1, T1⦄ ⊢ ⋕➡*[h, g] ⦃G, L, T⦄ → ⦃G, L, T⦄ ⊢ ⋕➡[h, g] ⦃G2, L2, T2⦄ → R G L T → R G2 L2 T2) → + ∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊢ ⋕➡*[h, g] ⦃G2, L2, T2⦄ → R G2 L2 T2. +#h #g #G1 #L1 #T1 #R #IH1 #IH2 #G2 #L2 #T2 #H +lapply (tri_TC_star_ind … IH1 IH2 G2 L2 T2 H) // +qed-. + +lemma fpns_ind_dx: ∀h,g,G2,L2,T2. ∀R:relation3 …. R G2 L2 T2 → + (∀G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ ⊢ ⋕➡[h, g] ⦃G, L, T⦄ → ⦃G, L, T⦄ ⊢ ⋕➡*[h, g] ⦃G2, L2, T2⦄ → R G L T → R G1 L1 T1) → + ∀G1,L1,T1. ⦃G1, L1, T1⦄ ⊢ ⋕➡*[h, g] ⦃G2, L2, T2⦄ → R G1 L1 T1. +#h #g #G2 #L2 #T2 #R #IH1 #IH2 #G1 #L1 #T1 #H +@(tri_TC_star_ind_dx … IH1 IH2 G1 L1 T1 H) // +qed-. + +(* Basic_properties *********************************************************) + +lemma fpns_refl: ∀h,g. tri_reflexive … (fpns h g). +/2 width=1 by tri_inj/ qed. + +lemma fpn_fpns: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊢ ⋕➡[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ ⊢ ⋕➡*[h, g] ⦃G2, L2, T2⦄. +/2 width=1 by tri_inj/ qed. + +lemma fpns_strap1: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ⊢ ⋕➡*[h, g] ⦃G, L, T⦄ → + ⦃G, L, T⦄ ⊢ ⋕➡[h, g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊢ ⋕➡*[h, g] ⦃G2, L2, T2⦄. +/2 width=5 by tri_step/ qed-. + +lemma fpns_strap2: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ⊢ ⋕➡[h, g] ⦃G, L, T⦄ → + ⦃G, L, T⦄ ⊢ ⋕➡*[h, g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊢ ⋕➡*[h, g] ⦃G2, L2, T2⦄. +/2 width=5 by tri_TC_strap/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpns_fpns.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpns_fpns.etc new file mode 100644 index 000000000..5aaea6a9e --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fpns_fpns.etc @@ -0,0 +1,74 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/lleq_lleq.ma". +include "basic_2/computation/lpxs.ma". +include "basic_2/computation/fpns.ma". + +(* COMPUTATION FOR "BIG TREE" NORMAL FORMS **********************************) + +(* Advanced inversion lemmas ************************************************) + +lemma fpns_inv_gen: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊢ ⋕➡*[h, g] ⦃G2, L2, T2⦄ → + ∧∧ G1 = G2 & ⦃G1, L1⦄ ⊢ ➡*[h, g] L2 & L1 ⋕[T1] L2 & T1 = T2. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpns_ind … H) -G2 -L2 -T2 /2 width=1 by and4_intro/ +#G #G2 #L #L2 #T #T2 #_ #H2 * #HG #HL1 #HT1 #HT destruct +elim (fpn_inv_gen … H2) -H2 #HG #HL2 #HT #HT2 destruct +/3 width=3 by lpxs_strap1, lleq_trans, and4_intro/ +qed-. + +(* Advanced properties ******************************************************) + +lemma lpxs_lleq_fpns: ∀h,g,G,L1,L2,T. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → L1 ⋕[T] L2 → + ⦃G, L1, T⦄ ⊢ ⋕➡*[h, g] ⦃G, L2, T⦄. +#h #g #G #L1 #L2 #T #H @(lpxs_ind … H) -L2 // +#L #L2 #HL1 #HL2 #IHL1 #HL12 elim (lleq_dec T L1 L) #HT +[ -HL1 @fpns_strap1 [4: @IHL1 // |1,2,3: skip ] + /3 width=3 by fpn_intro, lleq_canc_sn/ +| -IHL1 + +(* Main properties **********************************************************) + +theorem fpns_trans: tri_transitive … fqus. +/2 width=5 by tri_TC_transitive/ qed-. + + +(* +lemma fpns_refl: ∀h,g. tri_reflexive … (fpns h g). +/2 width=1 by and3_intro/ qed. + +lemma fpn_fpns: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊢ ➡[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ ⊢ ➡*[h, g] ⦃G2, L2, T2⦄. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 * /3 width=1 by lpx_lpxs, and3_intro/ +qed. + +lemma fpns_strap1: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ⊢ ➡*[h, g] ⦃G, L, T⦄ → + ⦃G, L, T⦄ ⊢ ➡[h, g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊢ ➡*[h, g] ⦃G2, L2, T2⦄. +#h #g #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 * #H1G #H1L #G1T * +/3 width=3 by lpxs_strap1, and3_intro/ +qed-. + +lemma fpns_strap2: ∀h,g,G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ⊢ ➡[h, g] ⦃G, L, T⦄ → + ⦃G, L, T⦄ ⊢ ➡*[h, g] ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊢ ➡*[h, g] ⦃G2, L2, T2⦄. +#h #g #G1 #G #G2 #L1 #L #L2 #T1 #T #T2 * #H1G #H1L #G1T * +/3 width=3 by lpxs_strap2, and3_intro/ +qed-. + +(* Basic forward lemmas *****************************************************) + +lemma fpns_fwd_bteq: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊢ ➡*[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 * /3 width=4 by lpxs_fwd_length, and3_intro/ +qed-. +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fqu.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fqu.etc new file mode 100644 index 000000000..1e4defb3c --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fqu.etc @@ -0,0 +1,14 @@ +include "basic_2/grammar/bteq.ma". + +lemma fqu_fwd_bteq: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⊥. +#G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 +[ #I #G #L #V * #_ #H elim (plus_xSy_x_false … H) +| #I #G #L #V #T * #_ #_ #H elim (discr_tpair_xy_x … H) +| #a #I #G #L #V #T * #_ #_ #H elim (discr_tpair_xy_y … H) +| #I #G #L #V #T * #_ #_ #H elim (discr_tpair_xy_y … H) +| #G #L #K #T #U #e #HLK #_ * #_ #H + lapply (ldrop_fwd_length_lt4 … HLK ?) // >H -L #H + elim (lt_refl_false … H) +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fsb.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fsb.etc new file mode 100644 index 000000000..3cd6861ad --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fsb.etc @@ -0,0 +1,12 @@ +(* Basic eliminators ********************************************************) + +theorem fsb_ind_alt: ∀h,g. ∀R: relation3 …. ( + ∀G1,L1,T1. ⦃G1, L1⦄ ⊢ ⦥[h,g] T1 → ( + ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≽[h, g] ⦃G2, L2, T2⦄ → + (⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⊥) → R G2 L2 T2 + ) → R G1 L1 T1 + ) → + ∀G,L,T. ⦃G, L⦄ ⊢ ⦥[h, g] T → R G L T. +#h #g #R #IH #G #L #T #H elim H -G -L -T +/5 width=1 by fpb_fpbc, fsb_intro/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fsb_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fsb_alt.etc new file mode 100644 index 000000000..8c69a001d --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/fsb_alt.etc @@ -0,0 +1,105 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/btsnalt_5.ma". +include "basic_2/computation/fpbs_fpbs.ma". +include "basic_2/computation/fsb.ma". + +(* "BIG TREE" STRONGLY NORMALIZING TERMS ************************************) + +(* Note: alternative definition of fsb *) +inductive fsba (h) (g): relation3 genv lenv term ≝ +| fsba_intro: ∀G1,L1,T1. ( + ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ → + (⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⊥) → fsba h g G2 L2 T2 + ) → fsba h g G1 L1 T1. + +interpretation + "'big tree' strong normalization (closure) alternative" + 'BTSNAlt h g G L T = (fsba h g G L T). + +(* Basic eliminators ********************************************************) + +theorem fsba_ind_alt: ∀h,g. ∀R: relation3 …. ( + ∀G1,L1,T1. ⦃G1, L1⦄ ⊢ ⦥⦥[h,g] T1 → ( + ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ → + (⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⊥) → R G2 L2 T2 + ) → R G1 L1 T1 + ) → + ∀G,L,T. ⦃G, L⦄ ⊢ ⦥⦥[h, g] T → R G L T. +#h #g #R #IH #G #L #T #H elim H -G -L -T +/5 width=1 by fsba_intro/ +qed-. + +(* Basic_properties *********************************************************) + +fact fsba_intro_aux: ∀h,g,G1,L1,T1. ( + ∀G,G2,L,L2,T,T2. ⦃G, L, T⦄ ≥[h, g] ⦃G2, L2, T2⦄ → + ⦃G1, L1, T1⦄ ⋕ ⦃G, L, T⦄ → + (⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⊥) → fsba h g G2 L2 T2 + ) → fsba h g G1 L1 T1. +/4 width=5 by fsba_intro/ qed-. + +lemma fsba_fpbs_trans: ∀h,g,G1,L1,T1. ⦃G1, L1⦄ ⊢ ⦥⦥[h, g] T1 → + ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ → ⦃G2, L2⦄ ⊢ ⦥⦥[h, g] T2. +#h #g #G1 #L1 #T1 #H @(fsba_ind_alt … H) -G1 -L1 -T1 +#G1 #L1 #T1 #H0 #IH0 #G #L #T #H1 @fsba_intro +#G2 #L2 #T2 #H2 #_ lapply (fpbs_trans … H1 … H2) -G -L -T +#H12 elim (bteq_dec G1 G2 L1 L2 T1 T2) /3 width=6 by fpb_fpbs/ +-IH0 #H212 + + + -H0 -H #H @(IH0 … H) -IH0 -H // @(fpbs_trans … H1 … H2) + +lemma fsba_intro_fpb: ∀h,g,G1,L1,T1. ( + ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≽[h, g] ⦃G2, L2, T2⦄ → + (⦃G1, L1, T1⦄ ⋕ ⦃G2, L2, T2⦄ → ⊥) → ⦃G2, L2⦄ ⊢ ⦥⦥[h, g] T2 + ) → ⦃G1, L1⦄ ⊢ ⦥⦥[h, g] T1. +#h #g #G1 #L1 #T1 #IH1 @fsba_intro_aux +#G #G2 #L #L2 #T #T2 #H @(fpbs_ind_dx … H) -G -L -T +[ #H1 #H2 -IH1 elim H2 -H2 // +| #G0 #G #L0 #L #T0 #T #H10 #H12 #IH2 #H210 #H212 elim (bteq_dec G1 G L1 L T1 T) + [ -IH1 -H210 -H10 -H12 /3 width=1 by/ + | -IH2 -H212 #H21 lapply (IH1 … H21) -IH1 -H21 + [ + | -H10 -H210 #H +(* +(* Main inversion lemmas ****************************************************) + +theorem fsba_inv_fsb: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ ⦥⦥[h, g] T → ⦃G, L⦄ ⊢ ⦥[h, g] T. +#h #g #G #L #T #H elim H -G -L -T +/5 width=12 by fsb_intro, fpb_fpbs, fpbc_fwd_fpb, fpbc_fwd_gen/ +qed-. + +(* Main properties **********************************************************) + +theorem fsb_fsba: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ ⦥[h, g] T → ⦃G, L⦄ ⊢ ⦥⦥[h, g] T. +#h #g #G #L #T #H @(fsb_ind_alt … H) -G -L -T +/4 width=1 by fsba_intro_fpb/ +qed. +(* +| fsba_intro: ∀G1,L1,T1. ( + ∀G2,L2,T2. ⦃G1, L1, T1⦄ ≻[h, g] ⦃G2, L2, T2⦄ → fsb h g G2 L2 T2 + ) → fsb h g G1 L1 T1 +. + + + +(****************************************************************************) + +include "basic_2/substitution/fqup.ma". + +lemma fsb_csx: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ ⬊*[h, g] T → ⦃G, L⦄ ⊢ ⦥[h, g] T. +#h #g #G #L #T #H @(csx_ind … H) -T +*)*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/lazyeq_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/lazyeq_6.etc new file mode 100644 index 000000000..105a47363 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpn/lazyeq_6.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ⋕ break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'LazyEq $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/cfpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/cfpr.etc new file mode 100644 index 000000000..f58a52c37 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/cfpr.etc @@ -0,0 +1,59 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( L ⊢ break ⦃ term 46 L1, break term 46 T1 ⦄ ➡ break ⦃ term 46 L2 , break term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'FocalizedPRed $L $L1 $T1 $L2 $T2 }. + +include "basic_2/reducibility/cpr.ma". +include "basic_2/reducibility/fpr.ma". + +(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON CLOSURES *************************) + +definition cfpr: lenv → bi_relation lenv term ≝ + λL,L1,T1,L2,T2. |L1| = |L2| ∧ L ⊢ L1 @@ T1 ➡ L2 @@ T2. + +interpretation + "context-sensitive parallel reduction (closure)" + 'FocalizedPRed L L1 T1 L2 T2 = (cfpr L L1 T1 L2 T2). + +(* Basic properties *********************************************************) + +lemma cfpr_refl: ∀L. bi_reflexive … (cfpr L). +/2 width=1/ qed. + +lemma fpr_cfpr: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ → ⋆ ⊢ ⦃L1, T1⦄ ➡ ⦃L2, T2⦄. +#L1 #L2 #T1 #T2 * /3 width=1/ +qed. + +(* Basic inversion lemmas ***************************************************) + +lemma cfpr_inv_atom1: ∀L,L2,T1,T2. L ⊢ ⦃⋆, T1⦄ ➡ ⦃L2, T2⦄ → L ⊢ T1 ➡ T2 ∧ L2 = ⋆. +#L #L2 #T1 #T2 * #H >(length_inv_zero_sn … H) /2 width=1/ +qed-. + +(* Advanced inversion lemmas ************************************************) + +lemma fpr_inv_pair1_sn: ∀I,K1,L2,V1,T1,T2. ⦃⋆.ⓑ{I}V1@@K1, T1⦄ ➡ ⦃L2, T2⦄ → + ∃∃K2,V2. V1 ➡ V2 & + ⋆.ⓑ{I}V2 ⊢ ⦃K1, T1⦄ ➡ ⦃K2, T2⦄ & + L2 = ⋆.ⓑ{I}V2@@K2. +#I1 #K1 #L2 #V1 #T1 #T2 * >append_length #H +elim (length_inv_pos_sn_append … H) -H #I2 #K2 #V2 #HK12 #H destruct +>shift_append_assoc >shift_append_assoc normalize in ⊢ (%→?); #H +elim (tpr_inv_bind1 … H) -H * +[ #V0 #T #T0 #HV10 #HT1 #HT0 #H destruct /5 width=5/ +| #T0 #_ #_ #H destruct +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/cfpr_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/cfpr_aaa.etc new file mode 100644 index 000000000..72802e499 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/cfpr_aaa.etc @@ -0,0 +1,27 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/cpr_aaa.ma". +include "basic_2/reducibility/cfpr_cpr.ma". + +(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON CLOSURES *************************) + +(* Properties about atomic arity assignment on terms ************************) + +lemma aaa_fpr_conf: ∀L1,T1,A. L1 ⊢ T1 ⁝ A → + ∀L2,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ → L2 ⊢ T2 ⁝ A. +#L1 #T1 #A #HT1 #L2 #T2 #H +elim (fpr_inv_all … H) -H +/4 width=5 by aaa_cpr_conf, aaa_ltpr_conf, aaa_ltpss_sn_conf/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/cfpr_cfpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/cfpr_cfpr.etc new file mode 100644 index 000000000..f442be28b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/cfpr_cfpr.etc @@ -0,0 +1,26 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/cpr_cpr.ma". +include "basic_2/reducibility/cfpr.ma". + +(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON CLOSURES *************************) + +(* Main properties **********************************************************) + +theorem cfpr_conf: ∀L. bi_confluent … (cfpr L). +#L #L0 #L1 #T0 #T1 * #HL01 #HT01 #L2 #T2 * >HL01 #HL12 #HT02 +elim (cpr_conf … HT01 HT02) -L0 -T0 #X #H1 #H2 +elim (cpr_fwd_shift1 … H1) #L0 #T0 #HL10 #H destruct /3 width=5/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/cfpr_cpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/cfpr_cpr.etc new file mode 100644 index 000000000..a1e20a025 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/cfpr_cpr.etc @@ -0,0 +1,64 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/cpr_tpss.ma". +include "basic_2/reducibility/cpr_cpr.ma". +include "basic_2/reducibility/cfpr_ltpss.ma". + +(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON CLOSURES *************************) + +(* Advanced properties ******************************************************) + +lemma fpr_all: ∀L1,L. L1 ➡ L → ∀L2,T1,T2. L ⊢ T1 ➡ T2 → + L ⊢ ▶* [0, |L|] L2 → ⦃L1, T1⦄ ➡ ⦃L2, T2⦄. +#L1 #L #H elim H -L1 -L +[ #L2 #T1 #T2 #HT12 #HL2 + lapply (ltpss_sn_inv_atom1 … HL2) -HL2 #H destruct + lapply (cpr_inv_atom … HT12) -HT12 /2 width=1/ +| #I #L1 #L #V1 #V #_ #HV1 #IH #X #T1 #T2 #HT12 #H + elim (ltpss_sn_inv_tpss21 … H ?) -H // append_length >append_length #H + lapply (injective_plus_r … H) -H #H + @(ex3_intro … (⋆.ⓑ{I}V@@Y)) append_length H -H >commutative_plus /3 width=1/ +] +qed-. + +lemma fpr_inv_all: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ → + ∃∃L. L1 ➡ L & L ⊢ T1 ➡ T2 & L ⊢ ▶* [0, |L|] L2. +#L1 #L2 #T1 #T2 #H +lapply (fpr_cfpr … H) -H #H +elim (cfpr_inv_all … H) -H /2 width=4/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/cfpr_ltpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/cfpr_ltpss.etc new file mode 100644 index 000000000..66e102e63 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/cfpr_ltpss.etc @@ -0,0 +1,39 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/cpr_lift.ma". +include "basic_2/reducibility/cpr_ltpss_sn.ma". +include "basic_2/reducibility/cfpr.ma". + +(* CONTEXT-SENSITIVE PARALLEL REDUCTION ON CLOSURES *************************) + +(* Advanced inversion lemmas ************************************************) + +lemma cfpr_inv_pair1: ∀I,L,K1,L2,V1,T1,T2. L ⊢ ⦃⋆.ⓑ{I}V1@@K1, T1⦄ ➡ ⦃L2, T2⦄ → + ∃∃K2,V,V2. V1 ➡ V & L ⊢ V ▶* [0, |L|] V2 & + L.ⓑ{I}V ⊢ ⦃K1, T1⦄ ➡ ⦃K2, T2⦄ & + L2 = ⋆.ⓑ{I}V2@@K2. +* #L #K1 #L2 #V1 #T1 #T2 * >append_length #H +elim (length_inv_pos_sn_append … H) -H #I2 #K2 #V2 #HK12 #H destruct +>shift_append_assoc >shift_append_assoc normalize in ⊢ (??%%→?); #H +[ elim (cpr_inv_abbr1 … H) -H * + [ #V #V0 #T0 #HV1 #HV0 #HT10 #H destruct /3 width=7/ + | #T0 #_ #_ #H destruct + ] +| elim (cpr_inv_abst1 … H Abst V2) -H + #V #T * #V0 #HV10 #HV0 #HT1 #H destruct + lapply (ltpss_sn_cpr_trans (L.ⓛV0) … 0 (|L|+1) … HT1) -HT1 /2 width=1/ #HT12 + /3 width=7/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpc.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpc.etc new file mode 100644 index 000000000..ee362471b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpc.etc @@ -0,0 +1,48 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( ⦃ term 46 L1 , break term 46 T1 ⦄ ⬌ break ⦃ term 46 L2 , break term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'FocalizedPConv $L1 $T1 $L2 $T2 }. + +notation "hvbox( ⦃ term 46 L1 , break term 46 T1 ⦄ ⬌ ⬌ break ⦃ term 46 L2 , break term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'FocalizedPConvAlt $L1 $T1 $L2 $T2 }. + +include "basic_2/reducibility/fpr.ma". + +(* CONTEXT-FREE PARALLEL CONVERSION ON CLOSURES *****************************) + +definition fpc: bi_relation lenv term ≝ + λL1,T1,L2,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ ∨ ⦃L2, T2⦄ ➡ ⦃L1, T1⦄. + +interpretation + "context-free parallel conversion (closure)" + 'FocalizedPConv L1 T1 L2 T2 = (fpc L1 T1 L2 T2). + +(* Basic properties *********************************************************) + +lemma fpc_refl: bi_reflexive … fpc. +/2 width=1/ qed. + +lemma fpc_sym: bi_symmetric … fpc. +#L1 #L2 #T1 #T2 * /2 width=1/ +qed. + +(* Basic forward lemmas *****************************************************) + +lemma fpc_fwd_fpr: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⬌ ⦃L2, T2⦄ → + ∃∃L,T. ⦃L1, T1⦄ ➡ ⦃L, T⦄ & ⦃L2, T2⦄ ➡ ⦃L, T⦄. +#L1 #L2 #T1 #T2 * /2 width=4/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpc_fpc.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpc_fpc.etc new file mode 100644 index 000000000..22fc16f37 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpc_fpc.etc @@ -0,0 +1,24 @@ +(**************************************************************************) +(* ___ *) +(* ||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/conversion/fpc.ma". + +(* CONTEXT-FREE PARALLEL CONVERSION ON CLOSURES *****************************) + +(* Main properties **********************************************************) + +theorem fpc_conf: ∀L0,L1,T0,T1. ⦃L0, T0⦄ ⬌ ⦃L1, T1⦄ → + ∀L2,T2. ⦃L0, T0⦄ ⬌ ⦃L2, T2⦄ → + ∃∃L,T. ⦃L1, T1⦄ ⬌ ⦃L, T⦄ & ⦃L2, T2⦄ ⬌ ⦃L, T⦄. +/3 width=4/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpcs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpcs.etc new file mode 100644 index 000000000..68c946ce8 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpcs.etc @@ -0,0 +1,84 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( ⦃ term 46 L1 , break term 46 T1 ⦄ ⬌ * break ⦃ term 46 L2 , break term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'FocalizedPConvStar $L1 $T1 $L2 $T2 }. + +notation "hvbox( ⦃ term 46 L1 , break term 46 T1 ⦄ ⬌ ⬌ * break ⦃ term 46 L2 , break term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'FocalizedPConvStarAlt $L1 $T1 $L2 $T2 }. + +include "basic_2/conversion/fpc.ma". + +(* CONTEXT-FREE PARALLEL EQUIVALENCE ON CLOSURES ****************************) + +definition fpcs: bi_relation lenv term ≝ bi_TC … fpc. + +interpretation "context-free parallel equivalence (closure)" + 'FocalizedPConvStar L1 T1 L2 T2 = (fpcs L1 T1 L2 T2). + +(* Basic eliminators ********************************************************) + +lemma fpcs_ind: ∀L1,T1. ∀R:relation2 lenv term. R L1 T1 → + (∀L,L2,T,T2. ⦃L1, T1⦄ ⬌* ⦃L, T⦄ → ⦃L, T⦄ ⬌ ⦃L2, T2⦄ → R L T → R L2 T2) → + ∀L2,T2. ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄ → R L2 T2. +/3 width=7 by bi_TC_star_ind/ qed-. + +lemma fpcs_ind_dx: ∀L2,T2. ∀R:relation2 lenv term. R L2 T2 → + (∀L1,L,T1,T. ⦃L1, T1⦄ ⬌ ⦃L, T⦄ → ⦃L, T⦄ ⬌* ⦃L2, T2⦄ → R L T → R L1 T1) → + ∀L1,T1. ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄ → R L1 T1. +/3 width=7 by bi_TC_star_ind_dx/ qed-. + +(* Basic properties *********************************************************) + +lemma fpcs_refl: bi_reflexive … fpcs. +/2 width=1/ qed. + +lemma fpcs_sym: bi_symmetric … fpcs. +/3 width=1/ qed. + +lemma fpc_fpcs: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⬌ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +/2 width=1/ qed. + +lemma fpcs_strap1: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ⬌* ⦃L, T⦄ → ⦃L, T⦄ ⬌ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +/2 width=4/ qed. + +lemma fpcs_strap2: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ⬌ ⦃L, T⦄ → ⦃L, T⦄ ⬌* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +/2 width=4/ qed. + +lemma fpcs_fpr_dx: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +/3 width=1/ qed. + +lemma fpcs_fpr_sn: ∀L1,L2,T1,T2. ⦃L2, T2⦄ ➡ ⦃L1, T1⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +/3 width=1/ qed. + +lemma fpcs_fpr_strap1: ∀L1,L,T1,T. ⦃L1, T1⦄ ⬌* ⦃L, T⦄ → + ∀L2,T2. ⦃L, T⦄ ➡ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +/3 width=4/ qed. + +lemma fpcs_fpr_strap2: ∀L1,L,T1,T. ⦃L1, T1⦄ ➡ ⦃L, T⦄ → + ∀L2,T2. ⦃L, T⦄ ⬌* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +/3 width=4/ qed. + +lemma fpcs_fpr_div: ∀L1,L,T1,T. ⦃L1, T1⦄ ⬌* ⦃L, T⦄ → + ∀L2,T2. ⦃L2, T2⦄ ➡ ⦃L, T⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +/3 width=4/ qed. + +lemma fpr_div: ∀L1,L,T1,T. ⦃L1, T1⦄ ➡ ⦃L, T⦄ → ∀L2,T2. ⦃L2, T2⦄ ➡ ⦃L, T⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +/3 width=4/ qed-. + +lemma fpcs_fpr_conf: ∀L1,L,T1,T. ⦃L, T⦄ ➡ ⦃L1, T1⦄ → + ∀L2,T2. ⦃L, T⦄ ⬌* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +/3 width=4/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpcs_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpcs_aaa.etc new file mode 100644 index 000000000..9f4327bff --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpcs_aaa.etc @@ -0,0 +1,30 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/fprs_aaa.ma". +include "basic_2/equivalence/fpcs_fpcs.ma". + +(* CONTEXT-FREE PARALLEL EQUIVALENCE ON CLOSURES ****************************) + +(* Main properties about atomic arity assignment on terms *******************) + +theorem aaa_fpcs_mono: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄ → + ∀A1. L1 ⊢ T1 ⁝ A1 → ∀A2. L2 ⊢ T2 ⁝ A2 → + A1 = A2. +#L1 #L2 #T1 #T2 #H12 #A1 #HT1 #A2 #HT2 +elim (fpcs_inv_fprs … H12) -H12 #L #T #H1 #H2 +lapply (aaa_fprs_conf … HT1 … H1) -L1 -T1 #HT1 +lapply (aaa_fprs_conf … HT2 … H2) -L2 -T2 #HT2 +lapply (aaa_mono … HT1 … HT2) -L -T // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpcs_cpcs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpcs_cpcs.etc new file mode 100644 index 000000000..b1288f751 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpcs_cpcs.etc @@ -0,0 +1,86 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/fprs_cprs.ma". +include "basic_2/equivalence/cpcs_cpcs.ma". +include "basic_2/equivalence/fpcs_fpcs.ma". + +(* CONTEXT-FREE PARALLEL EQUIVALENCE ON CLOSURES ****************************) + +(* Advanced properties ******************************************************) + +lemma fpcs_flat_dx_tpr: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄ → ∀V1,V2. V1 ➡ V2 → + ∀I. ⦃L1, ⓕ{I}V1.T1⦄ ⬌* ⦃L2, ⓕ{I}V2.T2⦄. +#L1 #L2 #T1 #T2 #HT12 +elim (fpcs_inv_fprs … HT12) -HT12 +/3 width=6 by fprs_flat_dx_tpr, fprs_div/ (**) (* auto too slow without trace *) +qed. + +lemma fpcs_shift: ∀I,L1,L2,V1,V2,T1,T2. ⦃L1, -ⓑ{I}V1.T1⦄ ⬌* ⦃L2, -ⓑ{I}V2.T2⦄ → + ⦃L1.ⓑ{I}V1, T1⦄ ⬌* ⦃L2.ⓑ{I}V2, T2⦄. +#I #L1 #L2 #V1 #V2 #T1 #T2 #H12 +elim (fpcs_inv_fprs … H12) -H12 #L #T #H1 #H2 +elim (fprs_bind2_minus … H1) -H1 #W1 #U1 #HTU1 #H destruct +elim (fprs_bind2_minus … H2) -H2 #W2 #U2 #HTU2 #H destruct /2 width=4/ +qed. + +(* Advanced inversion lemmas ************************************************) + +lemma fpcs_inv_shift: ∀I,L1,L2,V1,V2,T1,T2. ⦃L1.ⓑ{I}V1, T1⦄ ⬌* ⦃L2.ⓑ{I}V2, T2⦄ → + ⦃L1, -ⓑ{I}V1.T1⦄ ⬌* ⦃L2, -ⓑ{I}V2.T2⦄. +#I #L1 #L2 #V1 #V2 #T1 #T2 #H12 +elim (fpcs_inv_fprs … H12) -H12 #L #T #H1 #H2 +elim (fprs_inv_pair1 … H1) -H1 #K1 #U1 #_ #HTU1 #H destruct +elim (fprs_inv_pair1 … H2) -H2 #K2 #U2 #_ #HTU2 #H destruct /2 width=4/ +qed-. + +(* Advanced forward lemmas **************************************************) + +lemma fpcs_fwd_bind_minus: ∀I,L1,L2,V1,V2,T1,T2. ⦃L1, -ⓑ{I}V1.T1⦄ ⬌* ⦃L2, -ⓑ{I}V2.T2⦄ → + ∀b. ⦃L1, ⓑ{b,I}V1.T1⦄ ⬌* ⦃L2, ⓑ{b,I}V2.T2⦄. +#I #L1 #L2 #V1 #V2 #T1 #T2 #H12 #b +elim (fpcs_inv_fprs … H12) -H12 #L #T #H1 #H2 +elim (fprs_fwd_bind2_minus … H1 b) -H1 #W1 #U1 #HTU1 #H destruct +elim (fprs_fwd_bind2_minus … H2 b) -H2 #W2 #U2 #HTU2 #H destruct /2 width=4/ +qed-. + +lemma fpcs_fwd_shift: ∀I,L1,L2,V1,V2,T1,T2. ⦃L1.ⓑ{I}V1, T1⦄ ⬌* ⦃L2.ⓑ{I}V2, T2⦄ → + ∀b. ⦃L1, ⓑ{b,I}V1.T1⦄ ⬌* ⦃L2, ⓑ{b,I}V2.T2⦄. +/3 width=1 by fpcs_inv_shift, fpcs_fwd_bind_minus/ qed-. + +lemma fpcs_fwd_abst24: ∀a,L1,L2,V1,V2,T1,T2. ⦃L1, ⓛ{a}V1.T1⦄ ⬌* ⦃L2, ⓛ{a}V2.T2⦄ → + ∀b,I,W. ⦃L1, ⓑ{b,I}W.T1⦄ ⬌* ⦃L2, ⓑ{b,I}W.T2⦄. +#a #L1 #L2 #V1 #V2 #T1 #T2 #H12 #b #I #W +elim (fpcs_inv_fprs … H12) -H12 #L #U #H1 #H2 +elim (fprs_fwd_abst2 … H1 b I W) -H1 #W1 #U1 #HTU1 #H destruct +elim (fprs_fwd_abst2 … H2 b I W) -H2 #W2 #U2 #HTU2 #H destruct /2 width=4/ +qed-. + +lemma fpcs_fwd_abst13: ∀L1,L2,V1,V2,T1,T2. ⦃L1.ⓛV1, T1⦄ ⬌* ⦃L2.ⓛV2, T2⦄ → + ∀I,W. ⦃L1.ⓑ{I}W, T1⦄ ⬌* ⦃L2.ⓑ{I}W, T2⦄. +/4 width=4 by fpcs_fwd_shift, fpcs_fwd_abst24, fpcs_shift/ qed-. + +(* Properties on context-sensitive parallel equivalence for terms ***********) + +lemma cpcs_fpcs: ∀L,T1,T2. L ⊢ T1 ⬌* T2 → ⦃L, T1⦄ ⬌* ⦃L, T2⦄. +#L #T1 #T2 #H +elim (cpcs_inv_cprs … H) -H /3 width=4 by fprs_div, cprs_fprs/ (**) (* too slow without trace *) +qed. + +(* Inversion lemmas on context-sensitive parallel equivalence for terms *****) + +lemma fpcs_inv_cpcs: ∀L,T1,T2. ⦃L, T1⦄ ⬌* ⦃L, T2⦄ → L ⊢ T1 ⬌* T2. +#L #T1 #T2 #H +elim (fpcs_inv_fprs … H) -H /3 width=4 by cprs_div, fprs_fwd_cprs/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpcs_fpcs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpcs_fpcs.etc new file mode 100644 index 000000000..270e8dc40 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpcs_fpcs.etc @@ -0,0 +1,66 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/fprs_fprs.ma". +include "basic_2/conversion/fpc_fpc.ma". +include "basic_2/equivalence/fpcs_fprs.ma". + +(* CONTEXT-FREE PARALLEL EQUIVALENCE ON CLOSURES ****************************) + +(* Advanced inversion lemmas ************************************************) + +lemma fpcs_inv_fprs: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄ → + ∃∃L,T. ⦃L1, T1⦄ ➡* ⦃L, T⦄ & ⦃L2, T2⦄ ➡* ⦃L, T⦄. +#L1 #L2 #T1 #T2 #H @(fpcs_ind … H) -L2 -T2 +[ /3 width=4/ +| #L #L2 #T #T2 #_ #HT2 * #L0 #T0 #HT10 elim HT2 -HT2 #HT2 #HT0 + [ elim (fprs_strip … HT2 … HT0) -L -T #L #T #HT2 #HT0 + lapply (fprs_strap1 … HT10 … HT0) -L0 -T0 /2 width=4/ + | lapply (fprs_strap2 … HT2 … HT0) -L -T /2 width=4/ + ] +] +qed-. + +(* Advanced properties ******************************************************) + +lemma fpr_fprs_conf: ∀L,L1,L2,T,T1,T2. ⦃L, T⦄ ➡* ⦃L1, T1⦄ → ⦃L, T⦄ ➡ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +#L #L1 #L2 #T #T1 #T2 #HT1 #HT2 +elim (fprs_strip … HT2 … HT1) /2 width=4 by fpr_fprs_div/ +qed-. + +lemma fprs_fpr_conf: ∀L,L1,L2,T,T1,T2. ⦃L, T⦄ ➡* ⦃L1, T1⦄ → ⦃L, T⦄ ➡ ⦃L2, T2⦄ → ⦃L2, T2⦄ ⬌* ⦃L1, T1⦄. +#L #L1 #L2 #T #T1 #T2 #HT1 #HT2 +elim (fprs_strip … HT2 … HT1) /2 width=4 by fprs_fpr_div/ +qed-. + +lemma fprs_conf: ∀L,L1,L2,T,T1,T2. ⦃L, T⦄ ➡* ⦃L1, T1⦄ → ⦃L, T⦄ ➡* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +#L #L1 #L2 #T #T1 #T2 #HT1 #HT2 +elim (fprs_conf … HT1 … HT2) /2 width=4/ +qed-. + +lemma fpcs_strip: ∀L0,L1,T0,T1. ⦃L0, T0⦄ ⬌ ⦃L1, T1⦄ → + ∀L2,T2. ⦃L0, T0⦄ ⬌* ⦃L2, T2⦄ → + ∃∃L,T. ⦃L1, T1⦄ ⬌* ⦃L, T⦄ & ⦃L2, T2⦄ ⬌ ⦃L, T⦄. +/3 width=4/ qed. + +(* Main properties **********************************************************) + +theorem fpcs_trans: bi_transitive … fpcs. +/2 width=4/ qed. + +theorem fpcs_canc_sn: ∀L,L1,L2,T,T1,T2. ⦃L, T⦄ ⬌* ⦃L1, T1⦄ → ⦃L, T⦄ ⬌* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +/3 width=4 by fpcs_trans, fpcs_sym/ qed. (**) (* /3 width=3/ is too slow *) + +theorem fpcs_canc_dx: ∀L1,L2,L,T1,T2,T. ⦃L1, T1⦄ ⬌* ⦃L, T⦄ → ⦃L2, T2⦄ ⬌* ⦃L, T⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +/3 width=4 by fpcs_trans, fpcs_sym/ qed. (**) (* /3 width=3/ is too slow *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpcs_fprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpcs_fprs.etc new file mode 100644 index 000000000..43239eadd --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpcs_fprs.etc @@ -0,0 +1,55 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/fprs.ma". +include "basic_2/equivalence/fpcs.ma". + +(* CONTEXT-FREE PARALLEL EQUIVALENCE ON CLOSURES ****************************) + +(* Properties on context-free parallel computation for closures *************) + +(* Note: was lemma 1000 *) +lemma fpcs_fprs_dx: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +#L1 #L2 #T1 #T2 #H @(fprs_ind … H) -L2 -T2 /width=1/ /3 width=4/ +qed. + +lemma fpcs_fprs_sn: ∀L1,L2,T1,T2. ⦃L2, T2⦄ ➡* ⦃L1, T1⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +#L1 #L2 #T1 #T2 #H @(fprs_ind_dx … H) -L2 -T2 /width=1/ /3 width=4/ +qed. + +lemma fpcs_fprs_strap1: ∀L1,L,T1,T. ⦃L1, T1⦄ ⬌* ⦃L, T⦄ → ∀L2,T2. ⦃L, T⦄ ➡* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +#L1 #L #T1 #T #HT1 #L2 #T2 #H @(fprs_ind … H) -L2 -T2 /width=1/ /2 width=4/ +qed. + +lemma fpcs_fprs_strap2: ∀L1,L,T1,T. ⦃L1, T1⦄ ➡* ⦃L, T⦄ → ∀L2,T2. ⦃L, T⦄ ⬌* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +#L1 #L #T1 #T #H #L2 #T2 #HT2 @(fprs_ind_dx … H) -L1 -T1 /width=1/ /2 width=4/ +qed. + +lemma fpcs_fprs_div: ∀L1,L,T1,T. ⦃L1, T1⦄ ⬌* ⦃L, T⦄ → ∀L2,T2. ⦃L2, T2⦄ ➡* ⦃L, T⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +#L1 #L #T1 #T #HT1 #L2 #T2 #H @(fprs_ind_dx … H) -L2 -T2 /width=1/ /2 width=4/ +qed. + +lemma fpcs_fprs_conf: ∀L1,L,T1,T. ⦃L, T⦄ ➡* ⦃L1, T1⦄ → ∀L2,T2. ⦃L, T⦄ ⬌* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +#L1 #L #T1 #T #H #T2 #HT2 @(fprs_ind … H) -L1 -T1 /width=1/ /3 width=4 by fpcs_fpr_conf/ (**) (* /2 width=4/ does not work *) +qed. + +lemma fprs_div: ∀L1,L,T1,T. ⦃L1, T1⦄ ➡* ⦃L, T⦄ → ∀L2,T2. ⦃L2, T2⦄ ➡* ⦃L, T⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +#L1 #L #T1 #T #HT1 #T2 #L2 #H @(fprs_ind_dx … H) -L2 -T2 /2 width=1/ /2 width=4/ +qed. + +lemma fprs_fpr_div: ∀L1,L,T1,T. ⦃L1, T1⦄ ➡* ⦃L, T⦄ → ∀L2,T2. ⦃L2, T2⦄ ➡ ⦃L, T⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +/3 width=7 by bi_step, fprs_div/ qed-. + +lemma fpr_fprs_div: ∀L1,L,T1,T. ⦃L1, T1⦄ ➡ ⦃L, T⦄ → ∀L2,T2. ⦃L2, T2⦄ ➡* ⦃L, T⦄ → ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄. +/3 width=4 by bi_step, fprs_div/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpr.etc new file mode 100644 index 000000000..3bb168f9e --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpr.etc @@ -0,0 +1,68 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( ⦃ term 46 L1, break term 46 T1 ⦄ ➡ break ⦃ term 46 L2 , break term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'FocalizedPRed $L1 $T1 $L2 $T2 }. + +include "basic_2/reducibility/tpr.ma". + +(* CONTEXT-FREE PARALLEL REDUCTION ON CLOSURES ******************************) + +definition fpr: bi_relation lenv term ≝ + λL1,T1,L2,T2. |L1| = |L2| ∧ L1 @@ T1 ➡ L2 @@ T2. + +interpretation + "context-free parallel reduction (closure)" + 'FocalizedPRed L1 T1 L2 T2 = (fpr L1 T1 L2 T2). + +(* Basic properties *********************************************************) + +lemma fpr_refl: bi_reflexive … fpr. +/2 width=1/ qed. + +lemma fpr_shift: ∀I1,I2,L1,L2,V1,V2,T1,T2. + ⦃L1, -ⓑ{I1}V1.T1⦄ ➡ ⦃L2, -ⓑ{I2}V2.T2⦄ → + ⦃L1.ⓑ{I1}V1, T1⦄ ➡ ⦃L2.ⓑ{I2}V2, T2⦄. +#I1 #I2 #L1 #L2 #V1 #V2 #T1 #T2 * #HL12 #HT12 +@conj // normalize // (**) (* explicit constructor *) +qed. + +(* Basic inversion lemmas ***************************************************) + +lemma fpr_inv_atom1: ∀L2,T1,T2. ⦃⋆, T1⦄ ➡ ⦃L2, T2⦄ → T1 ➡ T2 ∧ L2 = ⋆. +#L2 #T1 #T2 * #H +lapply (length_inv_zero_sn … H) -H #H destruct /2 width=1/ +qed-. + +lemma fpr_inv_atom3: ∀L1,T1,T2. ⦃L1,T1⦄ ➡ ⦃⋆,T2⦄ → T1 ➡ T2 ∧ L1 = ⋆. +#L1 #T1 #T2 * #H +lapply (length_inv_zero_dx … H) -H #H destruct /2 width=1/ +qed-. + +(* Basic forward lemmas *****************************************************) + +lemma fpr_fwd_pair1: ∀I1,K1,L2,V1,T1,T2. ⦃K1.ⓑ{I1}V1, T1⦄ ➡ ⦃L2, T2⦄ → + ∃∃I2,K2,V2. ⦃K1, -ⓑ{I1}V1.T1⦄ ➡ ⦃K2, -ⓑ{I2}V2.T2⦄ & + L2 = K2.ⓑ{I2}V2. +#I1 #K1 #L2 #V1 #T1 #T2 * #H +elim (length_inv_pos_sn … H) -H #I2 #K2 #V2 #HK12 #H destruct /3 width=5/ +qed-. + +lemma fpr_fwd_pair3: ∀I2,L1,K2,V2,T1,T2. ⦃L1, T1⦄ ➡ ⦃K2.ⓑ{I2}V2, T2⦄ → + ∃∃I1,K1,V1. ⦃K1, -ⓑ{I1}V1.T1⦄ ➡ ⦃K2, -ⓑ{I2}V2.T2⦄ & + L1 = K1.ⓑ{I1}V1. +#I2 #L1 #K2 #V2 #T1 #T2 * #H +elim (length_inv_pos_dx … H) -H #I1 #K1 #V1 #HK12 #H destruct /3 width=5/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpr_cpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpr_cpr.etc new file mode 100644 index 000000000..baa630f5b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpr_cpr.etc @@ -0,0 +1,125 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/cfpr_cpr.ma". + +(* CONTEXT-FREE PARALLEL REDUCTION ON CLOSURES ******************************) + +(* Properties on context-sensitive parallel reduction for terms *************) + +lemma ltpr_tpr_fpr: ∀L1,L2. L1 ➡ L2 → ∀T1,T2. T1 ➡ T2 → ⦃L1, T1⦄ ➡ ⦃L2, T2⦄. +/3 width=4/ qed. + +lemma cpr_fpr: ∀L,T1,T2. L ⊢ T1 ➡ T2 → ⦃L, T1⦄ ➡ ⦃L, T2⦄. +/2 width=4/ qed. + +lemma fpr_lift: ∀K1,K2,T1,T2. ⦃K1, T1⦄ ➡ ⦃K2, T2⦄ → + ∀d,e,L1. ⇩[d, e] L1 ≡ K1 → + ∀U1,U2. ⇧[d, e] T1 ≡ U1 → ⇧[d, e] T2 ≡ U2 → + ∃∃L2. ⦃L1, U1⦄ ➡ ⦃L2, U2⦄ & ⇩[d, e] L2 ≡ K2. +#K1 #K2 #T1 #T2 #HT12 #d #e #L1 #HLK1 #U1 #U2 #HTU1 #HTU2 +elim (fpr_inv_all … HT12) -HT12 #K #HK1 #HT12 #HK2 +elim (ldrop_ltpr_trans … HLK1 … HK1) -K1 #L #HL1 #HLK +lapply (cpr_lift … HLK … HTU1 … HTU2 HT12) -T1 -T2 #HU12 +elim (le_or_ge (|K|) d) #Hd +[ elim (ldrop_ltpss_sn_trans_ge … HLK … HK2 …) +| elim (ldrop_ltpss_sn_trans_be … HLK … HK2 …) +] // -Hd #L2 #HL2 #HLK2 +lapply (ltpss_sn_weak_full … HL2) -K /3 width=4/ +qed-. + +(* Advanced properties ******************************************************) + +lemma fpr_flat_dx: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ → ∀V1,V2. V1 ➡ V2 → + ∀I. ⦃L1, ⓕ{I}V1.T1⦄ ➡ ⦃L2, ⓕ{I}V2.T2⦄. +#L1 #L2 #T1 #T2 #HT12 +elim (fpr_inv_all … HT12) -HT12 /4 width=4/ +qed. + +lemma fpr_bind_sn: ∀L1,L2,V1,V2. ⦃L1, V1⦄ ➡ ⦃L2, V2⦄ → ∀T1,T2. T1 ➡ T2 → + ∀a,I. ⦃L1, ⓑ{a,I}V1.T1⦄ ➡ ⦃L2, ⓑ{a,I}V2.T2⦄. +#L1 #L2 #V1 #V2 #H #T1 #T2 #HT12 #a #I +elim (fpr_inv_all … H) /3 width=4/ +qed. + +lemma fpr_bind2_minus: ∀I,L1,L2,V1,T1,U2. ⦃L1, -ⓑ{I}V1.T1⦄ ➡ ⦃L2, U2⦄ → + ∃∃V2,T2. ⦃L1.ⓑ{I}V1, T1⦄ ➡ ⦃L2.ⓑ{I}V2, T2⦄ & + U2 = -ⓑ{I}V2.T2. +#I1 #L1 #L2 #V1 #T1 #U2 #H +elim (fpr_inv_all … H) -H #L #HL1 #H #HL2 +elim (cpr_fwd_bind1_minus … H false) -H /4 width=4/ +qed-. + +(* Advanced forward lemmas **************************************************) + +lemma fpr_fwd_bind2_minus: ∀I,L1,L,V1,T1,T. ⦃L1, -ⓑ{I}V1.T1⦄ ➡ ⦃L, T⦄ → ∀b. + ∃∃V2,T2. ⦃L1, ⓑ{b,I}V1.T1⦄ ➡ ⦃L, ⓑ{b,I}V2.T2⦄ & + T = -ⓑ{I}V2.T2. +#I #L1 #L #V1 #T1 #T #H1 #b +elim (fpr_inv_all … H1) -H1 #L0 #HL10 #HT1 #HL0 +elim (cpr_fwd_bind1_minus … HT1 b) -HT1 /3 width=4/ +qed-. + +lemma fpr_fwd_shift_bind_minus: ∀I1,I2,L1,L2,V1,V2,T1,T2. + ⦃L1, -ⓑ{I1}V1.T1⦄ ➡ ⦃L2, -ⓑ{I2}V2.T2⦄ → + ⦃L1, V1⦄ ➡ ⦃L2, V2⦄ ∧ I1 = I2. +* #I2 #L1 #L2 #V1 #V2 #T1 #T2 #H +elim (fpr_inv_all … H) -H #L #HL1 #H #HL2 +[ elim (cpr_inv_abbr1 … H) -H * + [ #V #V0 #T #HV1 #HV0 #_ #H destruct /4 width=4/ + | #T #_ #_ #H destruct + ] +| elim (cpr_inv_abst1 … H Abst V2) -H + #V #T #HV1 #_ #H destruct /3 width=4/ +] +qed-. + +lemma fpr_fwd_abst2: ∀a,L1,L2,V1,T1,U2. ⦃L1, ⓛ{a}V1.T1⦄ ➡ ⦃L2, U2⦄ → ∀b,I,W. + ∃∃V2,T2. ⦃L1, ⓑ{b,I}W.T1⦄ ➡ ⦃L2, ⓑ{b,I}W.T2⦄ & + U2 = ⓛ{a}V2.T2. +#a #L1 #L2 #V1 #T1 #U2 #H +elim (fpr_inv_all … H) #L #HL1 #H #HL2 #b #I #W +elim (cpr_fwd_abst1 … H b I W) -H /3 width=4/ +qed-. + +(* Advanced inversion lemmas ************************************************) + +lemma fpr_inv_pair1: ∀I,K1,L2,V1,T1,T2. ⦃K1.ⓑ{I}V1, T1⦄ ➡ ⦃L2, T2⦄ → + ∃∃K2,V2. ⦃K1, V1⦄ ➡ ⦃K2, V2⦄ & + ⦃K1, -ⓑ{I}V1.T1⦄ ➡ ⦃K2, -ⓑ{I}V2.T2⦄ & + L2 = K2.ⓑ{I}V2. +#I1 #K1 #X #V1 #T1 #T2 #H +elim (fpr_fwd_pair1 … H) -H #I2 #K2 #V2 #HT12 #H destruct +elim (fpr_fwd_shift_bind_minus … HT12) #HV12 #H destruct /2 width=5/ +qed-. + +lemma fpr_inv_pair3: ∀I,L1,K2,V2,T1,T2. ⦃L1, T1⦄ ➡ ⦃K2.ⓑ{I}V2, T2⦄ → + ∃∃K1,V1. ⦃K1, V1⦄ ➡ ⦃K2, V2⦄ & + ⦃K1, -ⓑ{I}V1.T1⦄ ➡ ⦃K2, -ⓑ{I}V2.T2⦄ & + L1 = K1.ⓑ{I}V1. +#I2 #X #K2 #V2 #T1 #T2 #H +elim (fpr_fwd_pair3 … H) -H #I1 #K1 #V1 #HT12 #H destruct +elim (fpr_fwd_shift_bind_minus … HT12) #HV12 #H destruct /2 width=5/ +qed-. + +(* More advanced forward lemmas *********************************************) + +lemma fpr_fwd_pair1_full: ∀I,K1,L2,V1,T1,T2. ⦃K1.ⓑ{I}V1, T1⦄ ➡ ⦃L2, T2⦄ → + ∀b. ∃∃K2,V2. ⦃K1, V1⦄ ➡ ⦃K2, V2⦄ & + ⦃K1, ⓑ{b,I}V1.T1⦄ ➡ ⦃K2, ⓑ{b,I}V2.T2⦄ & + L2 = K2.ⓑ{I}V2. +#I #K1 #L2 #V1 #T1 #T2 #H #b +elim (fpr_inv_pair1 … H) -H #K2 #V2 #HV12 #HT12 #H destruct +elim (fpr_fwd_bind2_minus … HT12 b) -HT12 #W1 #U1 #HTU1 #H destruct /2 width=5/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpr_fpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpr_fpr.etc new file mode 100644 index 000000000..3f7ac2ceb --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fpr_fpr.etc @@ -0,0 +1,26 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/tpr_tpr.ma". +include "basic_2/reducibility/fpr.ma". + +(* CONTEXT-FREE PARALLEL REDUCTION ON CLOSURES ******************************) + +(* Main properties **********************************************************) + +theorem fpr_conf: bi_confluent … fpr. +#L0 #L1 #T0 #T1 * #HL01 #HT01 #L2 #T2 * >HL01 #HL12 #HT02 +elim (tpr_conf … HT01 HT02) -L0 -T0 #X #H1 #H2 +elim (tpr_fwd_shift1 … H1) #L #T #HL1 #H destruct /3 width=5/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fprs.etc new file mode 100644 index 000000000..f42bdf7e2 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fprs.etc @@ -0,0 +1,58 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( ⦃ term 46 L1 , term 46 T1 ⦄ ➡ * break ⦃ term 46 L2 , term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'FocalizedPRedStar $L1 $T1 $L2 $T2 }. + +notation "hvbox( ⦃ term 46 L1 , term 46 T1 ⦄ ➡ ➡ * break ⦃ term 46 L2 , term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'FocalizedPRedStarAlt $L1 $T1 $L2 $T2 }. + +include "basic_2/reducibility/fpr.ma". + +(* CONTEXT-FREE PARALLEL COMPUTATION ON CLOSURES ****************************) + +definition fprs: bi_relation lenv term ≝ bi_TC … fpr. + +interpretation "context-free parallel computation (closure)" + 'FocalizedPRedStar L1 T1 L2 T2 = (fprs L1 T1 L2 T2). + +(* Basic eliminators ********************************************************) + +lemma fprs_ind: ∀L1,T1. ∀R:relation2 lenv term. R L1 T1 → + (∀L,L2,T,T2. ⦃L1, T1⦄ ➡* ⦃L, T⦄ → ⦃L, T⦄ ➡ ⦃L2, T2⦄ → R L T → R L2 T2) → + ∀L2,T2. ⦃L1, T1⦄ ➡* ⦃L2, T2⦄ → R L2 T2. +/3 width=7 by bi_TC_star_ind/ qed-. + +lemma fprs_ind_dx: ∀L2,T2. ∀R:relation2 lenv term. R L2 T2 → + (∀L1,L,T1,T. ⦃L1, T1⦄ ➡ ⦃L, T⦄ → ⦃L, T⦄ ➡* ⦃L2, T2⦄ → R L T → R L1 T1) → + ∀L1,T1. ⦃L1, T1⦄ ➡* ⦃L2, T2⦄ → R L1 T1. +/3 width=7 by bi_TC_star_ind_dx/ qed-. + +(* Basic properties *********************************************************) + +lemma fpr_fprs: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ → ⦃L1, T1⦄ ➡* ⦃L2, T2⦄. +/2 width=1/ qed. + +lemma fprs_refl: bi_reflexive … fprs. +/2 width=1/ qed. + +lemma fprs_strap1: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ➡* ⦃L, T⦄ → ⦃L, T⦄ ➡ ⦃L2, T2⦄ → + ⦃L1, T1⦄ ➡* ⦃L2, T2⦄. +/2 width=4/ qed. + +lemma fprs_strap2: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ➡ ⦃L, T⦄ → ⦃L, T⦄ ➡* ⦃L2, T2⦄ → + ⦃L1, T1⦄ ➡* ⦃L2, T2⦄. +/2 width=4/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fprs_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fprs_aaa.etc new file mode 100644 index 000000000..b76637ff7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fprs_aaa.etc @@ -0,0 +1,26 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/cfpr_aaa.ma". +include "basic_2/computation/fprs.ma". + +(* CONTEXT-FREE PARALLEL COMPUTATION ON CLOSURES ****************************) + +(* Properties about atomic arity assignment on terms ************************) + +lemma aaa_fprs_conf: ∀L1,T1,A. L1 ⊢ T1 ⁝ A → + ∀L2,T2. ⦃L1, T1⦄ ➡* ⦃L2, T2⦄ → L2 ⊢ T2 ⁝ A. +#L1 #T1 #A #HT1 #L2 #T2 #HLT12 +@(bi_TC_Conf3 … HT1 ?? HLT12) /2 width=4/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fprs_cprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fprs_cprs.etc new file mode 100644 index 000000000..9d4d954b8 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fprs_cprs.etc @@ -0,0 +1,138 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/fpr_cpr.ma". +include "basic_2/computation/cprs_lfprs.ma". +include "basic_2/computation/lfprs_ltprs.ma". +include "basic_2/computation/lfprs_fprs.ma". + +(* CONTEXT-FREE PARALLEL COMPUTATION ON CLOSURES ****************************) + +(* Advanced properties ******************************************************) + +lemma fprs_flat_dx_tpr: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡* ⦃L2, T2⦄ → ∀V1,V2. V1 ➡ V2 → + ∀I. ⦃L1, ⓕ{I}V1.T1⦄ ➡* ⦃L2, ⓕ{I}V2.T2⦄. +#L1 #L2 #T1 #T2 #HT12 @(fprs_ind … HT12) -L2 -T2 /3 width=1/ +#L #L2 #T #T2 #_ #HT2 #IHT2 #V1 #V2 #HV12 #I +lapply (IHT2 … HV12 I) -IHT2 -HV12 /3 width=6/ +qed. + +lemma fprs_bind2_minus: ∀I,L1,L2,V1,T1,U2. ⦃L1, -ⓑ{I}V1.T1⦄ ➡* ⦃L2, U2⦄ → + ∃∃V2,T2. ⦃L1.ⓑ{I}V1, T1⦄ ➡* ⦃L2.ⓑ{I}V2, T2⦄ & + U2 = -ⓑ{I}V2.T2. +#I #L1 #L2 #V1 #T1 #U2 #H @(fprs_ind … H) -L2 -U2 /2 width=4/ +#L #L2 #U #U2 #_ #HU2 * #V #T #HT1 #H destruct +elim (fpr_bind2_minus … HU2) -HU2 /3 width=4/ +qed-. + +lemma fprs_lift: ∀K1,K2,T1,T2. ⦃K1, T1⦄ ➡* ⦃K2, T2⦄ → + ∀d,e,L1. ⇩[d, e] L1 ≡ K1 → + ∀U1,U2. ⇧[d, e] T1 ≡ U1 → ⇧[d, e] T2 ≡ U2 → + ∃∃L2. ⦃L1, U1⦄ ➡* ⦃L2, U2⦄ & ⇩[d, e] L2 ≡ K2. +#K1 #K2 #T1 #T2 #HT12 @(fprs_ind … HT12) -K2 -T2 +[ #d #e #L1 #HLK1 #U1 #U2 #HTU1 #HTU2 + >(lift_mono … HTU2 … HTU1) -U2 /2 width=3/ +| #K #K2 #T #T2 #_ #HT2 #IHT1 #d #e #L1 #HLK1 #U1 #U2 #HTU1 #HTU2 + elim (lift_total T d e) #U #HTU + elim (IHT1 … HLK1 … HTU1 HTU) -K1 -T1 #L #HU1 #HKL + elim (fpr_lift … HT2 … HKL … HTU HTU2) -K -T -T2 /3 width=4/ +] +qed-. + +(* Advanced inversion lemmas ************************************************) + +lemma fprs_inv_pair1: ∀I,K1,L2,V1,T1,T2. ⦃K1.ⓑ{I}V1, T1⦄ ➡* ⦃L2, T2⦄ → + ∃∃K2,V2. ⦃K1, V1⦄ ➡* ⦃K2, V2⦄ & + ⦃K1, -ⓑ{I}V1.T1⦄ ➡* ⦃K2, -ⓑ{I}V2.T2⦄ & + L2 = K2.ⓑ{I}V2. +#I #K1 #L2 #V1 #T1 #T2 #H @(fprs_ind … H) -L2 -T2 /2 width=5/ +#L #L2 #T #T2 #_ #HT2 * #K #V #HV1 #HT1 #H destruct +elim (fpr_inv_pair1 … HT2) -HT2 #K2 #V2 #HV2 #HT2 #H destruct /3 width=5/ +qed-. + +lemma fprs_inv_pair3: ∀I,L1,K2,V2,T1,T2. ⦃L1, T1⦄ ➡* ⦃K2.ⓑ{I}V2, T2⦄ → + ∃∃K1,V1. ⦃K1, V1⦄ ➡* ⦃K2, V2⦄ & + ⦃K1, -ⓑ{I}V1.T1⦄ ➡* ⦃K2, -ⓑ{I}V2.T2⦄ & + L1 = K1.ⓑ{I}V1. +#I2 #L1 #K2 #V2 #T1 #T2 #H @(fprs_ind_dx … H) -L1 -T1 /2 width=5/ +#L1 #L #T1 #T #HT1 #_ * #K #V #HV2 #HT2 #H destruct +elim (fpr_inv_pair3 … HT1) -HT1 #K1 #V1 #HV1 #HT1 #H destruct /3 width=5/ +qed-. + +(* Advanced forward lemmas **************************************************) + +lemma fprs_fwd_bind2_minus: ∀I,L1,L,V1,T1,T. ⦃L1, -ⓑ{I}V1.T1⦄ ➡* ⦃L, T⦄ → ∀b. + ∃∃V2,T2. ⦃L1, ⓑ{b,I}V1.T1⦄ ➡* ⦃L, ⓑ{b,I}V2.T2⦄ & + T = -ⓑ{I}V2.T2. +#I #L1 #L #V1 #T1 #T #H1 #b @(fprs_ind … H1) -L -T /2 width=4/ +#L0 #L #T0 #T #_ #H0 * #W1 #U1 #HTU1 #H destruct +elim (fpr_fwd_bind2_minus … H0 b) -H0 /3 width=4/ +qed-. + +lemma fprs_fwd_pair1_full: ∀I,K1,L2,V1,T1,T2. ⦃K1.ⓑ{I}V1, T1⦄ ➡* ⦃L2, T2⦄ → + ∀b. ∃∃K2,V2. ⦃K1, V1⦄ ➡* ⦃K2, V2⦄ & + ⦃K1, ⓑ{b,I}V1.T1⦄ ➡* ⦃K2, ⓑ{b,I}V2.T2⦄ & + L2 = K2.ⓑ{I}V2. +#I #K1 #L2 #V1 #T1 #T2 #H #b +elim (fprs_inv_pair1 … H) -H #K2 #V2 #HV12 #HT12 #H destruct +elim (fprs_fwd_bind2_minus … HT12 b) -HT12 #W1 #U1 #HTU1 #H destruct /2 width=5/ +qed-. + +lemma fprs_fwd_abst2: ∀a,L1,L2,V1,T1,U2. ⦃L1, ⓛ{a}V1.T1⦄ ➡* ⦃L2, U2⦄ → ∀b,I,W. + ∃∃V2,T2. ⦃L1, ⓑ{b,I}W.T1⦄ ➡* ⦃L2, ⓑ{b,I}W.T2⦄ & + U2 = ⓛ{a}V2.T2. +#a #L1 #L2 #V1 #T1 #U2 #H #b #I #W @(fprs_ind … H) -L2 -U2 /2 width=4/ +#L #L2 #U #U2 #_ #H2 * #V #T #HT1 #H destruct +elim (fpr_fwd_abst2 … H2 b I W) -H2 /3 width=4/ +qed-. + +(* Properties on context-sensitive parallel computation for terms ***********) + +lemma cprs_fprs: ∀L,T1,T2. L ⊢ T1 ➡* T2 → ⦃L, T1⦄ ➡* ⦃L, T2⦄. +#L #T1 #T2 #H @(cprs_ind … H) -T2 // /3 width=4/ +qed. + +(* Forward lemmas on context-sensitive parallel computation for terms *******) + +lemma fprs_fwd_cprs: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡* ⦃L2, T2⦄ → L1 ⊢ T1 ➡* T2. +#L1 #L2 #T1 #T2 #H @(fprs_ind … H) -L2 -T2 // +#L #L2 #T #T2 #H1 #H2 #IH1 +elim (fpr_inv_all … H2) -H2 #L0 #HL0 #HT2 #_ -L2 +lapply (lfprs_cpr_trans L1 … HT2) -HT2 /3 width=3/ +qed-. +(* +(* Advanced properties ******************************************************) + +lamma fpr_bind_sn: ∀L1,L2,V1,V2. ⦃L1, V1⦄ ➡ ⦃L2, V2⦄ → ∀T1,T2. T1 ➡ T2 → + ∀a,I. ⦃L1, ⓑ{a,I}V1.T1⦄ ➡ ⦃L2, ⓑ{a,I}V2.T2⦄. +#L1 #L2 #V1 #V2 #H #T1 #T2 #HT12 #a #I +elim (fpr_inv_all … H) /3 width=4/ +qed. + +(* Advanced forward lemmas **************************************************) + +lamma fpr_fwd_shift_bind_minus: ∀I1,I2,L1,L2,V1,V2,T1,T2. + ⦃L1, -ⓑ{I1}V1.T1⦄ ➡ ⦃L2, -ⓑ{I2}V2.T2⦄ → + ⦃L1, V1⦄ ➡ ⦃L2, V2⦄ ∧ I1 = I2. +* #I2 #L1 #L2 #V1 #V2 #T1 #T2 #H +elim (fpr_inv_all … H) -H #L #HL1 #H #HL2 +[ elim (cpr_inv_abbr1 … H) -H * + [ #V #V0 #T #HV1 #HV0 #_ #H destruct /4 width=4/ + | #T #_ #_ #H destruct + ] +| elim (cpr_inv_abst1 … H Abst V2) -H + #V #T #HV1 #_ #H destruct /3 width=4/ +] +qed-. +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fprs_fprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fprs_fprs.etc new file mode 100644 index 000000000..e0c1b3058 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/fprs_fprs.etc @@ -0,0 +1,34 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/fpr_fpr.ma". +include "basic_2/computation/fprs.ma". + +(* CONTEXT-FREE PARALLEL COMPUTATION ON CLOSURES ****************************) + +(* Advanced properties ******************************************************) + +lemma fprs_strip: ∀L0,L1,T0,T1. ⦃L0, T0⦄ ➡ ⦃L1, T1⦄ → + ∀L2,T2. ⦃L0, T0⦄ ➡* ⦃L2, T2⦄ → + ∃∃L,T. ⦃L1, T1⦄ ➡* ⦃L, T⦄ & ⦃L2, T2⦄ ➡ ⦃L, T⦄. +#H1 #H2 #H3 #H4 #H5 #H6 #H7 #H8 +/2 width=4/ qed. + +(* Main propertis ***********************************************************) + +theorem fprs_conf: bi_confluent … fprs. +/2 width=4/ qed. + +theorem fprs_trans: bi_transitive … fprs. +/2 width=4/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/lenv_px_bi.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/lenv_px_bi.etc new file mode 100644 index 000000000..931d075ab --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/lenv_px_bi.etc @@ -0,0 +1,88 @@ +(**************************************************************************) +(* ___ *) +(* ||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/grammar/lenv_length.ma". + +(* POINTWISE EXTENSION OF A FOCALIZED REALTION FOR TERMS ********************) + +inductive lpx_bi (R:bi_relation lenv term): relation lenv ≝ +| lpx_bi_stom: lpx_bi R (⋆) (⋆) +| lpx_bi_pair: ∀I,K1,K2,V1,V2. + lpx_bi R K1 K2 → R K1 V1 K2 V2 → + lpx_bi R (K1. ⓑ{I} V1) (K2. ⓑ{I} V2) +. + +(* Basic inversion lemmas ***************************************************) + +fact lpx_bi_inv_atom1_aux: ∀R,L1,L2. lpx_bi R L1 L2 → L1 = ⋆ → L2 = ⋆. +#R #L1 #L2 * -L1 -L2 +[ // +| #I #K1 #K2 #V1 #V2 #_ #_ #H destruct +] +qed-. + +lemma lpx_bi_inv_atom1: ∀R,L2. lpx_bi R (⋆) L2 → L2 = ⋆. +/2 width=4 by lpx_bi_inv_atom1_aux/ qed-. + +fact lpx_bi_inv_pair1_aux: ∀R,L1,L2. lpx_bi R L1 L2 → + ∀I,K1,V1. L1 = K1. ⓑ{I} V1 → + ∃∃K2,V2. lpx_bi R K1 K2 & + R K1 V1 K2 V2 & L2 = K2. ⓑ{I} V2. +#R #L1 #L2 * -L1 -L2 +[ #J #K1 #V1 #H destruct +| #I #K1 #K2 #V1 #V2 #HK12 #HV12 #J #L #W #H destruct /2 width=5/ +] +qed-. + +lemma lpx_bi_inv_pair1: ∀R,I,K1,V1,L2. lpx_bi R (K1. ⓑ{I} V1) L2 → + ∃∃K2,V2. lpx_bi R K1 K2 & R K1 V1 K2 V2 & + L2 = K2. ⓑ{I} V2. +/2 width=3 by lpx_bi_inv_pair1_aux/ qed-. + +fact lpx_bi_inv_atom2_aux: ∀R,L1,L2. lpx_bi R L1 L2 → L2 = ⋆ → L1 = ⋆. +#R #L1 #L2 * -L1 -L2 +[ // +| #I #K1 #K2 #V1 #V2 #_ #_ #H destruct +] +qed-. + +lemma lpx_bi_inv_atom2: ∀R,L1. lpx_bi R L1 (⋆) → L1 = ⋆. +/2 width=4 by lpx_bi_inv_atom2_aux/ qed-. + +fact lpx_bi_inv_pair2_aux: ∀R,L1,L2. lpx_bi R L1 L2 → + ∀I,K2,V2. L2 = K2. ⓑ{I} V2 → + ∃∃K1,V1. lpx_bi R K1 K2 & R K1 V1 K2 V2 & + L1 = K1. ⓑ{I} V1. +#R #L1 #L2 * -L1 -L2 +[ #J #K2 #V2 #H destruct +| #I #K1 #K2 #V1 #V2 #HK12 #HV12 #J #K #W #H destruct /2 width=5/ +] +qed-. + +lemma lpx_bi_inv_pair2: ∀R,I,L1,K2,V2. lpx_bi R L1 (K2. ⓑ{I} V2) → + ∃∃K1,V1. lpx_bi R K1 K2 & R K1 V1 K2 V2 & + L1 = K1. ⓑ{I} V1. +/2 width=3 by lpx_bi_inv_pair2_aux/ qed-. + +(* Basic forward lemmas *****************************************************) + +lemma lpx_bi_fwd_length: ∀R,L1,L2. lpx_bi R L1 L2 → |L1| = |L2|. +#R #L1 #L2 #H elim H -L1 -L2 normalize // +qed-. + +(* Basic properties *********************************************************) + +lemma lpx_bi_refl: ∀R. bi_reflexive ? ? R → reflexive … (lpx_bi R). +#R #HR #L elim L -L // /2 width=1/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/lfpr_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/lfpr_alt.etc new file mode 100644 index 000000000..95ec60ba2 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/lfpr_alt.etc @@ -0,0 +1,87 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( L1 ⊢ ➡ ➡ break term 46 L2 )" + non associative with precedence 45 + for @{ 'PRedSnAlt $L1 $L2 }. + +notation "hvbox( ⦃ term 46 L1 ⦄ ➡ ➡ break ⦃ term 46 L2 ⦄ )" + non associative with precedence 45 + for @{ 'FocalizedPRedAlt $L1 $L2 }. + +include "basic_2/grammar/lenv_px_bi.ma". +include "basic_2/reducibility/fpr_cpr.ma". +include "basic_2/reducibility/lfpr_fpr.ma". + +(* FOCALIZED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS **********************) + +(* alternative definition *) +definition lfpra: relation lenv ≝ lpx_bi fpr. + +interpretation + "focalized parallel reduction (environment) alternative" + 'FocalizedPRedAlt L1 L2 = (lfpra L1 L2). + +(* Basic properties *********************************************************) + +lemma lfpra_refl: reflexive … lfpra. +/2 width=1/ qed. + +lemma fpr_lfpra: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ → ⦃L1⦄ ➡➡ ⦃L2⦄. +#L1 elim L1 -L1 +[ #L2 #T1 #T2 #H + elim (fpr_inv_atom1 … H) -H #_ #H destruct // +| #L1 #I #V1 #IH #L2 #T1 #T2 #H + elim (fpr_inv_pair1 … H) -H #L #V #HV1 #HL1 #H destruct /3 width=3/ +] +qed. + +(* Basic inversion lemmas ***************************************************) + +lemma lfpra_inv_atom1: ∀L2. ⦃⋆⦄ ➡➡ ⦃L2⦄ → L2 = ⋆. +/2 width=2 by lpx_bi_inv_atom1/ qed-. + +lemma lfpra_inv_pair1: ∀K1,I,V1,L2. ⦃K1. ⓑ{I} V1⦄ ➡➡ ⦃L2⦄ → + ∃∃K2,V2. ⦃K1⦄ ➡➡ ⦃K2⦄ & ⦃K1, V1⦄ ➡ ⦃K2, V2⦄ & + L2 = K2. ⓑ{I} V2. +/2 width=1 by lpx_bi_inv_pair1/ qed-. + +lemma lfpra_inv_atom2: ∀L1. ⦃L1⦄ ➡➡ ⦃⋆⦄ → L1 = ⋆. +/2 width=2 by lpx_bi_inv_atom2/ qed-. + +lemma lfpra_inv_pair2: ∀L1,K2,I,V2. ⦃L1⦄ ➡➡ ⦃K2. ⓑ{I} V2⦄ → + ∃∃K1,V1. ⦃K1⦄ ➡➡ ⦃K2⦄ & ⦃K1, V1⦄ ➡ ⦃K2, V2⦄ & + L1 = K1. ⓑ{I} V1. +/2 width=1 by lpx_bi_inv_pair2/ qed-. + +lemma lfpra_inv_fpr: ∀L1,L2. ⦃L1⦄ ➡➡ ⦃L2⦄ → ∀T.⦃L1, T⦄ ➡ ⦃L2, T⦄. +#L1 #L2 * -L1 -L2 // /3 width=1/ +qed-. + +(* Basic forward lemmas *****************************************************) + +lemma lfpra_fwd_length: ∀L1,L2. ⦃L1⦄ ➡➡ ⦃L2⦄ → |L1| = |L2|. +/2 width=2 by lpx_bi_fwd_length/ qed-. + +(* Main properties **********************************************************) + +theorem lfpr_lfpra: ∀L1,L2. ⦃L1⦄ ➡ ⦃L2⦄ → ⦃L1⦄ ➡➡ ⦃L2⦄. +#L1 #L2 #H +lapply (lfpr_inv_fpr … H (⋆0)) -H /2 width=3/ +qed. + +theorem lfpra_lfpr: ∀L1,L2. ⦃L1⦄ ➡➡ ⦃L2⦄ → ⦃L1⦄ ➡ ⦃L2⦄. +#L1 #L2 #H +lapply (lfpra_inv_fpr … H (⋆0)) -H /2 width=3/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/lfpr_fpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/lfpr_fpr.etc new file mode 100644 index 000000000..f798d566b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/lfpr_fpr.etc @@ -0,0 +1,31 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/lfpr.ma". +include "basic_2/reducibility/cfpr_cpr.ma". + +(* FOCALIZED PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ***********************) + +(* Properties on context-free parallel reduction for closures ***************) + +lemma fpr_lfpr: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ → ⦃L1⦄ ➡ ⦃L2⦄. +#L1 #L2 #T1 #T2 #H +elim (fpr_inv_all … H) -H /2 width=3/ +qed. + +(* Inversion lemmas on context-free parallel reduction for closures *********) + +lemma lfpr_inv_fpr: ∀L1,L2. ⦃L1⦄ ➡ ⦃L2⦄ → ∀T. ⦃L1, T⦄ ➡ ⦃L2, T⦄. +#L1 #L2 * /2 width=4/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/lfprs_fprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/lfprs_fprs.etc new file mode 100644 index 000000000..a5c42ba65 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/fpr/lfprs_fprs.etc @@ -0,0 +1,41 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/lfpr_fpr.ma". +include "basic_2/computation/fprs_fprs.ma". +include "basic_2/computation/lfprs.ma". + +(* FOCALIZED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS *********************) + +(* Inversion lemmas on context-free parallel reduction for closures *********) + +lemma lfprs_inv_fprs: ∀L1,L2. ⦃L1⦄ ➡* ⦃L2⦄ → ∀T. ⦃L1, T⦄ ➡* ⦃L2, T⦄. +#L1 #L2 #H @(lfprs_ind … H) -L2 // +#L #L2 #_ #HL2 #IHL1 #T +lapply (lfpr_inv_fpr … HL2 T) -HL2 /3 width=4/ +qed-. + +(* Properties on context-free parallel computation for closures *************) + +lemma fprs_lfprs: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡* ⦃L2, T2⦄ → ⦃L1⦄ ➡* ⦃L2⦄. +#L1 #L2 #T1 #T2 #H @(fprs_ind … H) -L2 -T2 // /3 width=5/ +qed. + +lemma lfprs_fprs_trans: ∀L1,L,L2,T1,T2. ⦃L1⦄ ➡* ⦃L⦄ → ⦃L, T1⦄ ➡* ⦃L2, T2⦄ → ⦃L1, T1⦄ ➡* ⦃L2, T2⦄. +#L1 #L #L2 #T1 #T2 #HL1 #HL2 +lapply (lfprs_inv_fprs … HL1 T1) -HL1 /2 width=4/ +qed. +(* +lamma lfprs_cprs_conf: ∀L1,L,L2,T1,T2. ⦃L1⦄ ➡* ⦃L2⦄ → L1 ⊢ T1 ➡* T2 → ⦃L1, T1⦄ ➡* ⦃L2, T2⦄. +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/frsup/frsup.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/frsup/frsup.etc new file mode 100644 index 000000000..077fd7422 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/frsup/frsup.etc @@ -0,0 +1,123 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( ⦃ term 46 L1, break term 46 T1 ⦄ ⧁ break ⦃ term 46 L2 , break term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'RestSupTerm $L1 $T1 $L2 $T2 }. + +include "basic_2/grammar/cl_weight.ma". +include "basic_2/substitution/lift.ma". + +(* RESTRICTED SUPCLOSURE ****************************************************) + +inductive frsup: bi_relation lenv term ≝ +| frsup_bind_sn: ∀a,I,L,V,T. frsup L (ⓑ{a,I}V.T) L V +| frsup_bind_dx: ∀a,I,L,V,T. frsup L (ⓑ{a,I}V.T) (L.ⓑ{I}V) T +| frsup_flat_sn: ∀I,L,V,T. frsup L (ⓕ{I}V.T) L V +| frsup_flat_dx: ∀I,L,V,T. frsup L (ⓕ{I}V.T) L T +. + +interpretation + "restricted structural predecessor (closure)" + 'RestSupTerm L1 T1 L2 T2 = (frsup L1 T1 L2 T2). + +(* Basic inversion lemmas ***************************************************) + +fact frsup_inv_atom1_aux: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → + ∀J. T1 = ⓪{J} → ⊥. +#L1 #L2 #T1 #T2 * -L1 -L2 -T1 -T2 +[ #a #I #L #V #T #J #H destruct +| #a #I #L #V #T #J #H destruct +| #I #L #V #T #J #H destruct +| #I #L #V #T #J #H destruct +] +qed-. + +lemma frsup_inv_atom1: ∀J,L1,L2,T2. ⦃L1, ⓪{J}⦄ ⧁ ⦃L2, T2⦄ → ⊥. +/2 width=7 by frsup_inv_atom1_aux/ qed-. + +fact frsup_inv_bind1_aux: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → + ∀b,J,W,U. T1 = ⓑ{b,J}W.U → + (L2 = L1 ∧ T2 = W) ∨ + (L2 = L1.ⓑ{J}W ∧ T2 = U). +#L1 #L2 #T1 #T2 * -L1 -L2 -T1 -T2 +[ #a #I #L #V #T #b #J #W #U #H destruct /3 width=1/ +| #a #I #L #V #T #b #J #W #U #H destruct /3 width=1/ +| #I #L #V #T #b #J #W #U #H destruct +| #I #L #V #T #b #J #W #U #H destruct +] +qed-. + +lemma frsup_inv_bind1: ∀b,J,L1,L2,W,U,T2. ⦃L1, ⓑ{b,J}W.U⦄ ⧁ ⦃L2, T2⦄ → + (L2 = L1 ∧ T2 = W) ∨ + (L2 = L1.ⓑ{J}W ∧ T2 = U). +/2 width=4 by frsup_inv_bind1_aux/ qed-. + +fact frsup_inv_flat1_aux: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → + ∀J,W,U. T1 = ⓕ{J}W.U → + L2 = L1 ∧ (T2 = W ∨ T2 = U). +#L1 #L2 #T1 #T2 * -L1 -L2 -T1 -T2 +[ #a #I #L #V #T #J #W #U #H destruct +| #a #I #L #V #T #J #W #U #H destruct +| #I #L #V #T #J #W #U #H destruct /3 width=1/ +| #I #L #V #T #J #W #U #H destruct /3 width=1/ +] +qed-. + +lemma frsup_inv_flat1: ∀J,L1,L2,W,U,T2. ⦃L1, ⓕ{J}W.U⦄ ⧁ ⦃L2, T2⦄ → + L2 = L1 ∧ (T2 = W ∨ T2 = U). +/2 width=4 by frsup_inv_flat1_aux/ qed-. + +(* Basic forward lemmas *****************************************************) + +lemma frsup_fwd_fw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → ♯{L2, T2} < ♯{L1, T1}. +#L1 #L2 #T1 #T2 * -L1 -L2 -T1 -T2 /width=1/ +qed-. + +lemma frsup_fwd_lw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → ♯{L1} ≤ ♯{L2}. +#L1 #L2 #T1 #T2 * -L1 -L2 -T1 -T2 /width=1/ +qed-. + +lemma frsup_fwd_tw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → ♯{T2} < ♯{T1}. +#L1 #L2 #T1 #T2 * -L1 -L2 -T1 -T2 /width=1/ /2 width=1 by le_minus_to_plus/ +qed-. + +lemma frsup_fwd_append: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → ∃L. L2 = L1 @@ L. +#L1 #L2 #T1 #T2 * -L1 -L2 -T1 -T2 +[ #a +| #a #I #L #V #_ @(ex_intro … (⋆.ⓑ{I}V)) // +] +#I #L #V #T @(ex_intro … (⋆)) // +qed-. + +(* Advanced forward lemmas **************************************************) + +lemma lift_frsup_trans: ∀T1,U1,d,e. ⇧[d, e] T1 ≡ U1 → + ∀L,K,U2. ⦃L, U1⦄ ⧁ ⦃L @@ K, U2⦄ → + ∃T2. ⇧[d + |K|, e] T2 ≡ U2. +#T1 #U1 #d #e * -T1 -U1 -d -e +[5: #a #I #V1 #W1 #T1 #U1 #d #e #HVW1 #HTU1 #L #K #X #H + elim (frsup_inv_bind1 … H) -H * + [ -HTU1 #H1 #H2 destruct + >(append_inv_refl_dx … H1) -L -K normalize /2 width=2/ + | -HVW1 #H1 #H2 destruct + >(append_inv_pair_dx … H1) -L -K normalize /2 width=2/ + ] +|6: #I #V1 #W1 #T1 #U1 #d #e #HVW1 #HUT1 #L #K #X #H + elim (frsup_inv_flat1 … H) -H #H1 * #H2 destruct + >(append_inv_refl_dx … H1) -L -K normalize /2 width=2/ +] +#i #d #e [2,3: #_ ] #L #K #X #H +elim (frsup_inv_atom1 … H) +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/frsup/frsupp.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/frsup/frsupp.etc new file mode 100644 index 000000000..9f7a8dc9d --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/frsup/frsupp.etc @@ -0,0 +1,110 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( ⦃ term 46 L1, break term 46 T1 ⦄ ⧁ + break ⦃ term 46 L2 , break term 46 T2 ⦄ )" + non associative with precedence 45 + for @{ 'RestSupTermPlus $L1 $T1 $L2 $T2 }. + +include "basic_2/substitution/frsup.ma". + +(* PLUS-ITERATED RESTRICTED SUPCLOSURE **************************************) + +definition frsupp: bi_relation lenv term ≝ bi_TC … frsup. + +interpretation "plus-iterated restricted structural predecessor (closure)" + 'RestSupTermPlus L1 T1 L2 T2 = (frsupp L1 T1 L2 T2). + +(* Basic eliminators ********************************************************) + +lemma frsupp_ind: ∀L1,T1. ∀R:relation2 lenv term. + (∀L2,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → R L2 T2) → + (∀L,T,L2,T2. ⦃L1, T1⦄ ⧁+ ⦃L, T⦄ → ⦃L, T⦄ ⧁ ⦃L2, T2⦄ → R L T → R L2 T2) → + ∀L2,T2. ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄ → R L2 T2. +#L1 #T1 #R #IH1 #IH2 #L2 #T2 #H +@(bi_TC_ind … IH1 IH2 ? ? H) +qed-. + +lemma frsupp_ind_dx: ∀L2,T2. ∀R:relation2 lenv term. + (∀L1,T1. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → R L1 T1) → + (∀L1,L,T1,T. ⦃L1, T1⦄ ⧁ ⦃L, T⦄ → ⦃L, T⦄ ⧁+ ⦃L2, T2⦄ → R L T → R L1 T1) → + ∀L1,T1. ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄ → R L1 T1. +#L2 #T2 #R #IH1 #IH2 #L1 #T1 #H +@(bi_TC_ind_dx … IH1 IH2 ? ? H) +qed-. + +(* Baic inversion lemmas ****************************************************) + +lemma frsupp_inv_dx: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ ∨ + ∃∃L,T. ⦃L1, T1⦄ ⧁+ ⦃L, T⦄ & ⦃L, T⦄ ⧁ ⦃L2, T2⦄. +/2 width=1 by bi_TC_decomp_r/ qed-. + +lemma frsupp_inv_sn: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ ∨ + ∃∃L,T. ⦃L1, T1⦄ ⧁ ⦃L, T⦄ & ⦃L, T⦄ ⧁+ ⦃L2, T2⦄. +/2 width=1 by bi_TC_decomp_l/ qed-. + +(* Basic properties *********************************************************) + +lemma frsup_frsupp: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄. +/2 width=1/ qed. + +lemma frsupp_strap1: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ⧁+ ⦃L, T⦄ → ⦃L, T⦄ ⧁ ⦃L2, T2⦄ → + ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄. +/2 width=4/ qed. + +lemma frsupp_strap2: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ⧁ ⦃L, T⦄ → ⦃L, T⦄ ⧁+ ⦃L2, T2⦄ → + ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄. +/2 width=4/ qed. + +(* Basic forward lemmas *****************************************************) + +lemma frsupp_fwd_fw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄ → ♯{L2, T2} < ♯{L1, T1}. +#L1 #L2 #T1 #T2 #H @(frsupp_ind … H) -L2 -T2 +/3 width=3 by frsup_fwd_fw, transitive_lt/ +qed-. + +lemma frsupp_fwd_lw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄ → ♯{L1} ≤ ♯{L2}. +#L1 #L2 #T1 #T2 #H @(frsupp_ind … H) -L2 -T2 +/2 width=3 by frsup_fwd_lw/ (**) (* /3 width=5 by frsup_fwd_lw, transitive_le/ is too slow *) +#L #T #L2 #T2 #_ #HL2 #HL1 +lapply (frsup_fwd_lw … HL2) -HL2 /2 width=3 by transitive_le/ +qed-. + +lemma frsupp_fwd_tw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄ → ♯{T2} < ♯{T1}. +#L1 #L2 #T1 #T2 #H @(frsupp_ind … H) -L2 -T2 +/3 width=3 by frsup_fwd_tw, transitive_lt/ +qed-. + +lemma frsupp_fwd_append: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄ → ∃L. L2 = L1 @@ L. +#L1 #L2 #T1 #T2 #H @(frsupp_ind … H) -L2 -T2 /2 width=3 by frsup_fwd_append/ +#L #T #L2 #T2 #_ #HL2 * #K1 #H destruct +elim (frsup_fwd_append … HL2) -HL2 #K2 #H destruct /2 width=2/ +qed-. + +(* Advanced forward lemmas **************************************************) + +lemma lift_frsupp_trans: ∀L,U1,K,U2. ⦃L, U1⦄ ⧁+ ⦃L @@ K, U2⦄ → + ∀T1,d,e. ⇧[d, e] T1 ≡ U1 → + ∃T2. ⇧[d + |K|, e] T2 ≡ U2. +#L #U1 @(f2_ind … fw … L U1) -L -U1 #n #IH +#L #U1 #Hn #K #U2 #H #T1 #d #e #HTU1 destruct +elim (frsupp_inv_sn … H) -H /2 width=5 by lift_frsup_trans/ * +#L0 #U0 #HL0 #HL +elim (frsup_fwd_append … HL0) #K0 #H destruct +elim (frsupp_fwd_append … HL) #L0 >append_assoc #H +elim (append_inj_dx … H ?) -H // #_ #H destruct +(append_inv_refl_dx … (sym_eq … H1)) -H1 normalize /2 width=2/ +| /2 width=5 by lift_frsupp_trans/ +] +qed-. + +(* Advanced inversion lemmas for frsupp **************************************) + +lemma frsupp_inv_atom1_frsups: ∀J,L1,L2,T2. ⦃L1, ⓪{J}⦄ ⧁+ ⦃L2, T2⦄ → ⊥. +#J #L1 #L2 #T2 #H @(frsupp_ind … H) -L2 -T2 // +#L2 #T2 #H elim (frsup_inv_atom1 … H) +qed-. + +lemma frsupp_inv_bind1_frsups: ∀b,J,L1,L2,W,U,T2. ⦃L1, ⓑ{b,J}W.U⦄ ⧁+ ⦃L2, T2⦄ → + ⦃L1, W⦄ ⧁* ⦃L2, T2⦄ ∨ ⦃L1.ⓑ{J}W, U⦄ ⧁* ⦃L2, T2⦄. +#b #J #L1 #L2 #W #U #T2 #H @(frsupp_ind … H) -L2 -T2 +[ #L2 #T2 #H + elim (frsup_inv_bind1 … H) -H * #H1 #H2 destruct /2 width=1/ +| #L #T #L2 #T2 #_ #HT2 * /3 width=4/ +] +qed-. + +lemma frsupp_inv_flat1_frsups: ∀J,L1,L2,W,U,T2. ⦃L1, ⓕ{J}W.U⦄ ⧁+ ⦃L2, T2⦄ → + ⦃L1, W⦄ ⧁* ⦃L2, T2⦄ ∨ ⦃L1, U⦄ ⧁* ⦃L2, T2⦄. +#J #L1 #L2 #W #U #T2 #H @(frsupp_ind … H) -L2 -T2 +[ #L2 #T2 #H + elim (frsup_inv_flat1 … H) -H #H1 * #H2 destruct /2 width=1/ +| #L #T #L2 #T2 #_ #HT2 * /3 width=4/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/frsup/frsups_frsups.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/frsup/frsups_frsups.etc new file mode 100644 index 000000000..e7b7de26e --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/frsup/frsups_frsups.etc @@ -0,0 +1,22 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/frsups.ma". + +(* STAR-ITERATED RESTRICTED SUPCLOSURE **************************************) + +(* Main propertis ***********************************************************) + +theorem frsups_trans: bi_transitive … frsups. +/2 width=4/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/frsup/ssta_frsups.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/frsup/ssta_frsups.etc new file mode 100644 index 000000000..9eb1fbd8b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/frsup/ssta_frsups.etc @@ -0,0 +1,70 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/frsups.ma". +include "basic_2/static/ssta.ma". + +(* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************) + +(* Advanced inversion lemmas ************************************************) + +lemma ssta_inv_frsupp: ∀h,g,L,T,U,l. ⦃h, L⦄ ⊢ T •[g] ⦃l, U⦄ → ⦃L, U⦄ ⧁+ ⦃L, T⦄ → ⊥. +#h #g #L #T #U #l #H elim H -L -T -U -l +[ #L #k #l #_ #H + elim (frsupp_inv_atom1_frsups … H) +| #L #K #V #W #U #i #l #_ #_ #HWU #_ #H + elim (lift_frsupp_trans … (⋆) … H … HWU) -U #X #H + elim (lift_inv_lref2_be … H ? ?) -H // +| #L #K #W #V #U #i #l #_ #_ #HWU #_ #H + elim (lift_frsupp_trans … (⋆) … H … HWU) -U #X #H + elim (lift_inv_lref2_be … H ? ?) -H // +| #a #I #L #V #T #U #l #_ #IHTU #H + elim (frsupp_inv_bind1_frsups … H) -H #H [2: /4 width=4/ ] -IHTU + lapply (frsups_fwd_fw … H) -H normalize + (lcoeq_inv_O2 … HL1) -HL1 // +| #I1 #I #L1 #L #V1 #V #e #_ #IHL1 #X #H elim (lcoeq_inv_pair1 … H) -H // + #I2 #L2 #V2 #HL2 #H destruct /3 width=1 by lcoeq_pair/ +| #I #L1 #L #V #d #e #_ #IHL1 #X #H elim (lcoeq_inv_succ1 … H) -H // + #L2 #HL2 #H destruct /3 width=1 by lcoeq_succ/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lcoeq/ldrop_lcoeq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lcoeq/ldrop_lcoeq.etc new file mode 100644 index 000000000..4891949c2 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lcoeq/ldrop_lcoeq.etc @@ -0,0 +1,51 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "ground_2/ynat/ynat_minus.ma". +include "basic_2/grammar/lcoeq.ma". +include "basic_2/relocation/ldrop.ma". + +(* BASIC SLICING FOR LOCAL ENVIRONMENTS *************************************) + +(* Properties on coequivalence **********************************************) + +lemma lcoeq_ldrop_trans_lt: ∀L1,L2,d,e. L1 ≅[d, e] L2 → + ∀I,K2,W,s,i. ⇩[s, 0, i] L2 ≡ K2.ⓑ{I}W → i < d → + ∃∃K1. K1 ≅[⫰(d-i), e] K2 & ⇩[s, 0, i] L1 ≡ K1.ⓑ{I}W. +#L1 #L2 #d #e #H elim H -L1 -L2 -d -e +[ #d #e #J #K2 #W #s #i #H + elim (ldrop_inv_atom1 … H) -H #H destruct +| #I #L1 #L2 #V #_ #_ #J #K2 #W #s #i #_ #H + elim (ylt_yle_false … H) // +| #I1 #I2 #L1 #L2 #V1 #V2 #e #_ #_ #J #K2 #W #s #i #_ #H + elim (ylt_yle_false … H) // +| #I #L1 #L2 #V #d #e #HL12 #IHL12 #J #K2 #W #s #i #H + elim (ldrop_inv_O1_pair1 … H) -H * #Hi #HLK1 [ -IHL12 | -HL12 ] + [ #_ destruct >ypred_succ + /2 width=3 by ldrop_pair, ex2_intro/ + | lapply (ylt_inv_O1 i ?) /2 width=1 by ylt_inj/ + #H yminus_succ (cpys_inv_sort1 … H) -H // +qed. + +lemma lleq_gref: ∀L1,L2,d,p. |L1| = |L2| → L1 ⋕[§p, d] L2. +#L1 #L2 #d #k #HL12 @conj // -HL12 +#U @conj #H >(cpys_inv_gref1 … H) -H // +qed. + +lemma lleq_bind: ∀a,I,L1,L2,V,T,d. + L1 ⋕[V, d] L2 → L1.ⓑ{I}V ⋕[T, ⫯d] L2.ⓑ{I}V → + L1 ⋕[ⓑ{a,I}V.T, d] L2. +#a #I #L1 #L2 #V #T #d * #HL12 #IHV * #_ #IHT @conj // -HL12 +#X @conj #H elim (cpys_inv_bind1 … H) -H +#W #U #HVW #HTU #H destruct +elim (IHV W) -IHV elim (IHT U) -IHT /3 width=1 by cpys_bind/ +qed. + +lemma lleq_flat: ∀I,L1,L2,V,T,d. + L1 ⋕[V, d] L2 → L1 ⋕[T, d] L2 → L1 ⋕[ⓕ{I}V.T, d] L2. +#I #L1 #L2 #V #T #d * #HL12 #IHV * #_ #IHT @conj // -HL12 +#X @conj #H elim (cpys_inv_flat1 … H) -H +#W #U #HVW #HTU #H destruct +elim (IHV W) -IHV elim (IHT U) -IHT +/3 width=1 by cpys_flat/ +qed. + +lemma lleq_be: ∀L1,L2,U,dt. L1 ⋕[U, dt] L2 → ∀T,d,e. ⇧[d, e] T ≡ U → + d ≤ dt → dt ≤ d + e → L1 ⋕[U, d] L2. +#L1 #L2 #U #dt * #HL12 #IH #T #d #e #HTU #Hddt #Hdtde @conj // -HL12 +#U0 elim (IH U0) -IH #H12 #H21 @conj +#HU0 elim (cpys_fwd_up … HU0 … HTU) // -HU0 /4 width=5 by cpys_weak/ +qed-. + +lemma lsuby_lleq_trans: ∀L2,L,T,d. L2 ⋕[T, d] L → + ∀L1. L1 ⊑×[d, ∞] L2 → |L1| = |L2| → L1 ⋕[T, d] L. +#L2 #L #T #d * #HL2 #IH #L1 #HL12 #H @conj // -HL2 +#U elim (IH U) -IH #Hdx #Hsn @conj #HTU +[ @Hdx -Hdx -Hsn @(lsuby_cpys_trans … HTU) -HTU + /2 width=1 by lsuby_sym/ (**) (* full auto does not work *) +| -H -Hdx /3 width=3 by lsuby_cpys_trans/ +] +qed-. + +lemma lleq_lsuby_trans: ∀L,L1,T,d. L ⋕[T, d] L1 → + ∀L2. L1 ⊑×[d, ∞] L2 → |L1| = |L2| → L ⋕[T, d] L2. +/5 width=4 by lsuby_lleq_trans, lleq_sym, lsuby_sym/ qed-. + +lemma lleq_lsuby_repl: ∀L1,L2,T,d. L1 ⋕[T, d] L2 → + ∀K1. K1 ⊑×[d, ∞] L1 → |K1| = |L1| → + ∀K2. L2 ⊑×[d, ∞] K2 → |L2| = |K2| → + K1 ⋕[T, d] K2. +/3 width=4 by lleq_lsuby_trans, lsuby_lleq_trans/ qed-. + +(* Basic forward lemmas *****************************************************) + +lemma lleq_fwd_length: ∀L1,L2,T,d. L1 ⋕[T, d] L2 → |L1| = |L2|. +#L1 #L2 #T #d * // +qed-. + +lemma lleq_fwd_ldrop_sn: ∀L1,L2,T,d. L1 ⋕[d, T] L2 → ∀K1,i. ⇩[i] L1 ≡ K1 → + ∃K2. ⇩[i] L2 ≡ K2. +#L1 #L2 #T #d #H #K1 #i #HLK1 lapply (lleq_fwd_length … H) -H +#HL12 lapply (ldrop_fwd_length_le2 … HLK1) -HLK1 /2 width=1 by ldrop_O1_le/ +qed-. + +lemma lleq_fwd_ldrop_dx: ∀L1,L2,T,d. L1 ⋕[d, T] L2 → ∀K2,i. ⇩[i] L2 ≡ K2 → + ∃K1. ⇩[i] L1 ≡ K1. +/3 width=6 by lleq_fwd_ldrop_sn, lleq_sym/ qed-. + +lemma lleq_fwd_bind_sn: ∀a,I,L1,L2,V,T,d. + L1 ⋕[ⓑ{a,I}V.T, d] L2 → L1 ⋕[V, d] L2. +#a #I #L1 #L2 #V #T #d * #HL12 #H @conj // -HL12 +#U elim (H (ⓑ{a,I}U.T)) -H +#H1 #H2 @conj +#H [ lapply (H1 ?) | lapply (H2 ?) ] -H1 -H2 +/2 width=1 by cpys_bind/ -H +#H elim (cpys_inv_bind1 … H) -H +#X #Y #H1 #H2 #H destruct // +qed-. + +lemma lleq_fwd_bind_dx: ∀a,I,L1,L2,V,T,d. + L1 ⋕[ⓑ{a,I}V.T, d] L2 → L1.ⓑ{I}V ⋕[T, ⫯d] L2.ⓑ{I}V. +#a #I #L1 #L2 #V #T #d * #HL12 #H @conj [ normalize // ] -HL12 +#U elim (H (ⓑ{a,I}V.U)) -H +#H1 #H2 @conj +#H [ lapply (H1 ?) | lapply (H2 ?) ] -H1 -H2 +/2 width=1 by cpys_bind/ -H +#H elim (cpys_inv_bind1 … H) -H +#X #Y #H1 #H2 #H destruct // +qed-. + +lemma lleq_fwd_flat_sn: ∀I,L1,L2,V,T,d. + L1 ⋕[ⓕ{I}V.T, d] L2 → L1 ⋕[V, d] L2. +#I #L1 #L2 #V #T #d * #HL12 #H @conj // -HL12 +#U elim (H (ⓕ{I}U.T)) -H +#H1 #H2 @conj +#H [ lapply (H1 ?) | lapply (H2 ?) ] -H1 -H2 +/2 width=1 by cpys_flat/ -H +#H elim (cpys_inv_flat1 … H) -H +#X #Y #H1 #H2 #H destruct // +qed-. + +lemma lleq_fwd_flat_dx: ∀I,L1,L2,V,T,d. + L1 ⋕[ⓕ{I}V.T, d] L2 → L1 ⋕[T, d] L2. +#I #L1 #L2 #V #T #d * #HL12 #H @conj // -HL12 +#U elim (H (ⓕ{I}V.U)) -H +#H1 #H2 @conj +#H [ lapply (H1 ?) | lapply (H2 ?) ] -H1 -H2 +/2 width=1 by cpys_flat/ -H +#H elim (cpys_inv_flat1 … H) -H +#X #Y #H1 #H2 #H destruct // +qed-. + +(* Basic inversion lemmas ***************************************************) + +lemma lleq_inv_bind: ∀a,I,L1,L2,V,T,d. L1 ⋕[ⓑ{a,I}V.T, d] L2 → + L1 ⋕[V, d] L2 ∧ L1.ⓑ{I}V ⋕[T, ⫯d] L2.ⓑ{I}V. +/3 width=4 by lleq_fwd_bind_sn, lleq_fwd_bind_dx, conj/ qed-. + +lemma lleq_inv_flat: ∀I,L1,L2,V,T,d. L1 ⋕[ⓕ{I}V.T, d] L2 → + L1 ⋕[V, d] L2 ∧ L1 ⋕[T, d] L2. +/3 width=3 by lleq_fwd_flat_sn, lleq_fwd_flat_dx, conj/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lleq_alt/lleq_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lleq_alt/lleq_alt.etc new file mode 100644 index 000000000..a8fb526e5 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lleq_alt/lleq_alt.etc @@ -0,0 +1,85 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/lazyeqalt_4.ma". +include "basic_2/substitution/lleq_lleq.ma". + +(* LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **********************************) + +(* Note: alternative definition of lleq *) +inductive lleqa: relation4 ynat term lenv lenv ≝ +| lleqa_sort: ∀L1,L2,d,k. |L1| = |L2| → lleqa d (⋆k) L1 L2 +| lleqa_skip: ∀L1,L2,d,i. |L1| = |L2| → yinj i < d → lleqa d (#i) L1 L2 +| lleqa_lref: ∀I1,I2,L1,L2,K1,K2,V,d,i. d ≤ yinj i → + ⇩[i] L1 ≡ K1.ⓑ{I1}V → ⇩[i] L2 ≡ K2.ⓑ{I2}V → + lleqa (yinj 0) V K1 K2 → lleqa d (#i) L1 L2 +| lleqa_free: ∀L1,L2,d,i. |L1| = |L2| → |L1| ≤ i → |L2| ≤ i → lleqa d (#i) L1 L2 +| lleqa_gref: ∀L1,L2,d,p. |L1| = |L2| → lleqa d (§p) L1 L2 +| lleqa_bind: ∀a,I,L1,L2,V,T,d. + lleqa d V L1 L2 → lleqa (⫯d) T (L1.ⓑ{I}V) (L2.ⓑ{I}V) → + lleqa d (ⓑ{a,I}V.T) L1 L2 +| lleqa_flat: ∀I,L1,L2,V,T,d. + lleqa d V L1 L2 → lleqa d T L1 L2 → lleqa d (ⓕ{I}V.T) L1 L2 +. + +interpretation + "lazy equivalence (local environment) alternative" + 'LazyEqAlt T d L1 L2 = (lleqa d T L1 L2). + +(* Main inversion lemmas ****************************************************) + +theorem lleqa_inv_lleq: ∀L1,L2,T,d. L1 ⋕⋕[T, d] L2 → L1 ⋕[T, d] L2. +#L1 #L2 #T #d #H elim H -L1 -L2 -T -d +/2 width=8 by lleq_flat, lleq_bind, lleq_gref, lleq_free, lleq_lref, lleq_skip, lleq_sort/ +qed-. + +(* Main properties **********************************************************) + +theorem lleq_lleqa: ∀L1,T,L2,d. L1 ⋕[T, d] L2 → L1 ⋕⋕[T, d] L2. +#L1 #T @(f2_ind … rfw … L1 T) -L1 -T +#n #IH #L1 * * /3 width=3 by lleqa_gref, lleqa_sort, lleq_fwd_length/ +[ #i #Hn #L2 #d #H elim (lleq_fwd_lref … H) [ * || * ] + /4 width=9 by lleqa_free, lleqa_lref, lleqa_skip, lleq_fwd_length, ldrop_fwd_rfw/ +| #a #I #V #T #Hn #L2 #d #H elim (lleq_inv_bind … H) -H /3 width=1 by lleqa_bind/ +| #I #V #T #Hn #L2 #d #H elim (lleq_inv_flat … H) -H /3 width=1 by lleqa_flat/ +] +qed. + +(* Advanced eliminators *****************************************************) + +lemma lleq_ind_alt: ∀R:relation4 ynat term lenv lenv. ( + ∀L1,L2,d,k. |L1| = |L2| → R d (⋆k) L1 L2 + ) → ( + ∀L1,L2,d,i. |L1| = |L2| → yinj i < d → R d (#i) L1 L2 + ) → ( + ∀I1,I2,L1,L2,K1,K2,V,d,i. d ≤ yinj i → + ⇩[i] L1 ≡ K1.ⓑ{I1}V → ⇩[i] L2 ≡ K2.ⓑ{I2}V → + K1 ⋕[V, yinj O] K2 → R (yinj O) V K1 K2 → R d (#i) L1 L2 + ) → ( + ∀L1,L2,d,i. |L1| = |L2| → |L1| ≤ i → |L2| ≤ i → R d (#i) L1 L2 + ) → ( + ∀L1,L2,d,p. |L1| = |L2| → R d (§p) L1 L2 + ) → ( + ∀a,I,L1,L2,V,T,d. + L1 ⋕[V, d]L2 → L1.ⓑ{I}V ⋕[T, ⫯d] L2.ⓑ{I}V → + R d V L1 L2 → R (⫯d) T (L1.ⓑ{I}V) (L2.ⓑ{I}V) → R d (ⓑ{a,I}V.T) L1 L2 + ) → ( + ∀I,L1,L2,V,T,d. + L1 ⋕[V, d]L2 → L1 ⋕[T, d] L2 → + R d V L1 L2 → R d T L1 L2 → R d (ⓕ{I}V.T) L1 L2 + ) → + ∀d,T,L1,L2. L1 ⋕[T, d] L2 → R d T L1 L2. +#R #H1 #H2 #H3 #H4 #H5 #H6 #H7 #d #T #L1 #L2 #H elim (lleq_lleqa … H) -H +/3 width=9 by lleqa_inv_lleq/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lleq_alt/lleq_ext.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lleq_alt/lleq_ext.etc new file mode 100644 index 000000000..d6bb03fa7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lleq_alt/lleq_ext.etc @@ -0,0 +1,91 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/lleq_alt.ma". + +(* LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **********************************) + +(* Advanced inversion lemmas ************************************************) + +fact lleq_inv_S_aux: ∀L1,L2,T,d0. L1 ⋕[T, d0] L2 → ∀d. d0 = d + 1 → + ∀K1,K2,I,V. ⇩[d] L1 ≡ K1.ⓑ{I}V → ⇩[d] L2 ≡ K2.ⓑ{I}V → + K1 ⋕[V, 0] K2 → L1 ⋕[T, d] L2. +#L1 #L2 #T #d0 #H @(lleq_ind_alt … H) -L1 -L2 -T -d0 +/2 width=1 by lleq_gref, lleq_free, lleq_sort/ +[ #L1 #L2 #d0 #i #HL12 #Hid #d #H #K1 #K2 #I #V #HLK1 #HLK2 #HV destruct + elim (yle_split_eq i d) /2 width=1 by lleq_skip, ylt_fwd_succ2/ -HL12 -Hid + #H destruct /2 width=8 by lleq_lref/ +| #I1 #I2 #L1 #L2 #K11 #K22 #V #d0 #i #Hd0i #HLK11 #HLK22 #HV #_ #d #H #K1 #K2 #J #W #_ #_ #_ destruct + /3 width=8 by lleq_lref, yle_pred_sn/ +| #a #I #L1 #L2 #V #T #d0 #_ #_ #IHV #IHT #d #H #K1 #K2 #J #W #HLK1 #HLK2 destruct + /4 width=7 by lleq_bind, ldrop_drop/ +| #I #L1 #L2 #V #T #d0 #_ #_ #IHV #IHT #d #H #K1 #K2 #J #W #HLK1 #HLK2 destruct + /3 width=7 by lleq_flat/ +] +qed-. + +lemma lleq_inv_S: ∀T,L1,L2,d. L1 ⋕[T, d+1] L2 → + ∀K1,K2,I,V. ⇩[d] L1 ≡ K1.ⓑ{I}V → ⇩[d] L2 ≡ K2.ⓑ{I}V → + K1 ⋕[V, 0] K2 → L1 ⋕[T, d] L2. +/2 width=7 by lleq_inv_S_aux/ qed-. + +lemma lleq_inv_bind_O: ∀a,I,L1,L2,V,T. L1 ⋕[ⓑ{a,I}V.T, 0] L2 → + L1 ⋕[V, 0] L2 ∧ L1.ⓑ{I}V ⋕[T, 0] L2.ⓑ{I}V. +#a #I #L1 #L2 #V #T #H elim (lleq_inv_bind … H) -H +/3 width=7 by ldrop_pair, conj, lleq_inv_S/ +qed-. + +(* Advanced forward lemmas **************************************************) + +lemma lleq_fwd_bind_O: ∀a,I,L1,L2,V,T. L1 ⋕[ⓑ{a,I}V.T, 0] L2 → + L1.ⓑ{I}V ⋕[T, 0] L2.ⓑ{I}V. +#a #I #L1 #L2 #V #T #H elim (lleq_inv_bind_O … H) -H // +qed-. + +(* Advanced properties ******************************************************) + +lemma lleq_ge: ∀L1,L2,T,d1. L1 ⋕[T, d1] L2 → ∀d2. d1 ≤ d2 → L1 ⋕[T, d2] L2. +#L1 #L2 #T #d1 #H @(lleq_ind_alt … H) -L1 -L2 -T -d1 +/4 width=1 by lleq_sort, lleq_free, lleq_gref, lleq_bind, lleq_flat, yle_succ/ +[ /3 width=3 by lleq_skip, ylt_yle_trans/ +| #I1 #I2 #L1 #L2 #K1 #K2 #V #d1 #i #Hi #HLK1 #HLK2 #HV #IHV #d2 #Hd12 elim (ylt_split i d2) + [ lapply (lleq_fwd_length … HV) #HK12 #Hid2 + lapply (ldrop_fwd_length … HLK1) lapply (ldrop_fwd_length … HLK2) + normalize in ⊢ (%→%→?); -I1 -I2 -V -d1 /2 width=1 by lleq_skip/ + | /3 width=8 by lleq_lref, yle_trans/ + ] +] +qed-. + +lemma lleq_bind_O: ∀a,I,L1,L2,V,T. L1 ⋕[V, 0] L2 → L1.ⓑ{I}V ⋕[T, 0] L2.ⓑ{I}V → + L1 ⋕[ⓑ{a,I}V.T, 0] L2. +/3 width=3 by lleq_ge, lleq_bind/ qed. + +lemma lleq_bind_repl_SO: ∀I1,I2,L1,L2,V1,V2,T. L1.ⓑ{I1}V1 ⋕[T, 0] L2.ⓑ{I2}V2 → + ∀J1,J2,W1,W2. L1.ⓑ{J1}W1 ⋕[T, 1] L2.ⓑ{J2}W2. +#I1 #I2 #L1 #L2 #V1 #V2 #T #HT #J1 #J2 #W1 #W2 lapply (lleq_ge … HT 1 ?) // -HT +#HT @(lleq_lsuby_repl … HT) /2 width=1 by lsuby_succ/ (**) (* full auto fails *) +qed-. + +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. +/3 width=7 by lleq_bind_repl_SO, lleq_inv_S/ qed-. + +(* Inversion lemmas on negated lazy quivalence for local environments *******) + +lemma nlleq_inv_bind_O: ∀a,I,L1,L2,V,T. (L1 ⋕[ⓑ{a,I}V.T, 0] L2 → ⊥) → + (L1 ⋕[V, 0] L2 → ⊥) ∨ (L1.ⓑ{I}V ⋕[T, 0] L2.ⓑ{I}V → ⊥). +#a #I #L1 #L2 #V #T #H elim (lleq_dec V L1 L2 0) +/4 width=1 by lleq_bind_O, or_intror, or_introl/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lleq_alt/lleq_fqus.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lleq_alt/lleq_fqus.etc new file mode 100644 index 000000000..18744a539 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lleq_alt/lleq_fqus.etc @@ -0,0 +1,75 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/fqus_alt.ma". +include "basic_2/substitution/lleq_ext.ma". + +(* LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **********************************) + +(* Properties on supclosure and derivatives *********************************) + +lemma lleq_fqu_trans: ∀G1,G2,L2,K2,T,U. ⦃G1, L2, T⦄ ⊃ ⦃G2, K2, U⦄ → + ∀L1. L1 ⋕[T, 0] L2 → + ∃∃K1. ⦃G1, L1, T⦄ ⊃ ⦃G2, K1, U⦄ & K1 ⋕[U, 0] K2. +#G1 #G2 #L2 #K2 #T #U #H elim H -G1 -G2 -L2 -K2 -T -U +[ #I #G #L2 #V #L1 #H elim (lleq_inv_lref_ge_dx … H … I L2 V) -H // + #I1 #K1 #H1 #H2 lapply (ldrop_inv_O2 … H1) -H1 + #H destruct /2 width=3 by fqu_lref_O, ex2_intro/ +| * [ #a ] #I #G #L2 #V #T #L1 #H + [ elim (lleq_inv_bind … H) + | elim (lleq_inv_flat … H) + ] -H + /2 width=3 by fqu_pair_sn, ex2_intro/ +| #a #I #G #L2 #V #T #L1 #H elim (lleq_inv_bind_O … H) -H + #H3 #H4 /2 width=3 by fqu_bind_dx, ex2_intro/ +| #I #G #L2 #V #T #L1 #H elim (lleq_inv_flat … H) -H + /2 width=3 by fqu_flat_dx, ex2_intro/ +| #G #L2 #K2 #T #U #e #HLK2 #HTU #L1 #HL12 + elim (ldrop_O1_le (e+1) L1) + [ /3 width=12 by fqu_drop, lleq_inv_lift_le, ex2_intro/ + | lapply (ldrop_fwd_length_le2 … HLK2) -K2 + lapply (lleq_fwd_length … HL12) -T -U // + ] +] +qed-. + +lemma lleq_fquq_trans: ∀G1,G2,L2,K2,T,U. ⦃G1, L2, T⦄ ⊃⸮ ⦃G2, K2, U⦄ → + ∀L1. L1 ⋕[T, 0] L2 → + ∃∃K1. ⦃G1, L1, T⦄ ⊃⸮ ⦃G2, K1, U⦄ & K1 ⋕[U, 0] K2. +#G1 #G2 #L2 #K2 #T #U #H #L1 #HL12 elim(fquq_inv_gen … H) -H +[ #H elim (lleq_fqu_trans … H … HL12) -L2 /3 width=3 by fqu_fquq, ex2_intro/ +| * #HG #HL #HT destruct /2 width=3 by ex2_intro/ +] +qed-. + +lemma lleq_fqup_trans: ∀G1,G2,L2,K2,T,U. ⦃G1, L2, T⦄ ⊃+ ⦃G2, K2, U⦄ → + ∀L1. L1 ⋕[T, 0] L2 → + ∃∃K1. ⦃G1, L1, T⦄ ⊃+ ⦃G2, K1, U⦄ & K1 ⋕[U, 0] K2. +#G1 #G2 #L2 #K2 #T #U #H @(fqup_ind … H) -G2 -K2 -U +[ #G2 #K2 #U #HTU #L1 #HL12 elim (lleq_fqu_trans … HTU … HL12) -L2 + /3 width=3 by fqu_fqup, ex2_intro/ +| #G #G2 #K #K2 #U #U2 #_ #HU2 #IHTU #L1 #HL12 elim (IHTU … HL12) -L2 + #K1 #HTU #HK1 elim (lleq_fqu_trans … HU2 … HK1) -K + /3 width=5 by fqup_strap1, ex2_intro/ +] +qed-. + +lemma lleq_fqus_trans: ∀G1,G2,L2,K2,T,U. ⦃G1, L2, T⦄ ⊃* ⦃G2, K2, U⦄ → + ∀L1. L1 ⋕[T, 0] L2 → + ∃∃K1. ⦃G1, L1, T⦄ ⊃* ⦃G2, K1, U⦄ & K1 ⋕[U, 0] K2. +#G1 #G2 #L2 #K2 #T #U #H #L1 #HL12 elim(fqus_inv_gen … H) -H +[ #H elim (lleq_fqup_trans … H … HL12) -L2 /3 width=3 by fqup_fqus, ex2_intro/ +| * #HG #HL #HT destruct /2 width=3 by ex2_intro/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lleq_alt/lleq_ldrop.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lleq_alt/lleq_ldrop.etc new file mode 100644 index 000000000..9cb597c6f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lleq_alt/lleq_ldrop.etc @@ -0,0 +1,123 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/cpys_lift.ma". +include "basic_2/substitution/lleq.ma". + +(* LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **********************************) + +(* Advanced properties ******************************************************) + +lemma lleq_skip: ∀L1,L2,d,i. yinj i < d → |L1| = |L2| → L1 ⋕[#i, d] L2. +#L1 #L2 #d #i #Hid #HL12 @conj // -HL12 +#U @conj #H elim (cpys_inv_lref1 … H) -H // * +#I #Z #Y #X #H elim (ylt_yle_false … Hid … H) +qed. + +lemma lleq_lref: ∀I1,I2,L1,L2,K1,K2,V,d,i. d ≤ yinj i → + ⇩[i] L1 ≡ K1.ⓑ{I1}V → ⇩[i] L2 ≡ K2.ⓑ{I2}V → + K1 ⋕[V, 0] K2 → L1 ⋕[#i, d] L2. +#I1 #I2 #L1 #L2 #K1 #K2 #V #d #i #Hdi #HLK1 #HLK2 * #HK12 #IH @conj [ -IH | -HK12 ] +[ lapply (ldrop_fwd_length … HLK1) -HLK1 #H1 + lapply (ldrop_fwd_length … HLK2) -HLK2 #H2 + >H1 >H2 -H1 -H2 normalize // +| #U @conj #H elim (cpys_inv_lref1 … H) -H // * + >yminus_Y_inj #I #K #X #W #_ #_ #H #HVW #HWU + [ letin HLK ≝ HLK1 | letin HLK ≝ HLK2 ] + lapply (ldrop_mono … H … HLK) -H #H destruct elim (IH W) + /3 width=7 by cpys_subst_Y2/ +] +qed. + +lemma lleq_free: ∀L1,L2,d,i. |L1| ≤ i → |L2| ≤ i → |L1| = |L2| → L1 ⋕[#i, d] L2. +#L1 #L2 #d #i #HL1 #HL2 #HL12 @conj // -HL12 +#U @conj #H elim (cpys_inv_lref1 … H) -H // * +#I #Z #Y #X #_ #_ #H lapply (ldrop_fwd_length_lt2 … H) -H +#H elim (lt_refl_false i) /2 width=3 by lt_to_le_to_lt/ +qed. + +(* Properties on relocation *************************************************) + +lemma lleq_lift_le: ∀K1,K2,T,dt. K1 ⋕[T, dt] K2 → + ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → + ∀U. ⇧[d, e] T ≡ U → dt ≤ d → L1 ⋕[U, dt] L2. +#K1 #K2 #T #dt * #HK12 #IHT #L1 #L2 #d #e #HLK1 #HLK2 #U #HTU #Hdtd +lapply (ldrop_fwd_length … HLK1) lapply (ldrop_fwd_length … HLK2) +#H2 #H1 @conj // -HK12 -H1 -H2 #U0 @conj #HU0 +[ letin HLKA ≝ HLK1 letin HLKB ≝ HLK2 | letin HLKA ≝ HLK2 letin HLKB ≝ HLK1 ] +elim (cpys_inv_lift1_be … HU0 … HLKA … HTU) // -HU0 >yminus_Y_inj #T0 #HT0 #HTU0 +elim (IHT T0) [ #H #_ | #_ #H ] -IHT /3 width=12 by cpys_lift_be/ +qed-. + +lemma lleq_lift_ge: ∀K1,K2,T,dt. K1 ⋕[T, dt] K2 → + ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → + ∀U. ⇧[d, e] T ≡ U → d ≤ dt → L1 ⋕[U, dt+e] L2. +#K1 #K2 #T #dt * #HK12 #IHT #L1 #L2 #d #e #HLK1 #HLK2 #U #HTU #Hddt +lapply (ldrop_fwd_length … HLK1) lapply (ldrop_fwd_length … HLK2) +#H2 #H1 @conj // -HK12 -H1 -H2 #U0 @conj #HU0 +[ letin HLKA ≝ HLK1 letin HLKB ≝ HLK2 | letin HLKA ≝ HLK2 letin HLKB ≝ HLK1 ] +elim (cpys_inv_lift1_ge … HU0 … HLKA … HTU) /2 width=1 by monotonic_yle_plus_dx/ -HU0 >yplus_minus_inj #T0 #HT0 #HTU0 +elim (IHT T0) [ #H #_ | #_ #H ] -IHT /3 width=10 by cpys_lift_ge/ +qed-. + +(* Inversion lemmas on relocation *******************************************) + +lemma lleq_inv_lift_le: ∀L1,L2,U,dt. L1 ⋕[U, dt] L2 → + ∀K1,K2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → + ∀T. ⇧[d, e] T ≡ U → dt ≤ d → K1 ⋕[T, dt] K2. +#L1 #L2 #U #dt * #HL12 #IH #K1 #K2 #d #e #HLK1 #HLK2 #T #HTU #Hdtd +lapply (ldrop_fwd_length_minus2 … HLK1) lapply (ldrop_fwd_length_minus2 … HLK2) +#H2 #H1 @conj // -HL12 -H1 -H2 +#T0 elim (lift_total T0 d e) +#U0 #HTU0 elim (IH U0) -IH +#H12 #H21 @conj #HT0 +[ letin HLKA ≝ HLK1 letin HLKB ≝ HLK2 letin H0 ≝ H12 | letin HLKA ≝ HLK2 letin HLKB ≝ HLK1 letin H0 ≝ H21 ] +lapply (cpys_lift_be … HT0 … HLKA … HTU … HTU0) // -HT0 +>yplus_Y1 #HU0 elim (cpys_inv_lift1_be … (H0 HU0) … HLKB … HTU) // -L1 -L2 -U -Hdtd +#X #HT0 #HX lapply (lift_inj … HX … HTU0) -U0 // +qed-. + +lemma lleq_inv_lift_ge: ∀L1,L2,U,dt. L1 ⋕[U, dt] L2 → + ∀K1,K2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → + ∀T. ⇧[d, e] T ≡ U → yinj d + e ≤ dt → K1 ⋕[T, dt-e] K2. +#L1 #L2 #U #dt * #HL12 #IH #K1 #K2 #d #e #HLK1 #HLK2 #T #HTU #Hdedt +lapply (ldrop_fwd_length_minus2 … HLK1) lapply (ldrop_fwd_length_minus2 … HLK2) +#H2 #H1 @conj // -HL12 -H1 -H2 +elim (yle_inv_plus_inj2 … Hdedt) #Hddt #Hedt +#T0 elim (lift_total T0 d e) +#U0 #HTU0 elim (IH U0) -IH +#H12 #H21 @conj #HT0 +[ letin HLKA ≝ HLK1 letin HLKB ≝ HLK2 letin H0 ≝ H12 | letin HLKA ≝ HLK2 letin HLKB ≝ HLK1 letin H0 ≝ H21 ] +lapply (cpys_lift_ge … HT0 … HLKA … HTU … HTU0) // -HT0 -Hddt +>ymax_pre_sn // #HU0 elim (cpys_inv_lift1_ge … (H0 HU0) … HLKB … HTU) // -L1 -L2 -U -Hdedt -Hedt +#X #HT0 #HX lapply (lift_inj … HX … HTU0) -U0 // +qed-. + +lemma lleq_inv_lift_be: ∀L1,L2,U,dt. L1 ⋕[U, dt] L2 → + ∀K1,K2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → + ∀T. ⇧[d, e] T ≡ U → d ≤ dt → dt ≤ yinj d + e → K1 ⋕[T, d] K2. +#L1 #L2 #U #dt * #HL12 #IH #K1 #K2 #d #e #HLK1 #HLK2 #T #HTU #Hddt #Hdtde +lapply (ldrop_fwd_length_minus2 … HLK1) lapply (ldrop_fwd_length_minus2 … HLK2) +#H2 #H1 @conj // -HL12 -H1 -H2 +#T0 elim (lift_total T0 d e) +#U0 #HTU0 elim (IH U0) -IH +#H12 #H21 @conj #HT0 +[ letin HLKA ≝ HLK1 letin HLKB ≝ HLK2 letin H0 ≝ H12 | letin HLKA ≝ HLK2 letin HLKB ≝ HLK1 letin H0 ≝ H21 ] +lapply (cpys_lift_ge … HT0 … HLKA … HTU … HTU0) // -HT0 +#HU0 lapply (cpys_weak … HU0 dt (∞) ? ?) // -HU0 +#HU0 lapply (H0 HU0) +#HU0 lapply (cpys_weak … HU0 d (∞) ? ?) // -HU0 +#HU0 elim (cpys_inv_lift1_ge_up … HU0 … HLKB … HTU) // -L1 -L2 -U -Hddt -Hdtde +#X #HT0 #HX lapply (lift_inj … HX … HTU0) -U0 // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lleq_alt/lleq_lleq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lleq_alt/lleq_lleq.etc new file mode 100644 index 000000000..2a8873d9b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lleq_alt/lleq_lleq.etc @@ -0,0 +1,175 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/cpys_cpys.ma". +include "basic_2/substitution/lleq_ldrop.ma". + +(* Advanced forward lemmas **************************************************) + +lemma lleq_fwd_lref: ∀L1,L2. ∀d:ynat. ∀i:nat. L1 ⋕[#i, d] L2 → + ∨∨ |L1| ≤ i ∧ |L2| ≤ i + | yinj i < d + | ∃∃I1,I2,K1,K2,V. ⇩[i] L1 ≡ K1.ⓑ{I1}V & + ⇩[i] L2 ≡ K2.ⓑ{I2}V & + K1 ⋕[V, yinj 0] K2 & d ≤ yinj i. +#L1 #L2 #d #i * #HL12 #IH elim (lt_or_ge i (|L1|)) /3 width=3 by or3_intro0, conj/ +elim (ylt_split i d) /2 width=1 by or3_intro1/ #Hdi #Hi +elim (ldrop_O1_lt … Hi) #I1 #K1 #V1 #HLK1 +elim (ldrop_O1_lt L2 i) // -Hi #I2 #K2 #V2 #HLK2 +lapply (ldrop_fwd_length_minus2 … HLK2) #H +lapply (ldrop_fwd_length_minus2 … HLK1) >HL12 yminus_Y_inj ] /3 width=7 by cpys_subst_Y2, yle_inj/ +qed-. + +lemma lleq_fwd_lref_dx: ∀L1,L2,d,i. L1 ⋕[#i, d] L2 → + ∀I2,K2,V. ⇩[i] L2 ≡ K2.ⓑ{I2}V → + i < d ∨ + ∃∃I1,K1. ⇩[i] L1 ≡ K1.ⓑ{I1}V & K1 ⋕[V, 0] K2 & d ≤ i. +#L1 #L2 #d #i #H #I2 #K2 #V #HLK2 elim (lleq_fwd_lref … H) -H [ * || * ] +[ #_ #H elim (lt_refl_false i) + lapply (ldrop_fwd_length_lt2 … HLK2) -HLK2 + /2 width=3 by lt_to_le_to_lt/ (**) (* full auto too slow *) +| /2 width=1 by or_introl/ +| #I1 #I2 #K11 #K22 #V0 #HLK11 #HLK22 #HV0 #Hdi lapply (ldrop_mono … HLK22 … HLK2) -L2 + #H destruct /3 width=5 by ex3_2_intro, or_intror/ +] +qed-. + +lemma lleq_fwd_lref_sn: ∀L1,L2,d,i. L1 ⋕[#i, d] L2 → + ∀I1,K1,V. ⇩[i] L1 ≡ K1.ⓑ{I1}V → + i < d ∨ + ∃∃I2,K2. ⇩[i] L2 ≡ K2.ⓑ{I2}V & K1 ⋕[V, 0] K2 & d ≤ i. +#L1 #L2 #d #i #HL12 #I1 #K1 #V #HLK1 elim (lleq_fwd_lref_dx L2 … d … HLK1) -HLK1 +[2: * ] /4 width=6 by lleq_sym, ex3_2_intro, or_introl, or_intror/ +qed-. + +(* Advanced inversion lemmas ************************************************) + +lemma lleq_inv_lref_ge_dx: ∀L1,L2,d,i. L1 ⋕[#i, d] L2 → d ≤ i → + ∀I2,K2,V. ⇩[i] L2 ≡ K2.ⓑ{I2}V → + ∃∃I1,K1. ⇩[i] L1 ≡ K1.ⓑ{I1}V & K1 ⋕[V, 0] K2. +#L1 #L2 #d #i #H #Hdi #I2 #K2 #V #HLK2 elim (lleq_fwd_lref_dx … H … HLK2) -L2 +[ #H elim (ylt_yle_false … H Hdi) +| * /2 width=4 by ex2_2_intro/ +] +qed-. + +lemma lleq_inv_lref_ge_sn: ∀L1,L2,d,i. L1 ⋕[#i, d] L2 → d ≤ i → + ∀I1,K1,V. ⇩[i] L1 ≡ K1.ⓑ{I1}V → + ∃∃I2,K2. ⇩[i] L2 ≡ K2.ⓑ{I2}V & K1 ⋕[V, 0] K2. +#L1 #L2 #d #i #HL12 #Hdi #I1 #K1 #V #HLK1 elim (lleq_inv_lref_ge_dx L2 … Hdi … HLK1) -Hdi -HLK1 +/3 width=4 by lleq_sym, ex2_2_intro/ +qed-. + +lemma lleq_inv_lref_ge_gen: ∀L1,L2,d,i. L1 ⋕[#i, d] L2 → d ≤ i → + ∀I1,I2,K1,K2,V1,V2. + ⇩[i] L1 ≡ K1.ⓑ{I1}V1 → ⇩[i] L2 ≡ K2.ⓑ{I2}V2 → + V1 = V2 ∧ K1 ⋕[V2, 0] K2. +#L1 #L2 #d #i #HL12 #Hdi #I1 #I2 #K1 #K2 #V1 #V2 #HLK1 #HLK2 +elim (lleq_inv_lref_ge_sn … HL12 … HLK1) // -L1 -d +#J #Y #HY lapply (ldrop_mono … HY … HLK2) -L2 -i #H destruct /2 width=1 by conj/ +qed-. + +lemma lleq_inv_lref_ge: ∀L1,L2,d,i. L1 ⋕[#i, d] L2 → d ≤ i → + ∀I,K1,K2,V. ⇩[i] L1 ≡ K1.ⓑ{I}V → ⇩[i] L2 ≡ K2.ⓑ{I}V → + K1 ⋕[V, 0] K2. +#L1 #L2 #d #i #HL12 #Hdi #I #K1 #K2 #V #HLK1 #HLK2 +elim (lleq_inv_lref_ge_gen … HL12 … HLK1 HLK2) // +qed-. + +(* Advanced properties ******************************************************) + +lemma lleq_dec: ∀T,L1,L2,d. Decidable (L1 ⋕[T, d] L2). +#T #L1 @(f2_ind … rfw … L1 T) -L1 -T +#n #IH #L1 * * +[ #k #Hn #L2 elim (eq_nat_dec (|L1|) (|L2|)) /3 width=1 by or_introl, lleq_sort/ +| #i #Hn #L2 elim (eq_nat_dec (|L1|) (|L2|)) + [ #HL12 #d elim (ylt_split i d) /3 width=1 by lleq_skip, or_introl/ + #Hdi elim (lt_or_ge i (|L1|)) #HiL1 + elim (lt_or_ge i (|L2|)) #HiL2 /3 width=1 by or_introl, lleq_free/ + elim (ldrop_O1_lt … HiL2) #I2 #K2 #V2 #HLK2 + elim (ldrop_O1_lt … HiL1) #I1 #K1 #V1 #HLK1 + elim (eq_term_dec V2 V1) + [ #H3 elim (IH K1 V1 … K2 0) destruct + /3 width=8 by lleq_lref, ldrop_fwd_rfw, or_introl/ + ] + -IH #H3 @or_intror + #H elim (lleq_fwd_lref … H) -H [1,3,4,6: * ] + [1,3: /3 width=4 by lt_to_le_to_lt, lt_refl_false/ + |5,6: /2 width=4 by ylt_yle_false/ + ] + #Z1 #Z2 #Y1 #Y2 #X #HLY1 #HLY2 #HX #_ + lapply (ldrop_mono … HLY1 … HLK1) -HLY1 -HLK1 + lapply (ldrop_mono … HLY2 … HLK2) -HLY2 -HLK2 + #H2 #H1 destruct /2 width=1 by/ + ] +| #p #Hn #L2 elim (eq_nat_dec (|L1|) (|L2|)) /3 width=1 by or_introl, lleq_gref/ +| #a #I #V #T #Hn #L2 #d destruct + elim (IH L1 V … L2 d) /2 width=1 by/ + elim (IH (L1.ⓑ{I}V) T … (L2.ⓑ{I}V) (d+1)) -IH /3 width=1 by or_introl, lleq_bind/ + #H1 #H2 @or_intror + #H elim (lleq_inv_bind … H) -H /2 width=1 by/ +| #I #V #T #Hn #L2 #d destruct + elim (IH L1 V … L2 d) /2 width=1 by/ + elim (IH L1 T … L2 d) -IH /3 width=1 by or_introl, lleq_flat/ + #H1 #H2 @or_intror + #H elim (lleq_inv_flat … H) -H /2 width=1 by/ +] +-n /4 width=3 by lleq_fwd_length, or_intror/ +qed-. + +(* Main properties **********************************************************) + +theorem lleq_trans: ∀d,T. Transitive … (lleq d T). +#d #T #L1 #L * #HL1 #IH1 #L2 * #HL2 #IH2 /3 width=3 by conj, iff_trans/ +qed-. + +theorem lleq_canc_sn: ∀L,L1,L2,T,d. L ⋕[d, T] L1→ L ⋕[d, T] L2 → L1 ⋕[d, T] L2. +/3 width=3 by lleq_trans, lleq_sym/ qed-. + +theorem lleq_canc_dx: ∀L1,L2,L,T,d. L1 ⋕[d, T] L → L2 ⋕[d, T] L → L1 ⋕[d, T] L2. +/3 width=3 by lleq_trans, lleq_sym/ qed-. + +(* Inversion lemmas on negated lazy quivalence for local environments *******) + +lemma nlleq_inv_bind: ∀a,I,L1,L2,V,T,d. (L1 ⋕[ⓑ{a,I}V.T, d] L2 → ⊥) → + (L1 ⋕[V, d] L2 → ⊥) ∨ (L1.ⓑ{I}V ⋕[T, ⫯d] L2.ⓑ{I}V → ⊥). +#a #I #L1 #L2 #V #T #d #H elim (lleq_dec V L1 L2 d) +/4 width=1 by lleq_bind, or_intror, or_introl/ +qed-. + +lemma nlleq_inv_flat: ∀I,L1,L2,V,T,d. (L1 ⋕[ⓕ{I}V.T, d] L2 → ⊥) → + (L1 ⋕[V, d] L2 → ⊥) ∨ (L1 ⋕[T, d] L2 → ⊥). +#I #L1 #L2 #V #T #d #H elim (lleq_dec V L1 L2 d) +/4 width=1 by lleq_flat, or_intror, or_introl/ +qed-. + +(* Note: lleq_nlleq_trans: ∀d,T,L1,L. L1⋕[T, d] L → + ∀L2. (L ⋕[T, d] L2 → ⊥) → (L1 ⋕[T, d] L2 → ⊥). +/3 width=3 by lleq_canc_sn/ qed-. +works with /4 width=8/ so lleq_canc_sn is more convenient +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llneq/lazynegatedeq_4.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llneq/lazynegatedeq_4.etc new file mode 100644 index 000000000..6b0cb85e5 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llneq/lazynegatedeq_4.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( L1 ⧣ break [ term 46 T , break term 46 d ] break term 46 L2 )" + non associative with precedence 45 + for @{ 'LazyNegatedEq $T $d $L1 $L2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llneq/lazynegatedeqalt_4.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llneq/lazynegatedeqalt_4.etc new file mode 100644 index 000000000..b150f63ff --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llneq/lazynegatedeqalt_4.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( L1 ⧣ ⧣ break [ term 46 T , break term 46 d ] break term 46 L2 )" + non associative with precedence 45 + for @{ 'LazyNegatedEqAlt $T $d $L1 $L2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llneq/llneq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llneq/llneq.etc new file mode 100644 index 000000000..d41a4e83c --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llneq/llneq.etc @@ -0,0 +1,25 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/lazynegatedeq_4.ma". +include "basic_2/substitution/lleq.ma". + +(* NEGATED LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **************************) + +definition llneq: relation4 ynat term lenv lenv ≝ + λd,T,L1,L2. |L1| = |L2| ∧ (L1 ⋕[T, d] L2 → ⊥). + +interpretation + "negated lazy equivalence (local environment)" + 'LazyNegatedEq T d L1 L2 = (llneq d T L1 L2). diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llneq/llneq_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llneq/llneq_alt.etc new file mode 100644 index 000000000..00eb2c34e --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llneq/llneq_alt.etc @@ -0,0 +1,68 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/lazynegatedeqalt_4.ma". +include "basic_2/substitution/lleq_lleq.ma". +include "basic_2/substitution/llneq.ma". + +(* NEGATED LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **************************) + +(* alternative definition of llneq *) +inductive llneqa: relation4 ynat term lenv lenv ≝ +| llneqa_neq: ∀I1,I2,L1,L2,K1,K2,V1,V2,d,i. d ≤ yinj i → + ⇩[i]L1 ≡ K1.ⓑ{I1}V1 → ⇩[i]L2 ≡ K2.ⓑ{I2}V2 → + |K1| = |K2| → (V1 = V2 → ⊥) → llneqa d (#i) L1 L2 +| llneqa_eq : ∀I1,I2,L1,L2,K1,K2,V,d,i. d ≤ yinj i → + ⇩[i]L1 ≡ K1.ⓑ{I1}V → ⇩[i]L2 ≡ K2.ⓑ{I2}V → + llneqa 0 (V) K1 K2 → llneqa d (#i) L1 L2 +| llneqa_bind_sn: ∀a,I,L1,L2,V,T,d. + llneqa d V L1 L2 → llneqa d (ⓑ{a,I}V.T) L1 L2 +| llneqa_bind_dx: ∀a,I,L1,L2,V,T,d. + llneqa (⫯d) T (L1.ⓑ{I}V) (L2.ⓑ{I}V) → llneqa d (ⓑ{a,I}V.T) L1 L2 +| llneqa_flat_sn: ∀I,L1,L2,V,T,d. + llneqa d V L1 L2 → llneqa d (ⓕ{I}V.T) L1 L2 +| llneqa_flat_dx: ∀I,L1,L2,V,T,d. + llneqa d T L1 L2 → llneqa d (ⓕ{I}V.T) L1 L2 +. + +interpretation + "negated lazy equivalence (local environment) alternative" + 'LazyNegatedEqAlt T d L1 L2 = (llneqa d T L1 L2). + +(* Main properties **********************************************************) + +theorem llneq_llneqa: ∀T,L1,L2,d. L1 ⧣[T, d] L2 → L1 ⧣⧣[T, d] L2. +#T #L1 @(f2_ind … rfw … L1 T) -L1 -T +#n #IH #L1 * * +[ #k #Hn #L2 #d * #HL12 #H elim H /2 width=1 by lleq_sort/ +| #i #Hn #L2 #d * #HL12 #H elim (ylt_split i d) #Hdi + [ elim H /2 width=1 by lleq_skip/ ] + elim (lt_or_ge i (|L1|)) #HiL1 + [2: elim H /3 width=3 by lleq_free, le_repl_sn_aux/ ] + elim (ldrop_O1_lt … HiL1) #I1 #K1 #V1 #HLK1 + elim (ldrop_O1_lt L2 i) /2 width=1 by/ #I2 #K2 #V2 #HLK2 + lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) normalize + elim (eq_term_dec V1 V2) #HnV12 destruct + [2: #H @(llneqa_neq … HLK1 … HLK2) /2 width=1 by/ ] (**) (* explicit constructor *) + elim (lleq_dec V2 K1 K2 0) #HnV2 [ elim H /2 width=8 by lleq_lref/ ] + #H @(llneqa_eq … HLK1 … HLK2) /4 width=2 by ldrop_fwd_rfw, conj/ (**) (* explicit constructor *) +| #p #Hn #L2 #d * #HL12 #H elim H /2 width=1 by lleq_gref/ +| #a #I #V #T #Hn #L2 #d * #HL12 #H destruct elim (nlleq_inv_bind … H) -H + [ /5 width=1 by llneqa_bind_sn, conj/ + | #H @llneqa_bind_dx @IH // @conj normalize /2 width=1 by/ + ] +| #I #V #T #Hn #L2 #d * #HL12 #H destruct elim (nlleq_inv_flat … H) -H + /5 width=1 by llneqa_flat_dx, llneqa_flat_sn, conj/ +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llneq/llneq_ext.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llneq/llneq_ext.etc new file mode 100644 index 000000000..235d869c2 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llneq/llneq_ext.etc @@ -0,0 +1,33 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/llneq_alt.ma". + +(* NEGATED LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **************************) + +(* Advanced inversion lemmas ************************************************) + +lemma llneq_inv_atom1: ∀L1,L2,T,d. L1 ⧣⧣[T, d] L2 → |L1| ≤ d → ⊥. +#L1 #L2 #T #d #H elim H -L1 -L2 -T -d /2 width=1 by/ +[ #I1 #I2 #L1 #L2 #K1 #K2 #V1 #V2 #d #i #Hdi #HLK1 #_ #_ #_ + >(ldrop_fwd_length … HLK1) -HLK1 normalize + #H lapply (yle_trans … H … Hdi) -d + /3 width=4 by yle_inv_inj, le_plus_xySz_x_false/ +| #I1 #I2 #L1 #L2 #K1 #K2 #V #d #i #Hdi #HLK1 #_ #_ #_ + >(ldrop_fwd_length … HLK1) -HLK1 normalize + #H lapply (yle_trans … H … Hdi) -d + /3 width=4 by yle_inv_inj, le_plus_xySz_x_false/ +| #a #I #L1 (cprs_inv_sort1 … H1) -T #H2 +lapply (cprs_inv_sort1 … H2) -L #H destruct // +qed-. + +lemma cpcs_inv_abst1: ∀a,G,L,W1,T1,T. ⦃G, L⦄ ⊢ ⓛ{a}W1.T1 ⬌* T → + ∃∃W2,T2. ⦃G, L⦄ ⊢ T ➡* ⓛ{a}W2.T2 & ⦃G, L⦄ ⊢ ⓛ{a}W1.T1 ➡* ⓛ{a}W2.T2. +#a #G #L #W1 #T1 #T #H +elim (cpcs_inv_cprs … H) -H #X #H1 #H2 +elim (cprs_inv_abst1 … H1) -H1 #W2 #T2 #HW12 #HT12 #H destruct +/3 width=6 by cprs_bind, ex2_2_intro/ +qed-. + +lemma cpcs_inv_abst2: ∀a,G,L,W1,T1,T. ⦃G, L⦄ ⊢ T ⬌* ⓛ{a}W1.T1 → + ∃∃W2,T2. ⦃G, L⦄ ⊢ T ➡* ⓛ{a}W2.T2 & ⦃G, L⦄ ⊢ ⓛ{a}W1.T1 ➡* ⓛ{a}W2.T2. +/3 width=1 by cpcs_inv_abst1, cpcs_sym/ qed-. + +(* Basic_1: was: pc3_gen_sort_abst *) +lemma cpcs_inv_sort_abst: ∀a,G,L,W,T,k. ⦃G, L⦄ ⊢ ⋆k ⬌* ⓛ{a}W.T → ⊥. +#a #G #L #W #T #k #H +elim (cpcs_inv_cprs … H) -H #X #H1 +>(cprs_inv_sort1 … H1) -X #H2 +elim (cprs_inv_abst1 … H2) -H2 #W0 #T0 #_ #_ #H destruct +qed-. + +(* Basic_1: was: pc3_gen_lift *) +lemma cpcs_inv_lift: ∀G,L,K,s,d,e. ⇩[s, d, e] L ≡ K → + ∀T1,U1. ⇧[d, e] T1 ≡ U1 → ∀T2,U2. ⇧[d, e] T2 ≡ U2 → + ⦃G, L⦄ ⊢ U1 ⬌* U2 → ⦃G, K⦄ ⊢ T1 ⬌* T2. +#G #L #K #s #d #e #HLK #T1 #U1 #HTU1 #T2 #U2 #HTU2 #HU12 +elim (cpcs_inv_cprs … HU12) -HU12 #U #HU1 #HU2 +elim (cprs_inv_lift1 … HU1 … HLK … HTU1) -U1 #T #HTU #HT1 +elim (cprs_inv_lift1 … HU2 … HLK … HTU2) -L -U2 #X #HXU +>(lift_inj … HXU … HTU) -X -U -d -e /2 width=3 by cprs_div/ +qed-. + +(* Advanced properties ******************************************************) + +lemma llpr_cpcs_trans: ∀G,L1,L2,T1,T2. ⦃G, L1⦄ ⊢ ➡[T1, 0] L2 → ⦃G, L1⦄ ⊢ ➡[T2, 0] L2 → + ⦃G, L2⦄ ⊢ T1 ⬌* T2 → ⦃G, L1⦄ ⊢ T1 ⬌* T2. +#G #L1 #L2 #T1 #T2 #HT1 #HT2 #H elim (cpcs_inv_cprs … H) -H +/4 width=5 by cprs_div, cprs_llpr_trans/ +qed-. + +lemma llprs_cpcs_trans: ∀G,L1,L2,T1,T2. ⦃G, L1⦄ ⊢ ➡*[T1, 0] L2 → ⦃G, L1⦄ ⊢ ➡*[T2, 0] L2 → + ⦃G, L2⦄ ⊢ T1 ⬌* T2 → ⦃G, L1⦄ ⊢ T1 ⬌* T2. +#G #L1 #L2 #T1 #T2 #HT1 #HT2 #H elim (cpcs_inv_cprs … H) -H +/4 width=5 by cprs_div, llprs_cprs_trans/ +qed-. + +lemma cpr_cprs_conf_cpcs: ∀G,L,T,T1,T2. ⦃G, L⦄ ⊢ T ➡* T1 → ⦃G, L⦄ ⊢ T ➡ T2 → ⦃G, L⦄ ⊢ T1 ⬌* T2. +#G #L #T #T1 #T2 #HT1 #HT2 elim (cprs_strip … HT1 … HT2) -HT1 -HT2 +/2 width=3 by cpr_cprs_div/ +qed-. + +lemma cprs_cpr_conf_cpcs: ∀G,L,T,T1,T2. ⦃G, L⦄ ⊢ T ➡* T1 → ⦃G, L⦄ ⊢ T ➡ T2 → ⦃G, L⦄ ⊢ T2 ⬌* T1. +#G #L #T #T1 #T2 #HT1 #HT2 elim (cprs_strip … HT1 … HT2) -HT1 -HT2 +/2 width=3 by cprs_cpr_div/ +qed-. + +lemma cprs_conf_cpcs: ∀G,L,T,T1,T2. ⦃G, L⦄ ⊢ T ➡* T1 → ⦃G, L⦄ ⊢ T ➡* T2 → ⦃G, L⦄ ⊢ T1 ⬌* T2. +#G #L #T #T1 #T2 #HT1 #HT2 elim (cprs_conf … HT1 … HT2) -HT1 -HT2 +/2 width=3 by cprs_div/ +qed-. + +(* Basic_1: was: pc3_wcpr0_t *) +(* Basic_1: note: pc3_wcpr0_t should be renamed *) +lemma llpr_cprs_conf: ∀G,L1,L2,T1. ⦃G, L1⦄ ⊢ ➡[T1, 0] L2 → + ∀T2. ⦃G, L1⦄ ⊢ T1 ➡* T2 → ⦃G, L2⦄ ⊢ T1 ⬌* T2. +#G #L1 #L2 #T1 #HL12 #T2 #HT12 elim (cprs_llpr_conf_dx … HT12 … HL12) -L1 +/2 width=3 by cprs_div/ +qed-. + +(* Basic_1: was only: pc3_pr0_pr2_t *) +(* Basic_1: note: pc3_pr0_pr2_t should be renamed *) +lemma llpr_cpr_conf: ∀G,L1,L2,T1. ⦃G, L1⦄ ⊢ ➡[T1, 0] L2 → + ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ⦃G, L2⦄ ⊢ T1 ⬌* T2. +/3 width=5 by llpr_cprs_conf, cpr_cprs/ qed-. + +(* Basic_1: was only: pc3_thin_dx *) +lemma cpcs_flat: ∀G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬌* V2 → ∀T1,T2. ⦃G, L⦄ ⊢ T1 ⬌* T2 → + ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ⬌* ⓕ{I}V2.T2. +#G #L #V1 #V2 #HV12 #T1 #T2 #HT12 +elim (cpcs_inv_cprs … HV12) -HV12 +elim (cpcs_inv_cprs … HT12) -HT12 +/3 width=5 by cprs_flat, cprs_div/ +qed. + +lemma cpcs_flat_dx_cpr_rev: ∀G,L,V1,V2. ⦃G, L⦄ ⊢ V2 ➡ V1 → ∀T1,T2. ⦃G, L⦄ ⊢ T1 ⬌* T2 → + ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ⬌* ⓕ{I}V2.T2. +/3 width=1 by cpr_cpcs_sn, cpcs_flat/ qed. + +lemma cpcs_bind_dx: ∀a,I,G,L,V,T1,T2. ⦃G, L.ⓑ{I}V⦄ ⊢ T1 ⬌* T2 → + ⦃G, L⦄ ⊢ ⓑ{a,I}V.T1 ⬌* ⓑ{a,I}V.T2. +#a #I #G #L #V #T1 #T2 #HT12 elim (cpcs_inv_cprs … HT12) -HT12 +/3 width=5 by cprs_div, cprs_bind/ +qed. + +lemma cpcs_bind_sn: ∀a,I,G,L,V1,V2,T. ⦃G, L⦄ ⊢ V1 ⬌* V2 → ⦃G, L⦄ ⊢ ⓑ{a,I}V1. T ⬌* ⓑ{a,I}V2. T. +#a #I #G #L #V1 #V2 #T #HV12 elim (cpcs_inv_cprs … HV12) -HV12 +/3 width=5 by cprs_div, cprs_bind/ +qed. + +lemma lsubr_cpcs_trans: ∀G,L1,T1,T2. ⦃G, L1⦄ ⊢ T1 ⬌* T2 → + ∀L2. L2 ⊑ L1 → ⦃G, L2⦄ ⊢ T1 ⬌* T2. +#G #L1 #T1 #T2 #HT12 elim (cpcs_inv_cprs … HT12) -HT12 +/3 width=5 by cprs_div, lsubr_cprs_trans/ +qed-. + +(* Basic_1: was: pc3_lift *) +lemma cpcs_lift: ∀G,L,K,s,d,e. ⇩[s, d, e] L ≡ K → + ∀T1,U1. ⇧[d, e] T1 ≡ U1 → ∀T2,U2. ⇧[d, e] T2 ≡ U2 → + ⦃G, K⦄ ⊢ T1 ⬌* T2 → ⦃G, L⦄ ⊢ U1 ⬌* U2. +#G #L #K #s #d #e #HLK #T1 #U1 #HTU1 #T2 #U2 #HTU2 #HT12 +elim (cpcs_inv_cprs … HT12) -HT12 #T #HT1 #HT2 +elim (lift_total T d e) /3 width=12 by cprs_div, cprs_lift/ +qed. + +lemma cpcs_strip: ∀G,L,T1,T. ⦃G, L⦄ ⊢ T ⬌* T1 → ∀T2. ⦃G, L⦄ ⊢ T ⬌ T2 → + ∃∃T0. ⦃G, L⦄ ⊢ T1 ⬌ T0 & ⦃G, L⦄ ⊢ T2 ⬌* T0. +#G #L #T1 #T @TC_strip1 /2 width=3 by cpc_conf/ qed-. + +(* More inversion lemmas ****************************************************) + +axiom cpcs_inv_abst_sn: ∀a1,a2,G,L,W1,W2,T1,T2. ⦃G, L⦄ ⊢ ⓛ{a1}W1.T1 ⬌* ⓛ{a2}W2.T2 → + ∧∧ ⦃G, L⦄ ⊢ W1 ⬌* W2 & ⦃G, L.ⓛW1⦄ ⊢ T1 ⬌* T2 & a1 = a2. +(* +#a1 #a2 #G #L #W1 #W2 #T1 #T2 #H +elim (cpcs_inv_cprs … H) -H #T #H1 #H2 +elim (cprs_inv_abst1 … H1) -H1 #W0 #T0 #HW10 #HT10 #H destruct +elim (cprs_inv_abst1 … H2) -H2 #W #T #HW2 #HT2 #H destruct +lapply (llprs_cprs_conf … (L.ⓛW) … HT2) /2 width=1 by llprs_pair/ -HT2 #HT2 +lapply (llprs_cpcs_trans … (L.ⓛW1) … HT2) /2 width=1 by llprs_pair/ -HT2 #HT2 +/4 width=3 by and3_intro, cprs_div, cpcs_cprs_div, cpcs_sym/ +qed-. +*) +lemma cpcs_inv_abst_dx: ∀a1,a2,G,L,W1,W2,T1,T2. ⦃G, L⦄ ⊢ ⓛ{a1}W1.T1 ⬌* ⓛ{a2}W2.T2 → + ∧∧ ⦃G, L⦄ ⊢ W1 ⬌* W2 & ⦃G, L.ⓛW2⦄ ⊢ T1 ⬌* T2 & a1 = a2. +#a1 #a2 #G #L #W1 #W2 #T1 #T2 #HT12 lapply (cpcs_sym … HT12) -HT12 +#HT12 elim (cpcs_inv_abst_sn … HT12) -HT12 /3 width=1 by cpcs_sym, and3_intro/ +qed-. + +(* Main properties **********************************************************) + +(* Basic_1: was pc3_t *) +theorem cpcs_trans: ∀G,L,T1,T. ⦃G, L⦄ ⊢ T1 ⬌* T → ∀T2. ⦃G, L⦄ ⊢ T ⬌* T2 → ⦃G, L⦄ ⊢ T1 ⬌* T2. +#G #L #T1 #T #HT1 #T2 @(trans_TC … HT1) qed-. + +theorem cpcs_canc_sn: ∀G,L,T,T1,T2. ⦃G, L⦄ ⊢ T ⬌* T1 → ⦃G, L⦄ ⊢ T ⬌* T2 → ⦃G, L⦄ ⊢ T1 ⬌* T2. +/3 width=3 by cpcs_trans, cpcs_sym/ qed-. + +theorem cpcs_canc_dx: ∀G,L,T,T1,T2. ⦃G, L⦄ ⊢ T1 ⬌* T → ⦃G, L⦄ ⊢ T2 ⬌* T → ⦃G, L⦄ ⊢ T1 ⬌* T2. +/3 width=3 by cpcs_trans, cpcs_sym/ qed-. + +lemma cpcs_bind1: ∀a,I,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬌* V2 → + ∀T1,T2. ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ⬌* T2 → + ⦃G, L⦄ ⊢ ⓑ{a,I}V1. T1 ⬌* ⓑ{a,I}V2. T2. +/3 width=3 by cpcs_trans, cpcs_bind_sn, cpcs_bind_dx/ qed. + +lemma cpcs_bind2: ∀a,I,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬌* V2 → + ∀T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ⬌* T2 → + ⦃G, L⦄ ⊢ ⓑ{a,I}V1. T1 ⬌* ⓑ{a,I}V2. T2. +/3 width=3 by cpcs_trans, cpcs_bind_sn, cpcs_bind_dx/ qed. + +(* Basic_1: was: pc3_wcpr0 *) +lemma llpr_cpcs_conf: ∀G,L1,L2,T1,T2. ⦃G, L1⦄ ⊢ ➡[T1, 0] L2 → ⦃G, L1⦄ ⊢ ➡[T2, 0] L2 → + ⦃G, L1⦄ ⊢ T1 ⬌* T2 → ⦃G, L2⦄ ⊢ T1 ⬌* T2. +#G #L1 #L2 #T1 #T2 #HT1 #HT2 #H elim (cpcs_inv_cprs … H) -H +/3 width=5 by cpcs_canc_dx, llpr_cprs_conf/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/cprs_cprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/cprs_cprs.etc new file mode 100644 index 000000000..a85488cdf --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/cprs_cprs.etc @@ -0,0 +1,166 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reduction/llpr_llpr.ma". +include "basic_2/computation/cprs_lift.ma". + +(* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************) + +(* Main properties **********************************************************) + +(* Basic_1: was: pr3_t *) +(* Basic_1: includes: pr1_t *) +theorem cprs_trans: ∀G,L. Transitive … (cprs G L). +normalize /2 width=3 by trans_TC/ qed-. + +(* Basic_1: was: pr3_confluence *) +(* Basic_1: includes: pr1_confluence *) +theorem cprs_conf: ∀G,L. confluent2 … (cprs G L) (cprs G L). +normalize /3 width=3 by cpr_conf, TC_confluent2/ qed-. + +theorem cprs_bind: ∀a,I,G,L,V1,V2,T1,T2. ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ➡* T2 → ⦃G, L⦄ ⊢ V1 ➡* V2 → + ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡* ⓑ{a,I}V2.T2. +#a #I #G #L #V1 #V2 #T1 #T2 #HT12 #H @(cprs_ind … H) -V2 +/3 width=5 by cprs_trans, cprs_bind_dx/ +qed. + +(* Basic_1: was: pr3_flat *) +theorem cprs_flat: ∀I,G,L,V1,V2,T1,T2. ⦃G, L⦄ ⊢ T1 ➡* T2 → ⦃G, L⦄ ⊢ V1 ➡* V2 → + ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ➡* ⓕ{I}V2.T2. +#I #G #L #V1 #V2 #T1 #T2 #HT12 #H @(cprs_ind … H) -V2 +/3 width=3 by cprs_flat_dx, cprs_strap1, cpr_pair_sn/ +qed. + +theorem cprs_beta_rc: ∀a,G,L,V1,V2,W1,W2,T1,T2. + ⦃G, L⦄ ⊢ V1 ➡ V2 → ⦃G, L.ⓛW1⦄ ⊢ T1 ➡* T2 → ⦃G, L⦄ ⊢ W1 ➡* W2 → + ⦃G, L⦄ ⊢ ⓐV1.ⓛ{a}W1.T1 ➡* ⓓ{a}ⓝW2.V2.T2. +#a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HV12 #HT12 #H @(cprs_ind … H) -W2 /2 width=1 by cprs_beta_dx/ +#W #W2 #_ #HW2 #IHW1 (**) (* fulla uto too slow 14s *) +@(cprs_trans … IHW1) -IHW1 /3 width=1 by cprs_flat_dx, cprs_bind/ +qed. + +theorem cprs_beta: ∀a,G,L,V1,V2,W1,W2,T1,T2. + ⦃G, L.ⓛW1⦄ ⊢ T1 ➡* T2 → ⦃G, L⦄ ⊢ W1 ➡* W2 → ⦃G, L⦄ ⊢ V1 ➡* V2 → + ⦃G, L⦄ ⊢ ⓐV1.ⓛ{a}W1.T1 ➡* ⓓ{a}ⓝW2.V2.T2. +#a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HT12 #HW12 #H @(cprs_ind … H) -V2 /2 width=1 by cprs_beta_rc/ +#V #V2 #_ #HV2 #IHV1 +@(cprs_trans … IHV1) -IHV1 /3 width=1 by cprs_flat_sn, cprs_bind/ +qed. + +theorem cprs_theta_rc: ∀a,G,L,V1,V,V2,W1,W2,T1,T2. + ⦃G, L⦄ ⊢ V1 ➡ V → ⇧[0, 1] V ≡ V2 → ⦃G, L.ⓓW1⦄ ⊢ T1 ➡* T2 → + ⦃G, L⦄ ⊢ W1 ➡* W2 → ⦃G, L⦄ ⊢ ⓐV1.ⓓ{a}W1.T1 ➡* ⓓ{a}W2.ⓐV2.T2. +#a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 #HT12 #H elim H -W2 +/3 width=5 by cprs_trans, cprs_theta_dx, cprs_bind_dx/ +qed. + +theorem cprs_theta: ∀a,G,L,V1,V,V2,W1,W2,T1,T2. + ⇧[0, 1] V ≡ V2 → ⦃G, L⦄ ⊢ W1 ➡* W2 → ⦃G, L.ⓓW1⦄ ⊢ T1 ➡* T2 → + ⦃G, L⦄ ⊢ V1 ➡* V → ⦃G, L⦄ ⊢ ⓐV1.ⓓ{a}W1.T1 ➡* ⓓ{a}W2.ⓐV2.T2. +#a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV2 #HW12 #HT12 #H @(TC_ind_dx … V1 H) -V1 +/3 width=3 by cprs_trans, cprs_theta_rc, cprs_flat_dx/ +qed. + +(* Advanced inversion lemmas ************************************************) + +(* Basic_1: was pr3_gen_appl *) +lemma cprs_inv_appl1: ∀G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓐV1.T1 ➡* U2 → + ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡* V2 & ⦃G, L⦄ ⊢ T1 ➡* T2 & + U2 = ⓐV2. T2 + | ∃∃a,W,T. ⦃G, L⦄ ⊢ T1 ➡* ⓛ{a}W.T & + ⦃G, L⦄ ⊢ ⓓ{a}ⓝW.V1.T ➡* U2 + | ∃∃a,V0,V2,V,T. ⦃G, L⦄ ⊢ V1 ➡* V0 & ⇧[0,1] V0 ≡ V2 & + ⦃G, L⦄ ⊢ T1 ➡* ⓓ{a}V.T & + ⦃G, L⦄ ⊢ ⓓ{a}V.ⓐV2.T ➡* U2. +#G #L #V1 #T1 #U2 #H @(cprs_ind … H) -U2 /3 width=5 by or3_intro0, ex3_2_intro/ +#U #U2 #_ #HU2 * * +[ #V0 #T0 #HV10 #HT10 #H destruct + elim (cpr_inv_appl1 … HU2) -HU2 * + [ #V2 #T2 #HV02 #HT02 #H destruct /4 width=5 by cprs_strap1, or3_intro0, ex3_2_intro/ + | #a #V2 #W #W2 #T #T2 #HV02 #HW2 #HT2 #H1 #H2 destruct + lapply (cprs_strap1 … HV10 … HV02) -V0 #HV12 + lapply (lsubr_cpr_trans … HT2 (L.ⓓⓝW.V1) ?) -HT2 + /5 width=5 by cprs_flat_dx, cpr_cprs, cprs_bind, lsubr_abst, ex2_3_intro, or3_intro1/ + | #a #V #V2 #W0 #W2 #T #T2 #HV0 #HV2 #HW02 #HT2 #H1 #H2 destruct + @or3_intro2 @(ex4_5_intro … HV2 HT10) /3 width=3 by cprs_flat_sn, cprs_strap1, cpr_cprs, cprs_bind/ (**) (* full auto is too slow 11s *) + ] +| /4 width=9 by cprs_strap1, or3_intro1, ex2_3_intro/ +| /4 width=11 by cprs_strap1, or3_intro2, ex4_5_intro/ +] +qed-. + +(* Properties concerning sn parallel reduction on local environments ********) + +(* Basic_1: was just: pr3_pr2_pr2_t *) +(* Basic_1: includes: pr3_pr0_pr2_t *) +lemma llpr_cpr_trans: ∀G. s_r_transitive … (cpr G) (llpr G 0). +#G #L2 #T1 #T2 #HT12 elim HT12 -G -L2 -T1 -T2 +[ /2 width=3 by/ +| #G #L2 #K2 #V0 #V2 #W2 #i #HLK2 #_ #HVW2 #IHV02 #L1 #HL12 + elim (llpr_inv_lref_ge_dx … HL12 … HLK2) -L2 + /5 width=7 by cprs_delta, cprs_strap2, llpr_cpr_conf/ +| #a #I #G #L2 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #HL12 + elim (llpr_inv_bind_O … HL12) -HL12 /4 width=1 by cprs_bind/ +| #I #G #L2 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #HL12 + elim (llpr_inv_flat … HL12) -HL12 /3 width=1 by cprs_flat/ +| #G #L2 #V2 #T1 #T #T2 #_ #HT2 #IHT1 #L1 #HL12 + elim (llpr_inv_bind_O … HL12) /3 width=3 by cprs_zeta/ +| #G #L2 #V2 #T1 #T2 #HT12 #IHT12 #L1 #HL12 + elim (llpr_inv_flat … HL12) /3 width=1 by cprs_tau/ +| #a #G #L2 #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #L1 #HL12 + elim (llpr_inv_flat … HL12) -HL12 #HV1 #HL12 + elim (llpr_inv_bind_O … HL12) /3 width=3 by cprs_beta/ +| #a #G #L2 #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV1 #IHW12 #IHT12 #L1 #HL12 + elim (llpr_inv_flat … HL12) -HL12 #HV1 #HL12 + elim (llpr_inv_bind_O … HL12) /3 width=3 by cprs_theta/ +] +qed-. + +lemma cpr_bind2: ∀G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡ V2 → ∀I,T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ➡ T2 → + ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡* ⓑ{a,I}V2.T2. +/4 width=9 by llpr_cpr_trans, cprs_bind_dx, llpr_bind_repl_O/ qed. + +(* Advanced properties ******************************************************) + +(* Basic_1: was only: pr3_pr2_pr3_t pr3_wcpr0_t *) +lemma cprs_llpr_trans: ∀G. s_rs_transitive … (cpr G) (llpr G 0). +/3 width=6 by llpr_cpr_trans, llpr_cpr_conf, s_r_trans_LTC1/ qed-. + +(* Basic_1: was: pr3_strip *) +(* Basic_1: includes: pr1_strip *) +lemma cprs_strip: ∀G,L. confluent2 … (cprs G L) (cpr G L). +normalize /4 width=3 by cpr_conf, TC_strip1/ qed-. + +lemma cprs_llpr_conf_dx: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡* T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡[T0, 0] L1 → + ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡* T & ⦃G, L1⦄ ⊢ T0 ➡* T. +#G #L0 #T0 #T1 #H @(cprs_ind_dx … T0 H) -T0 /2 width=3 by ex2_intro/ +#T0 #T #HT0 #_ #IHT1 #L1 #HL01 +elim (IHT1 … L1) /2 by llpr_cpr_conf/ -IHT1 #T2 #HT12 #HT2 +elim (llpr_cpr_conf_dx … HT0 … HL01) -L0 #T3 #HT03 #HT3 +elim (cprs_strip … HT2 … HT3) -T +/4 width=5 by cprs_strap2, cprs_strap1, ex2_intro/ +qed-. + +lemma cprs_llpr_conf_sn: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡* T1 → + ∀L1. ⦃G, L0⦄ ⊢ ➡[T0, 0] L1 → + ∃∃T. ⦃G, L0⦄ ⊢ T1 ➡* T & ⦃G, L1⦄ ⊢ T0 ➡* T. +#G #L0 #T0 #T1 #HT01 #L1 #HL01 +elim (cprs_llpr_conf_dx … HT01 … HL01) +/4 width=5 by cprs_llpr_trans, cprs_llpr_conf, ex2_intro/ +qed-. + +lemma cprs_bind2_dx: ∀G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡ V2 → + ∀I,T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ➡* T2 → + ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡* ⓑ{a,I}V2.T2. +/4 width=9 by cprs_llpr_trans, cprs_bind_dx, llpr_bind_repl_O/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/cprs_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/cprs_lift.etc new file mode 100644 index 000000000..27f0bb6e5 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/cprs_lift.etc @@ -0,0 +1,63 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reduction/llpr_ldrop.ma". +include "basic_2/computation/cprs.ma". + +(* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************) + +(* Advanced properties ******************************************************) + +(* Note: apparently this was missing in basic_1 *) +lemma cprs_delta: ∀G,L,K,V,V2,i. + ⇩[i] L ≡ K.ⓓV → ⦃G, K⦄ ⊢ V ➡* V2 → + ∀W2. ⇧[0, i + 1] V2 ≡ W2 → ⦃G, L⦄ ⊢ #i ➡* W2. +#G #L #K #V #V2 #i #HLK #H elim H -V2 [ /3 width=6 by cpr_cprs, cpr_delta/ ] +#V1 #V2 #_ #HV12 #IHV1 #W2 #HVW2 +lapply (ldrop_fwd_drop2 … HLK) -HLK #HLK +elim (lift_total V1 0 (i+1)) /4 width=12 by cpr_lift, cprs_strap1/ +qed. + +lemma cprs_llpr_conf: ∀G. s_r_confluent1 … (cprs G) (llpr G 0). +/3 width=5 by llpr_cpr_conf, s_r_conf1_LTC1/ qed-. + +(* Advanced inversion lemmas ************************************************) + +(* Basic_1: was: pr3_gen_lref *) +lemma cprs_inv_lref1: ∀G,L,T2,i. ⦃G, L⦄ ⊢ #i ➡* T2 → + T2 = #i ∨ + ∃∃K,V1,T1. ⇩[i] L ≡ K.ⓓV1 & ⦃G, K⦄ ⊢ V1 ➡* T1 & + ⇧[0, i + 1] T1 ≡ T2. +#G #L #T2 #i #H @(cprs_ind … H) -T2 /2 width=1 by or_introl/ +#T #T2 #_ #HT2 * +[ #H destruct + elim (cpr_inv_lref1 … HT2) -HT2 /2 width=1 by or_introl/ + * /4 width=6 by cpr_cprs, ex3_3_intro, or_intror/ +| * #K #V1 #T1 #HLK #HVT1 #HT1 + lapply (ldrop_fwd_drop2 … HLK) #H0LK + elim (cpr_inv_lift1 … HT2 … H0LK … HT1) -H0LK -T + /4 width=6 by cprs_strap1, ex3_3_intro, or_intror/ +] +qed-. + +(* Relocation properties ****************************************************) + +(* Basic_1: was: pr3_lift *) +lemma cprs_lift: ∀G. l_liftable (cprs G). +/3 width=10 by l_liftable_LTC, cpr_lift/ qed. + +(* Basic_1: was: pr3_gen_lift *) +lemma cprs_inv_lift1: ∀G. l_deliftable_sn (cprs G). +/3 width=6 by l_deliftable_sn_LTC, cpr_inv_lift1/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/lazypredsn_5.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/lazypredsn_5.etc new file mode 100644 index 000000000..01ce586f8 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/lazypredsn_5.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G , break term 46 L1 ⦄ ⊢ ➡ break [ term 46 T , break term 46 d ] break term 46 L2 )" + non associative with precedence 45 + for @{ 'LazyPRedSn $G $L1 $L2 $T $d }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/lazypredsnstar_5.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/lazypredsnstar_5.etc new file mode 100644 index 000000000..824933fba --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/lazypredsnstar_5.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G , break term 46 L1 ⦄ ⊢ ➡* break [ term 46 T , break term 46 d ] break term 46 L2 )" + non associative with precedence 45 + for @{ 'LazyPRedSnStar $G $L1 $L2 $T $d }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llpr.etc new file mode 100644 index 000000000..e4c1a01be --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llpr.etc @@ -0,0 +1,51 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/lazypredsn_5.ma". +include "basic_2/relocation/llpx_sn.ma". +include "basic_2/reduction/cpr.ma". + +(* LAZY SN PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ************************) + +definition llpr: genv → relation4 ynat term lenv lenv ≝ λG. llpx_sn (cpr G). + +interpretation "lazy parallel reduction (local environment, sn variant)" + 'LazyPRedSn G L1 L2 T d = (llpr G d T L1 L2). + +(* Basic inversion lemmas ***************************************************) + +lemma llpr_inv_flat: ∀I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡[ⓕ{I}V.T, d] L2 → + ⦃G, L1⦄ ⊢ ➡[V, d] L2 ∧ ⦃G, L1⦄ ⊢ ➡[T, d] L2. +/2 width=2 by llpx_sn_inv_flat/ qed-. + +(* Basic forward lemmas *****************************************************) + +lemma llpr_fwd_length: ∀G,L1,L2,T,d. ⦃G, L1⦄ ⊢ ➡[T, d] L2 → |L1| = |L2|. +/2 width=4 by llpx_sn_fwd_length/ qed-. + +(* Basic properties *********************************************************) + +lemma llpr_lref: ∀I,G,L1,L2,K1,K2,V1,V2,d,i. d ≤ yinj i → + ⇩[i] L1 ≡ K1.ⓑ{I}V1 → ⇩[i] L2 ≡ K2.ⓑ{I}V2 → + ⦃G, K1⦄ ⊢ ➡[V1, 0] K2 → ⦃G, K1⦄ ⊢ V1 ➡ V2 → ⦃G, L1⦄ ⊢ ➡[#i, d] L2. +/2 width=9 by llpx_sn_lref/ qed. + +(* Note: lemma 250 *) +lemma llpr_refl: ∀G,T,d. reflexive … (llpr G d T). +/2 width=1 by llpx_sn_refl/ qed. + +(* Basic_1: removed theorems 5: wcpr0_gen_sort wcpr0_gen_head + wcpr0_getl wcpr0_getl_back + pr0_subst1_back +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llpr_ldrop.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llpr_ldrop.etc new file mode 100644 index 000000000..74f7cc6b3 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llpr_ldrop.etc @@ -0,0 +1,97 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/fquq_alt.ma". +include "basic_2/static/ssta_llpx_sn.ma". +include "basic_2/reduction/cpr_lift.ma". +include "basic_2/reduction/cpr_llpx_sn.ma". +include "basic_2/reduction/llpr.ma". + +(* LAZY SN PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ************************) + +(* Advanced inversion lemmas ************************************************) + +lemma llpr_inv_lref_ge_dx: ∀G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡[#i, d] L2 → d ≤ i → + ∀I,K2,V2. ⇩[i] L2 ≡ K2.ⓑ{I}V2 → + ∃∃K1,V1. ⇩[i] L1 ≡ K1.ⓑ{I}V1 & + ⦃G, K1⦄ ⊢ ➡[V1, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡ V2. +/2 width=5 by llpx_sn_inv_lref_ge_dx/ qed-. + +lemma llpr_inv_lref_ge_sn: ∀G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡[#i, d] L2 → d ≤ i → + ∀I,K1,V1. ⇩[i] L1 ≡ K1.ⓑ{I}V1 → + ∃∃K2,V2. ⇩[i] L2 ≡ K2.ⓑ{I}V2 & + ⦃G, K1⦄ ⊢ ➡[V1, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡ V2. +/2 width=5 by llpx_sn_inv_lref_ge_sn/ qed-. + +lemma llpr_inv_lref_ge_bi: ∀G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡[#i, d] L2 → d ≤ i → + ∀I1,I2,K1,K2,V1,V2. + ⇩[i] L1 ≡ K1.ⓑ{I1}V1 → ⇩[i] L2 ≡ K2.ⓑ{I2}V2 → + ∧∧ I1 = I2 & ⦃G, K1⦄ ⊢ ➡[V1, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡ V2. +/2 width=8 by llpx_sn_inv_lref_ge_bi/ qed-. + +lemma llpr_inv_bind_O: ∀a,I,G,L1,L2,V,T. ⦃G, L1⦄ ⊢ ➡ [ⓑ{a,I}V.T, 0] L2 → + ⦃G, L1⦄ ⊢ ➡[V, 0] L2 ∧ ⦃G, L1.ⓑ{I}V⦄ ⊢ ➡[T, 0] L2.ⓑ{I}V. +/2 width=2 by llpx_sn_inv_bind_O/ qed-. + +lemma llpr_bind_repl_O: ∀I,G,L1,L2,V1,V2,T. ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡[T, 0] L2.ⓑ{I}V2 → + ∀J,W1,W2. ⦃G, L1⦄ ⊢ ➡[W1, 0] L2 → ⦃G, L1⦄ ⊢ W1 ➡ W2 → ⦃G, L1.ⓑ{J}W1⦄ ⊢ ➡[T, 0] L2.ⓑ{J}W2. +/2 width=4 by llpx_sn_bind_repl_O/ qed-. + +(* Advanced properties ******************************************************) + +lemma llpr_ssta_conf: ∀h,g,G. s_r_confluent1 … (ssta h g G) (llpr G 0). +/3 width=10 by ssta_llpx_sn_conf, cpr_lift/ qed-. + +lemma llpr_cpr_conf: ∀G. s_r_confluent1 … (cpr G) (llpr G 0). +/3 width=10 by cpr_llpx_sn_conf, cpr_inv_lift1, cpr_lift/ qed-. + +(* Properties on context-sensitive parallel reduction for terms *************) + +lemma fqu_cpr_trans_dx: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ → + ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 → + ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[T1, 0] L & ⦃G1, L⦄ ⊢ T1 ➡ U1 & ⦃G1, L, U1⦄ ⊃ ⦃G2, L2, U2⦄. +#G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 +/3 width=10 by llpr_lref, cpr_pair_sn, cpr_atom, cpr_bind, cpr_flat, fqu_lref_O, fqu_pair_sn, fqu_bind_dx, fqu_flat_dx, ldrop_pair, ex3_2_intro/ +#G #L #K #U #T #e #HLK #HUT #U2 #HU2 +elim (lift_total U2 0 (e+1)) #T2 #HUT2 +lapply (cpr_lift … HU2 … HLK … HUT … HUT2) -HU2 -HUT /3 width=9 by fqu_drop, ex3_2_intro/ +qed-. + +lemma fquq_cpr_trans_dx: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ → + ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 → + ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[T1, 0] L & ⦃G1, L⦄ ⊢ T1 ➡ U1 & ⦃G1, L, U1⦄ ⊃⸮ ⦃G2, L2, U2⦄. +#G1 #G2 #L1 #L2 #T1 #T2 #H #U2 #HTU2 elim (fquq_inv_gen … H) -H +[ #HT12 elim (fqu_cpr_trans_dx … HT12 … HTU2) /3 width=5 by fqu_fquq, ex3_2_intro/ +| * #H1 #H2 #H3 destruct /2 width=5 by ex3_2_intro/ +] +qed-. + +lemma fqu_cpr_trans_sn: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ → + ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 → + ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[T1, 0] L & ⦃G1, L1⦄ ⊢ T1 ➡ U1 & ⦃G1, L, U1⦄ ⊃ ⦃G2, L2, U2⦄. +#G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 +/3 width=10 by llpr_lref, cpr_pair_sn, cpr_bind, cpr_flat, fqu_lref_O, fqu_pair_sn, fqu_bind_dx, fqu_flat_dx, ldrop_pair, ex3_2_intro/ +#G #L #K #U #T #e #HLK #HUT #U2 #HU2 +elim (lift_total U2 0 (e+1)) #T2 #HUT2 +lapply (cpr_lift … HU2 … HLK … HUT … HUT2) -HU2 -HUT /3 width=9 by fqu_drop, ex3_2_intro/ +qed-. + +lemma fquq_cpr_trans_sn: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ → + ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 → + ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡[T1, 0] L & ⦃G1, L1⦄ ⊢ T1 ➡ U1 & ⦃G1, L, U1⦄ ⊃⸮ ⦃G2, L2, U2⦄. +#G1 #G2 #L1 #L2 #T1 #T2 #H #U2 #HTU2 elim (fquq_inv_gen … H) -H +[ #HT12 elim (fqu_cpr_trans_sn … HT12 … HTU2) /3 width=5 by fqu_fquq, ex3_2_intro/ +| * #H1 #H2 #H3 destruct /2 width=5 by ex3_2_intro/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llpr_llpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llpr_llpr.etc new file mode 100644 index 000000000..4e5b9e2be --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llpr_llpr.etc @@ -0,0 +1,375 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/llpx_sn_llpx_sn.ma". +include "basic_2/substitution/fqup.ma". +include "basic_2/reduction/llpr_ldrop.ma". + +(* SN PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS *****************************) + +(* Main properties on context-sensitive parallel reduction for terms ********) + +fact cpr_conf_llpr_atom_atom: + ∀I,G,L1,L2. ∃∃T. ⦃G, L1⦄ ⊢ ⓪{I} ➡ T & ⦃G, L2⦄ ⊢ ⓪{I} ➡ T. +/2 width=3 by cpr_atom, ex2_intro/ qed-. + +fact cpr_conf_llpr_atom_delta: + ∀G,L0,i. ( + ∀L,T. ⦃G, L0, #i⦄ ⊃+ ⦃G, L, T⦄ → + ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → + ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → + ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 + ) → + ∀K0,V0. ⇩[i] L0 ≡ K0.ⓓV0 → + ∀V2. ⦃G, K0⦄ ⊢ V0 ➡ V2 → ∀T2. ⇧[O, i + 1] V2 ≡ T2 → + ∀L1. ⦃G, L0⦄ ⊢ ➡[#i, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[#i, 0] L2 → + ∃∃T. ⦃G, L1⦄ ⊢ #i ➡ T & ⦃G, L2⦄ ⊢ T2 ➡ T. +#G #L0 #i #IH #K0 #V0 #HLK0 #V2 #HV02 #T2 #HVT2 #L1 #HL01 #L2 #HL02 +elim (llpr_inv_lref_ge_sn … HL01 … HLK0) -HL01 // #K1 #V1 #HLK1 #HK01 #HV01 +elim (llpr_inv_lref_ge_sn … HL02 … HLK0) -HL02 // #K2 #W2 #HLK2 #HK02 #_ +lapply (ldrop_fwd_drop2 … HLK2) -W2 #HLK2 +lapply (fqup_lref … G … HLK0) -HLK0 #HLK0 +elim (IH … HLK0 … HV01 … HV02 … HK01 … HK02) -L0 -K0 -V0 #V #HV1 #HV2 +elim (lift_total V 0 (i+1)) +/3 width=12 by cpr_lift, cpr_delta, ex2_intro/ +qed-. + +(* Basic_1: includes: pr0_delta_delta pr2_delta_delta *) +fact cpr_conf_llpr_delta_delta: + ∀G,L0,i. ( + ∀L,T. ⦃G, L0, #i⦄ ⊃+ ⦃G, L, T⦄ → + ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → + ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → + ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 + ) → + ∀K0,V0. ⇩[i] L0 ≡ K0.ⓓV0 → + ∀V1. ⦃G, K0⦄ ⊢ V0 ➡ V1 → ∀T1. ⇧[O, i + 1] V1 ≡ T1 → + ∀KX,VX. ⇩[i] L0 ≡ KX.ⓓVX → + ∀V2. ⦃G, KX⦄ ⊢ VX ➡ V2 → ∀T2. ⇧[O, i + 1] V2 ≡ T2 → + ∀L1. ⦃G, L0⦄ ⊢ ➡[#i, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[#i, 0] L2 → + ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡ T & ⦃G, L2⦄ ⊢ T2 ➡ T. +#G #L0 #i #IH #K0 #V0 #HLK0 #V1 #HV01 #T1 #HVT1 +#KX #VX #H #V2 #HV02 #T2 #HVT2 #L1 #HL01 #L2 #HL02 +lapply (ldrop_mono … H … HLK0) -H #H destruct +elim (llpr_inv_lref_ge_sn … HL01 … HLK0) -HL01 // #K1 #W1 #HLK1 #HK01 #_ +lapply (ldrop_fwd_drop2 … HLK1) -W1 #HLK1 +elim (llpr_inv_lref_ge_sn … HL02 … HLK0) -HL02 // #K2 #W2 #HLK2 #HK02 #_ +lapply (ldrop_fwd_drop2 … HLK2) -W2 #HLK2 +lapply (fqup_lref … G … HLK0) -HLK0 #HLK0 +elim (IH … HLK0 … HV01 … HV02 … HK01 … HK02) -L0 -K0 -V0 #V #HV1 #HV2 +elim (lift_total V 0 (i+1)) /3 width=12 by cpr_lift, ex2_intro/ +qed-. + +fact cpr_conf_llpr_bind_bind: + ∀a,I,G,L0,V0,T0. ( + ∀L,T. ⦃G, L0, ⓑ{a,I}V0.T0⦄ ⊃+ ⦃G, L, T⦄ → + ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → + ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → + ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 + ) → + ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀T1. ⦃G, L0.ⓑ{I}V0⦄ ⊢ T0 ➡ T1 → + ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀T2. ⦃G, L0.ⓑ{I}V0⦄ ⊢ T0 ➡ T2 → + ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓑ{a,I}V0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓑ{a,I}V0.T0, 0] L2 → + ∃∃T. ⦃G, L1⦄ ⊢ ⓑ{a,I}V1.T1 ➡ T & ⦃G, L2⦄ ⊢ ⓑ{a,I}V2.T2 ➡ T. +#a #I #G #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01 +#V2 #HV02 #T2 #HT02 #L1 #HL01 #L2 #HL02 +elim (llpr_inv_bind_O … HL01) -HL01 #H1V0 #H1T0 +elim (llpr_inv_bind_O … HL02) -HL02 #H2V0 #H2T0 +elim (IH … HV01 … HV02 … H1V0 … H2V0) // +elim (IH … HT01 … HT02 (L1.ⓑ{I}V1) … (L2.ⓑ{I}V2)) -IH +/3 width=5 by llpr_bind_repl_O, cpr_bind, ex2_intro/ +qed-. + +fact cpr_conf_llpr_bind_zeta: + ∀G,L0,V0,T0. ( + ∀L,T. ⦃G, L0, +ⓓV0.T0⦄ ⊃+ ⦃G, L, T⦄ → + ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → + ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → + ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 + ) → + ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀T1. ⦃G, L0.ⓓV0⦄ ⊢ T0 ➡ T1 → + ∀T2. ⦃G, L0.ⓓV0⦄ ⊢ T0 ➡ T2 → ∀X2. ⇧[O, 1] X2 ≡ T2 → + ∀L1. ⦃G, L0⦄ ⊢ ➡[+ⓓV0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[+ⓓV0.T0, 0] L2 → + ∃∃T. ⦃G, L1⦄ ⊢ +ⓓV1.T1 ➡ T & ⦃G, L2⦄ ⊢ X2 ➡ T. +#G #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01 +#T2 #HT02 #X2 #HXT2 #L1 #HL01 #L2 #HL02 +elim (llpr_inv_bind_O … HL01) -HL01 #H1V0 #H1T0 +elim (llpr_inv_bind_O … HL02) -HL02 #H2V0 #H2T0 +elim (IH … HT01 … HT02 (L1.ⓓV1) … (L2.ⓓV1)) -IH -HT01 -HT02 /2 width=4 by llpr_bind_repl_O/ -L0 -V0 -T0 #T #HT1 #HT2 +elim (cpr_inv_lift1 … HT2 L2 … HXT2) -T2 /3 width=3 by cpr_zeta, ldrop_drop, ex2_intro/ +qed-. + +fact cpr_conf_llpr_zeta_zeta: + ∀G,L0,V0,T0. ( + ∀L,T. ⦃G, L0, +ⓓV0.T0⦄ ⊃+ ⦃G, L, T⦄ → + ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → + ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → + ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 + ) → + ∀T1. ⦃G, L0.ⓓV0⦄ ⊢ T0 ➡ T1 → ∀X1. ⇧[O, 1] X1 ≡ T1 → + ∀T2. ⦃G, L0.ⓓV0⦄ ⊢ T0 ➡ T2 → ∀X2. ⇧[O, 1] X2 ≡ T2 → + ∀L1. ⦃G, L0⦄ ⊢ ➡[+ⓓV0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[+ⓓV0.T0, 0] L2 → + ∃∃T. ⦃G, L1⦄ ⊢ X1 ➡ T & ⦃G, L2⦄ ⊢ X2 ➡ T. +#G #L0 #V0 #T0 #IH #T1 #HT01 #X1 #HXT1 +#T2 #HT02 #X2 #HXT2 #L1 #HL01 #L2 #HL02 +elim (llpr_inv_bind_O … HL01) -HL01 #H1V0 #H1T0 +elim (llpr_inv_bind_O … HL02) -HL02 #H2V0 #H2T0 +elim (IH … HT01 … HT02 (L1.ⓓV0) … (L2.ⓓV0)) -IH -HT01 -HT02 /2 width=4 by llpr_bind_repl_O/ -L0 -T0 #T #HT1 #HT2 +elim (cpr_inv_lift1 … HT1 L1 … HXT1) -T1 /2 width=2 by ldrop_drop/ #T1 #HT1 #HXT1 +elim (cpr_inv_lift1 … HT2 L2 … HXT2) -T2 /2 width=2 by ldrop_drop/ #T2 #HT2 #HXT2 +lapply (lift_inj … HT2 … HT1) -T #H destruct /2 width=3 by ex2_intro/ +qed-. + +fact cpr_conf_llpr_flat_flat: + ∀I,G,L0,V0,T0. ( + ∀L,T. ⦃G, L0, ⓕ{I}V0.T0⦄ ⊃+ ⦃G, L, T⦄ → + ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → + ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → + ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 + ) → + ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → + ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀T2. ⦃G, L0⦄ ⊢ T0 ➡ T2 → + ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓕ{I}V0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓕ{I}V0.T0, 0] L2 → + ∃∃T. ⦃G, L1⦄ ⊢ ⓕ{I}V1.T1 ➡ T & ⦃G, L2⦄ ⊢ ⓕ{I}V2.T2 ➡ T. +#I #G #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01 +#V2 #HV02 #T2 #HT02 #L1 #HL01 #L2 #HL02 +elim (llpr_inv_flat … HL01) -HL01 #H1V0 #H1T0 +elim (llpr_inv_flat … HL02) -HL02 #H2V0 #H2T0 +elim (IH … HV01 … HV02 … H1V0 … H2V0) // +elim (IH … HT01 … HT02 … H1T0 … H2T0) /3 width=5 by cpr_flat, ex2_intro/ +qed-. + +fact cpr_conf_llpr_flat_tau: + ∀G,L0,V0,T0. ( + ∀L,T. ⦃G, L0, ⓝV0.T0⦄ ⊃+ ⦃G, L, T⦄ → + ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → + ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → + ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 + ) → + ∀V1,T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → ∀T2. ⦃G, L0⦄ ⊢ T0 ➡ T2 → + ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓝV0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓝV0.T0, 0] L2 → + ∃∃T. ⦃G, L1⦄ ⊢ ⓝV1.T1 ➡ T & ⦃G, L2⦄ ⊢ T2 ➡ T. +#G #L0 #V0 #T0 #IH #V1 #T1 #HT01 +#T2 #HT02 #L1 #HL01 #L2 #HL02 +elim (llpr_inv_flat … HL01) -HL01 #_ #H1T0 +elim (llpr_inv_flat … HL02) -HL02 #_ #H2T0 +elim (IH … HT01 … HT02 … H1T0 … H2T0) // -L0 -V0 -T0 /3 width=3 by cpr_tau, ex2_intro/ +qed-. + +fact cpr_conf_llpr_tau_tau: + ∀G,L0,V0,T0. ( + ∀L,T. ⦃G, L0, ⓝV0.T0⦄ ⊃+ ⦃G, L, T⦄ → + ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → + ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → + ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 + ) → + ∀T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → ∀T2. ⦃G, L0⦄ ⊢ T0 ➡ T2 → + ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓝV0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓝV0.T0, 0] L2 → + ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡ T & ⦃G, L2⦄ ⊢ T2 ➡ T. +#G #L0 #V0 #T0 #IH #T1 #HT01 +#T2 #HT02 #L1 #HL01 #L2 #HL02 +elim (llpr_inv_flat … HL01) -HL01 #_ #H1T0 +elim (llpr_inv_flat … HL02) -HL02 #_ #H2T0 +elim (IH … HT01 … HT02 … H1T0 … H2T0) // -L0 -V0 -T0 /2 width=3 by ex2_intro/ +qed-. + +fact cpr_conf_llpr_flat_beta: + ∀a,G,L0,V0,W0,T0. ( + ∀L,T. ⦃G, L0, ⓐV0.ⓛ{a}W0.T0⦄ ⊃+ ⦃G, L, T⦄ → + ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → + ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → + ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 + ) → + ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀T1. ⦃G, L0⦄ ⊢ ⓛ{a}W0.T0 ➡ T1 → + ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀W2. ⦃G, L0⦄ ⊢ W0 ➡ W2 → ∀T2. ⦃G, L0.ⓛW0⦄ ⊢ T0 ➡ T2 → + ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓛ{a}W0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓛ{a}W0.T0, 0] L2 → + ∃∃T. ⦃G, L1⦄ ⊢ ⓐV1.T1 ➡ T & ⦃G, L2⦄ ⊢ ⓓ{a}ⓝW2.V2.T2 ➡ T. +#a #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #X #H +#V2 #HV02 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02 +elim (cpr_inv_abst1 … H) -H #W1 #T1 #HW01 #HT01 #H destruct +elim (llpr_inv_flat … HL01) -HL01 #H1V0 #HL01 +elim (llpr_inv_bind_O … HL01) -HL01 #H1W0 #H1T0 +elim (llpr_inv_flat … HL02) -HL02 #H2V0 #HL02 +elim (llpr_inv_bind_O … HL02) -HL02 #H2W0 #H2T0 +elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2 +elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1 by/ #W #HW1 #HW2 +elim (IH … HT01 … HT02 (L1.ⓛW1) … (L2.ⓛW2)) /2 width=4 by llpr_bind_repl_O/ -L0 -V0 -W0 -T0 #T #HT1 #HT2 +lapply (lsubr_cpr_trans … HT2 (L2.ⓓⓝW2.V2) ?) -HT2 /2 width=1 by lsubr_abst/ (**) (* full auto not tried *) +/4 width=5 by cpr_bind, cpr_flat, cpr_beta, ex2_intro/ +qed-. + +(* Basic-1: includes: + pr0_cong_upsilon_refl pr0_cong_upsilon_zeta + pr0_cong_upsilon_cong pr0_cong_upsilon_delta +*) +fact cpr_conf_llpr_flat_theta: + ∀a,G,L0,V0,W0,T0. ( + ∀L,T. ⦃G, L0, ⓐV0.ⓓ{a}W0.T0⦄ ⊃+ ⦃G, L, T⦄ → + ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → + ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → + ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 + ) → + ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀T1. ⦃G, L0⦄ ⊢ ⓓ{a}W0.T0 ➡ T1 → + ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀U2. ⇧[O, 1] V2 ≡ U2 → + ∀W2. ⦃G, L0⦄ ⊢ W0 ➡ W2 → ∀T2. ⦃G, L0.ⓓW0⦄ ⊢ T0 ➡ T2 → + ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓓ{a}W0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓓ{a}W0.T0, 0] L2 → + ∃∃T. ⦃G, L1⦄ ⊢ ⓐV1.T1 ➡ T & ⦃G, L2⦄ ⊢ ⓓ{a}W2.ⓐU2.T2 ➡ T. +#a #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #X #H +#V2 #HV02 #U2 #HVU2 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02 +elim (llpr_inv_flat … HL01) -HL01 #H1V0 #HL01 +elim (llpr_inv_bind_O … HL01) -HL01 #H1W0 #H1T0 +elim (llpr_inv_flat … HL02) -HL02 #H2V0 #HL02 +elim (llpr_inv_bind_O … HL02) -HL02 #H2W0 #H2T0 +elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2 +elim (lift_total V 0 1) #U #HVU +lapply (cpr_lift … HV2 (L2.ⓓW2) … HVU2 … HVU) -HVU2 /2 width=2 by ldrop_drop/ #HU2 +elim (cpr_inv_abbr1 … H) -H * +[ #W1 #T1 #HW01 #HT01 #H destruct + elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1 by/ + elim (IH … HT01 … HT02 (L1.ⓓW1) … (L2.ⓓW2)) /2 width=4 by llpr_bind_repl_O/ -L0 -V0 -W0 -T0 + /4 width=7 by cpr_bind, cpr_flat, cpr_theta, ex2_intro/ +| #T1 #HT01 #HXT1 #H destruct + elim (IH … HT01 … HT02 (L1.ⓓW2) … (L2.ⓓW2)) /2 width=4 by llpr_bind_repl_O/ -L0 -V0 -W0 -T0 #T #HT1 #HT2 + elim (cpr_inv_lift1 … HT1 L1 … HXT1) -HXT1 + /4 width=9 by cpr_flat, cpr_zeta, ldrop_drop, lift_flat, ex2_intro/ +] +qed-. + +fact cpr_conf_llpr_beta_beta: + ∀a,G,L0,V0,W0,T0. ( + ∀L,T. ⦃G, L0, ⓐV0.ⓛ{a}W0.T0⦄ ⊃+ ⦃G, L, T⦄ → + ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → + ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → + ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 + ) → + ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀W1. ⦃G, L0⦄ ⊢ W0 ➡ W1 → ∀T1. ⦃G, L0.ⓛW0⦄ ⊢ T0 ➡ T1 → + ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀W2. ⦃G, L0⦄ ⊢ W0 ➡ W2 → ∀T2. ⦃G, L0.ⓛW0⦄ ⊢ T0 ➡ T2 → + ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓛ{a}W0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓛ{a}W0.T0, 0] L2 → + ∃∃T. ⦃G, L1⦄ ⊢ ⓓ{a}ⓝW1.V1.T1 ➡ T & ⦃G, L2⦄ ⊢ ⓓ{a}ⓝW2.V2.T2 ➡ T. +#a #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #W1 #HW01 #T1 #HT01 +#V2 #HV02 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02 +elim (llpr_inv_flat … HL01) -HL01 #H1V0 #HL01 +elim (llpr_inv_bind_O … HL01) -HL01 #H1W0 #H1T0 +elim (llpr_inv_flat … HL02) -HL02 #H2V0 #HL02 +elim (llpr_inv_bind_O … HL02) -HL02 #H2W0 #H2T0 +elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2 +elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1/ #W #HW1 #HW2 +elim (IH … HT01 … HT02 (L1.ⓛW1) … (L2.ⓛW2)) /2 width=4 by llpr_bind_repl_O/ -L0 -V0 -W0 -T0 #T #HT1 #HT2 +lapply (lsubr_cpr_trans … HT1 (L1.ⓓⓝW1.V1) ?) -HT1 /2 width=1 by lsubr_abst/ +lapply (lsubr_cpr_trans … HT2 (L2.ⓓⓝW2.V2) ?) -HT2 /2 width=1 by lsubr_abst/ +/4 width=5 by cpr_bind, cpr_flat, ex2_intro/ (**) (* full auto not tried *) +qed-. + +(* Basic_1: includes: pr0_upsilon_upsilon *) +fact cpr_conf_llpr_theta_theta: + ∀a,G,L0,V0,W0,T0. ( + ∀L,T. ⦃G, L0, ⓐV0.ⓓ{a}W0.T0⦄ ⊃+ ⦃G, L, T⦄ → + ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 → + ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 → + ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0 + ) → + ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀U1. ⇧[O, 1] V1 ≡ U1 → + ∀W1. ⦃G, L0⦄ ⊢ W0 ➡ W1 → ∀T1. ⦃G, L0.ⓓW0⦄ ⊢ T0 ➡ T1 → + ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀U2. ⇧[O, 1] V2 ≡ U2 → + ∀W2. ⦃G, L0⦄ ⊢ W0 ➡ W2 → ∀T2. ⦃G, L0.ⓓW0⦄ ⊢ T0 ➡ T2 → + ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓓ{a}W0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓓ{a}W0.T0, 0] L2 → + ∃∃T. ⦃G, L1⦄ ⊢ ⓓ{a}W1.ⓐU1.T1 ➡ T & ⦃G, L2⦄ ⊢ ⓓ{a}W2.ⓐU2.T2 ➡ T. +#a #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #U1 #HVU1 #W1 #HW01 #T1 #HT01 +#V2 #HV02 #U2 #HVU2 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02 +elim (llpr_inv_flat … HL01) -HL01 #H1V0 #HL01 +elim (llpr_inv_bind_O … HL01) -HL01 #H1W0 #H1T0 +elim (llpr_inv_flat … HL02) -HL02 #H2V0 #HL02 +elim (llpr_inv_bind_O … HL02) -HL02 #H2W0 #H2T0 +elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2 +elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1 by/ +elim (IH … HT01 … HT02 (L1.ⓓW1) … (L2.ⓓW2)) /2 width=4 by llpr_bind_repl_O/ -L0 -V0 -W0 -T0 +elim (lift_total V 0 1) #U #HVU +lapply (cpr_lift … HV1 (L1.ⓓW1) … HVU1 … HVU) -HVU1 /2 width=2 by ldrop_drop/ +lapply (cpr_lift … HV2 (L2.ⓓW2) … HVU2 … HVU) -HVU2 /2 width=2 by ldrop_drop/ +/4 width=7 by cpr_bind, cpr_flat, ex2_intro/ (**) (* full auto not tried *) +qed-. + +theorem cpr_conf_llpr: ∀G. llpx_sn_confluent2 (cpr G) (cpr G). +#G #L0 #T0 @(fqup_wf_ind_eq … G L0 T0) -G -L0 -T0 #G #L #T #IH #G0 #L0 * [| * ] +[ #I0 #HG #HL #HT #T1 #H1 #T2 #H2 #L1 #HL01 #L2 #HL02 destruct + elim (cpr_inv_atom1 … H1) -H1 + elim (cpr_inv_atom1 … H2) -H2 + [ #H2 #H1 destruct + /2 width=1 by cpr_conf_llpr_atom_atom/ + | * #K0 #V0 #V2 #i2 #HLK0 #HV02 #HVT2 #H2 #H1 destruct + /3 width=10 by cpr_conf_llpr_atom_delta/ + | #H2 * #K0 #V0 #V1 #i1 #HLK0 #HV01 #HVT1 #H1 destruct + /4 width=10 by ex2_commute, cpr_conf_llpr_atom_delta/ + | * #X #Y #V2 #z #H #HV02 #HVT2 #H2 + * #K0 #V0 #V1 #i #HLK0 #HV01 #HVT1 #H1 destruct + /3 width=17 by cpr_conf_llpr_delta_delta/ + ] +| #a #I #V0 #T0 #HG #HL #HT #X1 #H1 #X2 #H2 #L1 #HL01 #L2 #HL02 destruct + elim (cpr_inv_bind1 … H1) -H1 * + [ #V1 #T1 #HV01 #HT01 #H1 + | #T1 #HT01 #HXT1 #H11 #H12 + ] + elim (cpr_inv_bind1 … H2) -H2 * + [1,3: #V2 #T2 #HV02 #HT02 #H2 + |2,4: #T2 #HT02 #HXT2 #H21 #H22 + ] destruct + [ /3 width=10 by cpr_conf_llpr_bind_bind/ + | /4 width=11 by ex2_commute, cpr_conf_llpr_bind_zeta/ + | /3 width=11 by cpr_conf_llpr_bind_zeta/ + | /3 width=12 by cpr_conf_llpr_zeta_zeta/ + ] +| #I #V0 #T0 #HG #HL #HT #X1 #H1 #X2 #H2 #L1 #HL01 #L2 #HL02 destruct + elim (cpr_inv_flat1 … H1) -H1 * + [ #V1 #T1 #HV01 #HT01 #H1 + | #HX1 #H1 + | #a1 #V1 #Y1 #W1 #Z1 #T1 #HV01 #HYW1 #HZT1 #H11 #H12 #H13 + | #a1 #V1 #U1 #Y1 #W1 #Z1 #T1 #HV01 #HVU1 #HYW1 #HZT1 #H11 #H12 #H13 + ] + elim (cpr_inv_flat1 … H2) -H2 * + [1,5,9,13: #V2 #T2 #HV02 #HT02 #H2 + |2,6,10,14: #HX2 #H2 + |3,7,11,15: #a2 #V2 #Y2 #W2 #Z2 #T2 #HV02 #HYW2 #HZT2 #H21 #H22 #H23 + |4,8,12,16: #a2 #V2 #U2 #Y2 #W2 #Z2 #T2 #HV02 #HVU2 #HYW2 #HZT2 #H21 #H22 #H23 + ] destruct + [ /3 width=10 by cpr_conf_llpr_flat_flat/ + | /4 width=8 by ex2_commute, cpr_conf_llpr_flat_tau/ + | /4 width=12 by ex2_commute, cpr_conf_llpr_flat_beta/ + | /4 width=14 by ex2_commute, cpr_conf_llpr_flat_theta/ + | /3 width=8 by cpr_conf_llpr_flat_tau/ + | /3 width=8 by cpr_conf_llpr_tau_tau/ + | /3 width=12 by cpr_conf_llpr_flat_beta/ + | /3 width=13 by cpr_conf_llpr_beta_beta/ + | /3 width=14 by cpr_conf_llpr_flat_theta/ + | /3 width=17 by cpr_conf_llpr_theta_theta/ + ] +] +qed-. + +(* Basic_1: includes: pr0_confluence pr2_confluence *) +theorem cpr_conf: ∀G,L. confluent … (cpr G L). +/2 width=6 by cpr_conf_llpr/ qed-. + +(* Properties on context-sensitive parallel reduction for terms *************) + +lemma llpr_cpr_conf_dx: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡[T0, 0] L1 → + ∃∃T. ⦃G, L1⦄ ⊢ T0 ➡ T & ⦃G, L1⦄ ⊢ T1 ➡ T. +#G #L0 #T0 #T1 #HT01 #L1 #HL01 +elim (cpr_conf_llpr … HT01 T0 … HL01 … HL01) /2 width=3 by ex2_intro/ +qed-. + +lemma llpr_cpr_conf_sn: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡[T0, 0] L1 → + ∃∃T. ⦃G, L1⦄ ⊢ T0 ➡ T & ⦃G, L0⦄ ⊢ T1 ➡ T. +#G #L0 #T0 #T1 #HT01 #L1 #HL01 +elim (cpr_conf_llpr … HT01 T0 … L0 … HL01) /2 width=3 by ex2_intro/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llprs.etc new file mode 100644 index 000000000..d3c2a6f27 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llprs.etc @@ -0,0 +1,61 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/lazypredsnstar_5.ma". +include "basic_2/reduction/llpr.ma". + +(* LAZY SN PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS ***********************) + +definition llprs: genv → relation4 ynat term lenv lenv ≝ + λG,d. LTC … (llpr G d). + +interpretation "lazy parallel computation (local environment, sn variant)" + 'LazyPRedSnStar G L1 L2 T d = (llprs G d T L1 L2). + +(* Basic eliminators ********************************************************) + +lemma llprs_ind: ∀G,L1,T,d. ∀R:predicate lenv. R L1 → + (∀L,L2. ⦃G, L1⦄ ⊢ ➡*[T, d] L → ⦃G, L⦄ ⊢ ➡[T, d] L2 → R L → R L2) → + ∀L2. ⦃G, L1⦄ ⊢ ➡*[T, d] L2 → R L2. +#G #L1 #T #d #R #HL1 #IHL1 #L2 #HL12 +@(TC_star_ind … HL1 IHL1 … HL12) // +qed-. + +lemma llprs_ind_dx: ∀G,L2,T,d. ∀R:predicate lenv. R L2 → + (∀L1,L. ⦃G, L1⦄ ⊢ ➡[T, d] L → ⦃G, L⦄ ⊢ ➡*[T, d] L2 → R L → R L1) → + ∀L1. ⦃G, L1⦄ ⊢ ➡*[T, d] L2 → R L1. +#G #L2 #T #d #R #HL2 #IHL2 #L1 #HL12 +@(TC_star_ind_dx … HL2 IHL2 … HL12) // +qed-. + +(* Basic properties *********************************************************) + +lemma lpr_llprs: ∀G,L1,L2,T,d. ⦃G, L1⦄ ⊢ ➡[T, d] L2 → ⦃G, L1⦄ ⊢ ➡*[T, d] L2. +/2 width=1 by inj/ qed. + +lemma llprs_refl: ∀G,L,T,d. ⦃G, L⦄ ⊢ ➡*[T, d] L. +/2 width=1 by lpr_llprs/ qed. + +lemma llprs_strap1: ∀G,L1,L,L2,T,d. ⦃G, L1⦄ ⊢ ➡*[T, d] L → ⦃G, L⦄ ⊢ ➡[T, d] L2 → ⦃G, L1⦄ ⊢ ➡*[T, d] L2. +normalize /2 width=3 by step/ qed-. + +lemma llprs_strap2: ∀G,L1,L,L2,T,d. ⦃G, L1⦄ ⊢ ➡[T, d] L → ⦃G, L⦄ ⊢ ➡*[T, d] L2 → ⦃G, L1⦄ ⊢ ➡*[T, d] L2. +normalize /2 width=3 by TC_strap/ qed-. + +(* Basic forward lemmas *****************************************************) + +lemma llprs_fwd_length: ∀G,L1,L2,T,d. ⦃G, L1⦄ ⊢ ➡*[T, d] L2 → |L1| = |L2|. +#G #L1 #L2 #T #d #H @(llprs_ind … H) -L2 +/3 width=6 by llpr_fwd_length, trans_eq/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llprs_cprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llprs_cprs.etc new file mode 100644 index 000000000..b9bf0f963 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llprs_cprs.etc @@ -0,0 +1,122 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/llpx_sn_tc.ma". +include "basic_2/computation/cprs_cprs.ma". +include "basic_2/computation/llprs.ma". + +(* LAZY SN PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS ***********************) + +(* Advanced properties ******************************************************) + +lemma llprs_pair_dx: ∀G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡* V2 → + ∀I,T. ⦃G, L.ⓑ{I}V1⦄ ⊢ ➡*[T, 0] L.ⓑ{I}V2. +/2 width=1 by llpx_sn_TC_pair_dx/ qed. + +(* Properties on context-sensitive parallel computation for terms ***********) + +lemma llprs_cpr_trans: ∀G. s_r_transitive … (cpr G) (llprs G 0). +/3 width=5 by cprs_llpr_trans, s_r_trans_LTC2/ qed-. + +(* Basic_1: was just: pr3_pr3_pr3_t *) +lemma llprs_cprs_trans: ∀G. s_rs_transitive … (cpr G) (llprs G 0). +#G @s_r_to_s_rs_trans @s_r_trans_LTC2 +/3 width=5 by cprs_llpr_trans, s_rs_trans_TC1/ (**) (* full auto too slow *) +qed-. + +(* Note: this is an instance of a general theorem *) +lemma llprs_cprs_conf_dx: ∀G2,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡* U2 → + ∀L0. ⦃G2, L0⦄ ⊢ ➡*[T2, O] L2 → ⦃G2, L0⦄ ⊢ ➡*[U2, O] L2. +#G2 #L2 #T2 #U2 #HTU2 #L0 #H @(llprs_ind_dx … H) -L0 // +#L0 #L #HL0 #HL2 #IHL2 @(llprs_strap2 … IHL2) -IHL2 +lapply (llprs_cprs_trans … HTU2 … HL2) -L2 #HTU2 +/3 width=3 by cprs_llpr_trans, cprs_llpr_conf/ +qed-. + +(* Note: this is an instance of a general theorem *) +lemma llprs_cpr_conf_dx: ∀G2,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 → + ∀L0. ⦃G2, L0⦄ ⊢ ➡*[T2, O] L2 → ⦃G2, L0⦄ ⊢ ➡*[U2, O] L2. +#G2 #L2 #T2 #U2 #HTU2 #L0 #H @(llprs_ind_dx … H) -L0 // +#L0 #L #HL0 #HL2 #IHL2 @(llprs_strap2 … IHL2) -IHL2 +lapply (llprs_cpr_trans … HTU2 … HL2) -L2 #HTU2 +/3 width=3 by cprs_llpr_trans, cprs_llpr_conf/ +qed-. + +lemma llprs_cprs_conf_sn: ∀G,L0,L1,T0. ⦃G, L0⦄ ⊢ ➡*[T0, 0] L1 → + ∀T1. ⦃G, L0⦄ ⊢ T0 ➡* T1 → + ∃∃T. ⦃G, L0⦄ ⊢ T1 ➡* T & ⦃G, L1⦄ ⊢ T0 ➡* T. +#G #L0 #L1 #T0 #H @(llprs_ind_dx … H) -L0 /2 width=3 by ex2_intro/ +#L0 #L #HL0 #HL1 #IHL1 #T1 #HT01 elim (cprs_llpr_conf_sn … HT01 … HL0) +#T2 #HT12 #HT02 elim (IHL1 … HT02) -IHL1 -HT02 +lapply (cprs_trans … HT01 … HT12) #HT02 +lapply (cprs_llpr_conf … HT02 … HL0) -HT02 -HL0 +/4 width=5 by cprs_llpr_trans, cprs_trans, ex2_intro/ +qed-. + +lemma llprs_cpr_conf_sn: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → + ∀L1. ⦃G, L0⦄ ⊢ ➡*[T0, 0] L1 → + ∃∃T. ⦃G, L0⦄ ⊢ T1 ➡* T & ⦃G, L1⦄ ⊢ T0 ➡* T. +/3 width=3 by llprs_cprs_conf_sn, cpr_cprs/ qed-. + +lemma cprs_bind2: ∀G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡* V2 → + ∀I,T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ➡* T2 → + ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡* ⓑ{a,I}V2.T2. +/4 width=3 by llprs_cprs_trans, llprs_pair_dx, cprs_bind/ qed-. + +(* Inversion lemmas on context-sensitive parallel computation for terms *****) + +(* Basic_1: was: pr3_gen_abst *) +lemma cprs_inv_abst1: ∀a,G,L,W1,T1,U2. ⦃G, L⦄ ⊢ ⓛ{a}W1.T1 ➡* U2 → + ∃∃W2,T2. ⦃G, L⦄ ⊢ W1 ➡* W2 & ⦃G, L.ⓛW1⦄ ⊢ T1 ➡* T2 & + U2 = ⓛ{a}W2.T2. +#a #G #L #V1 #T1 #U2 #H @(cprs_ind … H) -U2 /2 width=5 by ex3_2_intro/ +#U0 #U2 #_ #HU02 * #V0 #T0 #HV10 #HT10 #H destruct +elim (cpr_inv_abst1 … HU02) -HU02 #V2 #T2 #HV02 #HT02 #H destruct +lapply (llprs_cpr_trans … HT02 (L.ⓛV1) ?) +/3 width=5 by llprs_pair_dx, cprs_trans, cprs_strap1, ex3_2_intro/ +qed-. + +lemma cprs_inv_abst: ∀a,G,L,W1,W2,T1,T2. ⦃G, L⦄ ⊢ ⓛ{a}W1.T1 ➡* ⓛ{a}W2.T2 → + ⦃G, L⦄ ⊢ W1 ➡* W2 ∧ ⦃G, L.ⓛW1⦄ ⊢ T1 ➡* T2. +#a #G #L #W1 #W2 #T1 #T2 #H +elim (cprs_inv_abst1 … H) -H #W #T #HW1 #HT1 #H destruct /2 width=1 by conj/ +qed-. + +(* Basic_1: was pr3_gen_abbr *) +lemma cprs_inv_abbr1: ∀a,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓓ{a}V1.T1 ➡* U2 → ( + ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡* V2 & ⦃G, L.ⓓV1⦄ ⊢ T1 ➡* T2 & + U2 = ⓓ{a}V2.T2 + ) ∨ + ∃∃T2. ⦃G, L.ⓓV1⦄ ⊢ T1 ➡* T2 & ⇧[0, 1] U2 ≡ T2 & a = true. +#a #G #L #V1 #T1 #U2 #H @(cprs_ind … H) -U2 /3 width=5 by ex3_2_intro, or_introl/ +#U0 #U2 #_ #HU02 * * +[ #V0 #T0 #HV10 #HT10 #H destruct + elim (cpr_inv_abbr1 … HU02) -HU02 * + [ #V2 #T2 #HV02 #HT02 #H destruct + lapply (llprs_cpr_trans … HT02 (L.ⓓV1) ?) + /4 width=5 by llprs_pair_dx, cprs_trans, cprs_strap1, ex3_2_intro, or_introl/ + | #T2 #HT02 #HUT2 + lapply (llprs_cpr_trans … HT02 (L.ⓓV1) ?) -HT02 + /4 width=3 by llprs_pair_dx, cprs_trans, ex3_intro, or_intror/ + ] +| #U1 #HTU1 #HU01 + elim (lift_total U2 0 1) #U #HU2 + lapply (cpr_lift … HU02 (L.ⓓV1) … HU01 … HU2) -U0 + /4 width=3 by cprs_strap1, ldrop_drop, ex3_intro, or_intror/ +] +qed-. + +(* Note: we loose lprs_cprs_conf_dx and derivatives: + lprs_cpr_conf_dx lprs_cprs_conf +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llprs_llprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llprs_llprs.etc new file mode 100644 index 000000000..4f97672f3 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llprs_llprs.etc @@ -0,0 +1,22 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/llprs.ma". + +(* LAZY SN PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS ***********************) + +(* Main properties **********************************************************) + +theorem llprs_trans: ∀G,T,d. Transitive … (llprs G d T). +normalize /2 width=3 by trans_TC/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llpx_sn_llpx_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llpx_sn_llpx_sn.etc new file mode 100644 index 000000000..0df9690ee --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llpx_sn_llpx_sn.etc @@ -0,0 +1,24 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/llpx_sn.ma". + +(* LAZY SN POINTWISE EXTENSION OF A CONTEXT-SENSITIVE REALTION FOR TERMS ****) + +definition llpx_sn_confluent2: relation (lenv→relation term) ≝ λR1,R2. + ∀L0,T0,T1. R1 L0 T0 T1 → ∀T2. R2 L0 T0 T2 → + ∀L1. llpx_sn R1 0 T0 L0 L1 → ∀L2. llpx_sn R2 0 T0 L0 L2 → + ∃∃T. R2 L1 T1 T & R1 L2 T2 T. + +(* Note: we miss llpx_sn_conf and derivatives: lpr_conf lprs_conf *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/cpxs_llpx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/cpxs_llpx.etc new file mode 100644 index 000000000..bec908ef7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/cpxs_llpx.etc @@ -0,0 +1,53 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reduction/llpx_ldrop.ma". +include "basic_2/computation/cpxs_cpxs.ma". + +(* CONTEXT-SENSITIVE EXTENDED PARALLEL COMPUTATION ON TERMS *****************) + +(* Properties on lazy sn reduction on local environments ********************) + +lemma cpxs_llpx_conf: ∀h,g,G. s_r_confluent1 … (cpxs h g G) (llpx h g G 0). +/3 width=5 by llpx_cpx_conf, s_r_conf1_LTC1/ qed-. + +lemma llpx_cpx_trans: ∀h,g,G. s_r_transitive … (cpx h g G) (llpx h g G 0). +#h #g #G #L2 #T1 #T2 #HT12 elim HT12 -G -L2 -T1 -T2 +[ /2 width=3 by/ +| /3 width=2 by cpx_cpxs, cpx_sort/ +| #I #G #L2 #K2 #V0 #V2 #W2 #i #HLK2 #_ #HVW2 #IHV02 #L1 #HL12 + elim (llpx_inv_lref_ge_dx … HL12 … HLK2) -L2 + /5 width=8 by cpxs_delta, cpxs_strap2, llpx_cpx_conf/ +| #a #I #G #L2 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #HL12 + elim (llpx_inv_bind_O … HL12) -HL12 /4 width=1 by cpxs_bind/ +| #I #G #L2 #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #HL12 + elim (llpx_inv_flat … HL12) -HL12 /3 width=1 by cpxs_flat/ +| #G #L2 #V2 #T1 #T #T2 #_ #HT2 #IHT1 #L1 #HL12 + elim (llpx_inv_bind_O … HL12) /3 width=3 by cpxs_zeta/ +| #G #L2 #V2 #T1 #T2 #HT12 #IHT12 #L1 #HL12 + elim (llpx_inv_flat … HL12) /3 width=1 by cpxs_tau/ +| #G #L2 #V1 #V2 #T2 #HV12 #IHV12 #L1 #HL12 + elim (llpx_inv_flat … HL12) /3 width=1 by cpxs_ti/ +| #a #G #L2 #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #L1 #HL12 + elim (llpx_inv_flat … HL12) -HL12 #HV1 #HL12 + elim (llpx_inv_bind_O … HL12) /3 width=3 by cpxs_beta/ +| #a #G #L2 #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV1 #IHW12 #IHT12 #L1 #HL12 + elim (llpx_inv_flat … HL12) -HL12 #HV1 #HL12 + elim (llpx_inv_bind_O … HL12) /3 width=3 by cpxs_theta/ +] +qed-. + +lemma llpx_cpxs_trans: ∀h,g,G. s_rs_transitive … (cpx h g G) (llpx h g G 0). +#h #g #G @s_r_trans_LTC1 /2 width=3 by llpx_cpx_trans, llpx_cpx_conf/ (**) (* full auto fails here but works in cprs_cprs *) +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/csx_llpx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/csx_llpx.etc new file mode 100644 index 000000000..c14492f21 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/csx_llpx.etc @@ -0,0 +1,26 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/cpxs_llpx.ma". +include "basic_2/computation/csx_alt.ma". + +(* CONTEXT-SENSITIVE EXTENDED STRONGLY NORMALIZING TERMS ********************) + +(* Properties on lazy sn extended reduction for local environments **********) + +lemma csx_llpx_conf: ∀h,g,G,L1,T. ⦃G, L1⦄ ⊢ ⬊*[h, g] T → + ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g, T, 0] L2 → ⦃G, L2⦄ ⊢ ⬊*[h, g] T. +#h #g #G #L1 #T #H @(csx_ind_alt … H) -T +/5 width=3 by csx_intro_cpxs, llpx_cpxs_trans, cpxs_llpx_conf/ (* 2 cpxs_llpx_trans *) +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/csx_llpxs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/csx_llpxs.etc new file mode 100644 index 000000000..aad3e8bf0 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/csx_llpxs.etc @@ -0,0 +1,25 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/csx_llpx.ma". +include "basic_2/computation/llpxs.ma". + +(* CONTEXT-SENSITIVE EXTENDED STRONGLY NORMALIZING TERMS ********************) + +(* Properties on lazy sn extended computation for local environments ********) + +lemma csx_llpxs_conf: ∀h,g,G,L1,T. ⦃G, L1⦄ ⊢ ⬊*[h, g] T → + ∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, 0] L2 → ⦃G, L2⦄ ⊢ ⬊*[h, g] T. +#h #g #G #L1 #T #HT #L2 #H @(llpxs_ind … H) -L2 /3 by llpxs_strap1, csx_llpx_conf/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/fpbs_lpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/fpbs_lpr.etc new file mode 100644 index 000000000..34b60ad1d --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/fpbs_lpr.etc @@ -0,0 +1,36 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reduction/cpx_lift.ma". +include "basic_2/reduction/llpx_lpr.ma". +include "basic_2/computation/fpbs.ma". + +(* "BIG TREE" PARALLEL COMPUTATION FOR CLOSURES *****************************) + +(* Properties on sn parallel reduction for local environments ***************) + +(* Note: this is used in the closure proof *) +(* Note: original proof: /4 width=5 by fpbs_strap1, lpr_fpb, cpr_fpb/ *) +(* Note: this should be moved *) +lemma cpr_lpr_fpbs: ∀h,g,G,L1,L2,T1,T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ⦃G, L1⦄ ⊢ ➡ L2 → + ⦃G, L1, T1⦄ ≥[h, g] ⦃G, L2, T2⦄. +/5 width=5 by fpbs_strap1, cpr_fpb, fpb_llpx, lpr_llpx/ qed. + +(* Note: this is used in the closure proof *) +(* Note: this should be moved *) +lemma cpr_lpr_ssta_fpbs: ∀h,g,G,L1,L2,T1,T2,U2,l2. + ⦃G, L1⦄ ⊢ T1 ➡ T2 → ⦃G, L1⦄ ⊢ ➡ L2 → + ⦃G, L2⦄ ⊢ T2 ▪[h, g] l2+1 → ⦃G, L2⦄ ⊢ T2 •[h, g] U2 → + ⦃G, L1, T1⦄ ≥[h, g] ⦃G, L2, U2⦄. +/4 width=5 by fpbs_strap1, cpr_lpr_fpbs, ssta_cpx, fpb_cpx/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/lazypredsn_7.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/lazypredsn_7.etc new file mode 100644 index 000000000..2350f5efc --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/lazypredsn_7.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G , break term 46 L1 ⦄ ⊢ ➡ break [ term 46 h , break term 46 g , break term 46 T , break term 46 d ] break term 46 L2 )" + non associative with precedence 45 + for @{ 'LazyPRedSn $G $L1 $L2 $h $g $T $d }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/lazypredsnstar_7.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/lazypredsnstar_7.etc new file mode 100644 index 000000000..f8209e2f8 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/lazypredsnstar_7.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G , break term 46 L1 ⦄ ⊢ ➡* break [ term 46 h , break term 46 g , break term 46 T , break term 46 d ] break term 46 L2 )" + non associative with precedence 45 + for @{ 'LazyPRedSnStar $G $L1 $L2 $h $g $T $d }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/lazysn_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/lazysn_6.etc new file mode 100644 index 000000000..0c52a6ea5 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/lazysn_6.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( G ⊢ ⋕ ⬊ * break [ term 46 h , break term 46 g , break term 46 T , break term 46 d ] break term 46 L )" + non associative with precedence 45 + for @{ 'LazySN $h $g $T $d $G $L }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/lazysnalt_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/lazysnalt_6.etc new file mode 100644 index 000000000..0976a3136 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/lazysnalt_6.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( G ⊢ ⋕ ⬊ ⬊ * break [ term 46 h , break term 46 g , break term 46 T , break term 46 d ] break term 46 L )" + non associative with precedence 45 + for @{ 'LazySNAlt $h $g $T $d $G $L }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpx.etc new file mode 100644 index 000000000..3276008b4 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpx.etc @@ -0,0 +1,69 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/lazypredsn_7.ma". +include "basic_2/relocation/llpx_sn.ma". +include "basic_2/reduction/cpx.ma". + +(* LAZY SN EXTENDED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ***************) + +definition llpx: ∀h. sd h → genv → relation4 ynat term lenv lenv ≝ + λh,g,G. llpx_sn (cpx h g G). + +interpretation "lazy extended parallel reduction (local environment, sn variant)" + 'LazyPRedSn G L1 L2 h g T d = (llpx h g G d T L1 L2). + +(* Basic inversion lemmas ***************************************************) + +lemma llpx_inv_flat: ∀h,g,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡[h, g, ⓕ{I}V.T, d] L2 → + ⦃G, L1⦄ ⊢ ➡[h, g, V, d] L2 ∧ ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2. +/2 width=2 by llpx_sn_inv_flat/ qed-. + +(* Basic forward lemmas *****************************************************) + +lemma llpx_fwd_length: ∀h,g,G,L1,L2,T,d. ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2 → |L1| = |L2|. +/2 width=4 by llpx_sn_fwd_length/ qed-. + +lemma llpx_fwd_flat_dx: ∀h,g,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡[h, g, ⓕ{I}V.T, d] L2 → + ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2. +/2 width=3 by llpx_sn_fwd_flat_dx/ qed-. + +lemma llpx_fwd_pair_sn: ∀h,g,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡[h, g, ②{I}V.T, d] L2 → + ⦃G, L1⦄ ⊢ ➡[h, g, V, d] L2. +/2 width=3 by llpx_sn_fwd_pair_sn/ qed-. + +(* Note: this might be removed *) +lemma llpx_fwd_bind_sn: ∀h,g,a,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡[h, g, ⓑ{a,I}V.T, d] L2 → + ⦃G, L1⦄ ⊢ ➡[h, g, V, d] L2. +/2 width=4 by llpx_sn_fwd_bind_sn/ qed-. + +(* Note: this might be removed *) +lemma llpx_fwd_bind_dx: ∀h,g,a,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡[h, g, ⓑ{a,I}V.T, d] L2 → + ⦃G, L1.ⓑ{I}V⦄ ⊢ ➡[h, g, T, ⫯d] L2.ⓑ{I}V. +/2 width=2 by llpx_sn_fwd_bind_dx/ qed-. + +(* Note: this might be removed *) +lemma llpx_fwd_flat_sn: ∀h,g,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡[h, g, ⓕ{I}V.T, d] L2 → + ⦃G, L1⦄ ⊢ ➡[h, g, V, d] L2. +/2 width=3 by llpx_sn_fwd_flat_sn/ qed-. + +(* Basic properties *********************************************************) + +lemma llpx_lref: ∀h,g,I,G,L1,L2,K1,K2,V1,V2,d,i. d ≤ yinj i → + ⇩[i] L1 ≡ K1.ⓑ{I}V1 → ⇩[i] L2 ≡ K2.ⓑ{I}V2 → + ⦃G, K1⦄ ⊢ ➡[h, g, V1, 0] K2 → ⦃G, K1⦄ ⊢ V1 ➡[h, g] V2 → ⦃G, L1⦄ ⊢ ➡[h, g, #i, d] L2. +/2 width=9 by llpx_sn_lref/ qed. + +lemma llpx_refl: ∀h,g,G,T,d. reflexive … (llpx h g G d T). +/2 width=1 by llpx_sn_refl/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpx_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpx_aaa.etc new file mode 100644 index 000000000..99eef8d55 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpx_aaa.etc @@ -0,0 +1,82 @@ +(**************************************************************************) +(* ___ *) +(* ||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/static/aaa_lift.ma". +include "basic_2/static/lsuba_aaa.ma". +include "basic_2/reduction/llpx_ldrop.ma". + +(* SN EXTENDED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ********************) + +(* Properties on atomic arity assignment for terms **************************) + +(* Note: lemma 500 *) +lemma aaa_cpx_llpx_conf: ∀h,g,G,L1,T1,A. ⦃G, L1⦄ ⊢ T1 ⁝ A → + ∀T2. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2 → + ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g, T1, 0] L2 → ⦃G, L2⦄ ⊢ T2 ⁝ A. +#h #g #G #L1 #T1 #A #H elim H -G -L1 -T1 -A +[ #g #L1 #k #X #H elim (cpx_inv_sort1 … H) -H // * // +| #I #G #L1 #K1 #V1 #B #i #HLK1 #_ #IHV1 #X #H #L2 #HL12 + elim (cpx_inv_lref1 … H) -H + [ #H destruct + elim (llpx_inv_lref_ge_sn … HL12 … HLK1) -L1 /3 width=6 by aaa_lref/ + | * #J #Y #Z #V2 #H #HV12 #HV2 + lapply (ldrop_mono … H … HLK1) -H #H destruct + elim (llpx_inv_lref_ge_sn … HL12 … HLK1) -L1 /3 width=8 by aaa_lift, ldrop_fwd_drop2/ + ] +| #a #G #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12 + elim (llpx_inv_bind_O … HL12) -HL12 #HV1 #HT1 + elim (cpx_inv_abbr1 … H) -H * + [ #V2 #T2 #HV12 #HT12 #H destruct /4 width=4 by llpx_bind_repl_O, aaa_abbr/ + | #T2 #HT12 #HT2 #H destruct -IHV1 /3 width=8 by aaa_inv_lift, ldrop_drop/ + ] +| #a #G #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12 + elim (llpx_inv_bind_O … HL12) -HL12 #HV1 #HT1 + elim (cpx_inv_abst1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct + /4 width=4 by llpx_bind_repl_O, aaa_abst/ +| #G #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12 + elim (llpx_inv_flat … HL12) -HL12 #HV1 #HT1 + elim (cpx_inv_appl1 … H) -H * + [ #V2 #T2 #HV12 #HT12 #H destruct /3 width=3 by aaa_appl/ + | #b #V2 #W1 #W2 #U1 #U2 #HV12 #HW12 #HU12 #H1 #H2 destruct + lapply (IHV1 … HV12 … HV1) -IHV1 -HV12 #HV2 + lapply (IHT1 (ⓛ{b}W2.U2) … HT1) -IHT1 /2 width=1 by cpx_bind/ -L1 #H + elim (aaa_inv_abst … H) -H #B0 #A0 #HW1 #HU2 #H destruct + /5 width=6 by lsuba_aaa_trans, lsuba_abbr, aaa_abbr, aaa_cast/ + | #b #V #V2 #W1 #W2 #U1 #U2 #HV1 #HV2 #HW12 #HU12 #H1 #H2 destruct + lapply (aaa_lift G L2 … B … (L2.ⓓW2) … HV2) -HV2 /2 width=2 by ldrop_drop/ #HV2 + lapply (IHT1 (ⓓ{b}W2.U2) … HT1) -IHT1 /2 width=1 by cpx_bind/ -L1 #H + elim (aaa_inv_abbr … H) -H /3 width=3 by aaa_abbr, aaa_appl/ + ] +| #G #L1 #V1 #T1 #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12 + elim (llpx_inv_flat … HL12) -HL12 #HV1 #HT1 + elim (cpx_inv_cast1 … H) -H + [ * #V2 #T2 #HV12 #HT12 #H destruct /3 width=1 by aaa_cast/ + | -IHV1 /2 width=1 by/ + | -IHT1 /2 width=1 by/ + ] +] +qed-. + +lemma aaa_cpx_conf: ∀h,g,G,L,T1,A. ⦃G, L⦄ ⊢ T1 ⁝ A → ∀T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 → ⦃G, L⦄ ⊢ T2 ⁝ A. +/2 width=7 by aaa_cpx_llpx_conf/ qed-. + +lemma aaa_llpx_conf: ∀h,g,G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A → ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g, T, 0] L2 → ⦃G, L2⦄ ⊢ T ⁝ A. +/2 width=7 by aaa_cpx_llpx_conf/ qed-. + +lemma aaa_cpr_conf: ∀G,L,T1,A. ⦃G, L⦄ ⊢ T1 ⁝ A → ∀T2. ⦃G, L⦄ ⊢ T1 ➡ T2 → ⦃G, L⦄ ⊢ T2 ⁝ A. +/3 width=5 by aaa_cpx_conf, cpr_cpx/ qed-. +(* +lamma aaa_llpr_conf: ∀G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A → ∀L2. ⦃G, L1⦄ ⊢ ➡[T, 0] L2 → ⦃G, L2⦄ ⊢ T ⁝ A. +/3 width=5 by aaa_llpx_conf, llpr_llpx/ qed-. +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpx_ldrop.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpx_ldrop.etc new file mode 100644 index 000000000..3e4bcab8f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpx_ldrop.etc @@ -0,0 +1,90 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reduction/cpx_llpx_sn.ma". +include "basic_2/reduction/cpx_lift.ma". +include "basic_2/reduction/llpx.ma". + +(* LAZY SN EXTENDED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ***************) + +(* Advanced inversion lemmas ************************************************) + +lemma llpx_inv_lref_ge_dx: ∀h,g,G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡[h, g, #i, d] L2 → d ≤ i → + ∀I,K2,V2. ⇩[i] L2 ≡ K2.ⓑ{I}V2 → + ∃∃K1,V1. ⇩[i] L1 ≡ K1.ⓑ{I}V1 & + ⦃G, K1⦄ ⊢ ➡[h, g, V1, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡[h, g] V2. +/2 width=5 by llpx_sn_inv_lref_ge_dx/ qed-. + +lemma llpx_inv_lref_ge_sn: ∀h,g,G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡[h, g, #i, d] L2 → d ≤ i → + ∀I,K1,V1. ⇩[i] L1 ≡ K1.ⓑ{I}V1 → + ∃∃K2,V2. ⇩[i] L2 ≡ K2.ⓑ{I}V2 & + ⦃G, K1⦄ ⊢ ➡[h, g, V1, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡[h, g] V2. +/2 width=5 by llpx_sn_inv_lref_ge_sn/ qed-. + +lemma llpx_inv_lref_ge_bi: ∀h,g,G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡[h, g, #i, d] L2 → d ≤ i → + ∀I1,I2,K1,K2,V1,V2. + ⇩[i] L1 ≡ K1.ⓑ{I1}V1 → ⇩[i] L2 ≡ K2.ⓑ{I2}V2 → + ∧∧ I1 = I2 & ⦃G, K1⦄ ⊢ ➡[h, g, V1, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡[h, g] V2. +/2 width=8 by llpx_sn_inv_lref_ge_bi/ qed-. + +lemma llpx_inv_bind_O: ∀h,g,a,I,G,L1,L2,V,T. ⦃G, L1⦄ ⊢ ➡ [h, g, ⓑ{a,I}V.T, 0] L2 → + ⦃G, L1⦄ ⊢ ➡[h, g, V, 0] L2 ∧ ⦃G, L1.ⓑ{I}V⦄ ⊢ ➡[h, g, T, 0] L2.ⓑ{I}V. +/2 width=2 by llpx_sn_inv_bind_O/ qed-. + +lemma llpx_bind_repl_O: ∀h,g,I,G,L1,L2,V1,V2,T. ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡[h, g, T, 0] L2.ⓑ{I}V2 → + ∀J,W1,W2. ⦃G, L1⦄ ⊢ ➡[h, g, W1, 0] L2 → ⦃G, L1⦄ ⊢ W1 ➡[h, g] W2 → ⦃G, L1.ⓑ{J}W1⦄ ⊢ ➡[h, g, T, 0] L2.ⓑ{J}W2. +/2 width=4 by llpx_sn_bind_repl_O/ qed-. + +(* Advanced forward lemmas **************************************************) + +lemma llpx_fwd_bind_O_dx: ∀h,g,a,I,G,L1,L2,V,T. ⦃G, L1⦄ ⊢ ➡[h, g, ⓑ{a,I}V.T, 0] L2 → + ⦃G, L1.ⓑ{I}V⦄ ⊢ ➡[h, g, T, 0] L2.ⓑ{I}V. +/2 width=3 by llpx_sn_fwd_bind_O_dx/ qed-. + +(* Advanced properties ******************************************************) + +lemma llpx_cpx_conf: ∀h,g,G. s_r_confluent1 … (cpx h g G) (llpx h g G 0). +/3 width=10 by cpx_llpx_sn_conf, cpx_inv_lift1, cpx_lift/ qed-. + +(* Inversion lemmas on relocation *******************************************) + +lemma llpx_ldrop_trans_O: ∀h,g,G,L1,L2,U. ⦃G, L1⦄ ⊢ ➡[h, g, U, 0] L2 → + ∀K2,e. ⇩[e] L2 ≡ K2 → ∀T. ⇧[0, e] T ≡ U → + ∃∃K1. ⇩[e] L1 ≡ K1 & ⦃G, K1⦄ ⊢ ➡[h, g, T, 0] K2. +/2 width=5 by llpx_sn_ldrop_trans_O/ qed-. + +(* Properties on supclosure *************************************************) + +lemma llpx_fqu_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ → + ∀K1. ⦃G1, K1⦄ ⊢ ➡[h, g, T1, 0] L1 → + ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡[h, g] T & ⦃G1, K1, T⦄ ⊃ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g, T2, 0] L2. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 +/3 width=7 by llpx_fwd_bind_O_dx, llpx_fwd_pair_sn,llpx_fwd_flat_dx, ex3_2_intro/ +[ #I #G1 #L1 #V1 #K1 #H elim (llpx_inv_lref_ge_dx … H) -H [5,6: // |2,3,4: skip ] + #Y1 #W1 #HKL1 #HW1 #HWV1 elim (lift_total V1 0 1) + /4 width=7 by llpx_cpx_conf, cpx_delta, fqu_drop, ldrop_fwd_drop2, ex3_2_intro/ +| #G #L1 #K1 #T1 #U1 #e #HLK1 #HTU1 #L0 #HU1 + elim (llpx_ldrop_trans_O … HU1 … HLK1) -L1 + /3 width=5 by fqu_drop, ex3_2_intro/ +] +qed-. + +lemma llpx_fquq_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ → + ∀K1. ⦃G1, K1⦄ ⊢ ➡[h, g, T1, 0] L1 → + ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡[h, g] T & ⦃G1, K1, T⦄ ⊃⸮ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g, T2, 0] L2. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H #K1 #HKL1 elim (fquq_inv_gen … H) -H +[ #HT12 elim (llpx_fqu_trans … HT12 … HKL1) /3 width=5 by fqu_fquq, ex3_2_intro/ +| * #H1 #H2 #H3 destruct /2 width=5 by ex3_2_intro/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpx_lleq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpx_lleq.etc new file mode 100644 index 000000000..e936cc531 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpx_lleq.etc @@ -0,0 +1,31 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reduction/cpx_lleq.ma". +include "basic_2/reduction/llpx.ma". + +(* LAZY SN EXTENDED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ***************) + +(* Properties on lazy equivalence for local environments ********************) + +lemma llpx_lrefl: ∀h,g,G,L1,L2,T,d. L1 ⋕[T, d] L2 → ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2. +/2 width=1 by llpx_sn_lrefl/ qed-. + +lemma lleq_llpx_trans: ∀h,g,G,L1,L2,T,d. L1 ⋕[T, d] L2 → + ∀L.⦃G, L2⦄ ⊢ ➡[h, g, T, d] L → ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L. +/3 width=3 by lleq_cpx_trans, lleq_llpx_sn_trans/ qed-. + +lemma lleq_llpx_conf: ∀h,g,G,L1,L2,T,d. L1 ⋕[T, d] L2 → + ∀L.⦃G, L1⦄ ⊢ ➡[h, g, T, d] L → ⦃G, L2⦄ ⊢ ➡[h, g, T, d] L. +/3 width=3 by lleq_cpx_trans, lleq_llpx_sn_conf/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpx_lpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpx_lpr.etc new file mode 100644 index 000000000..6ceb64b51 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpx_lpr.etc @@ -0,0 +1,25 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/llpx_sn_lpx_sn.ma". +include "basic_2/reduction/lpr.ma". +include "basic_2/reduction/llpx.ma". + +(* LAZY SN EXTENDED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ***************) + +(* Properties on sn parallel reduction **************************************) + +(* Note: this should be moved *) +lemma lpr_llpx: ∀h,g,G,L1,L2,T,d. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2. +/3 width=4 by cpr_cpx, lpx_sn_llpx_sn, llpx_sn_co/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpxs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpxs.etc new file mode 100644 index 000000000..750d0b5b1 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpxs.etc @@ -0,0 +1,89 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/lazypredsnstar_7.ma". +include "basic_2/reduction/llpx.ma". + +(* LAZY SN EXTENDED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS **************) + +definition llpxs: ∀h. sd h → genv → relation4 ynat term lenv lenv ≝ + λh,g,G,d. LTC … (llpx h g G d). + +interpretation "lazy extended parallel computation (local environment, sn variant)" + 'LazyPRedSnStar G L1 L2 h g T d = (llpxs h g G d T L1 L2). + +(* Basic eliminators ********************************************************) + +lemma llpxs_ind: ∀h,g,G,L1,T,d. ∀R:predicate lenv. R L1 → + (∀L,L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L → ⦃G, L⦄ ⊢ ➡[h, g, T, d] L2 → R L → R L2) → + ∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → R L2. +#h #g #G #L1 #T #d #R #HL1 #IHL1 #L2 #HL12 +@(TC_star_ind … HL1 IHL1 … HL12) // +qed-. + +lemma llpxs_ind_dx: ∀h,g,G,L2,T,d. ∀R:predicate lenv. R L2 → + (∀L1,L. ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L → ⦃G, L⦄ ⊢ ➡*[h, g, T, d] L2 → R L → R L1) → + ∀L1. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → R L1. +#h #g #G #L2 #T #d #R #HL2 #IHL2 #L1 #HL12 +@(TC_star_ind_dx … HL2 IHL2 … HL12) // +qed-. + +(* Basic properties *********************************************************) + +lemma llpx_llpxs: ∀h,g,G,L1,L2,T,d. ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2 → ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2. +normalize /2 width=1 by inj/ qed. + +lemma llpxs_refl: ∀h,g,G,L,T,d. ⦃G, L⦄ ⊢ ➡*[h, g, T, d] L. +/2 width=1 by llpx_llpxs/ qed. + +lemma llpxs_strap1: ∀h,g,G,L1,L,L2,T,d. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L → ⦃G, L⦄ ⊢ ➡[h, g, T, d] L2 → ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2. +normalize /2 width=3 by step/ qed. + +lemma llpxs_strap2: ∀h,g,G,L1,L,L2,T,d. ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L → ⦃G, L⦄ ⊢ ➡*[h, g, T, d] L2 → ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2. +normalize /2 width=3 by TC_strap/ qed. + +(* Basic forward lemmas *****************************************************) + +lemma llpxs_fwd_length: ∀h,g,G,L1,L2,T,d. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → |L1| = |L2|. +#h #g #G #L1 #L2 #T #d #H @(llpxs_ind … H) -L2 +/3 width=8 by llpx_fwd_length, trans_eq/ +qed-. + +(* Note: this might be moved *) +lemma llpxs_fwd_bind_sn: ∀h,g,a,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡*[h, g, ⓑ{a,I}V.T, d] L2 → + ⦃G, L1⦄ ⊢ ➡*[h, g, V, d] L2. +#h #g #a #I #G #L1 #L2 #V #T #d #H @(llpxs_ind … H) -L2 +/3 width=6 by llpx_fwd_bind_sn, llpxs_strap1/ +qed-. + +(* Note: this might be moved *) +lemma llpxs_fwd_bind_dx: ∀h,g,a,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡*[h, g, ⓑ{a,I}V.T, d] L2 → + ⦃G, L1.ⓑ{I}V⦄ ⊢ ➡*[h, g, T, ⫯d] L2.ⓑ{I}V. +#h #g #a #I #G #L1 #L2 #V #T #d #H @(llpxs_ind … H) -L2 +/3 width=6 by llpx_fwd_bind_dx, llpxs_strap1/ +qed-. + +(* Note: this might be moved *) +lemma llpxs_fwd_flat_sn: ∀h,g,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡*[h, g, ⓕ{I}V.T, d] L2 → + ⦃G, L1⦄ ⊢ ➡*[h, g, V, d] L2. +#h #g #I #G #L1 #L2 #V #T #d #H @(llpxs_ind … H) -L2 +/3 width=6 by llpx_fwd_flat_sn, llpxs_strap1/ +qed-. + +(* Note: this might be moved *) +lemma llpxs_fwd_flat_dx: ∀h,g,I,G,L1,L2,V,T,d. ⦃G, L1⦄ ⊢ ➡*[h, g, ⓕ{I}V.T, d] L2 → + ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2. +#h #g #I #G #L1 #L2 #V #T #d #H @(llpxs_ind … H) -L2 +/3 width=6 by llpx_fwd_flat_dx, llpxs_strap1/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpxs_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpxs_aaa.etc new file mode 100644 index 000000000..ededb03a2 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpxs_aaa.etc @@ -0,0 +1,31 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reduction/llpx_aaa.ma". +include "basic_2/computation/llpxs.ma". + +(* LAZY SN EXTENDED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS **************) + +(* Properties about atomic arity assignment on terms ************************) + +lemma aaa_llpxs_conf: ∀h,g,G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A → + ∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, 0] L2 → ⦃G, L2⦄ ⊢ T ⁝ A. +#h #g #G #L1 #T #A #HT #L2 #HL12 +@(TC_Conf3 … (λL,A. ⦃G, L⦄ ⊢ T ⁝ A) … HT ? HL12) /2 width=5 by aaa_llpx_conf/ +qed-. +(* +lamma aaa_llprs_conf: ∀G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A → + ∀L2. ⦃G, L1⦄ ⊢ ➡*[T, 0] L2 → ⦃G, L2⦄ ⊢ T ⁝ A. +/3 width=5 by aaa_llpxs_conf, llprs_llpxs/ qed-. +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpxs_cpxs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpxs_cpxs.etc new file mode 100644 index 000000000..35472d7e5 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpxs_cpxs.etc @@ -0,0 +1,172 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/llpx_sn_tc.ma". +include "basic_2/computation/cpxs_llpx.ma". +include "basic_2/computation/llpxs.ma". + +(* LAZY SN EXTENDED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS **************) + +(* Advanced properties ******************************************************) + +lemma llpxs_pair_dx: ∀h,g,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡*[h, g] V2 → + ∀I,T. ⦃G, L.ⓑ{I}V1⦄ ⊢ ➡*[h, g, T, 0] L.ⓑ{I}V2. +/2 width=1 by llpx_sn_TC_pair_dx/ qed. + +(* Properties on context-sensitive extended parallel computation for terms **) + +lemma llpxs_cpx_trans: ∀h,g,G. s_r_transitive … (cpx h g G) (llpxs h g G 0). +/3 width=5 by s_r_trans_LTC2, llpx_cpxs_trans/ qed-. + +lemma llpxs_cpxs_trans: ∀h,g,G. s_rs_transitive … (cpx h g G) (llpxs h g G 0). +#h #g #G @s_r_to_s_rs_trans @s_r_trans_LTC2 +/3 width=5 by llpx_cpxs_trans, s_rs_trans_TC1/ (**) (* full auto too slow *) +qed-. + +(* Note: this is an instance of a general theorem *) +lemma llpxs_cpxs_conf_dx: ∀h,g,G2,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡*[h, g] U2 → + ∀L0. ⦃G2, L0⦄ ⊢ ➡*[h, g, T2, O] L2 → ⦃G2, L0⦄ ⊢ ➡*[h, g, U2, O] L2. +#h #g #G2 #L2 #T2 #U2 #HTU2 #L0 #H @(llpxs_ind_dx … H) -L0 // +#L0 #L #HL0 #HL2 #IHL2 @(llpxs_strap2 … IHL2) -IHL2 +lapply (llpxs_cpxs_trans … HTU2 … HL2) -L2 #HTU2 +/3 width=3 by llpx_cpxs_trans, cpxs_llpx_conf/ +qed-. + +(* Note: this is an instance of a general theorem *) +lemma llpxs_cpx_conf_dx: ∀h,g,G2,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡[h, g] U2 → + ∀L0. ⦃G2, L0⦄ ⊢ ➡*[h, g, T2, O] L2 → ⦃G2, L0⦄ ⊢ ➡*[h, g, U2, O] L2. +#h #g #G2 #L2 #T2 #U2 #HTU2 #L0 #H @(llpxs_ind_dx … H) -L0 // +#L0 #L #HL0 #HL2 #IHL2 @(llpxs_strap2 … IHL2) -IHL2 +lapply (llpxs_cpx_trans … HTU2 … HL2) -L2 #HTU2 +/3 width=3 by llpx_cpxs_trans, cpxs_llpx_conf/ +qed-. + +lemma cpxs_bind2: ∀h,g,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡*[h, g] V2 → + ∀I,T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ➡*[h, g] T2 → + ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡*[h, g] ⓑ{a,I}V2.T2. +/4 width=5 by llpxs_cpxs_trans, llpxs_pair_dx, cpxs_bind/ qed. + +(* Advanced forward lemmas **************************************************) + +(* Note: this might be moved *) +lemma llpxs_fwd_lref_ge_sn: ∀h,g,G,L1,L2,d,i. ⦃G, L1⦄ ⊢ ➡*[h, g, #i, d] L2 → d ≤ i → + ∀I,K1,V1. ⇩[i] L1 ≡ K1.ⓑ{I}V1 → + ∃∃K2,V2. ⇩[i] L2 ≡ K2.ⓑ{I}V2 & + ⦃G, K1⦄ ⊢ ➡*[h, g, V2, 0] K2 & ⦃G, K1⦄ ⊢ V1 ➡*[h, g] V2. +#h #g #G #L1 #L2 #d #i #H #Hdi #I #K1 #V1 #HLK1 @(llpxs_ind … H) -L2 /2 width=5 by ex3_2_intro/ -HLK1 +#L #L2 #_ #HL2 * #K #V #HLK #HK1 #HV1 elim (llpx_inv_lref_ge_sn … HL2 … HLK) // -HL2 -HLK -Hdi +#K2 #V2 #HLK2 #HK2 #HV2 +@(ex3_2_intro … HLK2) -HLK2 +[ /3 width=5 by llpxs_cpx_conf_dx, llpxs_strap1, llpx_cpx_conf/ +| /3 width=5 by llpxs_cpx_trans, cpxs_trans/ +] +qed-. + +(* Inversion lemmas on context-sensitive ext parallel computation for terms *) + +lemma cpxs_inv_abst1: ∀h,g,a,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓛ{a}V1.T1 ➡*[h, g] U2 → + ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡*[h, g] V2 & ⦃G, L.ⓛV1⦄ ⊢ T1 ➡*[h, g] T2 & + U2 = ⓛ{a}V2.T2. +#h #g #a #G #L #V1 #T1 #U2 #H @(cpxs_ind … H) -U2 /2 width=5 by ex3_2_intro/ +#U0 #U2 #_ #HU02 * #V0 #T0 #HV10 #HT10 #H destruct +elim (cpx_inv_abst1 … HU02) -HU02 #V2 #T2 #HV02 #HT02 #H destruct +lapply (llpxs_cpx_trans … HT02 (L.ⓛV1) ?) +/3 width=5 by llpxs_pair_dx, cpxs_trans, cpxs_strap1, ex3_2_intro/ +qed-. + +lemma cpxs_inv_abbr1: ∀h,g,a,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓓ{a}V1.T1 ➡*[h, g] U2 → ( + ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡*[h, g] V2 & ⦃G, L.ⓓV1⦄ ⊢ T1 ➡*[h, g] T2 & + U2 = ⓓ{a}V2.T2 + ) ∨ + ∃∃T2. ⦃G, L.ⓓV1⦄ ⊢ T1 ➡*[h, g] T2 & ⇧[0, 1] U2 ≡ T2 & a = true. +#h #g #a #G #L #V1 #T1 #U2 #H @(cpxs_ind … H) -U2 /3 width=5 by ex3_2_intro, or_introl/ +#U0 #U2 #_ #HU02 * * +[ #V0 #T0 #HV10 #HT10 #H destruct + elim (cpx_inv_abbr1 … HU02) -HU02 * + [ #V2 #T2 #HV02 #HT02 #H destruct + lapply (llpxs_cpx_trans … HT02 (L.ⓓV1) ?) + /4 width=5 by llpxs_pair_dx, cpxs_trans, cpxs_strap1, ex3_2_intro, or_introl/ + | #T2 #HT02 #HUT2 + lapply (llpxs_cpx_trans … HT02 (L.ⓓV1) ?) -HT02 + /4 width=3 by llpxs_pair_dx, cpxs_trans, ex3_intro, or_intror/ + ] +| #U1 #HTU1 #HU01 + elim (lift_total U2 0 1) #U #HU2 + /6 width=12 by cpxs_strap1, cpx_lift, ldrop_drop, ex3_intro, or_intror/ +] +qed-. + +(* Properties on supclosure *************************************************) + +lemma llpx_fqup_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃+ ⦃G2, L2, T2⦄ → + ∀K1. ⦃G1, K1⦄ ⊢ ➡[h, g, T1, 0] L1 → + ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡*[h, g] T & ⦃G1, K1, T⦄ ⊃+ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g, T2, 0] L2. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2 +[ #G2 #L2 #T2 #H12 #K1 #HKL1 elim (llpx_fqu_trans … H12 … HKL1) -L1 + /3 width=5 by cpx_cpxs, fqu_fqup, ex3_2_intro/ +| #G #G2 #L #L2 #T #T2 #_ #H2 #IH1 #K1 #HLK1 elim (IH1 … HLK1) -L1 + #L0 #T0 #HT10 #HT0 #HL0 elim (llpx_fqu_trans … H2 … HL0) -L + #L #T3 #HT3 #HT32 #HL2 elim (fqup_cpx_trans … HT0 … HT3) -T + /3 width=7 by cpxs_strap1, fqup_strap1, ex3_2_intro/ +] +qed-. + +lemma llpx_fqus_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃* ⦃G2, L2, T2⦄ → + ∀K1. ⦃G1, K1⦄ ⊢ ➡[h, g, T1, 0] L1 → + ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡*[h, g] T & ⦃G1, K1, T⦄ ⊃* ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g, T2, 0] L2. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqus_ind … H) -G2 -L2 -T2 /2 width=5 by ex3_2_intro/ +#G #G2 #L #L2 #T #T2 #_ #H2 #IH1 #K1 #HLK1 elim (IH1 … HLK1) -L1 +#L0 #T0 #HT10 #HT0 #HL0 elim (llpx_fquq_trans … H2 … HL0) -L +#L #T3 #HT3 #HT32 #HL2 elim (fqus_cpx_trans … HT0 … HT3) -T +/3 width=7 by cpxs_strap1, fqus_strap1, ex3_2_intro/ +qed-. + +lemma llpxs_fquq_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ → + ∀K1. ⦃G1, K1⦄ ⊢ ➡*[h, g, T1, 0] L1 → + ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡*[h, g] T & ⦃G1, K1, T⦄ ⊃⸮ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡*[h, g, T2, 0] L2. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #HT12 #K1 #H @(llpxs_ind_dx … H) -K1 +[ /2 width=5 by ex3_2_intro/ +| #K1 #K #HK1 #_ * #L #T #HT1 #HT2 #HL2 -HT12 + lapply (llpx_cpxs_trans … HT1 … HK1) -HT1 #HT1 + lapply (cpxs_llpx_conf … HT1 … HK1) -HK1 #HK1 + elim (llpx_fquq_trans … HT2 … HK1) -K + /3 width=7 by llpxs_strap2, cpxs_strap1, ex3_2_intro/ +] +qed-. + +lemma llpxs_fqup_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃+ ⦃G2, L2, T2⦄ → + ∀K1. ⦃G1, K1⦄ ⊢ ➡*[h, g, T1, 0] L1 → + ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡*[h, g] T & ⦃G1, K1, T⦄ ⊃+ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡*[h, g, T2, 0] L2. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #HT12 #K1 #H @(llpxs_ind_dx … H) -K1 +[ /2 width=5 by ex3_2_intro/ +| #K1 #K #HK1 #_ * #L #T #HT1 #HT2 #HL2 -HT12 + lapply (llpx_cpxs_trans … HT1 … HK1) -HT1 #HT1 + lapply (cpxs_llpx_conf … HT1 … HK1) -HK1 #HK1 + elim (llpx_fqup_trans … HT2 … HK1) -K + /3 width=7 by llpxs_strap2, cpxs_trans, ex3_2_intro/ +] +qed-. + +lemma llpxs_fqus_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃* ⦃G2, L2, T2⦄ → + ∀K1. ⦃G1, K1⦄ ⊢ ➡*[h, g, T1, 0] L1 → + ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡*[h, g] T & ⦃G1, K1, T⦄ ⊃* ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡*[h, g, T2, 0] L2. +#h #g #G1 #G2 #L1 #L2 #T1 #T2 #HT12 #K1 #H @(llpxs_ind_dx … H) -K1 +[ /2 width=5 by ex3_2_intro/ +| #K1 #K #HK1 #_ * #L #T #HT1 #HT2 #HL2 -HT12 + lapply (llpx_cpxs_trans … HT1 … HK1) -HT1 #HT1 + lapply (cpxs_llpx_conf … HT1 … HK1) -HK1 #HK1 + elim (llpx_fqus_trans … HT2 … HK1) -K + /3 width=7 by llpxs_strap2, cpxs_trans, ex3_2_intro/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpxs_lleq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpxs_lleq.etc new file mode 100644 index 000000000..a38ba395a --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpxs_lleq.etc @@ -0,0 +1,66 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/lleq_leq.ma". +include "basic_2/reduction/llpx_lleq.ma". +include "basic_2/computation/cpxs_lleq.ma". +include "basic_2/computation/llpxs_cpxs.ma". + +(* LAZY SN EXTENDED PARALLEL COMPUTATION FOR LOCAL ENVIRONMENTS *************) + +(* Properties on lazy equivalence for local environments ********************) + +lemma llpxs_lrefl: ∀h,g,G,L1,L2,T,d. L1 ⋕[T, d] L2 → ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2. +/3 width=1 by llpx_lrefl, llpx_llpxs/ qed-. + +lemma lleq_llpxs_trans: ∀h,g,G,L2,L,T,d. ⦃G, L2⦄ ⊢ ➡*[h, g, T, d] L → + ∀L1. L1 ⋕[T, d] L2 → ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L. +#h #g #G #L2 #L #T #d #H @(llpxs_ind … H) -L +/3 width=3 by llpxs_strap1, llpxs_lrefl/ +qed-. + +lemma lleq_llpxs_conf: ∀h,g,G,L1,L,T,d. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L → + ∀L2. L1 ⋕[T, d] L2 → ⦃G, L2⦄ ⊢ ➡*[h, g, T, d] L. +/3 width=3 by lleq_llpxs_trans, lleq_sym/ qed-. +(* +foct leq_lpxs_trans_lleq_aux: ∀h,g,G,L1,L0,d,e. L1 ≃[d, e] L0 → e = ∞ → + ∀L2. ⦃G, L0⦄ ⊢ ➡*[h, g] L2 → + ∃∃L. L ≃[d, e] L2 & ⦃G, L1⦄ ⊢ ➡*[h, g] L & + (∀T. L0 ⋕[T, d] L2 ↔ L1 ⋕[T, d] L). +#h #g #G #L1 #L0 #d #e #H elim H -L1 -L0 -d -e +[ #d #e #_ #L2 #H >(lpxs_inv_atom1 … H) -H + /3 width=5 by ex3_intro, conj/ +| #I1 #I0 #L1 #L0 #V1 #V0 #_ #_ #He destruct +| #I #L1 #L0 #V1 #e #HL10 #IHL10 #He #Y #H + elim (lpxs_inv_pair1 … H) -H #L2 #V2 #HL02 #HV02 #H destruct + lapply (ysucc_inv_Y_dx … He) -He #He + elim (IHL10 … HL02) // -IHL10 -HL02 #L #HL2 #HL1 #IH + @(ex3_intro … (L.ⓑ{I}V2)) /3 width=3 by lpxs_pair, leq_cpxs_trans, leq_pair/ + #T elim (IH T) #HL0dx #HL0sn + @conj #H @(lleq_leq_repl … H) -H /3 width=1 by leq_sym, leq_pair_O_Y/ +| #I1 #I0 #L1 #L0 #V1 #V0 #d #e #HL10 #IHL10 #He #Y #H + elim (lpxs_inv_pair1 … H) -H #L2 #V2 #HL02 #HV02 #H destruct + elim (IHL10 … HL02) // -IHL10 -HL02 #L #HL2 #HL1 #IH + @(ex3_intro … (L.ⓑ{I1}V1)) /3 width=1 by lpxs_pair, leq_succ/ + #T elim (IH T) #HL0dx #HL0sn + @conj #H @(lleq_leq_repl … H) -H /3 width=1 by leq_sym, leq_succ/ +] +qed-. + +lamma leq_lpxs_trans_lleq: ∀h,g,G,L1,L0,d. L1 ≃[d, ∞] L0 → + ∀L2. ⦃G, L0⦄ ⊢ ➡*[h, g] L2 → + ∃∃L. L ≃[d, ∞] L2 & ⦃G, L1⦄ ⊢ ➡*[h, g] L & + (∀T. L0 ⋕[T, d] L2 ↔ L1 ⋕[T, d] L). +/2 width=1 by leq_lpxs_trans_lleq_aux/ qed-. +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpxs_llpxs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpxs_llpxs.etc new file mode 100644 index 000000000..d316c5207 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpxs_llpxs.etc @@ -0,0 +1,22 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/llpxs.ma". + +(* LAZY SN EXTENDED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS **************) + +(* Main properties **********************************************************) + +theorem llpxs_trans: ∀h,g,G,T,d. Transitive … (llpxs h g G d T). +normalize /2 width=3 by trans_TC/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpxs_lprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpxs_lprs.etc new file mode 100644 index 000000000..32d7bbc38 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llpxs_lprs.etc @@ -0,0 +1,25 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reduction/llpx_lpr.ma". +include "basic_2/computation/lprs.ma". +include "basic_2/computation/llpxs.ma". + +(* LAZY SN EXTENDED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS **************) + +(* Properties on sn parallel computation ************************************) + +(* Note: this should be moved *) +lemma lprs_llpxs: ∀h,g,G,L1,L2,T,d. ⦃G, L1⦄ ⊢ ➡* L2 → ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2. +normalize /3 width=3 by lpr_llpx, monotonic_TC/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llsx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llsx.etc new file mode 100644 index 000000000..286d0645f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llsx.etc @@ -0,0 +1,57 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/lazysn_6.ma". +include "basic_2/substitution/lleq.ma". +include "basic_2/reduction/llpx.ma". + +(* LAZY SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS *****************) + +definition llsx: ∀h. sd h → relation4 ynat term genv lenv ≝ + λh,g,d,T,G. SN … (llpx h g G d T) (lleq d T). + +interpretation + "lazy extended strong normalization (local environment)" + 'LazySN h g d T G L = (llsx h g T d G L). + +(* Basic eliminators ********************************************************) + +lemma llsx_ind: ∀h,g,G,T,d. ∀R:predicate lenv. + (∀L1. G ⊢ ⋕⬊*[h, g, T, d] L1 → + (∀L2. ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → R L2) → + R L1 + ) → + ∀L. G ⊢ ⋕⬊*[h, g, T, d] L → R L. +#h #g #G #T #d #R #H0 #L1 #H elim H -L1 +/5 width=1 by lleq_sym, SN_intro/ +qed-. + +(* Basic properties *********************************************************) + +lemma llsx_intro: ∀h,g,G,L1,T,d. + (∀L2. ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → G ⊢ ⋕⬊*[h, g, T, d] L2) → + G ⊢ ⋕⬊*[h, g, T, d] L1. +/5 width=1 by lleq_sym, SN_intro/ qed. + +lemma llsx_sort: ∀h,g,G,L,d,k. G ⊢ ⋕⬊*[h, g, ⋆k, d] L. +#h #g #G #L1 #d #k @llsx_intro +#L2 #HL12 #H elim H -H +/3 width=6 by llpx_fwd_length, lleq_sort/ +qed. + +lemma llsx_gref: ∀h,g,G,L,d,p. G ⊢ ⋕⬊*[h, g, §p, d] L. +#h #g #G #L1 #d #p @llsx_intro +#L2 #HL12 #H elim H -H +/3 width=6 by llpx_fwd_length, lleq_gref/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llsx_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llsx_alt.etc new file mode 100644 index 000000000..0d23439b9 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llsx_alt.etc @@ -0,0 +1,107 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/lazysnalt_6.ma". +include "basic_2/substitution/lleq_lleq.ma". +include "basic_2/computation/llpxs_lleq.ma". +include "basic_2/computation/llsx.ma". + +(* SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS **********************) + +(* alternative definition of llsx *) +definition llsxa: ∀h. sd h → relation4 ynat term genv lenv ≝ + λh,g,d,T,G. SN … (llpxs h g G d T) (lleq d T). + +interpretation + "lazy extended strong normalization (local environment) alternative" + 'LazySNAlt h g d T G L = (llsxa h g T d G L). + +(* Basic eliminators ********************************************************) + +lemma llsxa_ind: ∀h,g,G,T,d. ∀R:predicate lenv. + (∀L1. G ⊢ ⋕⬊⬊*[h, g, T, d] L1 → + (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → R L2) → + R L1 + ) → + ∀L. G ⊢ ⋕⬊⬊*[h, g, T, d] L → R L. +#h #g #G #T #d #R #H0 #L1 #H elim H -L1 +/5 width=1 by lleq_sym, SN_intro/ +qed-. + +(* Basic properties *********************************************************) + +lemma llsxa_intro: ∀h,g,G,L1,T,d. + (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → G ⊢ ⋕⬊⬊*[h, g, T, d] L2) → + G ⊢ ⋕⬊⬊*[h, g, T, d] L1. +/5 width=1 by lleq_sym, SN_intro/ qed. + +fact llsxa_intro_aux: ∀h,g,G,L1,T,d. + (∀L,L2. ⦃G, L⦄ ⊢ ➡*[h, g, T, d] L2 → L1 ⋕[T, d] L → (L1 ⋕[T, d] L2 → ⊥) → G ⊢ ⋕⬊⬊*[h, g, T, d] L2) → + G ⊢ ⋕⬊⬊*[h, g, T, d] L1. +/4 width=3 by llsxa_intro/ qed-. + +lemma llsxa_llpxs_trans: ∀h,g,G,L1,T,d. G ⊢ ⋕⬊⬊*[h, g, T, d] L1 → + ∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → G ⊢ ⋕⬊⬊*[h, g, T, d] L2. +#h #g #G #L1 #T #d #H @(llsxa_ind … H) -L1 #L1 #HL1 #IHL1 #L2 #HL12 @llsxa_intro +elim (lleq_dec T L1 L2 d) /4 width=4 by lleq_llpxs_trans, lleq_canc_sn/ +qed-. + +lemma llsxa_intro_llpx: ∀h,g,G,L1,T,d. + (∀L2. ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → G ⊢ ⋕⬊⬊*[h, g, T, d] L2) → + G ⊢ ⋕⬊⬊*[h, g, T, d] L1. +#h #g #G #L1 #T #d #IH @llsxa_intro_aux +#L #L2 #H @(llpxs_ind_dx … H) -L +[ #H destruct #H elim H // +| #L0 #L elim (lleq_dec T L1 L d) + /4 width=3 by llsxa_llpxs_trans, lleq_llpx_trans/ +] +qed. + +(* Main properties **********************************************************) + +theorem llsx_llsxa: ∀h,g,G,L,T,d. G ⊢ ⋕⬊*[h, g, T, d] L → G ⊢ ⋕⬊⬊*[h, g, T, d] L. +#h #g #G #L #T #d #H @(llsx_ind … H) -L +/4 width=1 by llsxa_intro_llpx/ +qed. + +(* Main inversion lemmas ****************************************************) + +theorem llsxa_inv_llsx: ∀h,g,G,L,T,d. G ⊢ ⋕⬊⬊*[h, g, T, d] L → G ⊢ ⋕⬊*[h, g, T, d] L. +#h #g #G #L #T #d #H @(llsxa_ind … H) -L +/4 width=1 by llsx_intro, llpx_llpxs/ +qed-. + +(* Advanced properties ******************************************************) + +lemma llsx_intro_alt: ∀h,g,G,L1,T,d. + (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → G ⊢ ⋕⬊*[h, g, T, d] L2) → + G ⊢ ⋕⬊*[h, g, T, d] L1. +/6 width=1 by llsxa_inv_llsx, llsx_llsxa, llsxa_intro/ qed. + +lemma llsx_llpxs_trans: ∀h,g,G,L1,T,d. G ⊢ ⋕⬊*[h, g, T, d] L1 → + ∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → G ⊢ ⋕⬊*[h, g, T, d] L2. +/4 width=3 by llsxa_inv_llsx, llsx_llsxa, llsxa_llpxs_trans/ +qed-. + +(* Advanced eliminators *****************************************************) + +lemma llsx_ind_alt: ∀h,g,G,T,d. ∀R:predicate lenv. + (∀L1. G ⊢ ⋕⬊*[h, g, T, d] L1 → + (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → R L2) → + R L1 + ) → + ∀L. G ⊢ ⋕⬊*[h, g, T, d] L → R L. +#h #g #G #T #d #R #IH #L #H @(llsxa_ind h g G T d … L) +/4 width=1 by llsxa_inv_llsx, llsx_llsxa/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llsx_csx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llsx_csx.etc new file mode 100644 index 000000000..9c284732c --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llsx_csx.etc @@ -0,0 +1,96 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/csx_lift.ma". +include "basic_2/computation/csx_llpxs.ma". +include "basic_2/computation/llsx_ldrop.ma". +include "basic_2/computation/llsx_llpx.ma". +include "basic_2/computation/llsx_llpxs.ma". +(* +axiom cpx_llpx_trans: ∀h,g,G,L1,T1,T2. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2 → + ∀L2. ⦃G, L1⦄⊢ ➡[h, g, T2, O] L2 → + ∃∃L. ⦃G, L1⦄⊢ ➡[h, g, T1, O] L & L ⋕[T2, 0] L2. +(* +fact llsx_cpx_trans_aux: ∀h,g,G,L0,T1,T2. ⦃G, L0⦄ ⊢ T1 ➡[h, g] T2 → + ∀L1,d. G ⊢ ⋕⬊*[h, g, T1, d] L1 → d = 0 → + L0 ⋕[T1, d] L1 → ∀L2. L1 ⋕[T2, d] L2 → + G ⊢ ⋕⬊*[h, g, T2, d] L2. +#h #g #G #L0 #T1 #T2 #HT12 #L1 #d #H @(llsx_ind … H) -L1 +#L1 #_ #IHL1 #Hd #He011 #L2 #He122 @llsx_intro +#L3 #Hx223 #Hn223 destruct +lapply (lleq_cpx_conf_sn … HT12 … He011) #He021 +lapply (lleq_cpx_conf … HT12 … He011) -HT12 #HT12 +lapply (lleq_llpx_trans … He122 … Hx223) -Hx223 #Hx123 +elim (cpx_llpx_trans … HT12 … Hx123) -Hx123 #L4 #Hx114 #He423 +(* lapply (lleq_cpx_conf … Hx114 … He011) #He120 *) +@(IHL1 … Hx114) // -IHL1 +[ #HL13 @HnL2 -HnL2 +*) + +fact llsx_cpx_trans_aux: ∀h,g,G,L1,T1,d. G ⊢ ⋕⬊*[h, g, T1, d] L1 → d = 0 → + ∀T2. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2 → + ∀L2. L1 ⋕[T1, d] L2 → G ⊢ ⋕⬊*[h, g, T2, 0] L2. +#h #g #G #L1 #T1 #d #H @(llsx_ind … H) -L1 +#L1 #_ #IHL1 #Hd #T2 #HT12 #L2 #He112 @llsx_intro +#L3 #Hx223 #Hn223 destruct +lapply (lleq_cpx_conf_sn … HT12 … He112) #He122 +lapply (lleq_cpx_conf … HT12 … He112) -HT12 #HT12 +elim (cpx_llpx_trans … HT12 … Hx223) #L4 #Hx214 #He423 +@(IHL1 … L4) // +*) +axiom llsx_cpx_trans_O: ∀h,g,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 → + G ⊢ ⋕⬊*[h, g, T1, 0] L → G ⊢ ⋕⬊*[h, g, T2, 0] L. + +(* LAZY SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS *****************) + +(* Advanced properties ******************************************************) + +lemma llsx_lref_be_lpxs: ∀h,g,I,G,K1,V,i,d. d ≤ yinj i → ⦃G, K1⦄ ⊢ ⬊*[h, g] V → + ∀K2. G ⊢ ⋕⬊*[h, g, V, 0] K2 → ⦃G, K1⦄ ⊢ ➡*[h, g, V, 0] K2 → + ∀L2. ⇩[i] L2 ≡ K2.ⓑ{I}V → G ⊢ ⋕⬊*[h, g, #i, d] L2. +#h #g #I #G #K1 #V #i #d #Hdi #H @(csx_ind_alt … H) -V +#V0 #_ #IHV0 #K2 #H @(llsx_ind … H) -K2 +#K0 #HK0 #IHK0 #HK10 #L0 #HLK0 @llsx_intro +#L2 #HL02 #HnL02 elim (llpx_inv_lref_ge_sn … HL02 … HLK0) // -HL02 +#K2 #V2 #HLK2 #HK02 #HV02 elim (eq_term_dec V0 V2) +#HnV02 destruct [ -IHV0 -HV02 -HK0 | -IHK0 -HnL02 -HLK0 ] +[ /4 width=7 by llpxs_strap1, lleq_lref/ +| lapply (llpx_cpx_conf … HV02 … HK02) -HK02 #HK02 + @(IHV0 … HnV02 … HLK2) -IHV0 -HnV02 -HLK2 + /3 width=3 by llsx_cpx_trans_O, llpxs_cpx_conf_dx, llsx_llpx_trans, llpxs_cpx_trans, llpxs_strap1/ +] +qed. + +lemma llsx_lref_be: ∀h,g,I,G,K,V,i,d. d ≤ yinj i → ⦃G, K⦄ ⊢ ⬊*[h, g] V → + G ⊢ ⋕⬊*[h, g, V, 0] K → + ∀L. ⇩[i] L ≡ K.ⓑ{I}V → G ⊢ ⋕⬊*[h, g, #i, d] L. +/2 width=8 by llsx_lref_be_lpxs/ qed. + +(* Main properties **********************************************************) + +theorem csx_llsx: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ ⬊*[h, g] T → ∀d. G ⊢ ⋕⬊*[h, g, T, d] L. +#h #g #G #L #T @(fqup_wf_ind_eq … G L T) -G -L -T +#Z #Y #X #IH #G #L * * // +[ #i #HG #HL #HT #H #d destruct + elim (lt_or_ge i (|L|)) /2 width=1 by llsx_lref_free/ + elim (ylt_split i d) /2 width=1 by llsx_lref_skip/ + #Hdi #Hi elim (ldrop_O1_lt … Hi) -Hi + #I #K #V #HLK lapply (csx_inv_lref_bind … HLK … H) -H + /4 width=6 by llsx_lref_be, fqup_lref/ +| #a #I #V #T #HG #HL #HT #H #d destruct + elim (csx_fwd_bind … H) -H /3 width=1 by llsx_bind/ +| #I #V #T #HG #HL #HT #H #d destruct + elim (csx_fwd_flat … H) -H /3 width=1 by llsx_flat/ +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llsx_ldrop.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llsx_ldrop.etc new file mode 100644 index 000000000..2d16e3240 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llsx_ldrop.etc @@ -0,0 +1,32 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/lleq_ldrop.ma". +include "basic_2/computation/llsx.ma". + +(* LAZY SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS *****************) + +(* Advanced properties ******************************************************) + +lemma llsx_lref_free: ∀h,g,G,L,d,i. |L| ≤ i → G ⊢ ⋕⬊*[h, g, #i, d] L. +#h #g #G #L1 #d #i #HL1 @llsx_intro +#L2 #HL12 #H elim H -H +/4 width=8 by llpx_fwd_length, lleq_free, le_repl_sn_conf_aux/ +qed. + +lemma llsx_lref_skip: ∀h,g,G,L,d,i. yinj i < d → G ⊢ ⋕⬊*[h, g, #i, d] L. +#h #g #G #L1 #d #i #HL1 @llsx_intro +#L2 #HL12 #H elim H -H +/3 width=6 by llpx_fwd_length, lleq_skip/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llsx_llpx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llsx_llpx.etc new file mode 100644 index 000000000..9392afba2 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llsx_llpx.etc @@ -0,0 +1,27 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/lleq_lleq.ma". +include "basic_2/reduction/llpx_lleq.ma". +include "basic_2/computation/llsx.ma". + +(* SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS **********************) + +(* Advanced properties ******************************************************) + +lemma llsx_llpx_trans: ∀h,g,G,L1,T,d. G ⊢ ⋕⬊*[h, g, T, d] L1 → + ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2 → G ⊢ ⋕⬊*[h, g, T, d] L2. +#h #g #G #L1 #T #d #H @(llsx_ind … H) -L1 #L1 #HL1 #IHL1 #L2 #HL12 @llsx_intro +elim (lleq_dec T L1 L2 d) /4 width=4 by lleq_llpx_trans, lleq_canc_sn/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llsx_llpxs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llsx_llpxs.etc new file mode 100644 index 000000000..af37a372f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx/llsx_llpxs.etc @@ -0,0 +1,66 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/llpxs_llpxs.ma". +include "basic_2/computation/llsx_alt.ma". + +(* SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS **********************) + +(* Advanced properties ******************************************************) + +fact llsx_bind_llpxs_aux: ∀h,g,a,I,G,L1,V,d. G ⊢ ⋕⬊*[h, g, V, d] L1 → + ∀Y,T. G ⊢ ⋕⬊*[h, g, T, ⫯d] Y → + ∀L2. Y = L2.ⓑ{I}V → ⦃G, L1⦄ ⊢ ➡*[h, g, ⓑ{a,I}V.T, d] L2 → + G ⊢ ⋕⬊*[h, g, ⓑ{a,I}V.T, d] L2. +#h #g #a #I #G #L1 #V #d #H @(llsx_ind_alt … H) -L1 +#L1 #HL1 #IHL1 #Y #T #H @(llsx_ind_alt … H) -Y +#Y #HY #IHY #L2 #H #HL12 destruct @llsx_intro_alt +#L0 #HL20 lapply (llpxs_fwd_bind_dx … HL20) +lapply (llpxs_trans … HL12 … HL20) +#HL10 #HT #H elim (nlleq_inv_bind … H) -H [ -HL1 -IHY | -HY -IHL1 ] +[ #HnV elim (lleq_dec V L1 L2 d) + [ -HL20 #HV @(IHL1 … L0) + /3 width=4 by llsx_llpxs_trans, llpxs_fwd_bind_sn, lleq_canc_sn/ (**) (* full auto too slow *) + | -HnV -HL10 + /3 width=4 by llsx_llpxs_trans, llpxs_fwd_bind_sn/ + ] +| /3 width=4 by/ +] +qed-. + +lemma llsx_bind: ∀h,g,a,I,G,L,V,d. G ⊢ ⋕⬊*[h, g, V, d] L → + ∀T. G ⊢ ⋕⬊*[h, g, T, ⫯d] L.ⓑ{I}V → + G ⊢ ⋕⬊*[h, g, ⓑ{a,I}V.T, d] L. +/2 width=3 by llsx_bind_llpxs_aux/ qed. + +lemma llsx_flat_llpxs: ∀h,g,I,G,L1,V,d. G ⊢ ⋕⬊*[h, g, V, d] L1 → + ∀L2,T. G ⊢ ⋕⬊*[h, g, T, d] L2 → ⦃G, L1⦄ ⊢ ➡*[h, g, ⓕ{I}V.T, d] L2 → + G ⊢ ⋕⬊*[h, g, ⓕ{I}V.T, d] L2. +#h #g #I #G #L1 #V #d #H @(llsx_ind_alt … H) -L1 +#L1 #HL1 #IHL1 #L2 #T #H @(llsx_ind_alt … H) -L2 +#L2 #HL2 #IHL2 #HL12 @llsx_intro_alt +#L0 #HL20 lapply (llpxs_fwd_flat_dx … HL20) +lapply (llpxs_trans … HL12 … HL20) +#HL10 #HT #H elim (nlleq_inv_flat … H) -H [ -HL1 -IHL2 | -HL2 -IHL1 ] +[ #HnV elim (lleq_dec V L1 L2 d) + [ #HV @(IHL1 … L0) /3 width=3 by llsx_llpxs_trans, llpxs_fwd_flat_sn, lleq_canc_sn/ (**) (* full auto too slow: 47s *) + | -HnV -HL10 /3 width=4 by llsx_llpxs_trans, llpxs_fwd_flat_sn/ + ] +| /3 width=1 by/ +] +qed-. + +lemma llsx_flat: ∀h,g,I,G,L,V,d. G ⊢ ⋕⬊*[h, g, V, d] L → + ∀T. G ⊢ ⋕⬊*[h, g, T, d] L → G ⊢ ⋕⬊*[h, g, ⓕ{I}V.T, d] L. +/2 width=3 by llsx_flat_llpxs/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx_sn/llpx_sn_tc.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx_sn/llpx_sn_tc.etc new file mode 100644 index 000000000..682b48c68 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx_sn/llpx_sn_tc.etc @@ -0,0 +1,160 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/ldrop_leq.ma". +include "basic_2/relocation/llpx_sn.ma". + +(* LAZY SN POINTWISE EXTENSION OF A CONTEXT-SENSITIVE REALTION FOR TERMS ****) + +definition TC_llpx_sn_confluent1: relation (relation3 lenv term term) ≝ λS,R. + ∀Ls,T1,T2. S Ls T1 T2 → + ∀Ld. TC … (llpx_sn R 0 T1) Ls Ld → TC … (llpx_sn R 0 T2) Ls Ld. + +lemma TC_llpx_sn_s_confluent: ∀S,R. (llpx_sn_confluent1 S R) → TC_llpx_sn_confluent1 S R. +#S #R #HSR #Ls #T1 #T2 #HT12 #Ld #H +generalize in match HT12; -HT12 +@(TC_ind_dx … Ls H) -Ls +[ /3 width=3 by inj/ +| #Ls #L #HLs #_ #IHLd #HT12 + @(TC_strap … L) /2 width=3 by/ @IHLd -IHLd + +lemma TC_llpx_sn_lref_refl: ∀R. (∀L.reflexive … (R L)) → + ∀I,L1,K1,K2,V,d,i. d ≤ yinj i → ⇩[i] L1 ≡ K1.ⓑ{I}V → + TC lenv (llpx_sn R 0 V) K1 K2 → + ∀L2. ⇩[i] L2 ≡ K2.ⓑ{I}V → TC … (llpx_sn R d (#i)) L1 L2. +#R #HR #I #L1 #K1 #K2 #V #d #i #Hdi #HLK1 #H @(TC_star_ind … K2 H) -K2 +[ /2 width=1 by llpx_sn_refl/ +| /4 width=9 by llpx_sn_refl, llpx_sn_lref, inj/ +| #K #K2 #_ #HV #IHK1 #L2 #HLK2 lapply (ldrop_fwd_length … HLK2) + #H elim (ldrop_O1_ex (K.ⓑ{I}V) i L2) [2: normalize in H ⊢ %; >(llpx_sn_fwd_length … HV) ] + /4 width=11 by llpx_sn_lref, step/ +] +qed-. + +lemma TC_llpx_sn_lref: ∀R. (∀L.reflexive … (R L)) → (llpx_sn_confluent1 R R) → + ∀I,K1,V1,V2,d,i. d ≤ yinj i → LTC … R K1 V1 V2 → + ∀K2. TC lenv (llpx_sn R 0 V1) K1 K2 → ∀L1. ⇩[i] L1 ≡ K1.ⓑ{I}V1 → + ∀L2. ⇩[i] L2 ≡ K2.ⓑ{I}V2 → TC … (llpx_sn R d (#i)) L1 L2. +#R #H1R #H2R #I #K1 #V1 #V2 #d #i #Hdi #H @(TC_star_ind_dx … V1 H) -V1 +[ /2 width=1 by llpx_sn_refl/ +| /2 width=7 by TC_llpx_sn_lref_refl/ +| #V1 #V #HV1 #_ #IHV2 #K2 #HK12 #L1 #HLK1 #L2 #HLK2 + lapply (ldrop_fwd_length … HLK1) + #H elim (ldrop_O1_ex (K1.ⓑ{I}V) i L1) [2: normalize in H ⊢ %; // ] -H + #L #_ #HLK @(TC_strap … L) + [ @(llpx_sn_lref … HLK1 … HLK) /2 width=1 by llpx_sn_refl/ + | @(IHV2 … HLK … HLK2) + -HLK1 -HLK2 -HLK -IHV2 -Hdi @(TC_llpx_sn_s_confluent R R … HK12) // + ] +] + + +lemma llpx_sn_LTC_TC_llpx_sn: ∀R. (∀L. reflexive … (R L)) → + ∀L1,L2,T,d. llpx_sn (LTC … R) d T L1 L2 → + TC … (llpx_sn R d T) L1 L2. +#R #HR #L1 #L2 #T #d #H elim H -L1 -L2 +/3 width=3 by llpx_sn_gref, llpx_sn_free, llpx_sn_skip, llpx_sn_sort, inj/ +[ #I #L1 #L2 #K1 #K2 #V1 #V2 #d #i #Hdi #HLK1 #HLK2 #_ #HV12 #IHV1 + +(* Properties on transitive_closure *****************************************) + +lemma TC_lpx_sn_pair: ∀R. (∀L. reflexive … (R L)) → + ∀I,L1,L2. TC … (lpx_sn R) L1 L2 → + ∀V1,V2. LTC … R L1 V1 V2 → + TC … (lpx_sn R) (L1. ⓑ{I} V1) (L2. ⓑ{I} V2). +#R #HR #I #L1 #L2 #HL12 #V1 #V2 #H @(TC_star_ind_dx … V1 H) -V1 // +[ /2 width=1 by TC_lpx_sn_pair_refl/ +| /4 width=3 by TC_strap, lpx_sn_pair, lpx_sn_refl/ +] +qed-. + +lemma lpx_sn_LTC_TC_lpx_sn: ∀R. (∀L. reflexive … (R L)) → + ∀L1,L2. lpx_sn (LTC … R) L1 L2 → + TC … (lpx_sn R) L1 L2. +#R #HR #L1 #L2 #H elim H -L1 -L2 +/2 width=1 by TC_lpx_sn_pair, lpx_sn_atom, inj/ +qed-. + +(* Inversion lemmas on transitive closure ***********************************) + +lemma TC_lpx_sn_inv_atom2: ∀R,L1. TC … (lpx_sn R) L1 (⋆) → L1 = ⋆. +#R #L1 #H @(TC_ind_dx … L1 H) -L1 +[ /2 width=2 by lpx_sn_inv_atom2/ +| #L1 #L #HL1 #_ #IHL2 destruct /2 width=2 by lpx_sn_inv_atom2/ +] +qed-. + +lemma TC_lpx_sn_inv_pair2: ∀R. s_rs_trans … R (lpx_sn R) → + ∀I,L1,K2,V2. TC … (lpx_sn R) L1 (K2.ⓑ{I}V2) → + ∃∃K1,V1. TC … (lpx_sn R) K1 K2 & LTC … R K1 V1 V2 & L1 = K1. ⓑ{I} V1. +#R #HR #I #L1 #K2 #V2 #H @(TC_ind_dx … L1 H) -L1 +[ #L1 #H elim (lpx_sn_inv_pair2 … H) -H /3 width=5 by inj, ex3_2_intro/ +| #L1 #L #HL1 #_ * #K #V #HK2 #HV2 #H destruct + elim (lpx_sn_inv_pair2 … HL1) -HL1 #K1 #V1 #HK1 #HV1 #H destruct + lapply (HR … HV2 … HK1) -HR -HV2 /3 width=5 by TC_strap, ex3_2_intro/ +] +qed-. + +lemma TC_lpx_sn_ind: ∀R. s_rs_trans … R (lpx_sn R) → + ∀S:relation lenv. + S (⋆) (⋆) → ( + ∀I,K1,K2,V1,V2. + TC … (lpx_sn R) K1 K2 → LTC … R K1 V1 V2 → + S K1 K2 → S (K1.ⓑ{I}V1) (K2.ⓑ{I}V2) + ) → + ∀L2,L1. TC … (lpx_sn R) L1 L2 → S L1 L2. +#R #HR #S #IH1 #IH2 #L2 elim L2 -L2 +[ #X #H >(TC_lpx_sn_inv_atom2 … H) -X // +| #L2 #I #V2 #IHL2 #X #H + elim (TC_lpx_sn_inv_pair2 … H) // -H -HR + #L1 #V1 #HL12 #HV12 #H destruct /3 width=1 by/ +] +qed-. + +lemma TC_lpx_sn_inv_atom1: ∀R,L2. TC … (lpx_sn R) (⋆) L2 → L2 = ⋆. +#R #L2 #H elim H -L2 +[ /2 width=2 by lpx_sn_inv_atom1/ +| #L #L2 #_ #HL2 #IHL1 destruct /2 width=2 by lpx_sn_inv_atom1/ +] +qed-. + +fact TC_lpx_sn_inv_pair1_aux: ∀R. s_rs_trans … R (lpx_sn R) → + ∀L1,L2. TC … (lpx_sn R) L1 L2 → + ∀I,K1,V1. L1 = K1.ⓑ{I}V1 → + ∃∃K2,V2. TC … (lpx_sn R) K1 K2 & LTC … R K1 V1 V2 & L2 = K2. ⓑ{I} V2. +#R #HR #L1 #L2 #H @(TC_lpx_sn_ind … H) // -HR -L1 -L2 +[ #J #K #W #H destruct +| #I #L1 #L2 #V1 #V2 #HL12 #HV12 #_ #J #K #W #H destruct /2 width=5 by ex3_2_intro/ +] +qed-. + +lemma TC_lpx_sn_inv_pair1: ∀R. s_rs_trans … R (lpx_sn R) → + ∀I,K1,L2,V1. TC … (lpx_sn R) (K1.ⓑ{I}V1) L2 → + ∃∃K2,V2. TC … (lpx_sn R) K1 K2 & LTC … R K1 V1 V2 & L2 = K2. ⓑ{I} V2. +/2 width=3 by TC_lpx_sn_inv_pair1_aux/ qed-. + +lemma TC_lpx_sn_inv_lpx_sn_LTC: ∀R. s_rs_trans … R (lpx_sn R) → + ∀L1,L2. TC … (lpx_sn R) L1 L2 → + lpx_sn (LTC … R) L1 L2. +/3 width=4 by TC_lpx_sn_ind, lpx_sn_pair/ qed-. + +(* Forward lemmas on transitive closure *************************************) + +lemma TC_lpx_sn_fwd_length: ∀R,L1,L2. TC … (lpx_sn R) L1 L2 → |L1| = |L2|. +#R #L1 #L2 #H elim H -L2 +[ #L2 #HL12 >(lpx_sn_fwd_length … HL12) -HL12 // +| #L #L2 #_ #HL2 #IHL1 + >IHL1 -L1 >(lpx_sn_fwd_length … HL2) -HL2 // +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx_sn/lpx_conj.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx_sn/lpx_conj.etc new file mode 100644 index 000000000..5950f1b92 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpx_sn/lpx_conj.etc @@ -0,0 +1,120 @@ +include "basic_2/relocation/lleq_alt.ma". +include "basic_2/reduction/cpx_lleq.ma". +include "basic_2/reduction/lpx_lleq.ma". + +lemma not_ex_to_all_not: ∀A:Type[0]. ∀R:predicate A. + ((∃a. R a)→⊥) → (∀a. R a → ⊥). +/3 width=2 by ex_intro/ qed-. + +lemma lt_repl_sn_trans_tw: ∀L1,L2,T1,T2. ♯{L1, T1} < ♯{L2, T2} → + ∀U1. ♯{U1} = ♯{T1} → ♯{L1, U1} < ♯{L2, T2}. +normalize in ⊢ (?→?→?→?→?%%→?→?→?%%); // +qed-. + +axiom cpx_fwd_lift1: ∀h,g,G,L,U1,U2. ⦃G, L⦄ ⊢ U1 ➡[h, g] U2 → + ∀T1,d,e. ⇧[d, e] T1 ≡ U1 → ∃T2. ⇧[d, e] T2 ≡ U2. +(* +#h #g #G #L #U1 #U2 #H elim H -G -L -U1 -U2 +[ * #i #G #L #T1 #d #e #H + [ lapply (lift_inv_sort2 … H) -H #H destruct /2 width=2 by ex_intro/ + | elim (lift_inv_lref2 … H) -H * #Hid #H destruct /3 width=2 by lift_lref_ge_minus, lift_lref_lt, ex_intro/ + | lapply (lift_inv_gref2 … H) -H #H destruct /2 width=2 by ex_intro/ + ] +| #G #L #k #l #Hkl #T1 #d #e #H + lapply (lift_inv_sort2 … H) -H #H destruct /3 width=3 by ex_intro/ +| #I #G #L #K #V1 #V2 #W2 #i #HLK #HV12 #HVW2 #IHV2 #T1 #d #e #H + elim (lift_inv_lref2 … H) -H * #Hid #H destruct + [ elim (ldrop_conf_lt … HLK … HLV) -L // #L #U #HKL #HLV #HUV + elim (IHV2 … HLV … HUV) -V #U2 #HUV2 #HU2 + elim (lift_trans_le … HUV2 … HVW2) -V2 // >minus_plus plus_minus // (length_inv_zero_dx … H) -Ys /2 width=3 by ex2_intro/ +| #Id #L1d #L2d #W1d #W2d #HL12d #HW12d #HY #Hd #U2 #HU12 destruct + elim (length_inv_pos_dx … H) -H #Is #L1s #W1s #_ #H destruct + elim (is_lift_dec U1 0 1) [ -IHU1 -HW12d | -HU1 ] + [ * #T1 #HTU1 lapply (lift_fwd_tw … HTU1) #H + lapply (lleq_inv_lift_le … HU1 L1s L1d … HTU1 ?) -HU1 /2 width=1 by ldrop_drop/ + #HT1 elim (cpx_inv_lift1 … HU12 L1d … HTU1) -HU12 -HTU1 /2 width=4 by ldrop_drop/ + #T2 #HTU2 #HT12 elim (IH … HT1 … HL12d … HT12) /2 width=3 by lt_repl_sn_trans_tw/ -IH -HT1 -HT12 -H + #L2s #HL12s #HT2 @(ex2_intro … (L2s.ⓑ{Is}W1s)) + /3 width=10 by lleq_lift_le, lpx_pair, ldrop_drop/ (**) (* full auto too slow *) + | #HnU1 lapply (not_ex_to_all_not … HnU1) -HnU1 #HnU1 + elim (IHU1 … HnU1) [2,3,4: // |5,6,7,8,9,10: skip ] -HnU1 #H1 #H2 #HW1s destruct + elim (IH … HW1s … HL12d … HW12d) // #L2s #HL12s #HW2d + @(ex2_intro … (L2s.ⓑ{Id}W2d)) /3 width=3 by lleq_cpx_trans, lpx_pair/ + lapply (lleq_fwd_length … HW2d) #HL2sd -HW12d -HW1s + @lleq_intro_alt [ normalize // ] -HL2sd + #I2s #I2d #K2s #K2d #V2s #V2d #i @(nat_ind_plus … i) -i + [ #_ #_ #HLK2s #HLK2d -IH -IHU1 -HU12 -HL12s -HL12d + lapply (ldrop_inv_O2 … HLK2s) -HLK2s #H destruct + lapply (ldrop_inv_O2 … HLK2d) -HLK2d #H destruct /2 width=1 by and3_intro/ + | #i #_ #_ #HnU2 #HLK2s #HLK2d + lapply (cpx_fwd_nlift2 … HU12 … HnU2) -HU12 -HnU2 #HnU1 + lapply (ldrop_inv_drop1 … HLK2s) -HLK2s #HLK2s + lapply (ldrop_inv_drop1 … HLK2d) -HLK2d #HLK2d + elim (lpx_ldrop_trans_O1 … HL12s … HLK2s) -L2s #Y #HLK1s #H + elim (lpx_inv_pair2 … H) -H #K1s #V1s #HK12s #HV12s #H destruct + elim (lpx_ldrop_trans_O1 … HL12d … HLK2d) -L2d #Y #HLK1d #H + elim (lpx_inv_pair2 … H) -H #K1d #V1d #HK12d #HV12d #H destruct + elim (IHU1 … HnU1) [2,3,4: /2 width=2 by ldrop_drop/ | 5,6,7,8,9,10: skip ] -IHU1 -HnU1 -HLK1d + #H1 #H2 #HV1d destruct + lapply (ldrop_fwd_rfw … HLK1s) -HLK1s #H + elim (IH … HV1d … HK12d … HV12d) // -IH -HV1d -HK12d -HV12d + [ #Y #H1Y #H2Y + + + diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpc.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpc.etc new file mode 100644 index 000000000..b80b290b6 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpc.etc @@ -0,0 +1,41 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( ⦃ term 46 L1 ⦄ ⬌ ⬌ break ⦃ term 46 L2 ⦄ )" + non associative with precedence 45 + for @{ 'FocalizedPConvAlt $L1 $L2 }. + +include "basic_2/reducibility/lfpr.ma". + +(* FOCALIZED PARALLEL CONVERSION ON LOCAL ENVIRONMENTS **********************) + +definition lfpc: relation lenv ≝ + λL1,L2. ⦃L1⦄ ➡ ⦃L2⦄ ∨ ⦃L2⦄ ➡ ⦃L1⦄. + +interpretation + "focalized parallel conversion (local environment)" + 'FocalizedPConv L1 L2 = (lfpc L1 L2). + +(* Basic properties *********************************************************) + +lemma lfpc_refl: ∀L. ⦃L⦄ ⬌ ⦃L⦄. +/2 width=1/ qed. + +lemma lfpc_sym: ∀L1,L2. ⦃L1⦄ ⬌ ⦃L2⦄ → ⦃L2⦄ ⬌ ⦃L1⦄. +#L1 #L2 * /2 width=1/ +qed. + +lemma lfpc_lfpr: ∀L1,L2. ⦃L1⦄ ⬌ ⦃L2⦄ → ∃∃L. ⦃L1⦄ ➡ ⦃L⦄ & ⦃L2⦄ ➡ ⦃L⦄. +#L1 #L2 * /2 width=3/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpc_lfpc.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpc_lfpc.etc new file mode 100644 index 000000000..69e444adb --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpc_lfpc.etc @@ -0,0 +1,23 @@ +(**************************************************************************) +(* ___ *) +(* ||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/conversion/lfpc.ma". + +(* FOCALIZED PARALLEL CONVERSION ON LOCAL ENVIRONMENTS **********************) + +(* Main properties **********************************************************) + +theorem lfpc_conf: ∀L0,L1,L2. ⦃L0⦄ ⬌ ⦃L1⦄ → ⦃L0⦄ ⬌ ⦃L2⦄ → + ∃∃L. ⦃L1⦄ ⬌ ⦃L⦄ & ⦃L2⦄ ⬌ ⦃L⦄. +/3 width=3/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpcs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpcs.etc new file mode 100644 index 000000000..3674637dd --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpcs.etc @@ -0,0 +1,76 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( ⦃ term 46 L1 ⦄ ⬌ ⬌ * break ⦃ term 46 L2 ⦄ )" + non associative with precedence 45 + for @{ 'FocalizedPConvStarAlt $L1 $L2 }. + +include "basic_2/conversion/lfpc.ma". + +(* FOCALIZED PARALLEL EQUIVALENCE ON LOCAL ENVIRONMENTS *********************) + +definition lfpcs: relation lenv ≝ TC … lfpc. + +interpretation "focalized parallel equivalence (local environment)" + 'FocalizedPConvStar L1 L2 = (lfpcs L1 L2). + +(* Basic eliminators ********************************************************) + +lemma lfpcs_ind: ∀L1. ∀R:predicate lenv. R L1 → + (∀L,L2. ⦃L1⦄ ⬌* ⦃L⦄ → ⦃L⦄ ⬌ ⦃L2⦄ → R L → R L2) → + ∀L2. ⦃L1⦄ ⬌* ⦃L2⦄ → R L2. +#L1 #R #HL1 #IHL1 #L2 #HL12 @(TC_star_ind … HL1 IHL1 … HL12) // +qed-. + +lemma lfpcs_ind_dx: ∀L2. ∀R:predicate lenv. R L2 → + (∀L1,L. ⦃L1⦄ ⬌ ⦃L⦄ → ⦃L⦄ ⬌* ⦃L2⦄ → R L → R L1) → + ∀L1. ⦃L1⦄ ⬌* ⦃L2⦄ → R L1. +#L2 #R #HL2 #IHL2 #L1 #HL12 +@(TC_star_ind_dx … HL2 IHL2 … HL12) // +qed-. + +(* Basic properties *********************************************************) + +lemma lfpcs_refl: reflexive … lfpcs. +/2 width=1/ qed. + +lemma lfpcs_sym: symmetric … lfpcs. +/3 width=1/ qed. + +lemma lfpc_lfpcs: ∀L1,L2. ⦃L1⦄ ⬌ ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +/2 width=1/ qed. + +lemma lfpcs_strap1: ∀L1,L,L2. ⦃L1⦄ ⬌* ⦃L⦄ → ⦃L⦄ ⬌ ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +/2 width=3/ qed. + +lemma lfpcs_strap2: ∀L1,L,L2. ⦃L1⦄ ⬌ ⦃L⦄ → ⦃L⦄ ⬌* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +/2 width=3/ qed. + +lemma lfpcs_lfpr_dx: ∀L1,L2. ⦃L1⦄ ➡ ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +/3 width=1/ qed. + +lemma lfpcs_lfpr_sn: ∀L1,L2. ⦃L2⦄ ➡ ⦃L1⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +/3 width=1/ qed. + +lemma lfpcs_lfpr_strap1: ∀L1,L. ⦃L1⦄ ⬌* ⦃L⦄ → ∀L2. ⦃L⦄ ➡ ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +/3 width=3/ qed. + +lemma lfpcs_lfpr_strap2: ∀L1,L. ⦃L1⦄ ➡ ⦃L⦄ → ∀L2. ⦃L⦄ ⬌* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +/3 width=3/ qed. + +lemma lfpcs_lfpr_div: ∀L1,L. ⦃L1⦄ ⬌* ⦃L⦄ → ∀L2. ⦃L2⦄ ➡ ⦃L⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +/3 width=3/ qed. + +lemma lfpcs_lfpr_conf: ∀L1,L. ⦃L⦄ ➡ ⦃L1⦄ → ∀L2. ⦃L⦄ ⬌* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +/3 width=3/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpcs_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpcs_aaa.etc new file mode 100644 index 000000000..b7cea0b7a --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpcs_aaa.etc @@ -0,0 +1,30 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/lfprs_aaa.ma". +include "basic_2/equivalence/lfpcs_lfpcs.ma". + +(* FOCALIZED PARALLEL EQUIVALENCE ON LOCAL ENVIRONMENTS *********************) + +(* Main properties about atomic arity assignment on terms *******************) + +theorem aaa_lfpcs_mono: ∀L1,L2. ⦃L1⦄ ⬌* ⦃L2⦄ → + ∀T,A1. L1 ⊢ T ⁝ A1 → ∀A2. L2 ⊢ T ⁝ A2 → + A1 = A2. +#L1 #L2 #HL12 #T #A1 #HT1 #A2 #HT2 +elim (lfpcs_inv_lfprs … HL12) -HL12 #L #HL1 #HL2 +lapply (aaa_lfprs_conf … HT1 … HL1) -L1 #HT1 +lapply (aaa_lfprs_conf … HT2 … HL2) -L2 #HT2 +lapply (aaa_mono … HT1 … HT2) -L -T // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpcs_fpcs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpcs_fpcs.etc new file mode 100644 index 000000000..8f3688890 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpcs_fpcs.etc @@ -0,0 +1,52 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/fprs_cprs.ma". +include "basic_2/computation/lfprs_fprs.ma". +include "basic_2/equivalence/fpcs_fpcs.ma". +include "basic_2/equivalence/lfpcs_lfpcs.ma". + +(* FOCALIZED PARALLEL EQUIVALENCE ON LOCAL ENVIRONMENTS *********************) + +(* Inversion lemmas on context-free parallel equivalence for closures *******) + +lemma lfpcs_inv_fpcs: ∀L1,L2. ⦃L1⦄ ⬌* ⦃L2⦄ → ∀T. ⦃L1, T⦄ ⬌* ⦃L2, T⦄. +#L1 #L2 #HL12 #T +elim (lfpcs_inv_lfprs … HL12) -HL12 #L #HL1 #HL2 +lapply (lfprs_inv_fprs … HL1 T) -HL1 +lapply (lfprs_inv_fprs … HL2 T) -HL2 /2 width=4/ +qed-. + +(* Properties on context-free parallel equivalence for closures *************) + +lemma fpcs_lfpcs: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⬌* ⦃L2, T2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +#L1 #L2 #T1 #T2 #HT12 +elim (fpcs_inv_fprs … HT12) -HT12 /3 width=5 by fprs_lfprs, lfprs_div/ (**) (* auto too slow without trace *) +qed. + +lemma fpcs_lift: ∀K1,K2,T1,T2. ⦃K1, T1⦄ ⬌* ⦃K2, T2⦄ → + ∀L1,L2. ⦃L1⦄ ⬌* ⦃L2⦄ → + ∀d,e. ⇩[d, e] L1 ≡ K1 → ⇩[d, e] L2 ≡ K2 → + ∀U1,U2. ⇧[d, e] T1 ≡ U1 → ⇧[d, e] T2 ≡ U2 → + ⦃L1, U1⦄ ⬌* ⦃L2, U2⦄. +#K1 #K2 #T1 #T2 #HT12 #L1 #L2 #HL12 #d #e #HLK1 #HLK2 #U1 #U2 #HTU1 #HTU2 +elim (fpcs_inv_fprs … HT12) -HT12 #K #T #HT1 #HT2 +elim (lift_total T d e) #U #HTU +elim (fprs_lift … HT1 … HLK1 … HTU1 HTU) -K1 -T1 #K1 #HU1 #_ +elim (fprs_lift … HT2 … HLK2 … HTU2 HTU) -K2 -T2 -T #K2 #HU2 #_ -K -d -e +lapply (lfpcs_lfprs_conf K1 … HL12) -HL12 /2 width=3/ #H +lapply (lfpcs_lfprs_strap1 … H K2 ?) -H /2 width=3/ #HK12 +lapply (lfpcs_inv_fpcs … HK12 U) -HK12 #HU +/3 width=4 by fpcs_fprs_strap2, fpcs_fprs_div/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpcs_lfpcs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpcs_lfpcs.etc new file mode 100644 index 000000000..1e9521736 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpcs_lfpcs.etc @@ -0,0 +1,50 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/lfprs_lfprs.ma". +include "basic_2/conversion/lfpc_lfpc.ma". +include "basic_2/equivalence/lfpcs_lfprs.ma". + +(* FOCALIZED PARALLEL EQUIVALENCE ON LOCAL ENVIRONMENTS *********************) + +(* Advanced inversion lemmas ************************************************) + +lemma lfpcs_inv_lfprs: ∀L1,L2. ⦃L1⦄ ⬌* ⦃L2⦄ → + ∃∃L. ⦃L1⦄ ➡* ⦃L⦄ & ⦃L2⦄ ➡* ⦃L⦄. +#L1 #L2 #H @(lfpcs_ind … H) -L2 +[ /3 width=3/ +| #L #L2 #_ #HL2 * #L0 #HL10 elim HL2 -HL2 #HL2 #HL0 + [ elim (lfprs_strip … HL0 … HL2) -L #L #HL0 #HL2 + lapply (lfprs_strap1 … HL10 … HL0) -L0 /2 width=3/ + | lapply (lfprs_strap2 … HL2 … HL0) -L /2 width=3/ + ] +] +qed-. + +(* Advanced properties ******************************************************) + +lemma lfpcs_strip: ∀L,L1. ⦃L⦄ ⬌* ⦃L1⦄ → ∀L2. ⦃L⦄ ⬌ ⦃L2⦄ → + ∃∃L0. ⦃L1⦄ ⬌ ⦃L0⦄ & ⦃L2⦄ ⬌* ⦃L0⦄. +/3 width=3/ qed. + +(* Main properties **********************************************************) + +theorem lfpcs_trans: ∀L1,L. ⦃L1⦄ ⬌* ⦃L⦄ → ∀L2. ⦃L⦄ ⬌* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +/2 width=3/ qed. + +theorem lfpcs_canc_sn: ∀L,L1,L2. ⦃L⦄ ⬌* ⦃L1⦄ → ⦃L⦄ ⬌* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +/3 width=3 by lfpcs_trans, lfpcs_sym/ qed. + +theorem lfpcs_canc_dx: ∀L,L1,L2. ⦃L1⦄ ⬌* ⦃L⦄ → ⦃L2⦄ ⬌* ⦃L⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +/3 width=3 by lfpcs_trans, lfpcs_sym/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpcs_lfprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpcs_lfprs.etc new file mode 100644 index 000000000..baf2caf27 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpc/lfpcs_lfprs.etc @@ -0,0 +1,48 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/lfprs.ma". +include "basic_2/equivalence/lfpcs.ma". + +(* FOCALIZED PARALLEL EQUIVALENCE ON LOCAL ENVIRONMENTS *********************) + +(* Properties on focalized computation for local environments ***************) + +lemma lfpcs_lfprs_dx: ∀L1,L2. ⦃L1⦄ ➡* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +#L1 #L2 #H @(lfprs_ind … H) -L2 /width=1/ /3 width=3/ +qed. + +lemma lfpcs_lfprs_sn: ∀L1,L2. ⦃L2⦄ ➡* ⦃L1⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +#L1 #L2 #H @(lfprs_ind_dx … H) -L2 /width=1/ /3 width=3/ +qed. + +lemma lfpcs_lfprs_strap1: ∀L1,L. ⦃L1⦄ ⬌* ⦃L⦄ → ∀L2. ⦃L⦄ ➡* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +#L1 #L #HL1 #L2 #H @(lfprs_ind … H) -L2 /width=1/ /2 width=3/ +qed. + +lemma lfpcs_lfprs_strap2: ∀L1,L. ⦃L1⦄ ➡* ⦃L⦄ → ∀L2. ⦃L⦄ ⬌* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +#L1 #L #H #L2 #HL2 @(lfprs_ind_dx … H) -L1 /width=1/ /2 width=3/ +qed. + +lemma lfpcs_lfprs_div: ∀L1,L. ⦃L1⦄ ⬌* ⦃L⦄ → ∀L2. ⦃L2⦄ ➡* ⦃L⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +#L1 #L #HL1 #L2 #H @(lfprs_ind_dx … H) -L2 /width=1/ /2 width=3/ +qed. + +lemma lfpcs_lfprs_conf: ∀L1,L. ⦃L⦄ ➡* ⦃L1⦄ → ∀L2. ⦃L⦄ ⬌* ⦃L2⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +#L1 #L #H #L2 #HL2 @(lfprs_ind … H) -L1 /width=1/ /2 width=3/ +qed. + +lemma lfprs_div: ∀L1,L. ⦃L1⦄ ➡* ⦃L⦄ → ∀L2. ⦃L2⦄ ➡* ⦃L⦄ → ⦃L1⦄ ⬌* ⦃L2⦄. +#L1 #L #HL1 #L2 #H @(lfprs_ind_dx … H) -L2 /2 width=1/ /2 width=3/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/cpr_llpx_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/cpr_llpx_sn.etc new file mode 100644 index 000000000..4db858798 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/cpr_llpx_sn.etc @@ -0,0 +1,49 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/llpx_sn_ldrop.ma". +include "basic_2/reduction/cpr.ma". + +(* CONTEXT-SENSITIVE PARALLEL REDUCTION FOR TERMS ***************************) + +(* Properties on lazy sn pointwise extensions *******************************) + +lemma cpr_llpx_sn_conf: ∀R. (∀I,L.reflexive … (R I L)) → + (∀I.l_liftable (R I)) → + (∀I.l_deliftable_sn (R I)) → + ∀G. s_r_confluent1 … (cpr G) (llpx_sn R 0). +#R #H1R #H2R #H3R #G #Ls #T1 #T2 #H elim H -G -Ls -T1 -T2 +[ // +| #G #Ls #Ks #V1s #V2s #W2s #i #HLKs #_ #HVW2s #IHV12s #Ld #H elim (llpx_sn_inv_lref_ge_sn … H … HLKs) // -H + #Kd #V1d #HLKd #HV1s #HV1sd + lapply (ldrop_fwd_drop2 … HLKs) -HLKs #HLKs + lapply (ldrop_fwd_drop2 … HLKd) -HLKd #HLKd + @(llpx_sn_lift_le … HLKs HLKd … HVW2s) -HLKs -HLKd -HVW2s /2 width=1 by/ (**) (* full auto too slow *) +| #a #I #G #Ls #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #Ld #H elim (llpx_sn_inv_bind_O … H) -H + /4 width=5 by llpx_sn_bind_repl_SO, llpx_sn_bind/ +| #I #G #Ls #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H + /3 width=1 by llpx_sn_flat/ +| #G #Ls #V #T1 #T2 #T #_ #HT2 #IHT12 #Ld #H elim (llpx_sn_inv_bind_O … H) -H + /3 width=10 by llpx_sn_inv_lift_le, ldrop_drop/ +| #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H /2 width=1 by/ +| #a #G #Ls #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H + #HV1 #H elim (llpx_sn_inv_bind_O … H) -H + /4 width=5 by llpx_sn_bind_repl_SO, llpx_sn_flat, llpx_sn_bind/ +| #a #G #Ls #V1 #V2 #V #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV12 #IHW12 #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H + #HV1 #H elim (llpx_sn_inv_bind_O … H) -H // + #HW1 #HT1 @llpx_sn_bind_O /2 width=1 by/ @llpx_sn_flat (**) (* full auto too slow *) + [ /3 width=10 by llpx_sn_lift_le, ldrop_drop/ + | /3 width=4 by llpx_sn_bind_repl_O/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/cpx_llpx_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/cpx_llpx_sn.etc new file mode 100644 index 000000000..418106494 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/cpx_llpx_sn.etc @@ -0,0 +1,52 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/llpx_sn_ldrop.ma". +include "basic_2/reduction/cpx.ma". + +(* CONTEXT-SENSITIVE EXTENDED PARALLEL REDUCTION FOR TERMS ******************) + +(* Properties on lazy sn pointwise extensions *******************************) + +(* Note: lemma 1000 *) +lemma cpx_llpx_sn_conf: ∀R. (∀I,L.reflexive … (R I L)) → + (∀I.l_liftable (R I)) → + (∀I.l_deliftable_sn (R I)) → + ∀h,g,G. s_r_confluent1 … (cpx h g G) (llpx_sn R 0). +#R #H1R #H2R #H3R #h #g #G #Ls #T1 #T2 #H elim H -G -Ls -T1 -T2 +[ // +| /3 width=4 by llpx_sn_fwd_length, llpx_sn_sort/ +| #I #G #Ls #Ks #V1s #V2s #W2s #i #HLKs #_ #HVW2s #IHV12s #Ld #H elim (llpx_sn_inv_lref_ge_sn … H … HLKs) // -H + #Kd #V1d #HLKd #HV1s #HV1sd + lapply (ldrop_fwd_drop2 … HLKs) -HLKs #HLKs + lapply (ldrop_fwd_drop2 … HLKd) -HLKd #HLKd + @(llpx_sn_lift_le … HLKs HLKd … HVW2s) -HLKs -HLKd -HVW2s /2 width=1 by/ (**) (* full auto too slow *) +| #a #I #G #Ls #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #Ld #H elim (llpx_sn_inv_bind_O … H) -H + /4 width=5 by llpx_sn_bind_repl_SO, llpx_sn_bind/ +| #I #G #Ls #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H + /3 width=1 by llpx_sn_flat/ +| #G #Ls #V #T1 #T2 #T #_ #HT2 #IHT12 #Ld #H elim (llpx_sn_inv_bind_O … H) -H + /3 width=10 by llpx_sn_inv_lift_le, ldrop_drop/ +| #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H /2 width=1 by/ +| #G #Ls #V1 #V2 #T #_ #IHV12 #Ld #H elim (llpx_sn_inv_flat … H) -H /2 width=1 by/ +| #a #G #Ls #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H + #HV1 #H elim (llpx_sn_inv_bind_O … H) -H + /4 width=5 by llpx_sn_bind_repl_SO, llpx_sn_flat, llpx_sn_bind/ +| #a #G #Ls #V1 #V2 #V #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV12 #IHW12 #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H + #HV1 #H elim (llpx_sn_inv_bind_O … H) -H // + #HW1 #HT1 @llpx_sn_bind_O /2 width=1 by/ @llpx_sn_flat (**) (* full auto too slow *) + [ /3 width=10 by llpx_sn_lift_le, ldrop_drop/ + | /3 width=4 by llpx_sn_bind_repl_O/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/lleq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/lleq.etc new file mode 100644 index 000000000..dc138a492 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/lleq.etc @@ -0,0 +1,160 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/lazyeq_4.ma". +include "basic_2/substitution/llpx_sn.ma". + +(* LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **********************************) + +definition ceq: relation4 bind2 lenv term term ≝ λI,L,T1,T2. T1 = T2. + +definition lleq: relation4 ynat term lenv lenv ≝ llpx_sn ceq. + +interpretation + "lazy equivalence (local environment)" + 'LazyEq T d L1 L2 = (lleq d T L1 L2). + +definition lleq_transitive: predicate (relation4 bind2 lenv term term) ≝ + λR. ∀I,L2,T1,T2. R I L2 T1 T2 → ∀L1. L1 ≡[T1, 0] L2 → R I L1 T1 T2. + +(* Basic inversion lemmas ***************************************************) + +lemma lleq_ind: ∀R:relation4 ynat term lenv lenv. ( + ∀L1,L2,d,k. |L1| = |L2| → R d (⋆k) L1 L2 + ) → ( + ∀L1,L2,d,i. |L1| = |L2| → yinj i < d → R d (#i) L1 L2 + ) → ( + ∀I,L1,L2,K1,K2,V,d,i. d ≤ yinj i → + ⇩[i] L1 ≡ K1.ⓑ{I}V → ⇩[i] L2 ≡ K2.ⓑ{I}V → + K1 ≡[V, yinj O] K2 → R (yinj O) V K1 K2 → R d (#i) L1 L2 + ) → ( + ∀L1,L2,d,i. |L1| = |L2| → |L1| ≤ i → |L2| ≤ i → R d (#i) L1 L2 + ) → ( + ∀L1,L2,d,p. |L1| = |L2| → R d (§p) L1 L2 + ) → ( + ∀a,I,L1,L2,V,T,d. + L1 ≡[V, d]L2 → L1.ⓑ{I}V ≡[T, ⫯d] L2.ⓑ{I}V → + R d V L1 L2 → R (⫯d) T (L1.ⓑ{I}V) (L2.ⓑ{I}V) → R d (ⓑ{a,I}V.T) L1 L2 + ) → ( + ∀I,L1,L2,V,T,d. + L1 ≡[V, d]L2 → L1 ≡[T, d] L2 → + R d V L1 L2 → R d T L1 L2 → R d (ⓕ{I}V.T) L1 L2 + ) → + ∀d,T,L1,L2. L1 ≡[T, d] L2 → R d T L1 L2. +#R #H1 #H2 #H3 #H4 #H5 #H6 #H7 #d #T #L1 #L2 #H elim H -L1 -L2 -T -d /2 width=8 by/ +qed-. + +lemma lleq_inv_bind: ∀a,I,L1,L2,V,T,d. L1 ≡[ⓑ{a,I}V.T, d] L2 → + L1 ≡[V, d] L2 ∧ L1.ⓑ{I}V ≡[T, ⫯d] L2.ⓑ{I}V. +/2 width=2 by llpx_sn_inv_bind/ qed-. + +lemma lleq_inv_flat: ∀I,L1,L2,V,T,d. L1 ≡[ⓕ{I}V.T, d] L2 → + L1 ≡[V, d] L2 ∧ L1 ≡[T, d] L2. +/2 width=2 by llpx_sn_inv_flat/ qed-. + +(* Basic forward lemmas *****************************************************) + +lemma lleq_fwd_length: ∀L1,L2,T,d. L1 ≡[T, d] L2 → |L1| = |L2|. +/2 width=4 by llpx_sn_fwd_length/ qed-. + +lemma lleq_fwd_lref: ∀L1,L2,d,i. L1 ≡[#i, d] L2 → + ∨∨ |L1| ≤ i ∧ |L2| ≤ i + | yinj i < d + | ∃∃I,K1,K2,V. ⇩[i] L1 ≡ K1.ⓑ{I}V & + ⇩[i] L2 ≡ K2.ⓑ{I}V & + K1 ≡[V, yinj 0] K2 & d ≤ yinj i. +#L1 #L2 #d #i #H elim (llpx_sn_fwd_lref … H) /2 width=1/ +* /3 width=7 by or3_intro2, ex4_4_intro/ +qed-. + +lemma lleq_fwd_ldrop_sn: ∀L1,L2,T,d. L1 ≡[d, T] L2 → ∀K1,i. ⇩[i] L1 ≡ K1 → + ∃K2. ⇩[i] L2 ≡ K2. +/2 width=7 by llpx_sn_fwd_ldrop_sn/ qed-. + +lemma lleq_fwd_ldrop_dx: ∀L1,L2,T,d. L1 ≡[d, T] L2 → ∀K2,i. ⇩[i] L2 ≡ K2 → + ∃K1. ⇩[i] L1 ≡ K1. +/2 width=7 by llpx_sn_fwd_ldrop_dx/ qed-. + +lemma lleq_fwd_bind_sn: ∀a,I,L1,L2,V,T,d. + L1 ≡[ⓑ{a,I}V.T, d] L2 → L1 ≡[V, d] L2. +/2 width=4 by llpx_sn_fwd_bind_sn/ qed-. + +lemma lleq_fwd_bind_dx: ∀a,I,L1,L2,V,T,d. + L1 ≡[ⓑ{a,I}V.T, d] L2 → L1.ⓑ{I}V ≡[T, ⫯d] L2.ⓑ{I}V. +/2 width=2 by llpx_sn_fwd_bind_dx/ qed-. + +lemma lleq_fwd_flat_sn: ∀I,L1,L2,V,T,d. + L1 ≡[ⓕ{I}V.T, d] L2 → L1 ≡[V, d] L2. +/2 width=3 by llpx_sn_fwd_flat_sn/ qed-. + +lemma lleq_fwd_flat_dx: ∀I,L1,L2,V,T,d. + L1 ≡[ⓕ{I}V.T, d] L2 → L1 ≡[T, d] L2. +/2 width=3 by llpx_sn_fwd_flat_dx/ qed-. + +(* Basic properties *********************************************************) + +lemma lleq_sort: ∀L1,L2,d,k. |L1| = |L2| → L1 ≡[⋆k, d] L2. +/2 width=1 by llpx_sn_sort/ qed. + +lemma lleq_skip: ∀L1,L2,d,i. yinj i < d → |L1| = |L2| → L1 ≡[#i, d] L2. +/2 width=1 by llpx_sn_skip/ qed. + +lemma lleq_lref: ∀I,L1,L2,K1,K2,V,d,i. d ≤ yinj i → + ⇩[i] L1 ≡ K1.ⓑ{I}V → ⇩[i] L2 ≡ K2.ⓑ{I}V → + K1 ≡[V, 0] K2 → L1 ≡[#i, d] L2. +/2 width=9 by llpx_sn_lref/ qed. + +lemma lleq_free: ∀L1,L2,d,i. |L1| ≤ i → |L2| ≤ i → |L1| = |L2| → L1 ≡[#i, d] L2. +/2 width=1 by llpx_sn_free/ qed. + +lemma lleq_gref: ∀L1,L2,d,p. |L1| = |L2| → L1 ≡[§p, d] L2. +/2 width=1 by llpx_sn_gref/ qed. + +lemma lleq_bind: ∀a,I,L1,L2,V,T,d. + L1 ≡[V, d] L2 → L1.ⓑ{I}V ≡[T, ⫯d] L2.ⓑ{I}V → + L1 ≡[ⓑ{a,I}V.T, d] L2. +/2 width=1 by llpx_sn_bind/ qed. + +lemma lleq_flat: ∀I,L1,L2,V,T,d. + L1 ≡[V, d] L2 → L1 ≡[T, d] L2 → L1 ≡[ⓕ{I}V.T, d] L2. +/2 width=1 by llpx_sn_flat/ qed. + +lemma lleq_refl: ∀d,T. reflexive … (lleq d T). +/2 width=1 by llpx_sn_refl/ qed. + +lemma lleq_Y: ∀L1,L2,T. |L1| = |L2| → L1 ≡[T, ∞] L2. +/2 width=1 by llpx_sn_Y/ qed. + +lemma lleq_sym: ∀d,T. symmetric … (lleq d T). +#d #T #L1 #L2 #H @(lleq_ind … H) -d -T -L1 -L2 +/2 width=7 by lleq_sort, lleq_skip, lleq_lref, lleq_free, lleq_gref, lleq_bind, lleq_flat/ +qed-. + +lemma lleq_ge_up: ∀L1,L2,U,dt. L1 ≡[U, dt] L2 → + ∀T,d,e. ⇧[d, e] T ≡ U → + dt ≤ d + e → L1 ≡[U, d] L2. +/2 width=6 by llpx_sn_ge_up/ qed-. + +lemma lleq_ge: ∀L1,L2,T,d1. L1 ≡[T, d1] L2 → ∀d2. d1 ≤ d2 → L1 ≡[T, d2] L2. +/2 width=3 by llpx_sn_ge/ qed-. + +lemma lleq_bind_O: ∀a,I,L1,L2,V,T. L1 ≡[V, 0] L2 → L1.ⓑ{I}V ≡[T, 0] L2.ⓑ{I}V → + L1 ≡[ⓑ{a,I}V.T, 0] L2. +/2 width=1 by llpx_sn_bind_O/ qed-. + +(* Advancded properties on lazy pointwise exyensions ************************) + +lemma llpx_sn_lrefl: ∀R. (∀I,L. reflexive … (R I L)) → + ∀L1,L2,T,d. L1 ≡[T, d] L2 → llpx_sn R d T L1 L2. +/2 width=3 by llpx_sn_co/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/llpx_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/llpx_sn.etc new file mode 100644 index 000000000..918b42605 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/llpx_sn.etc @@ -0,0 +1,209 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "ground_2/ynat/ynat_plus.ma". +include "basic_2/relocation/ldrop.ma". + +(* LAZY SN POINTWISE EXTENSION OF A CONTEXT-SENSITIVE REALTION FOR TERMS ****) + +inductive llpx_sn (R:relation4 bind2 lenv term term): relation4 ynat term lenv lenv ≝ +| llpx_sn_sort: ∀L1,L2,d,k. |L1| = |L2| → llpx_sn R d (⋆k) L1 L2 +| llpx_sn_skip: ∀L1,L2,d,i. |L1| = |L2| → yinj i < d → llpx_sn R d (#i) L1 L2 +| llpx_sn_lref: ∀I,L1,L2,K1,K2,V1,V2,d,i. d ≤ yinj i → + ⇩[i] L1 ≡ K1.ⓑ{I}V1 → ⇩[i] L2 ≡ K2.ⓑ{I}V2 → + llpx_sn R (yinj 0) V1 K1 K2 → R I K1 V1 V2 → llpx_sn R d (#i) L1 L2 +| llpx_sn_free: ∀L1,L2,d,i. |L1| ≤ i → |L2| ≤ i → |L1| = |L2| → llpx_sn R d (#i) L1 L2 +| llpx_sn_gref: ∀L1,L2,d,p. |L1| = |L2| → llpx_sn R d (§p) L1 L2 +| llpx_sn_bind: ∀a,I,L1,L2,V,T,d. + llpx_sn R d V L1 L2 → llpx_sn R (⫯d) T (L1.ⓑ{I}V) (L2.ⓑ{I}V) → + llpx_sn R d (ⓑ{a,I}V.T) L1 L2 +| llpx_sn_flat: ∀I,L1,L2,V,T,d. + llpx_sn R d V L1 L2 → llpx_sn R d T L1 L2 → llpx_sn R d (ⓕ{I}V.T) L1 L2 +. + +(* Basic inversion lemmas ***************************************************) + +fact llpx_sn_inv_bind_aux: ∀R,L1,L2,X,d. llpx_sn R d X L1 L2 → + ∀a,I,V,T. X = ⓑ{a,I}V.T → + llpx_sn R d V L1 L2 ∧ llpx_sn R (⫯d) T (L1.ⓑ{I}V) (L2.ⓑ{I}V). +#R #L1 #L2 #X #d * -L1 -L2 -X -d +[ #L1 #L2 #d #k #_ #b #J #W #U #H destruct +| #L1 #L2 #d #i #_ #_ #b #J #W #U #H destruct +| #I #L1 #L2 #K1 #K2 #V1 #V2 #d #i #_ #_ #_ #_ #_ #b #J #W #U #H destruct +| #L1 #L2 #d #i #_ #_ #_ #b #J #W #U #H destruct +| #L1 #L2 #d #p #_ #b #J #W #U #H destruct +| #a #I #L1 #L2 #V #T #d #HV #HT #b #J #W #U #H destruct /2 width=1 by conj/ +| #I #L1 #L2 #V #T #d #_ #_ #b #J #W #U #H destruct +] +qed-. + +lemma llpx_sn_inv_bind: ∀R,a,I,L1,L2,V,T,d. llpx_sn R d (ⓑ{a,I}V.T) L1 L2 → + llpx_sn R d V L1 L2 ∧ llpx_sn R (⫯d) T (L1.ⓑ{I}V) (L2.ⓑ{I}V). +/2 width=4 by llpx_sn_inv_bind_aux/ qed-. + +fact llpx_sn_inv_flat_aux: ∀R,L1,L2,X,d. llpx_sn R d X L1 L2 → + ∀I,V,T. X = ⓕ{I}V.T → + llpx_sn R d V L1 L2 ∧ llpx_sn R d T L1 L2. +#R #L1 #L2 #X #d * -L1 -L2 -X -d +[ #L1 #L2 #d #k #_ #J #W #U #H destruct +| #L1 #L2 #d #i #_ #_ #J #W #U #H destruct +| #I #L1 #L2 #K1 #K2 #V1 #V2 #d #i #_ #_ #_ #_ #_ #J #W #U #H destruct +| #L1 #L2 #d #i #_ #_ #_ #J #W #U #H destruct +| #L1 #L2 #d #p #_ #J #W #U #H destruct +| #a #I #L1 #L2 #V #T #d #_ #_ #J #W #U #H destruct +| #I #L1 #L2 #V #T #d #HV #HT #J #W #U #H destruct /2 width=1 by conj/ +] +qed-. + +lemma llpx_sn_inv_flat: ∀R,I,L1,L2,V,T,d. llpx_sn R d (ⓕ{I}V.T) L1 L2 → + llpx_sn R d V L1 L2 ∧ llpx_sn R d T L1 L2. +/2 width=4 by llpx_sn_inv_flat_aux/ qed-. + +(* Basic forward lemmas *****************************************************) + +lemma llpx_sn_fwd_length: ∀R,L1,L2,T,d. llpx_sn R d T L1 L2 → |L1| = |L2|. +#R #L1 #L2 #T #d #H elim H -L1 -L2 -T -d // +#I #L1 #L2 #K1 #K2 #V1 #V2 #d #i #_ #HLK1 #HLK2 #_ #_ #HK12 +lapply (ldrop_fwd_length … HLK1) -HLK1 +lapply (ldrop_fwd_length … HLK2) -HLK2 +normalize // +qed-. + +lemma llpx_sn_fwd_ldrop_sn: ∀R,L1,L2,T,d. llpx_sn R d T L1 L2 → + ∀K1,i. ⇩[i] L1 ≡ K1 → ∃K2. ⇩[i] L2 ≡ K2. +#R #L1 #L2 #T #d #H #K1 #i #HLK1 lapply (llpx_sn_fwd_length … H) -H +#HL12 lapply (ldrop_fwd_length_le2 … HLK1) -HLK1 /2 width=1 by ldrop_O1_le/ +qed-. + +lemma llpx_sn_fwd_ldrop_dx: ∀R,L1,L2,T,d. llpx_sn R d T L1 L2 → + ∀K2,i. ⇩[i] L2 ≡ K2 → ∃K1. ⇩[i] L1 ≡ K1. +#R #L1 #L2 #T #d #H #K2 #i #HLK2 lapply (llpx_sn_fwd_length … H) -H +#HL12 lapply (ldrop_fwd_length_le2 … HLK2) -HLK2 /2 width=1 by ldrop_O1_le/ +qed-. + +fact llpx_sn_fwd_lref_aux: ∀R,L1,L2,X,d. llpx_sn R d X L1 L2 → ∀i. X = #i → + ∨∨ |L1| ≤ i ∧ |L2| ≤ i + | yinj i < d + | ∃∃I,K1,K2,V1,V2. ⇩[i] L1 ≡ K1.ⓑ{I}V1 & + ⇩[i] L2 ≡ K2.ⓑ{I}V2 & + llpx_sn R (yinj 0) V1 K1 K2 & + R I K1 V1 V2 & d ≤ yinj i. +#R #L1 #L2 #X #d * -L1 -L2 -X -d +[ #L1 #L2 #d #k #_ #j #H destruct +| #L1 #L2 #d #i #_ #Hid #j #H destruct /2 width=1 by or3_intro1/ +| #I #L1 #L2 #K1 #K2 #V1 #V2 #d #i #Hdi #HLK1 #HLK2 #HK12 #HV12 #j #H destruct + /3 width=9 by or3_intro2, ex5_5_intro/ +| #L1 #L2 #d #i #HL1 #HL2 #_ #j #H destruct /3 width=1 by or3_intro0, conj/ +| #L1 #L2 #d #p #_ #j #H destruct +| #a #I #L1 #L2 #V #T #d #_ #_ #j #H destruct +| #I #L1 #L2 #V #T #d #_ #_ #j #H destruct +] +qed-. + +lemma llpx_sn_fwd_lref: ∀R,L1,L2,d,i. llpx_sn R d (#i) L1 L2 → + ∨∨ |L1| ≤ i ∧ |L2| ≤ i + | yinj i < d + | ∃∃I,K1,K2,V1,V2. ⇩[i] L1 ≡ K1.ⓑ{I}V1 & + ⇩[i] L2 ≡ K2.ⓑ{I}V2 & + llpx_sn R (yinj 0) V1 K1 K2 & + R I K1 V1 V2 & d ≤ yinj i. +/2 width=3 by llpx_sn_fwd_lref_aux/ qed-. + +lemma llpx_sn_fwd_bind_sn: ∀R,a,I,L1,L2,V,T,d. llpx_sn R d (ⓑ{a,I}V.T) L1 L2 → + llpx_sn R d V L1 L2. +#R #a #I #L1 #L2 #V #T #d #H elim (llpx_sn_inv_bind … H) -H // +qed-. + +lemma llpx_sn_fwd_bind_dx: ∀R,a,I,L1,L2,V,T,d. llpx_sn R d (ⓑ{a,I}V.T) L1 L2 → + llpx_sn R (⫯d) T (L1.ⓑ{I}V) (L2.ⓑ{I}V). +#R #a #I #L1 #L2 #V #T #d #H elim (llpx_sn_inv_bind … H) -H // +qed-. + +lemma llpx_sn_fwd_flat_sn: ∀R,I,L1,L2,V,T,d. llpx_sn R d (ⓕ{I}V.T) L1 L2 → + llpx_sn R d V L1 L2. +#R #I #L1 #L2 #V #T #d #H elim (llpx_sn_inv_flat … H) -H // +qed-. + +lemma llpx_sn_fwd_flat_dx: ∀R,I,L1,L2,V,T,d. llpx_sn R d (ⓕ{I}V.T) L1 L2 → + llpx_sn R d T L1 L2. +#R #I #L1 #L2 #V #T #d #H elim (llpx_sn_inv_flat … H) -H // +qed-. + +lemma llpx_sn_fwd_pair_sn: ∀R,I,L1,L2,V,T,d. llpx_sn R d (②{I}V.T) L1 L2 → + llpx_sn R d V L1 L2. +#R * /2 width=4 by llpx_sn_fwd_flat_sn, llpx_sn_fwd_bind_sn/ +qed-. + +(* Basic_properties *********************************************************) + +lemma llpx_sn_refl: ∀R. (∀I,L. reflexive … (R I L)) → ∀T,L,d. llpx_sn R d T L L. +#R #HR #T #L @(f2_ind … rfw … L T) -L -T +#n #IH #L * * /3 width=1 by llpx_sn_sort, llpx_sn_gref, llpx_sn_bind, llpx_sn_flat/ +#i #Hn elim (lt_or_ge i (|L|)) /2 width=1 by llpx_sn_free/ +#HiL #d elim (ylt_split i d) /2 width=1 by llpx_sn_skip/ +elim (ldrop_O1_lt … HiL) -HiL destruct /4 width=9 by llpx_sn_lref, ldrop_fwd_rfw/ +qed-. + +lemma llpx_sn_Y: ∀R,T,L1,L2. |L1| = |L2| → llpx_sn R (∞) T L1 L2. +#R #T #L1 @(f2_ind … rfw … L1 T) -L1 -T +#n #IH #L1 * * /3 width=1 by llpx_sn_sort, llpx_sn_skip, llpx_sn_gref, llpx_sn_flat/ +#a #I #V1 #T1 #Hn #L2 #HL12 +@llpx_sn_bind /2 width=1/ (**) (* explicit constructor *) +@IH -IH // normalize /2 width=1 by eq_f2/ +qed-. + +lemma llpx_sn_ge_up: ∀R,L1,L2,U,dt. llpx_sn R dt U L1 L2 → ∀T,d,e. ⇧[d, e] T ≡ U → + dt ≤ d + e → llpx_sn R d U L1 L2. +#R #L1 #L2 #U #dt #H elim H -L1 -L2 -U -dt +[ #L1 #L2 #dt #k #HL12 #X #d #e #H #_ >(lift_inv_sort2 … H) -H /2 width=1 by llpx_sn_sort/ +| #L1 #L2 #dt #i #HL12 #Hidt #X #d #e #H #Hdtde + elim (lift_inv_lref2 … H) -H * #Hid #H destruct /3 width=1 by llpx_sn_skip, ylt_inj/ -HL12 + elim (ylt_yle_false … Hidt) -Hidt + @(yle_trans … Hdtde) /2 width=1 by yle_inj/ (**) (* full auto too slow 11s *) +| #I #L1 #L2 #K1 #K2 #W1 #W2 #dt #i #Hdti #HLK1 #HLK2 #HW1 #HW12 #_ #X #d #e #H #_ + elim (lift_inv_lref2 … H) -H * #Hid #H destruct + [ lapply (llpx_sn_fwd_length … HW1) -HW1 #HK12 + lapply (ldrop_fwd_length … HLK1) lapply (ldrop_fwd_length … HLK2) + normalize in ⊢ (%→%→?); -I -W1 -W2 -dt /3 width=1 by llpx_sn_skip, ylt_inj/ + | /4 width=9 by llpx_sn_lref, yle_inj, le_plus_b/ + ] +| /2 width=1 by llpx_sn_free/ +| #L1 #L2 #dt #p #HL12 #X #d #e #H #_ >(lift_inv_gref2 … H) -H /2 width=1 by llpx_sn_gref/ +| #a #I #L1 #L2 #W #U #dt #_ #_ #IHV #IHT #X #d #e #H #Hdtde destruct + elim (lift_inv_bind2 … H) -H #V #T #HVW >commutative_plus #HTU #H destruct + @(llpx_sn_bind) /2 width=4 by/ (**) (* full auto fails *) + @(IHT … HTU) /2 width=1 by yle_succ/ +| #I #L1 #L2 #W #U #dt #_ #_ #IHV #IHT #X #d #e #H #Hdtde destruct + elim (lift_inv_flat2 … H) -H #HVW #HTU #H destruct + /3 width=4 by llpx_sn_flat/ +] +qed-. + +(**) (* the minor premise comes first *) +lemma llpx_sn_ge: ∀R,L1,L2,T,d1,d2. d1 ≤ d2 → + llpx_sn R d1 T L1 L2 → llpx_sn R d2 T L1 L2. +#R #L1 #L2 #T #d1 #d2 * -d1 -d2 (**) (* destructed yle *) +/3 width=6 by llpx_sn_ge_up, llpx_sn_Y, llpx_sn_fwd_length, yle_inj/ +qed-. + +lemma llpx_sn_bind_O: ∀R,a,I,L1,L2,V,T. llpx_sn R 0 V L1 L2 → + llpx_sn R 0 T (L1.ⓑ{I}V) (L2.ⓑ{I}V) → + llpx_sn R 0 (ⓑ{a,I}V.T) L1 L2. +/3 width=3 by llpx_sn_ge, llpx_sn_bind/ qed-. + +lemma llpx_sn_co: ∀R1,R2. (∀I,L,T1,T2. R1 I L T1 T2 → R2 I L T1 T2) → + ∀L1,L2,T,d. llpx_sn R1 d T L1 L2 → llpx_sn R2 d T L1 L2. +#R1 #R2 #HR12 #L1 #L2 #T #d #H elim H -L1 -L2 -T -d +/3 width=9 by llpx_sn_sort, llpx_sn_skip, llpx_sn_lref, llpx_sn_free, llpx_sn_gref, llpx_sn_bind, llpx_sn_flat/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/llpx_sn_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/llpx_sn_alt.etc new file mode 100644 index 000000000..0916edb67 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/llpx_sn_alt.etc @@ -0,0 +1,62 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/cofrees_alt.ma". +include "basic_2/substitution/llpx_sn_alt_rec.ma". + +(* LAZY SN POINTWISE EXTENSION OF A CONTEXT-SENSITIVE REALTION FOR TERMS ****) + +(* alternative definition of llpx_sn (not recursive) *) +definition llpx_sn_alt: relation4 bind2 lenv term term → relation4 ynat term lenv lenv ≝ + λR,d,T,L1,L2. |L1| = |L2| ∧ + (∀I1,I2,K1,K2,V1,V2,i. d ≤ yinj i → (L1 ⊢ i ~ϵ 𝐅*[d]⦃T⦄ → ⊥) → + ⇩[i] L1 ≡ K1.ⓑ{I1}V1 → ⇩[i] L2 ≡ K2.ⓑ{I2}V2 → + I1 = I2 ∧ R I1 K1 V1 V2 + ). + +(* Main properties **********************************************************) + +theorem llpx_sn_llpx_sn_alt: ∀R,T,L1,L2,d. llpx_sn R d T L1 L2 → llpx_sn_alt R d T L1 L2. +#R #U #L1 @(f2_ind … rfw … L1 U) -L1 -U +#n #IHn #L1 #U #Hn #L2 #d #H elim (llpx_sn_inv_alt_r … H) -H +#HL12 #IHU @conj // +#I1 #I2 #K1 #K2 #V1 #V2 #i #Hdi #H #HLK1 #HLK2 elim (frees_inv_ge … H) -H // +[ -n #HnU elim (IHU … HnU HLK1 HLK2) -IHU -HnU -HLK1 -HLK2 /2 width=1 by conj/ +| * #J1 #K10 #W10 #j #Hdj #Hji #HLK10 #HnW10 #HnU destruct + lapply (ldrop_fwd_drop2 … HLK10) #H + lapply (ldrop_conf_ge … H … HLK1 ?) -H /2 width=1 by lt_to_le/ (minus_plus_m_m j (i+1)) in ⊢ (%→?); >commutative_plus (lift_inv_sort1 … H) -X + lapply (ldrop_fwd_length_eq2 … HLK1 HLK2 HK12) -K1 -K2 -d + /2 width=1 by llpx_sn_sort/ +| #K1 #K2 #d0 #i #HK12 #Hid0 #L1 #L2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_lref1 … H) -H + * #Hdi #H destruct + [ lapply (ldrop_fwd_length_eq2 … HLK1 HLK2 HK12) -K1 -K2 -d + /2 width=1 by llpx_sn_skip/ + | elim (ylt_yle_false … Hid0) -L1 -L2 -K1 -K2 -e -Hid0 + /3 width=3 by yle_trans, yle_inj/ + ] +| #I #K1 #K2 #K11 #K22 #V1 #V2 #d0 #i #Hid0 #HK11 #HK22 #HK12 #HV12 #IHK12 #L1 #L2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_lref1 … H) -H + * #Hdi #H destruct [ -HK12 | -IHK12 ] + [ elim (ldrop_trans_lt … HLK1 … HK11) // -K1 + elim (ldrop_trans_lt … HLK2 … HK22) // -Hdi -K2 + /3 width=18 by llpx_sn_lref/ + | lapply (ldrop_trans_ge_comm … HLK1 … HK11 ?) // -K1 + lapply (ldrop_trans_ge_comm … HLK2 … HK22 ?) // -Hdi -Hd0 -K2 + /3 width=9 by llpx_sn_lref, yle_plus_dx1_trans/ + ] +| #K1 #K2 #d0 #i #HK1 #HK2 #HK12 #L1 #L2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_lref1 … H) -H + * #Hid #H destruct + lapply (ldrop_fwd_length_eq2 … HLK1 HLK2 HK12) -HK12 + [ /3 width=7 by llpx_sn_free, ldrop_fwd_be/ + | lapply (ldrop_fwd_length … HLK1) -HLK1 #HLK1 + lapply (ldrop_fwd_length … HLK2) -HLK2 #HLK2 + @llpx_sn_free [ >HLK1 | >HLK2 ] -Hid -HLK1 -HLK2 /2 width=1 by monotonic_le_plus_r/ (**) (* explicit constructor *) + ] +| #K1 #K2 #d0 #p #HK12 #L1 #L2 #d #e #HLK1 #HLK2 #X #H #_ >(lift_inv_gref1 … H) -X + lapply (ldrop_fwd_length_eq2 … HLK1 HLK2 HK12) -K1 -K2 -d -e + /2 width=1 by llpx_sn_gref/ +| #a #I #K1 #K2 #V #T #d0 #_ #_ #IHV #IHT #L1 #L2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_bind1 … H) -H + #W #U #HVW #HTU #H destruct /4 width=6 by llpx_sn_bind, ldrop_skip, yle_succ/ +| #I #K1 #K2 #V #T #d0 #_ #_ #IHV #IHT #L1 #L2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_flat1 … H) -H + #W #U #HVW #HTU #H destruct /3 width=6 by llpx_sn_flat/ +] +qed-. + +lemma llpx_sn_lift_ge: ∀R,K1,K2,T,d0. llpx_sn R d0 T K1 K2 → + ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → + ∀U. ⇧[d, e] T ≡ U → d ≤ d0 → llpx_sn R (d0+e) U L1 L2. +#R #K1 #K2 #T #d0 #H elim H -K1 -K2 -T -d0 +[ #K1 #K2 #d0 #k #HK12 #L1 #L2 #d #e #HLK1 #HLK2 #X #H #_ >(lift_inv_sort1 … H) -X + lapply (ldrop_fwd_length_eq2 … HLK1 HLK2 HK12) -K1 -K2 -d + /2 width=1 by llpx_sn_sort/ +| #K1 #K2 #d0 #i #HK12 #Hid0 #L1 #L2 #d #e #HLK1 #HLK2 #X #H #_ elim (lift_inv_lref1 … H) -H + * #_ #H destruct + lapply (ldrop_fwd_length_eq2 … HLK1 HLK2 HK12) -K1 -K2 + [ /3 width=3 by llpx_sn_skip, ylt_plus_dx2_trans/ + | /3 width=3 by llpx_sn_skip, monotonic_ylt_plus_dx/ + ] +| #I #K1 #K2 #K11 #K22 #V1 #V2 #d0 #i #Hid0 #HK11 #HK22 #HK12 #HV12 #_ #L1 #L2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_lref1 … H) -H + * #Hid #H destruct + [ elim (ylt_yle_false … Hid0) -I -L1 -L2 -K1 -K2 -K11 -K22 -V1 -V2 -e -Hid0 + /3 width=3 by ylt_yle_trans, ylt_inj/ + | lapply (ldrop_trans_ge_comm … HLK1 … HK11 ?) // -K1 + lapply (ldrop_trans_ge_comm … HLK2 … HK22 ?) // -Hid -Hd0 -K2 + /3 width=9 by llpx_sn_lref, monotonic_yle_plus_dx/ + ] +| #K1 #K2 #d0 #i #HK1 #HK2 #HK12 #L1 #L2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_lref1 … H) -H + * #Hid #H destruct + lapply (ldrop_fwd_length_eq2 … HLK1 HLK2 HK12) -HK12 + [ /3 width=7 by llpx_sn_free, ldrop_fwd_be/ + | lapply (ldrop_fwd_length … HLK1) -HLK1 #HLK1 + lapply (ldrop_fwd_length … HLK2) -HLK2 #HLK2 + @llpx_sn_free [ >HLK1 | >HLK2 ] -Hid -HLK1 -HLK2 /2 width=1 by monotonic_le_plus_r/ (**) (* explicit constructor *) + ] +| #K1 #K2 #d0 #p #HK12 #L1 #L2 #d #e #HLK1 #HLK2 #X #H #_ >(lift_inv_gref1 … H) -X + lapply (ldrop_fwd_length_eq2 … HLK1 HLK2 HK12) -K1 -K2 -d + /2 width=1 by llpx_sn_gref/ +| #a #I #K1 #K2 #V #T #d0 #_ #_ #IHV #IHT #L1 #L2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_bind1 … H) -H + #W #U #HVW #HTU #H destruct /4 width=5 by llpx_sn_bind, ldrop_skip, yle_succ/ +| #I #K1 #K2 #V #T #d0 #_ #_ #IHV #IHT #L1 #L2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_flat1 … H) -H + #W #U #HVW #HTU #H destruct /3 width=5 by llpx_sn_flat/ +] +qed-. + +(* Inversion lemmas on relocation *******************************************) + +lemma llpx_sn_inv_lift_le: ∀R. (∀I. l_deliftable_sn (R I)) → + ∀L1,L2,U,d0. llpx_sn R d0 U L1 L2 → + ∀K1,K2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → + ∀T. ⇧[d, e] T ≡ U → d0 ≤ d → llpx_sn R d0 T K1 K2. +#R #HR #L1 #L2 #U #d0 #H elim H -L1 -L2 -U -d0 +[ #L1 #L2 #d0 #k #HL12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #_ >(lift_inv_sort2 … H) -X + lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) -L1 -L2 -d -e + /2 width=1 by llpx_sn_sort/ +| #L1 #L2 #d0 #i #HL12 #Hid0 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #_ elim (lift_inv_lref2 … H) -H + * #_ #H destruct + lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) -L1 -L2 + [ /2 width=1 by llpx_sn_skip/ + | /3 width=3 by llpx_sn_skip, yle_ylt_trans/ + ] +| #I #L1 #L2 #K11 #K22 #W1 #W2 #d0 #i #Hid0 #HLK11 #HLK22 #HK12 #HW12 #IHK12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_lref2 … H) -H + * #Hid #H destruct [ -HK12 | -IHK12 ] + [ elim (ldrop_conf_lt … HLK1 … HLK11) // -L1 #L1 #V1 #HKL1 #HKL11 #HVW1 + elim (ldrop_conf_lt … HLK2 … HLK22) // -Hid -L2 #L2 #V2 #HKL2 #HKL22 #HVW2 + elim (HR … HW12 … HKL11 … HVW1) -HR #V0 #HV0 #HV12 + lapply (lift_inj … HV0 … HVW2) -HV0 -HVW2 #H destruct + /3 width=10 by llpx_sn_lref/ + | lapply (ldrop_conf_ge … HLK1 … HLK11 ?) // -L1 + lapply (ldrop_conf_ge … HLK2 … HLK22 ?) // -L2 -Hid0 + elim (le_inv_plus_l … Hid) -Hid /4 width=9 by llpx_sn_lref, yle_trans, yle_inj/ (**) (* slow *) + ] +| #L1 #L2 #d0 #i #HL1 #HL2 #HL12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_lref2 … H) -H + * #_ #H destruct + lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) + [ lapply (ldrop_fwd_length_le4 … HLK1) -HLK1 + lapply (ldrop_fwd_length_le4 … HLK2) -HLK2 + #HKL2 #HKL1 #HK12 @llpx_sn_free // /2 width=3 by transitive_le/ (**) (* full auto too slow *) + | lapply (ldrop_fwd_length … HLK1) -HLK1 #H >H in HL1; -H + lapply (ldrop_fwd_length … HLK2) -HLK2 #H >H in HL2; -H + /3 width=1 by llpx_sn_free, le_plus_to_minus_r/ + ] +| #L1 #L2 #d0 #p #HL12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #_ >(lift_inv_gref2 … H) -X + lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) -L1 -L2 -d -e + /2 width=1 by llpx_sn_gref/ +| #a #I #L1 #L2 #W #U #d0 #_ #_ #IHW #IHU #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_bind2 … H) -H + #V #T #HVW #HTU #H destruct /4 width=6 by llpx_sn_bind, ldrop_skip, yle_succ/ +| #I #L1 #L2 #W #U #d0 #_ #_ #IHW #IHU #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hd0 elim (lift_inv_flat2 … H) -H + #V #T #HVW #HTU #H destruct /3 width=6 by llpx_sn_flat/ +] +qed-. + +lemma llpx_sn_inv_lift_be: ∀R,L1,L2,U,d0. llpx_sn R d0 U L1 L2 → + ∀K1,K2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → + ∀T. ⇧[d, e] T ≡ U → d ≤ d0 → d0 ≤ yinj d + e → llpx_sn R d T K1 K2. +#R #L1 #L2 #U #d0 #H elim H -L1 -L2 -U -d0 +[ #L1 #L2 #d0 #k #HL12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #_ #_ >(lift_inv_sort2 … H) -X + lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) -L1 -L2 -d0 -e + /2 width=1 by llpx_sn_sort/ +| #L1 #L2 #d0 #i #HL12 #Hid0 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hd0 #Hd0e elim (lift_inv_lref2 … H) -H + * #Hid #H destruct + [ lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) -L1 -L2 + -Hid0 /3 width=1 by llpx_sn_skip, ylt_inj/ + | elim (ylt_yle_false … Hid0) -L1 -L2 -Hd0 -Hid0 + /3 width=3 by yle_trans, yle_inj/ (**) (* slow *) + ] +| #I #L1 #L2 #K11 #K22 #W1 #W2 #d0 #i #Hid0 #HLK11 #HLK22 #HK12 #HW12 #_ #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hd0 #Hd0e elim (lift_inv_lref2 … H) -H + * #Hid #H destruct + [ elim (ylt_yle_false … Hid0) -I -L1 -L2 -K11 -K22 -W1 -W2 -Hd0e -Hid0 + /3 width=3 by ylt_yle_trans, ylt_inj/ + | lapply (ldrop_conf_ge … HLK1 … HLK11 ?) // -L1 + lapply (ldrop_conf_ge … HLK2 … HLK22 ?) // -L2 -Hid0 -Hd0 -Hd0e + elim (le_inv_plus_l … Hid) -Hid /3 width=9 by llpx_sn_lref, yle_inj/ + ] +| #L1 #L2 #d0 #i #HL1 #HL2 #HL12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hd0 #Hd0e elim (lift_inv_lref2 … H) -H + * #_ #H destruct + lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) + [ lapply (ldrop_fwd_length_le4 … HLK1) -HLK1 + lapply (ldrop_fwd_length_le4 … HLK2) -HLK2 + #HKL2 #HKL1 #HK12 @llpx_sn_free // /2 width=3 by transitive_le/ (**) (* full auto too slow *) + | lapply (ldrop_fwd_length … HLK1) -HLK1 #H >H in HL1; -H + lapply (ldrop_fwd_length … HLK2) -HLK2 #H >H in HL2; -H + /3 width=1 by llpx_sn_free, le_plus_to_minus_r/ + ] +| #L1 #L2 #d0 #p #HL12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #_ #_ >(lift_inv_gref2 … H) -X + lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) -L1 -L2 -d0 -e + /2 width=1 by llpx_sn_gref/ +| #a #I #L1 #L2 #W #U #d0 #_ #_ #IHW #IHU #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hd0 #Hd0e elim (lift_inv_bind2 … H) -H + >commutative_plus #V #T #HVW #HTU #H destruct + @llpx_sn_bind [ /2 width=5 by/ ] -IHW (**) (* explicit constructor *) + @(IHU … HTU) -IHU -HTU /2 width=1 by ldrop_skip, yle_succ/ +| #I #L1 #L2 #W #U #d0 #_ #_ #IHW #IHU #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hd0 #Hd0e elim (lift_inv_flat2 … H) -H + #V #T #HVW #HTU #H destruct /3 width=6 by llpx_sn_flat/ +] +qed-. + +lemma llpx_sn_inv_lift_ge: ∀R,L1,L2,U,d0. llpx_sn R d0 U L1 L2 → + ∀K1,K2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → + ∀T. ⇧[d, e] T ≡ U → yinj d + e ≤ d0 → llpx_sn R (d0-e) T K1 K2. +#R #L1 #L2 #U #d0 #H elim H -L1 -L2 -U -d0 +[ #L1 #L2 #d0 #k #HL12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #_ >(lift_inv_sort2 … H) -X + lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) -L1 -L2 -d + /2 width=1 by llpx_sn_sort/ +| #L1 #L2 #d0 #i #HL12 #Hid0 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hded0 elim (lift_inv_lref2 … H) -H + * #Hid #H destruct [ -Hid0 | -Hded0 ] + lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) -L1 -L2 + [ /4 width=3 by llpx_sn_skip, yle_plus_to_minus_inj2, ylt_yle_trans, ylt_inj/ + | elim (le_inv_plus_l … Hid) -Hid #_ + /4 width=1 by llpx_sn_skip, monotonic_ylt_minus_dx, yle_inj/ + ] +| #I #L1 #L2 #K11 #K22 #W1 #W2 #d0 #i #Hid0 #HLK11 #HLK22 #HK12 #HW12 #_ #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hded0 elim (lift_inv_lref2 … H) -H + * #Hid #H destruct + [ elim (ylt_yle_false … Hid0) -I -L1 -L2 -K11 -K22 -W1 -W2 -Hid0 + /3 width=3 by yle_fwd_plus_sn1, ylt_yle_trans, ylt_inj/ + | lapply (ldrop_conf_ge … HLK1 … HLK11 ?) // -L1 + lapply (ldrop_conf_ge … HLK2 … HLK22 ?) // -L2 -Hded0 -Hid + /3 width=9 by llpx_sn_lref, monotonic_yle_minus_dx/ + ] +| #L1 #L2 #d0 #i #HL1 #HL2 #HL12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hded0 elim (lift_inv_lref2 … H) -H + * #_ #H destruct + lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) + [ lapply (ldrop_fwd_length_le4 … HLK1) -HLK1 + lapply (ldrop_fwd_length_le4 … HLK2) -HLK2 + #HKL2 #HKL1 #HK12 @llpx_sn_free // /2 width=3 by transitive_le/ (**) (* full auto too slow *) + | lapply (ldrop_fwd_length … HLK1) -HLK1 #H >H in HL1; -H + lapply (ldrop_fwd_length … HLK2) -HLK2 #H >H in HL2; -H + /3 width=1 by llpx_sn_free, le_plus_to_minus_r/ + ] +| #L1 #L2 #d0 #p #HL12 #K1 #K2 #d #e #HLK1 #HLK2 #X #H #_ >(lift_inv_gref2 … H) -X + lapply (ldrop_fwd_length_eq1 … HLK1 HLK2 HL12) -L1 -L2 -d + /2 width=1 by llpx_sn_gref/ +| #a #I #L1 #L2 #W #U #d0 #_ #_ #IHW #IHU #K1 #K2 #d #e #HLK1 #HLK2 #X #H #Hded0 elim (lift_inv_bind2 … H) -H + #V #T #HVW #HTU #H destruct + @llpx_sn_bind [ /2 width=5 by/ ] -IHW (**) (* explicit constructor *) + (lpx_sn_inv_atom1 … H) -H + /4 width=3 by ldrop_atom, lpx_sn_atom, ex2_intro/ +| #I #K1 #V1 #X #H elim (lpx_sn_inv_pair1 … H) -H + #L2 #V2 #HL12 #HV12 #H destruct + /3 width=5 by ldrop_pair, lpx_sn_pair, ex2_intro/ +| #I #L1 #K1 #V1 #e #_ #IHLK1 #X #H elim (lpx_sn_inv_pair1 … H) -H + #L2 #V2 #HL12 #HV12 #H destruct + elim (IHLK1 … HL12) -L1 /3 width=3 by ldrop_drop, ex2_intro/ +| #I #L1 #K1 #V1 #W1 #d #e #HLK1 #HWV1 #IHLK1 #X #H + elim (lpx_sn_inv_pair1 … H) -H #L2 #V2 #HL12 #HV12 #H destruct + elim (HR … HV12 … HLK1 … HWV1) -V1 + elim (IHLK1 … HL12) -L1 /3 width=5 by ldrop_skip, lpx_sn_pair, ex2_intro/ +] +qed-. + +lemma lpx_sn_liftable_dedropable: ∀R. (∀I,L. reflexive ? (R I L)) → + (∀I. l_liftable (R I)) → dedropable_sn (lpx_sn R). +#R #H1R #H2R #L1 #K1 #s #d #e #H elim H -L1 -K1 -d -e +[ #d #e #He #X #H >(lpx_sn_inv_atom1 … H) -H + /4 width=4 by ldrop_atom, lpx_sn_atom, ex3_intro/ +| #I #K1 #V1 #X #H elim (lpx_sn_inv_pair1 … H) -H + #K2 #V2 #HK12 #HV12 #H destruct + lapply (lpx_sn_fwd_length … HK12) + #H @(ex3_intro … (K2.ⓑ{I}V2)) (**) (* explicit constructor *) + /3 width=1 by lpx_sn_pair, monotonic_le_plus_l/ + @leq_O2 normalize // +| #I #L1 #K1 #V1 #e #_ #IHLK1 #K2 #HK12 elim (IHLK1 … HK12) -K1 + /3 width=5 by ldrop_drop, leq_pair, lpx_sn_pair, ex3_intro/ +| #I #L1 #K1 #V1 #W1 #d #e #HLK1 #HWV1 #IHLK1 #X #H + elim (lpx_sn_inv_pair1 … H) -H #K2 #W2 #HK12 #HW12 #H destruct + elim (lift_total W2 d e) #V2 #HWV2 + lapply (H2R … HW12 … HLK1 … HWV1 … HWV2) -W1 + elim (IHLK1 … HK12) -K1 + /3 width=6 by ldrop_skip, leq_succ, lpx_sn_pair, ex3_intro/ +] +qed-. + +fact lpx_sn_dropable_aux: ∀R,L2,K2,s,d,e. ⇩[s, d, e] L2 ≡ K2 → ∀L1. lpx_sn R L1 L2 → + d = 0 → ∃∃K1. ⇩[s, 0, e] L1 ≡ K1 & lpx_sn R K1 K2. +#R #L2 #K2 #s #d #e #H elim H -L2 -K2 -d -e +[ #d #e #He #X #H >(lpx_sn_inv_atom2 … H) -H + /4 width=3 by ldrop_atom, lpx_sn_atom, ex2_intro/ +| #I #K2 #V2 #X #H elim (lpx_sn_inv_pair2 … H) -H + #K1 #V1 #HK12 #HV12 #H destruct + /3 width=5 by ldrop_pair, lpx_sn_pair, ex2_intro/ +| #I #L2 #K2 #V2 #e #_ #IHLK2 #X #H #_ elim (lpx_sn_inv_pair2 … H) -H + #L1 #V1 #HL12 #HV12 #H destruct + elim (IHLK2 … HL12) -L2 /3 width=3 by ldrop_drop, ex2_intro/ +| #I #L2 #K2 #V2 #W2 #d #e #_ #_ #_ #L1 #_ + (lpx_sn_inv_atom1 … H1) -X1 + >(lpx_sn_inv_atom1 … H2) -X2 /2 width=3 by lpx_sn_atom, ex2_intro/ +| #L0 #I #V0 #Hn #X1 #H1 #X2 #H2 destruct + elim (lpx_sn_inv_pair1 … H1) -H1 #L1 #V1 #HL01 #HV01 #H destruct + elim (lpx_sn_inv_pair1 … H2) -H2 #L2 #V2 #HL02 #HV02 #H destruct + elim (IH … HL01 … HL02) -IH normalize // #L #HL1 #HL2 + elim (HR12 … HV01 … HV02 … HL01 … HL02) -L0 -V0 /3 width=5 by lpx_sn_pair, ex2_intro/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/lpx_sn_tc.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/lpx_sn_tc.etc new file mode 100644 index 000000000..2a3a87cf4 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/lpx_sn_tc.etc @@ -0,0 +1,119 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/lpx_sn.ma". + +(* SN POINTWISE EXTENSION OF A CONTEXT-SENSITIVE REALTION FOR TERMS *********) + +(* Properties on transitive_closure *****************************************) + +lemma TC_lpx_sn_pair_refl: ∀R. (∀I,L. reflexive … (R I L)) → + ∀L1,L2. TC … (lpx_sn R) L1 L2 → + ∀I,V. TC … (lpx_sn R) (L1.ⓑ{I}V) (L2. ⓑ{I}V). +#R #HR #L1 #L2 #H @(TC_star_ind … L2 H) -L2 +[ /2 width=1 by lpx_sn_refl/ +| /3 width=1 by TC_reflexive, lpx_sn_refl/ +| /3 width=5 by lpx_sn_pair, step/ +] +qed-. + +lemma TC_lpx_sn_pair: ∀R. (∀I,L. reflexive … (R I L)) → + ∀I,L1,L2. TC … (lpx_sn R) L1 L2 → + ∀V1,V2. LTC … (R I) L1 V1 V2 → + TC … (lpx_sn R) (L1.ⓑ{I}V1) (L2. ⓑ{I}V2). +#R #HR #I #L1 #L2 #HL12 #V1 #V2 #H @(TC_star_ind_dx … V1 H) -V1 // +[ /2 width=1 by TC_lpx_sn_pair_refl/ +| /4 width=3 by TC_strap, lpx_sn_pair, lpx_sn_refl/ +] +qed-. + +lemma lpx_sn_LTC_TC_lpx_sn: ∀R. (∀I,L. reflexive … (R I L)) → + ∀L1,L2. lpx_sn (λI.LTC … (R I)) L1 L2 → + TC … (lpx_sn R) L1 L2. +#R #HR #L1 #L2 #H elim H -L1 -L2 +/2 width=1 by TC_lpx_sn_pair, lpx_sn_atom, inj/ +qed-. + +(* Inversion lemmas on transitive closure ***********************************) + +lemma TC_lpx_sn_inv_atom2: ∀R,L1. TC … (lpx_sn R) L1 (⋆) → L1 = ⋆. +#R #L1 #H @(TC_ind_dx … L1 H) -L1 +[ /2 width=2 by lpx_sn_inv_atom2/ +| #L1 #L #HL1 #_ #IHL2 destruct /2 width=2 by lpx_sn_inv_atom2/ +] +qed-. + +lemma TC_lpx_sn_inv_pair2: ∀R. (∀I.s_rs_transitive … (R I) (λ_.lpx_sn R)) → + ∀I,L1,K2,V2. TC … (lpx_sn R) L1 (K2.ⓑ{I}V2) → + ∃∃K1,V1. TC … (lpx_sn R) K1 K2 & LTC … (R I) K1 V1 V2 & L1 = K1.ⓑ{I}V1. +#R #HR #I #L1 #K2 #V2 #H @(TC_ind_dx … L1 H) -L1 +[ #L1 #H elim (lpx_sn_inv_pair2 … H) -H /3 width=5 by inj, ex3_2_intro/ +| #L1 #L #HL1 #_ * #K #V #HK2 #HV2 #H destruct + elim (lpx_sn_inv_pair2 … HL1) -HL1 #K1 #V1 #HK1 #HV1 #H destruct + lapply (HR … HV2 … HK1) -HR -HV2 /3 width=5 by TC_strap, ex3_2_intro/ +] +qed-. + +lemma TC_lpx_sn_ind: ∀R. (∀I.s_rs_transitive … (R I) (λ_.lpx_sn R)) → + ∀S:relation lenv. + S (⋆) (⋆) → ( + ∀I,K1,K2,V1,V2. + TC … (lpx_sn R) K1 K2 → LTC … (R I) K1 V1 V2 → + S K1 K2 → S (K1.ⓑ{I}V1) (K2.ⓑ{I}V2) + ) → + ∀L2,L1. TC … (lpx_sn R) L1 L2 → S L1 L2. +#R #HR #S #IH1 #IH2 #L2 elim L2 -L2 +[ #X #H >(TC_lpx_sn_inv_atom2 … H) -X // +| #L2 #I #V2 #IHL2 #X #H + elim (TC_lpx_sn_inv_pair2 … H) // -H -HR + #L1 #V1 #HL12 #HV12 #H destruct /3 width=1 by/ +] +qed-. + +lemma TC_lpx_sn_inv_atom1: ∀R,L2. TC … (lpx_sn R) (⋆) L2 → L2 = ⋆. +#R #L2 #H elim H -L2 +[ /2 width=2 by lpx_sn_inv_atom1/ +| #L #L2 #_ #HL2 #IHL1 destruct /2 width=2 by lpx_sn_inv_atom1/ +] +qed-. + +fact TC_lpx_sn_inv_pair1_aux: ∀R. (∀I.s_rs_transitive … (R I) (λ_.lpx_sn R)) → + ∀L1,L2. TC … (lpx_sn R) L1 L2 → + ∀I,K1,V1. L1 = K1.ⓑ{I}V1 → + ∃∃K2,V2. TC … (lpx_sn R) K1 K2 & LTC … (R I) K1 V1 V2 & L2 = K2. ⓑ{I} V2. +#R #HR #L1 #L2 #H @(TC_lpx_sn_ind … H) // -HR -L1 -L2 +[ #J #K #W #H destruct +| #I #L1 #L2 #V1 #V2 #HL12 #HV12 #_ #J #K #W #H destruct /2 width=5 by ex3_2_intro/ +] +qed-. + +lemma TC_lpx_sn_inv_pair1: ∀R. (∀I.s_rs_transitive … (R I) (λ_.lpx_sn R)) → + ∀I,K1,L2,V1. TC … (lpx_sn R) (K1.ⓑ{I}V1) L2 → + ∃∃K2,V2. TC … (lpx_sn R) K1 K2 & LTC … (R I) K1 V1 V2 & L2 = K2. ⓑ{I} V2. +/2 width=3 by TC_lpx_sn_inv_pair1_aux/ qed-. + +lemma TC_lpx_sn_inv_lpx_sn_LTC: ∀R. (∀I.s_rs_transitive … (R I) (λ_.lpx_sn R)) → + ∀L1,L2. TC … (lpx_sn R) L1 L2 → + lpx_sn (λI.LTC … (R I)) L1 L2. +/3 width=4 by TC_lpx_sn_ind, lpx_sn_pair/ qed-. + +(* Forward lemmas on transitive closure *************************************) + +lemma TC_lpx_sn_fwd_length: ∀R,L1,L2. TC … (lpx_sn R) L1 L2 → |L1| = |L2|. +#R #L1 #L2 #H elim H -L2 +[ #L2 #HL12 >(lpx_sn_fwd_length … HL12) -HL12 // +| #L #L2 #_ #HL2 #IHL1 + >IHL1 -L1 >(lpx_sn_fwd_length … HL2) -HL2 // +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/ssta_llpx_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/ssta_llpx_sn.etc new file mode 100644 index 000000000..3b1db6a9a --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lpx_sn/ssta_llpx_sn.etc @@ -0,0 +1,44 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/llpx_sn_ldrop.ma". +include "basic_2/static/ssta.ma". + +(* STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS ******************************) + +(* Properties on lazy sn pointwise extensions *******************************) + +lemma ssta_llpx_sn_conf: ∀R. (∀I,L.reflexive … (R I L)) → + (∀I.l_liftable (R I)) → + ∀h,g,G. s_r_confluent1 … (ssta h g G) (llpx_sn R 0). +#R #H1R #H2R #h #g #G #Ls #T1 #T2 #H elim H -G -Ls -T1 -T2 +[ /3 width=4 by llpx_sn_fwd_length, llpx_sn_sort/ +| #G #Ls #Ks #V1s #W2s #V2s #i #HLKs #_ #HVW2s #IHV12s #Ld #H elim (llpx_sn_inv_lref_ge_sn … H … HLKs) // -H + #Kd #V1d #HLKd #HV1s #HV1sd + lapply (ldrop_fwd_drop2 … HLKs) -HLKs #HLKs + lapply (ldrop_fwd_drop2 … HLKd) -HLKd #HLKd + @(llpx_sn_lift_le … HLKs HLKd … HVW2s) -HLKs -HLKd -HVW2s /2 width=1 by/ (**) (* full auto too slow *) +| #G #Ls #Ks #V1s #W1s #l #i #HLKs #Hl #HVW1s #Ld #H elim (llpx_sn_inv_lref_ge_sn … H … HLKs) // -H + #Kd #V1d #HLKd #HV1s #HV1sd + lapply (ldrop_fwd_drop2 … HLKs) -HLKs #HLKs + lapply (ldrop_fwd_drop2 … HLKd) -HLKd #HLKd + @(llpx_sn_lift_le … HLKs HLKd … HVW1s) -HLKs -HLKd -HVW1s /2 width=1 by/ (**) (* full auto too slow *) +| #a #I #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_bind_O … H) -H + /4 width=5 by llpx_sn_bind_repl_SO, llpx_sn_bind/ +| #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H + /3 width=1 by llpx_sn_flat/ +| #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H + /3 width=1 by llpx_sn_flat/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubn/lsubn_lsubn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubn/lsubn_lsubn.etc new file mode 100644 index 000000000..9ef3dda88 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubn/lsubn_lsubn.etc @@ -0,0 +1,36 @@ +(**************************************************************************) +(* ___ *) +(* ||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/dynamic/lsubn_nta.ma". + +(* LOCAL ENVIRONMENT REFINEMENT FOR NATIVE TYPE ASSIGNMENT ******************) + +(* Main properties **********************************************************) + +(* Note: new property *) +theorem lsubn_trans: ∀h,L1,L. h ⊢ L1 :⊑ L → ∀L2. h ⊢ L :⊑ L2 → h ⊢ L1 :⊑ L2. +#h #L1 #L #H elim H -L1 -L +[ #X #H >(lsubn_inv_atom1 … H) -H // +| #I #L1 #L #V #HL1 #H1W #IHL1 #X #H + elim (lsubn_inv_pair1 … H) -H * #L2 + [ #HL2 #H #H2W destruct /4 width=1/ + | #W #H1VW #H2VW #HL2 #H1 #H2 destruct /3 width=3/ + ] +| #L1 #L #V1 #W1 #H1VW1 #H2VW1 #HL1 #IHL1 #X #H + elim (lsubn_inv_pair1 … H) -H * #L2 + [ #HL2 #H #HW destruct /3 width=1/ + | #V #_ #_ #_ #_ #H destruct + ] +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/aaa_lpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/aaa_lpss.etc new file mode 100644 index 000000000..e930823ad --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/aaa_lpss.etc @@ -0,0 +1,54 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/lpss_ldrop.ma". +include "basic_2/static/aaa_lift.ma". + +(* ATONIC ARITY ASSIGNMENT ON TERMS *****************************************) + +(* Properties about sn parallel substitution ********************************) + +(* Note: lemma 500 *) +lemma aaa_cpss_lpss_conf: ∀L1,T1,A. L1 ⊢ T1 ⁝ A → ∀T2. L1 ⊢ T1 ▶* T2 → + ∀L2. L1 ⊢ ▶* L2 → L2 ⊢ T2 ⁝ A. +#L1 #T1 #A #H elim H -L1 -T1 -A +[ #L1 #k #X #H + >(cpss_inv_sort1 … H) -H // +| #I #L1 #K1 #V1 #B #i #HLK1 #_ #IHV1 #X #H #L2 #HL12 + elim (cpss_inv_lref1 … H) -H + [ #H destruct + elim (lpss_ldrop_conf … HLK1 … HL12) -L1 #X #H #HLK2 + elim (lpss_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct /3 width=6/ + | * #Y #Z #V2 #H #HV12 #HV2 + lapply (ldrop_mono … H … HLK1) -H #H destruct + elim (lpss_ldrop_conf … HLK1 … HL12) -L1 #Z #H #HLK2 + elim (lpss_inv_pair1 … H) -H #K2 #V0 #HK12 #_ #H destruct + lapply (ldrop_fwd_ldrop2 … HLK2) -V0 /3 width=7/ + ] +| #a #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12 + elim (cpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct /4 width=2/ +| #a #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12 + elim (cpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct /4 width=1/ +| #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12 + elim (cpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct /3 width=3/ +| #L1 #V1 #T1 #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12 + elim (cpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct /3 width=1/ +] +qed-. + +lemma aaa_cpss_conf: ∀L,T1,A. L ⊢ T1 ⁝ A → ∀T2. L ⊢ T1 ▶* T2 → L ⊢ T2 ⁝ A. +/2 width=5 by aaa_cpss_lpss_conf/ qed-. + +lemma aaa_lpss_conf: ∀L1,T,A. L1 ⊢ T ⁝ A → ∀L2. L1 ⊢ ▶* L2 → L2 ⊢ T ⁝ A. +/2 width=5 by aaa_cpss_lpss_conf/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/cpcs_lpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/cpcs_lpss.etc new file mode 100644 index 000000000..09d29754f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/cpcs_lpss.etc @@ -0,0 +1,50 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/cprs_lpss.ma". +include "basic_2/equivalence/cpcs_cpcs.ma". + +(* CONTEXT-SENSITIVE PARALLEL EQUIVALENCE ON TERMS **************************) + +(* Properties on sn parallel substitution for local environments ************) + +lemma cpcs_lpss_conf: ∀L1,T1,T2. L1 ⊢ T1 ⬌* T2 → + ∀L2. L1 ⊢ ▶* L2 → L2 ⊢ T1 ⬌* T2. +#L1 #T1 #T2 #H #L2 #HL12 +elim (cpcs_inv_cprs … H) -H #T #HT1 #HT2 +elim (cprs_lpss_conf_dx … HT1 … HL12) -HT1 #U1 #H1 #HTU1 +elim (cprs_lpss_conf_dx … HT2 … HL12) -L1 #U2 #H2 #HTU2 +elim (cpss_conf … H1 … H2) -T #U #HU1 #HU2 +lapply (cprs_cpss_trans … HTU1 … HU1) -U1 +lapply (cprs_cpss_trans … HTU2 … HU2) -U2 /2 width=3/ +qed-. + +lemma cpcs_cpss_lpss_conf: ∀L1,T,T2. L1 ⊢ T ⬌* T2 → ∀T1. L1 ⊢ T ▶* T1 → + ∀L2. L1 ⊢ ▶* L2 → L2 ⊢ T1 ⬌* T2. +#L1 #T #T2 #HT2 #T1 #HT1 #L2 #HL12 +lapply (cpcs_lpss_conf … HT2 … HL12) -HT2 #HT2 +elim (lpss_cpss_conf_dx … HT1 … HL12) -L1 #T0 #HT0 #HT10 +lapply (cpcs_cpss_conf … HT0 … HT2) -T #HT02 +lapply (cpcs_cpss_strap2 … HT10 … HT02) -T0 // +qed-. + +lemma cpcs_cpss2_lpss_conf: ∀L1,T1,T2. L1 ⊢ T1 ⬌* T2 → + ∀T3. L1 ⊢ T1 ▶* T3 → ∀T4. L1 ⊢ T2 ▶* T4 → + ∀L2. L1 ⊢ ▶* L2 → L2 ⊢ T3 ⬌* T4. +#L1 #T1 #T2 #HT12 #T3 #HT13 #T4 #HT24 #L2 #HL12 +lapply (cpcs_cpss_lpss_conf … HT12 … HT13 … HL12) -T1 #HT32 +elim (lpss_cpss_conf_dx … HT24 … HL12) -L1 #T #HT2 #HT4 +lapply (cpcs_cpss_strap1 … HT32 … HT2) -T2 #HT3 +lapply (cpcs_cpss_div … HT3 … HT4) -T // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/cpqs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/cpqs.etc new file mode 100644 index 000000000..41120361a --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/cpqs.etc @@ -0,0 +1,227 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( L ⊢ break term 46 T1 ➤ * break term 46 T2 )" + non associative with precedence 45 + for @{ 'PRestStar $L $T1 $T2 }. + +include "basic_2/substitution/cpss.ma". + +(* CONTEXT-SENSITIVE RESTRICTED PARALLEL COMPUTATION FOR TERMS **************) + +inductive cpqs: lenv → relation term ≝ +| cpqs_atom : ∀I,L. cpqs L (⓪{I}) (⓪{I}) +| cpqs_delta: ∀L,K,V,V2,W2,i. + ⇩[0, i] L ≡ K. ⓓV → cpqs K V V2 → + ⇧[0, i + 1] V2 ≡ W2 → cpqs L (#i) W2 +| cpqs_bind : ∀a,I,L,V1,V2,T1,T2. + cpqs L V1 V2 → cpqs (L. ⓑ{I} V1) T1 T2 → + cpqs L (ⓑ{a,I} V1. T1) (ⓑ{a,I} V2. T2) +| cpqs_flat : ∀I,L,V1,V2,T1,T2. + cpqs L V1 V2 → cpqs L T1 T2 → + cpqs L (ⓕ{I} V1. T1) (ⓕ{I} V2. T2) +| cpqs_zeta : ∀L,V,T1,T,T2. cpqs (L.ⓓV) T1 T → + ⇧[0, 1] T2 ≡ T → cpqs L (+ⓓV. T1) T2 +| cpqs_tau : ∀L,V,T1,T2. cpqs L T1 T2 → cpqs L (ⓝV. T1) T2 +. + +interpretation "context-sensitive restricted parallel computation (term)" + 'PRestStar L T1 T2 = (cpqs L T1 T2). + +(* Basic properties *********************************************************) + +lemma cpqs_lsubr_trans: lsub_trans … cpqs lsubr. +#L1 #T1 #T2 #H elim H -L1 -T1 -T2 +[ // +| #L1 #K1 #V1 #V2 #W2 #i #HLK1 #_ #HVW2 #IHV12 #L2 #HL12 + elim (lsubr_fwd_ldrop2_abbr … HL12 … HLK1) -HL12 -HLK1 /3 width=6/ +| /4 width=1/ +|4,6: /3 width=1/ +| /4 width=3/ +] +qed-. + +lemma cpss_cpqs: ∀L,T1,T2. L ⊢ T1 ▶* T2 → L ⊢ T1 ➤* T2. +#L #T1 #T2 #H elim H -L -T1 -T2 // /2 width=1/ /2 width=6/ +qed. + +lemma cpqs_refl: ∀T,L. L ⊢ T ➤* T. +/2 width=1/ qed. + +lemma cpqs_delift: ∀L,K,V,T1,d. ⇩[0, d] L ≡ (K. ⓓV) → + ∃∃T2,T. L ⊢ T1 ➤* T2 & ⇧[d, 1] T ≡ T2. +#L #K #V #T1 #d #HLK +elim (cpss_delift … T1 … HLK) -HLK /3 width=4/ +qed-. + +lemma cpqs_append: l_appendable_sn … cpqs. +#K #T1 #T2 #H elim H -K -T1 -T2 // /2 width=1/ /2 width=3/ +#K #K0 #V1 #V2 #W2 #i #HK0 #_ #HVW2 #IHV12 #L +lapply (ldrop_fwd_length_lt2 … HK0) #H +@(cpqs_delta … (L@@K0) V1 … HVW2) // +@(ldrop_O1_append_sn_le … HK0) /2 width=2/ (**) (* /3/ does not work *) +qed. + +(* Basic inversion lemmas ***************************************************) + +fact cpqs_inv_atom1_aux: ∀L,T1,T2. L ⊢ T1 ➤* T2 → ∀I. T1 = ⓪{I} → + T2 = ⓪{I} ∨ + ∃∃K,V,V2,i. ⇩[O, i] L ≡ K. ⓓV & + K ⊢ V ➤* V2 & + ⇧[O, i + 1] V2 ≡ T2 & + I = LRef i. +#L #T1 #T2 * -L -T1 -T2 +[ #I #L #J #H destruct /2 width=1/ +| #L #K #V #V2 #T2 #i #HLK #HV2 #HVT2 #J #H destruct /3 width=8/ +| #a #I #L #V1 #V2 #T1 #T2 #_ #_ #J #H destruct +| #I #L #V1 #V2 #T1 #T2 #_ #_ #J #H destruct +| #L #V #T1 #T #T2 #_ #_ #J #H destruct +| #L #V #T1 #T2 #_ #J #H destruct +] +qed-. + +lemma cpqs_inv_atom1: ∀I,L,T2. L ⊢ ⓪{I} ➤* T2 → + T2 = ⓪{I} ∨ + ∃∃K,V,V2,i. ⇩[O, i] L ≡ K. ⓓV & + K ⊢ V ➤* V2 & + ⇧[O, i + 1] V2 ≡ T2 & + I = LRef i. +/2 width=3 by cpqs_inv_atom1_aux/ qed-. + +lemma cpqs_inv_sort1: ∀L,T2,k. L ⊢ ⋆k ➤* T2 → T2 = ⋆k. +#L #T2 #k #H +elim (cpqs_inv_atom1 … H) -H // +* #K #V #V2 #i #_ #_ #_ #H destruct +qed-. + +lemma cpqs_inv_lref1: ∀L,T2,i. L ⊢ #i ➤* T2 → + T2 = #i ∨ + ∃∃K,V,V2. ⇩[O, i] L ≡ K. ⓓV & + K ⊢ V ➤* V2 & + ⇧[O, i + 1] V2 ≡ T2. +#L #T2 #i #H +elim (cpqs_inv_atom1 … H) -H /2 width=1/ +* #K #V #V2 #j #HLK #HV2 #HVT2 #H destruct /3 width=6/ +qed-. + +lemma cpqs_inv_gref1: ∀L,T2,p. L ⊢ §p ➤* T2 → T2 = §p. +#L #T2 #p #H +elim (cpqs_inv_atom1 … H) -H // +* #K #V #V2 #i #_ #_ #_ #H destruct +qed-. + +fact cpqs_inv_bind1_aux: ∀L,U1,U2. L ⊢ U1 ➤* U2 → + ∀a,I,V1,T1. U1 = ⓑ{a,I} V1. T1 → ( + ∃∃V2,T2. L ⊢ V1 ➤* V2 & + L. ⓑ{I} V1 ⊢ T1 ➤* T2 & + U2 = ⓑ{a,I} V2. T2 + ) ∨ + ∃∃T. L.ⓓV1 ⊢ T1 ➤* T & ⇧[0, 1] U2 ≡ T & a = true & I = Abbr. +#L #U1 #U2 * -L -U1 -U2 +[ #I #L #b #J #W1 #U1 #H destruct +| #L #K #V #V2 #W2 #i #_ #_ #_ #b #J #W1 #U1 #H destruct +| #a #I #L #V1 #V2 #T1 #T2 #HV12 #HT12 #b #J #W1 #U1 #H destruct /3 width=5/ +| #I #L #V1 #V2 #T1 #T2 #_ #_ #b #J #W1 #U1 #H destruct +| #L #V #T1 #T #T2 #HT1 #HT2 #b #J #W1 #U1 #H destruct /3 width=3/ +| #L #V #T1 #T2 #_ #b #J #W1 #U1 #H destruct +] +qed-. + +lemma cpqs_inv_bind1: ∀a,I,L,V1,T1,U2. L ⊢ ⓑ{a,I} V1. T1 ➤* U2 → ( + ∃∃V2,T2. L ⊢ V1 ➤* V2 & + L. ⓑ{I} V1 ⊢ T1 ➤* T2 & + U2 = ⓑ{a,I} V2. T2 + ) ∨ + ∃∃T. L.ⓓV1 ⊢ T1 ➤* T & ⇧[0, 1] U2 ≡ T & a = true & I = Abbr. +/2 width=3 by cpqs_inv_bind1_aux/ qed-. + +lemma cpqs_inv_abbr1: ∀a,L,V1,T1,U2. L ⊢ ⓓ{a} V1. T1 ➤* U2 → ( + ∃∃V2,T2. L ⊢ V1 ➤* V2 & + L. ⓓ V1 ⊢ T1 ➤* T2 & + U2 = ⓓ{a} V2. T2 + ) ∨ + ∃∃T. L.ⓓV1 ⊢ T1 ➤* T & ⇧[0, 1] U2 ≡ T & a = true. +#a #L #V1 #T1 #U2 #H +elim (cpqs_inv_bind1 … H) -H * /3 width=3/ /3 width=5/ +qed-. + +lemma cpqs_inv_abst1: ∀a,L,V1,T1,U2. L ⊢ ⓛ{a} V1. T1 ➤* U2 → + ∃∃V2,T2. L ⊢ V1 ➤* V2 & + L. ⓛ V1 ⊢ T1 ➤* T2 & + U2 = ⓛ{a} V2. T2. +#a #L #V1 #T1 #U2 #H +elim (cpqs_inv_bind1 … H) -H * +[ /3 width=5/ +| #T #_ #_ #_ #H destruct +] +qed-. + +fact cpqs_inv_flat1_aux: ∀L,U1,U2. L ⊢ U1 ➤* U2 → + ∀I,V1,T1. U1 = ⓕ{I} V1. T1 → ( + ∃∃V2,T2. L ⊢ V1 ➤* V2 & L ⊢ T1 ➤* T2 & + U2 = ⓕ{I} V2. T2 + ) ∨ + (L ⊢ T1 ➤* U2 ∧ I = Cast). +#L #U1 #U2 * -L -U1 -U2 +[ #I #L #J #W1 #U1 #H destruct +| #L #K #V #V2 #W2 #i #_ #_ #_ #J #W1 #U1 #H destruct +| #a #I #L #V1 #V2 #T1 #T2 #_ #_ #J #W1 #U1 #H destruct +| #I #L #V1 #V2 #T1 #T2 #HV12 #HT12 #J #W1 #U1 #H destruct /3 width=5/ +| #L #V #T1 #T #T2 #_ #_ #J #W1 #U1 #H destruct +| #L #V #T1 #T2 #HT12 #J #W1 #U1 #H destruct /3 width=1/ +] +qed-. + +lemma cpqs_inv_flat1: ∀I,L,V1,T1,U2. L ⊢ ⓕ{I} V1. T1 ➤* U2 → ( + ∃∃V2,T2. L ⊢ V1 ➤* V2 & L ⊢ T1 ➤* T2 & + U2 = ⓕ{I} V2. T2 + ) ∨ + (L ⊢ T1 ➤* U2 ∧ I = Cast). +/2 width=3 by cpqs_inv_flat1_aux/ qed-. + +lemma cpqs_inv_appl1: ∀L,V1,T1,U2. L ⊢ ⓐ V1. T1 ➤* U2 → + ∃∃V2,T2. L ⊢ V1 ➤* V2 & L ⊢ T1 ➤* T2 & + U2 = ⓐ V2. T2. +#L #V1 #T1 #U2 #H elim (cpqs_inv_flat1 … H) -H * +[ /3 width=5/ +| #_ #H destruct +] +qed-. + +lemma cpqs_inv_cast1: ∀L,V1,T1,U2. L ⊢ ⓝ V1. T1 ➤* U2 → ( + ∃∃V2,T2. L ⊢ V1 ➤* V2 & L ⊢ T1 ➤* T2 & + U2 = ⓝ V2. T2 + ) ∨ + L ⊢ T1 ➤* U2. +#L #V1 #T1 #U2 #H elim (cpqs_inv_flat1 … H) -H * /2 width=1/ /3 width=5/ +qed-. + +(* Basic forward lemmas *****************************************************) + +lemma cpqs_fwd_shift1: ∀L1,L,T1,T. L ⊢ L1 @@ T1 ➤* T → + ∃∃L2,T2. |L1| = |L2| & T = L2 @@ T2. +#L1 @(lenv_ind_dx … L1) -L1 normalize +[ #L #T1 #T #HT1 + @(ex2_2_intro … (⋆)) // (**) (* explicit constructor *) +| #I #L1 #V1 #IH #L #T1 #X + >shift_append_assoc normalize #H + elim (cpqs_inv_bind1 … H) -H * + [ #V0 #T0 #_ #HT10 #H destruct + elim (IH … HT10) -IH -HT10 #L2 #T2 #HL12 #H destruct + >append_length >HL12 -HL12 + @(ex2_2_intro … (⋆.ⓑ{I}V0@@L2) T2) [ >append_length ] // /2 width=3/ (**) (* explicit constructor *) + | #T #_ #_ #H destruct + ] +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/cpqs_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/cpqs_lift.etc new file mode 100644 index 000000000..78529b6b1 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/cpqs_lift.etc @@ -0,0 +1,81 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/ldrop_ldrop.ma". +include "basic_2/unfold/cpqs.ma". + +(* CONTEXT-SENSITIVE RESTRICTED PARALLEL COMPUTATION FOR TERMS **************) + +(* Relocation properties ****************************************************) + +lemma cpqs_lift: l_liftable cpqs. +#K #T1 #T2 #H elim H -K -T1 -T2 +[ #I #K #L #d #e #_ #U1 #H1 #U2 #H2 + >(lift_mono … H1 … H2) -H1 -H2 // +| #K #KV #V #V2 #W2 #i #HKV #HV2 #HVW2 #IHV2 #L #d #e #HLK #U1 #H #U2 #HWU2 + elim (lift_inv_lref1 … H) * #Hid #H destruct + [ elim (lift_trans_ge … HVW2 … HWU2) -W2 // plus_plus_comm_23 #HVU2 + lapply (ldrop_trans_ge_comm … HLK … HKV ?) -K // -Hid /3 width=6/ + ] +| #a #I #K #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #d #e #HLK #U1 #H1 #U2 #H2 + elim (lift_inv_bind1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 destruct + elim (lift_inv_bind1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /4 width=5/ +| #I #K #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #d #e #HLK #U1 #H1 #U2 #H2 + elim (lift_inv_flat1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 destruct + elim (lift_inv_flat1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /3 width=6/ +| #K #V #T1 #T #T2 #_ #HT2 #IHT1 #L #d #e #HLK #U1 #H #U2 #HTU2 + elim (lift_inv_bind1 … H) -H #VV1 #TT1 #HVV1 #HTT1 #H destruct + elim (lift_conf_O1 … HTU2 … HT2) -T2 /4 width=5/ +| #K #V #T1 #T2 #_ #IHT12 #L #d #e #HLK #U1 #H #U2 #HTU2 + elim (lift_inv_flat1 … H) -H #VV1 #TT1 #HVV1 #HTT1 #H destruct /3 width=5/ +] +qed. + +lemma cpqs_inv_lift1: l_deliftable_sn cpqs. +#L #U1 #U2 #H elim H -L -U1 -U2 +[ * #L #i #K #d #e #_ #T1 #H + [ lapply (lift_inv_sort2 … H) -H #H destruct /2 width=3/ + | elim (lift_inv_lref2 … H) -H * #Hid #H destruct /3 width=3/ + | lapply (lift_inv_gref2 … H) -H #H destruct /2 width=3/ + ] +| #L #LV #V #V2 #W2 #i #HLV #HV2 #HVW2 #IHV2 #K #d #e #HLK #T1 #H + elim (lift_inv_lref2 … H) -H * #Hid #H destruct + [ elim (ldrop_conf_lt … HLK … HLV) -L // #L #U #HKL #HLV #HUV + elim (IHV2 … HLV … HUV) -V #U2 #HUV2 #HU2 + elim (lift_trans_le … HUV2 … HVW2) -V2 // >minus_plus plus_minus // shift_append_assoc normalize #H + elim (cpss_inv_bind1 … H) -H + #V0 #T0 #_ #HT10 #H destruct + elim (IH … HT10) -IH -HT10 #L2 #T2 #HL12 #H destruct + >append_length >HL12 -HL12 + @(ex2_2_intro … (⋆.ⓑ{I}V0@@L2) T2) [ >append_length ] // /2 width=3/ (**) (* explicit constructor *) +] +qed-. + +(* Basic_1: removed theorems 27: + subst0_gen_sort subst0_gen_lref subst0_gen_head subst0_gen_lift_lt + subst0_gen_lift_false subst0_gen_lift_ge subst0_refl subst0_trans + subst0_lift_lt subst0_lift_ge subst0_lift_ge_S subst0_lift_ge_s + subst0_subst0 subst0_subst0_back subst0_weight_le subst0_weight_lt + subst0_confluence_neq subst0_confluence_eq subst0_tlt_head + subst0_confluence_lift subst0_tlt + subst1_head subst1_gen_head subst1_lift_S subst1_confluence_lift + subst1_gen_lift_eq subst1_confluence_neq +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/cpss_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/cpss_lift.etc new file mode 100644 index 000000000..9745b6cde --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/cpss_lift.etc @@ -0,0 +1,71 @@ +(**************************************************************************) +(* ___ *) +(* ||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/relocation/ldrop_ldrop.ma". +include "basic_2/substitution/cpss.ma". + +(* CONTEXT-SENSITIVE PARALLEL SUBSTITUTION FOR TERMS ************************) + +(* Relocation properties ****************************************************) + +(* Basic_1: was only: subst1_lift_lt subst1_lift_ge *) +lemma cpss_lift: l_liftable cpss. +#K #T1 #T2 #H elim H -K -T1 -T2 +[ #I #K #L #d #e #_ #U1 #H1 #U2 #H2 + >(lift_mono … H1 … H2) -H1 -H2 // +| #K #KV #V #V2 #W2 #i #HKV #HV2 #HVW2 #IHV2 #L #d #e #HLK #U1 #H #U2 #HWU2 + elim (lift_inv_lref1 … H) * #Hid #H destruct + [ elim (lift_trans_ge … HVW2 … HWU2) -W2 // plus_plus_comm_23 #HVU2 + lapply (ldrop_trans_ge_comm … HLK … HKV ?) -K // -Hid /3 width=6/ + ] +| #a #I #K #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #d #e #HLK #U1 #H1 #U2 #H2 + elim (lift_inv_bind1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 destruct + elim (lift_inv_bind1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /4 width=5/ +| #I #K #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #d #e #HLK #U1 #H1 #U2 #H2 + elim (lift_inv_flat1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 destruct + elim (lift_inv_flat1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /3 width=6/ +] +qed. + +(* Basic_1: was only: subst1_gen_lift_lt subst1_gen_lift_ge *) +lemma cpss_inv_lift1: l_deliftable_sn cpss. +#L #U1 #U2 #H elim H -L -U1 -U2 +[ * #L #i #K #d #e #_ #T1 #H + [ lapply (lift_inv_sort2 … H) -H #H destruct /2 width=3/ + | elim (lift_inv_lref2 … H) -H * #Hid #H destruct /3 width=3/ + | lapply (lift_inv_gref2 … H) -H #H destruct /2 width=3/ + ] +| #L #LV #V #V2 #W2 #i #HLV #HV2 #HVW2 #IHV2 #K #d #e #HLK #T1 #H + elim (lift_inv_lref2 … H) -H * #Hid #H destruct + [ elim (ldrop_conf_lt … HLK … HLV) -L // #L #U #HKL #HLV #HUV + elim (IHV2 … HLV … HUV) -V #U2 #HUV2 #HU2 + elim (lift_trans_le … HUV2 … HVW2) -V2 // >minus_plus plus_minus // shift_append_assoc #H shift_append_assoc #H (cpss_inv_sort1 … H) -X // +| #I #L1 #K1 #V1 #i #HLK1 #_ #IHV1 #W2 #H #L2 #HL12 + elim (cpss_inv_lref1 … H) -H + [ #H destruct + elim (lpss_ldrop_conf … HLK1 … HL12) -L1 #X #H #HLK2 + elim (lpss_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct + lapply (IHV1 … HV12 … HK12) -IHV1 -HV12 -HK12 /2 width=5/ + | * #K0 #V0 #V2 #HLK0 #HV12 #HVW2 + lapply (ldrop_mono … HLK0 … HLK1) -HLK0 #H destruct + elim (lpss_ldrop_conf … HLK1 … HL12) -L1 #X #H #HLK2 + elim (lpss_inv_pair1 … H) -H #K2 #V #HK12 #_ #H destruct + lapply (ldrop_fwd_ldrop2 … HLK2) -V #HLK2 + lapply (IHV1 … HV12 … HK12) -IHV1 -HV12 -HK12 /2 width=7/ + ] +| #a #I #L1 #V1 #T1 #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12 + elim (cpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct + lapply (IHV1 … HV12 … HL12) -IHV1 #HV2 + lapply (IHT1 … HT12 (L2.ⓑ{I}V2) ?) -IHT1 -HT12 /2 width=1/ +| #a #L1 #V1 #W1 #W0 #T1 #U1 #l #_ #_ #HVW1 #HW10 #HTU1 #IHV1 #IHT1 #X #H #L2 #HL12 + elim (cpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct + lapply (IHV1 … HV12 … HL12) -IHV1 #HV2 + lapply (IHT1 … HT12 … HL12) -IHT1 #HT2 + elim (ssta_cpss_lpss_conf … HVW1 … HV12 … HL12) -V1 #W2 #HVW2 #HW12 + elim (dxprs_cpss_lpss_conf … HTU1 … HT12 … HL12) -T1 #X #HTU2 #H + elim (cpss_inv_bind1 … H) -H #W #U2 #HW0 #_ #H -U1 destruct + elim (cprs_cpss2_lpss_conf_dx … HW10 … HW12 … HW0 … HL12) -L1 -W1 -W0 #W0 #HW20 #HW0 + lapply (dxprs_strap1 … (ⓛ{a}W0.U2) HTU2 ?) -HTU2 /3 width=3/ -HW0 /2 width=8/ +| #L1 #W1 #T1 #U1 #l #_ #_ #HTU1 #HUW1 #IHW1 #IHT1 #X #H #L2 #HL12 + elim (cpss_inv_flat1 … H) -H #W2 #T2 #HW12 #HT12 #H destruct + lapply (IHW1 … HW12 … HL12) -IHW1 #HW2 + lapply (IHT1 … HT12 … HL12) -IHT1 #HT2 + elim (ssta_cpss_lpss_conf … HTU1 … HT12 … HL12) -T1 #U2 #HTU2 #HU12 + lapply (cpcs_cpss2_lpss_conf … HUW1 … HU12 … HW12 … HL12) -L1 -W1 -U1 /2 width=4/ +] +qed-. + +lemma snv_lpss_conf: ∀h,g,L1,T. ⦃h, L1⦄ ⊢ T ¡[g] → + ∀L2. L1 ⊢ ▶* L2 → ⦃h, L2⦄ ⊢ T ¡[g]. +#h #g #L1 #T #HT #L2 #HL12 +@(snv_cpss_lpss_conf … HT … HL12) // +qed-. + +lemma snv_cpss_conf: ∀h,g,L,T1. ⦃h, L⦄ ⊢ T1 ¡[g] → + ∀T2. L ⊢ T1 ▶* T2 → ⦃h, L⦄ ⊢ T2 ¡[g]. +#h #g #L #T1 #HT1 #T2 #HT12 +@(snv_cpss_lpss_conf … HT1 … HT12) // +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/ssta_lpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/ssta_lpss.etc new file mode 100644 index 000000000..7471b2304 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/ssta_lpss.etc @@ -0,0 +1,81 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/lpss_ldrop.ma". +include "basic_2/static/ssta_lift.ma". + +(* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************) + +(* Properties about sn parallel substitution ********************************) + +(* Note: apparently this was missing in basic_1 *) +lemma ssta_cpss_lpss_conf: ∀h,g,L1,T1,U1,l. ⦃h, L1⦄ ⊢ T1 •[g] ⦃l, U1⦄ → + ∀T2. L1 ⊢ T1 ▶* T2 → ∀L2. L1 ⊢ ▶* L2 → + ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g] ⦃l, U2⦄ & L1 ⊢ U1 ▶* U2. +#h #g #L1 #T1 #U1 #l #H elim H -L1 -T1 -U1 -l +[ #L1 #k1 #l1 #Hkl1 #X #H + >(cpss_inv_sort1 … H) -H /3 width=3/ +| #L1 #K1 #V1 #W1 #U1 #i #l #HLK1 #_ #HWU1 #IHVW1 #X #H #L2 #HL12 + elim (cpss_inv_lref1 … H) -H + [ #H destruct + elim (lpss_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2 + elim (lpss_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct + lapply (ldrop_fwd_ldrop2 … HLK1) -HLK1 #HLK1 + elim (IHVW1 … HV12 … HK12) -IHVW1 -HV12 -HK12 #W2 #HVW2 #HW12 + elim (lift_total W2 0 (i+1)) #U2 #HWU2 + lapply (cpss_lift … HW12 … HLK1 … HWU1 … HWU2) -HW12 -HLK1 -HWU1 /3 width=6/ + | * #Y #Z #V2 #H #HV12 #HV2 + lapply (ldrop_mono … H … HLK1) -H #H destruct + elim (lpss_ldrop_conf … HLK1 … HL12) -HL12 #Z #H #HLK2 + elim (lpss_inv_pair1 … H) -H #K2 #V0 #HK12 #_ #H destruct + lapply (ldrop_fwd_ldrop2 … HLK2) -V0 #HLK2 + lapply (ldrop_fwd_ldrop2 … HLK1) -HLK1 #HLK1 + elim (IHVW1 … HV12 … HK12) -IHVW1 -HK12 -HV12 #W2 #HVW2 #HW12 + elim (lift_total W2 0 (i+1)) #U2 #HWU2 + lapply (ssta_lift … HVW2 … HLK2 … HV2 … HWU2) -HVW2 -HLK2 -HV2 + lapply (cpss_lift … HW12 … HLK1 … HWU1 … HWU2) -HW12 -HLK1 -HWU1 -HWU2 /3 width=3/ + ] +| #L1 #K1 #W1 #V1 #U1 #i #l #HLK1 #_ #HWU1 #IHWV1 #X #H #L2 #HL12 + elim (cpss_inv_lref1 … H) -H [ | -IHWV1 -HWU1 -HL12 ] + [ #H destruct + elim (lpss_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2 + elim (lpss_inv_pair1 … H) -H #K2 #W2 #HK12 #HW12 #H destruct + lapply (ldrop_fwd_ldrop2 … HLK1) -HLK1 #HLK1 + elim (IHWV1 … HW12 … HK12) -IHWV1 -HK12 #V2 #HWV2 #_ + elim (lift_total W2 0 (i+1)) #U2 #HWU2 + lapply (cpss_lift … HW12 … HLK1 … HWU1 … HWU2) -HW12 -HLK1 -HWU1 /3 width=6/ + | * #K2 #V2 #W2 #HLK2 #_ #_ + lapply (ldrop_mono … HLK2 … HLK1) -HLK1 -HLK2 #H destruct + ] +| #a #I #L1 #V1 #T1 #U1 #l #_ #IHTU1 #X #H #L2 #HL12 + elim (cpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct + elim (IHTU1 … HT12 (L2.ⓑ{I}V2)) -IHTU1 -HT12 /2 width=1/ -HL12 /3 width=5/ +| #L1 #V1 #T1 #U1 #l #_ #IHTU1 #X #H #L2 #HL12 + elim (cpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct + elim (IHTU1 … HT12 … HL12) -IHTU1 -HT12 -HL12 /3 width=5/ +| #L1 #W1 #T1 #U1 #l #_ #IHTU1 #X #H #L2 #HL12 + elim (cpss_inv_flat1 … H) -H #W2 #T2 #HW12 #HT12 #H destruct + elim (IHTU1 … HT12 … HL12) -IHTU1 -HT12 -HL12 /3 width=3/ +] +qed-. + +lemma ssta_cpss_conf: ∀h,g,L,T1,U1,l. ⦃h, L⦄ ⊢ T1 •[g] ⦃l, U1⦄ → + ∀T2. L ⊢ T1 ▶* T2 → + ∃∃U2. ⦃h, L⦄ ⊢ T2 •[g] ⦃l, U2⦄ & L ⊢ U1 ▶* U2. +/2 width=3 by ssta_cpss_lpss_conf/ qed-. + +lemma ssta_lpss_conf: ∀h,g,L1,T,U1,l. ⦃h, L1⦄ ⊢ T •[g] ⦃l, U1⦄ → + ∀L2. L1 ⊢ ▶* L2 → + ∃∃U2. ⦃h, L2⦄ ⊢ T •[g] ⦃l, U2⦄ & L1 ⊢ U1 ▶* U2. +/2 width=3 by ssta_cpss_lpss_conf/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/sstas_lpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/sstas_lpss.etc new file mode 100644 index 000000000..3ecbc2256 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/lsubr/sstas_lpss.etc @@ -0,0 +1,39 @@ +(**************************************************************************) +(* ___ *) +(* ||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/static/ssta_lpss.ma". +include "basic_2/unfold/sstas.ma". + +(* ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *********************) + +(* Properties about sn parallel substitution for local environments *********) + +lemma sstas_cpss_lpss_conf: ∀h,g,L1,T1,U1. ⦃h, L1⦄ ⊢ T1 •*[g] U1 → + ∀T2. L1 ⊢ T1 ▶* T2 → ∀L2. L1 ⊢ ▶* L2 → + ∃∃U2. ⦃h, L2⦄ ⊢ T2 •*[g] U2 & L1 ⊢ U1 ▶* U2. +#h #g #L1 #T1 #U1 #H @(sstas_ind_dx … H) -T1 /2 width=3/ +#T0 #U0 #l0 #HTU0 #_ #IHU01 #T #HT0 #L2 #HL12 +elim (ssta_cpss_lpss_conf … HTU0 … HT0 … HL12) -HTU0 -HT0 #U #HTU #HU0 +elim (IHU01 … HU0 … HL12) -IHU01 -U0 -HL12 /3 width=4/ +qed-. + +lemma sstas_cpss_conf: ∀h,g,L,T1,U1. ⦃h, L⦄ ⊢ T1 •*[g] U1 → + ∀T2. L ⊢ T1 ▶* T2 → + ∃∃U2. ⦃h, L⦄ ⊢ T2 •*[g] U2 & L ⊢ U1 ▶* U2. +/2 width=3 by sstas_cpss_lpss_conf/ qed-. + +lemma sstas_lpss_conf: ∀h,g,L1,T,U1. ⦃h, L1⦄ ⊢ T •*[g] U1 → + ∀L2. L1 ⊢ ▶* L2 → + ∃∃U2. ⦃h, L2⦄ ⊢ T •*[g] U2 & L1 ⊢ U1 ▶* U2. +/2 width=3 by sstas_cpss_lpss_conf/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/lsubn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/lsubn.etc new file mode 100644 index 000000000..c4359c35f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/lsubn.etc @@ -0,0 +1,118 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( h ⊢ break term 46 L1 : ⊑ break term 46 L2 )" + non associative with precedence 45 + for @{ 'CrSubEqN $h $L1 $L2 }. + +notation "hvbox( h ⊢ break term 46 L1 : : ⊑ break term 46 L2 )" + non associative with precedence 45 + for @{ 'CrSubEqNAlt $h $L1 $L2 }. + +include "basic_2/dynamic/nta.ma". + +(* LOCAL ENVIRONMENT REFINEMENT FOR NATIVE TYPE ASSIGNMENT ******************) + +(* Note: may not be transitive *) +inductive lsubn (h:sh): relation lenv ≝ +| lsubn_atom: lsubn h (⋆) (⋆) +| lsubn_pair: ∀I,L1,L2,W. lsubn h L1 L2 → lsubn h (L1. ⓑ{I} W) (L2. ⓑ{I} W) +| lsubn_abbr: ∀L1,L2,V,W. ⦃h, L1⦄ ⊢ V : W → ⦃h, L2⦄ ⊢ V : W → + lsubn h L1 L2 → lsubn h (L1. ⓓV) (L2. ⓛW) +. + +interpretation + "local environment refinement (native type assigment)" + 'CrSubEqN h L1 L2 = (lsubn h L1 L2). + +(* Basic inversion lemmas ***************************************************) + +fact lsubn_inv_atom1_aux: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → L1 = ⋆ → L2 = ⋆. +#h #L1 #L2 * -L1 -L2 +[ // +| #I #L1 #L2 #V #_ #H destruct +| #L1 #L2 #V #W #_ #_ #_ #H destruct +] +qed. + +lemma lsubn_inv_atom1: ∀h,L2. h ⊢ ⋆ :⊑ L2 → L2 = ⋆. +/2 width=4/ qed-. + +fact lsubn_inv_pair1_aux: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → ∀I,K1,V. L1 = K1. ⓑ{I} V → + (∃∃K2. h ⊢ K1 :⊑ K2 & L2 = K2. ⓑ{I} V) ∨ + ∃∃K2,W. ⦃h, K1⦄ ⊢ V : W & ⦃h, K2⦄ ⊢ V : W & + h ⊢ K1 :⊑ K2 & L2 = K2. ⓛW & I = Abbr. +#h #L1 #L2 * -L1 -L2 +[ #I #K1 #V #H destruct +| #J #L1 #L2 #V #HL12 #I #K1 #W #H destruct /3 width=3/ +| #L1 #L2 #V #W #H1VW #H2VW #HL12 #I #K1 #V1 #H destruct /3 width=7/ +] +qed. + +lemma lsubn_inv_pair1: ∀h,I,K1,L2,V. h ⊢ K1. ⓑ{I} V :⊑ L2 → + (∃∃K2. h ⊢ K1 :⊑ K2 & L2 = K2. ⓑ{I} V) ∨ + ∃∃K2,W. ⦃h, K1⦄ ⊢ V : W & ⦃h, K2⦄ ⊢ V : W & + h ⊢ K1 :⊑ K2 & L2 = K2. ⓛW & I = Abbr. +/2 width=3/ qed-. + +fact lsubn_inv_atom2_aux: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → L2 = ⋆ → L1 = ⋆. +#h #L1 #L2 * -L1 -L2 +[ // +| #I #L1 #L2 #V #_ #H destruct +| #L1 #L2 #V #W #_ #_ #_ #H destruct +] +qed. + +lemma lsubc_inv_atom2: ∀h,L1. h ⊢ L1 :⊑ ⋆ → L1 = ⋆. +/2 width=4/ qed-. + +fact lsubn_inv_pair2_aux: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → ∀I,K2,W. L2 = K2. ⓑ{I} W → + (∃∃K1. h ⊢ K1 :⊑ K2 & L1 = K1. ⓑ{I} W) ∨ + ∃∃K1,V. ⦃h, K1⦄ ⊢ V : W & ⦃h, K2⦄ ⊢ V : W & + h ⊢ K1 :⊑ K2 & L1 = K1. ⓓV & I = Abst. +#h #L1 #L2 * -L1 -L2 +[ #I #K2 #W #H destruct +| #J #L1 #L2 #V #HL12 #I #K2 #W #H destruct /3 width=3/ +| #L1 #L2 #V #W #H1VW #H2VW #HL12 #I #K2 #W2 #H destruct /3 width=7/ +] +qed. + +(* Basic_1: was: csubt_gen_bind *) +lemma lsubn_inv_pair2: ∀h,I,L1,K2,W. h ⊢ L1 :⊑ K2. ⓑ{I} W → + (∃∃K1. h ⊢ K1 :⊑ K2 & L1 = K1. ⓑ{I} W) ∨ + ∃∃K1,V. ⦃h, K1⦄ ⊢ V : W & ⦃h, K2⦄ ⊢ V : W & + h ⊢ K1 :⊑ K2 & L1 = K1. ⓓV & I = Abst. +/2 width=3/ qed-. + +(* Basic_forward lemmas *****************************************************) + +lemma lsubn_fwd_lsubs1: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → L1 ≼[0, |L1|] L2. +#h #L1 #L2 #H elim H -L1 -L2 // /2 width=1/ +qed-. + +lemma lsubn_fwd_lsubs2: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → L1 ≼[0, |L2|] L2. +#h #L1 #L2 #H elim H -L1 -L2 // /2 width=1/ +qed-. + +(* Basic properties *********************************************************) + +(* Basic_1: was: csubt_refl *) +lemma lsubn_refl: ∀h,L. h ⊢ L :⊑ L. +#h #L elim L -L // /2 width=1/ +qed. + +(* Basic_1: removed theorems 6: + csubt_gen_flat csubt_drop_flat csubt_clear_conf + csubt_getl_abbr csubt_getl_abst csubt_ty3_ld +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/lsubn_cpcs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/lsubn_cpcs.etc new file mode 100644 index 000000000..5f610bc96 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/lsubn_cpcs.etc @@ -0,0 +1,34 @@ +(**************************************************************************) +(* ___ *) +(* ||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/equivalence/cpcs_cpcs.ma". +include "basic_2/dynamic/lsubn.ma". + +(* LOCAL ENVIRONMENT REFINEMENT FOR NATIVE TYPE ASSIGNMENT ******************) + +(* Properties on context-sensitive parallel equivalence for terms ***********) + +(* Basic_1: was: csubt_pr2 *) +lemma cpr_lsubn_trans: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → + ∀T1,T2. L2 ⊢ T1 ➡ T2 → L1 ⊢ T1 ➡ T2. +/3 width=4 by lsubn_fwd_lsubs2, cpr_lsubs_trans/ qed. + +lemma cprs_lsubn_trans: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → + ∀T1,T2. L2 ⊢ T1 ➡* T2 → L1 ⊢ T1 ➡* T2. +/3 width=4 by lsubn_fwd_lsubs2, cprs_lsubs_trans/ qed. + +(* Basic_1: was: csubt_pc3 *) +lemma cpcs_lsubn_trans: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → + ∀T1,T2. L2 ⊢ T1 ⬌* T2 → L1 ⊢ T1 ⬌* T2. +/3 width=4 by lsubn_fwd_lsubs2, cpcs_lsubs_trans/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/lsubn_ldrop.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/lsubn_ldrop.etc new file mode 100644 index 000000000..a16fff618 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/lsubn_ldrop.etc @@ -0,0 +1,64 @@ +(**************************************************************************) +(* ___ *) +(* ||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/dynamic/lsubn.ma". + +(* LOCAL ENVIRONMENT REFINEMENT FOR NATIVE TYPE ASSIGNMENT ******************) + +(* Properties concerning basic local environment slicing ********************) + +(* Note: the constant 0 cannot be generalized *) +lemma lsubn_ldrop_O1_conf: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → ∀K1,e. ⇩[0, e] L1 ≡ K1 → + ∃∃K2. h ⊢ K1 :⊑ K2 & ⇩[0, e] L2 ≡ K2. +#h #L1 #L2 #H elim H -L1 -L2 +[ /2 width=3/ +| #I #L1 #L2 #V #_ #IHL12 #K1 #e #H + elim (ldrop_inv_O1 … H) -H * #He #HLK1 + [ destruct + elim (IHL12 L1 0 ?) -IHL12 // #X #HL12 #H + <(ldrop_inv_refl … H) in HL12; -H /3 width=3/ + | elim (IHL12 … HLK1) -L1 /3 width=3/ + ] +| #L1 #L2 #V #W #H1VW #H2VW #_ #IHL12 #K1 #e #H + elim (ldrop_inv_O1 … H) -H * #He #HLK1 + [ destruct + elim (IHL12 L1 0 ?) -IHL12 // #X #HL12 #H + <(ldrop_inv_refl … H) in HL12; -H /3 width=3/ + | elim (IHL12 … HLK1) -L1 /3 width=3/ + ] +] +qed. + +(* Note: the constant 0 cannot be generalized *) +(* Basic_1: was only: csubt_drop_abbr csubt_drop_abst *) +lemma lsubn_ldrop_O1_trans: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → ∀K2,e. ⇩[0, e] L2 ≡ K2 → + ∃∃K1. h ⊢ K1 :⊑ K2 & ⇩[0, e] L1 ≡ K1. +#h #L1 #L2 #H elim H -L1 -L2 +[ /2 width=3/ +| #I #L1 #L2 #V #_ #IHL12 #K2 #e #H + elim (ldrop_inv_O1 … H) -H * #He #HLK2 + [ destruct + elim (IHL12 L2 0 ?) -IHL12 // #X #HL12 #H + <(ldrop_inv_refl … H) in HL12; -H /3 width=3/ + | elim (IHL12 … HLK2) -L2 /3 width=3/ + ] +| #L1 #L2 #V #W #H1VW #H2VW #_ #IHL12 #K2 #e #H + elim (ldrop_inv_O1 … H) -H * #He #HLK2 + [ destruct + elim (IHL12 L2 0 ?) -IHL12 // #X #HL12 #H + <(ldrop_inv_refl … H) in HL12; -H /3 width=3/ + | elim (IHL12 … HLK2) -L2 /3 width=3/ + ] +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/lsubn_nta.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/lsubn_nta.etc new file mode 100644 index 000000000..5832b00b6 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/lsubn_nta.etc @@ -0,0 +1,47 @@ +(**************************************************************************) +(* ___ *) +(* ||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/dynamic/nta_nta.ma". +include "basic_2/dynamic/lsubn_ldrop.ma". +include "basic_2/dynamic/lsubn_cpcs.ma". + +(* LOCAL ENVIRONMENT REFINEMENT FOR NATIVE TYPE ASSIGNMENT ******************) + +(* Properties concerning atomic arity assignment ****************************) + +(* Note: the corresponding confluence property does not hold *) +(* Basic_1: was: csubt_ty3 *) +lemma lsubn_nta_trans: ∀h,L2,T,U. ⦃h, L2⦄ ⊢ T : U → ∀L1. h ⊢ L1 :⊑ L2 → + ⦃h, L1⦄ ⊢ T : U. +#h #L2 #T #U #H elim H -L2 -T -U +[ // +| #L2 #K2 #V2 #W2 #U2 #i #HLK2 #_ #WU2 #IHVW2 #L1 #HL12 + elim (lsubn_ldrop_O1_trans … HL12 … HLK2) -L2 #X #H #HLK1 + elim (lsubn_inv_pair2 … H) -H * #K1 + [ #HK12 #H destruct /3 width=6/ + | #V1 #_ #_ #_ #_ #H destruct + ] +| #L2 #K2 #W2 #V2 #U2 #i #HLK2 #_ #HWU2 #IHWV2 #L1 #HL12 + elim (lsubn_ldrop_O1_trans … HL12 … HLK2) -L2 #X #H #HLK1 + elim (lsubn_inv_pair2 … H) -H * #K1 [ | -IHWV2 ] + [ #HK12 #H destruct /3 width=6/ + | #V1 #H1V1W2 #_ #_ #H #_ destruct /2 width=6/ + ] +| /4 width=2/ +| /3 width=1/ +| /3 width=2/ +| /3 width=1/ +| /4 width=6/ +] +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta.etc new file mode 100644 index 000000000..fa4a8ed8f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta.etc @@ -0,0 +1,53 @@ +(**************************************************************************) +(* ___ *) +(* ||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/static/sh.ma". +include "basic_2/equivalence/cpcs.ma". + +(* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************) + +inductive nta (h:sh): lenv → relation term ≝ +| nta_sort: ∀L,k. nta h L (⋆k) (⋆(next h k)) +| nta_ldef: ∀L,K,V,W,U,i. ⇩[0, i] L ≡ K. ⓓV → nta h K V W → + ⇧[0, i + 1] W ≡ U → nta h L (#i) U +| nta_ldec: ∀L,K,W,V,U,i. ⇩[0, i] L ≡ K. ⓛW → nta h K W V → + ⇧[0, i + 1] W ≡ U → nta h L (#i) U +| nta_bind: ∀I,L,V,W,T,U. nta h L V W → nta h (L. ⓑ{I} V) T U → + nta h L (ⓑ{I}V.T) (ⓑ{I}V.U) +| nta_appl: ∀L,V,W,T,U. nta h L V W → nta h L (ⓛW.T) (ⓛW.U) → + nta h L (ⓐV.ⓛW.T) (ⓐV.ⓛW.U) +| nta_pure: ∀L,V,W,T,U. nta h L T U → nta h L (ⓐV.U) W → + nta h L (ⓐV.T) (ⓐV.U) +| nta_cast: ∀L,T,U. nta h L T U → nta h L (ⓝU. T) U +| nta_conv: ∀L,T,U1,U2,V2. nta h L T U1 → L ⊢ U1 ⬌* U2 → nta h L U2 V2 → + nta h L T U2 +. + +interpretation "native type assignment (term)" + 'NativeType h L T U = (nta h L T U). + +(* Basic properties *********************************************************) + +(* Basic_1: was: ty3_cast *) +lemma nta_cast_old: ∀h,L,W,T,U. + ⦃h, L⦄ ⊢ T : U → ⦃h, L⦄ ⊢ U : W → ⦃h, L⦄ ⊢ ⓝU.T : ⓝW.U. +/4 width=3/ qed. + +(* Basic_1: was: ty3_typecheck *) +lemma nta_typecheck: ∀h,L,T,U. ⦃h, L⦄ ⊢ T : U → ∃T0. ⦃h, L⦄ ⊢ ⓝU.T : T0. +/3 width=2/ qed. + +(* Basic_1: removed theorems 4: + ty3_getl_subst0 ty3_fsubst0 ty3_csubst0 ty3_subst0 +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_aaa.etc new file mode 100644 index 000000000..962856983 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_aaa.etc @@ -0,0 +1,49 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/csn_aaa.ma". +include "basic_2/equivalence/lcpcs_aaa.ma". +include "basic_2/dynamic/nta.ma". + +(* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************) + +(* Forward lemmas on atomic arity assignment for terms **********************) + +lemma nta_fwd_aaa: ∀h,L,T,U. ⦃h, L⦄ ⊢ T : U → ∃∃A. L ⊢ T ⁝ A & L ⊢ U ⁝ A. +#h #L #T #U #H elim H -L -T -U +[ /2 width=3/ +| #L #K #V #W #U #i #HLK #_ #HWU * #B #HV #HW + lapply (ldrop_fwd_ldrop2 … HLK) /3 width=9/ +| #L #K #W #V #U #i #HLK #_ #HWU * #B #HW #_ -V + lapply (ldrop_fwd_ldrop2 … HLK) /3 width=9/ +| * #L #V #W #T #U #_ #_ * #B #HV #HW * #A #HT #HU + [ /3 width=3/ | /3 width=5/ ] +| #L #V #W #T #U #_ #_ * #B #HV #HW * #X #H1 #H2 + elim (aaa_inv_abst … H1) -H1 #B1 #A1 #HW1 #HT #H destruct + elim (aaa_inv_abst … H2) -H2 #B2 #A #_ #HU #H destruct + lapply (aaa_mono … HW1 … HW) -HW1 #H destruct /4 width=5/ +| #L #V #W #T #U #_ #_ * #X #HT #HUX * #A #H #_ -W + elim (aaa_inv_appl … H) -H #B #HV #HUA + lapply (aaa_mono … HUA … HUX) -HUX #H destruct /3 width=5/ +| #L #T #U #_ * #A #HT #HU /3 width=3/ +| #L #T #U1 #U2 #V2 #_ #HU12 #_ * #X #HT #HU1 * #A #HU2 #_ + lapply (aaa_cpcs_mono … HU12 … HU1 … HU2) -U1 #H destruct /2 width=3/ +] +qed-. + +(* Note: this is the stong normalization property *) +(* Basic_1: was only: ty3_sn3 *) +theorem nta_fwd_csn: ∀h,L,T,U. ⦃h, L⦄ ⊢ T : U → L ⊢ ⬇* T ∧ L ⊢ ⬇* U. +#h #L #T #U #H elim (nta_fwd_aaa … H) -H /3 width=2/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_alt.etc new file mode 100644 index 000000000..8cbd59518 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_alt.etc @@ -0,0 +1,190 @@ +(**************************************************************************) +(* ___ *) +(* ||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/equivalence/cpcs_cpcs.ma". +include "basic_2/dynamic/nta.ma". + +(* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************) + +(* alternative definition of nta *) +inductive ntaa (h:sh): lenv → relation term ≝ +| ntaa_sort: ∀L,k. ntaa h L (⋆k) (⋆(next h k)) +| ntaa_ldef: ∀L,K,V,W,U,i. ⇩[0, i] L ≡ K. ⓓV → ntaa h K V W → + ⇧[0, i + 1] W ≡ U → ntaa h L (#i) U +| ntaa_ldec: ∀L,K,W,V,U,i. ⇩[0, i] L ≡ K. ⓛW → ntaa h K W V → + ⇧[0, i + 1] W ≡ U → ntaa h L (#i) U +| ntaa_bind: ∀I,L,V,W,T,U. ntaa h L V W → ntaa h (L. ⓑ{I} V) T U → + ntaa h L (ⓑ{I}V.T) (ⓑ{I}V.U) +| ntaa_appl: ∀L,V,W,T,U. ntaa h L V W → ntaa h L (ⓛW.T) (ⓛW.U) → + ntaa h L (ⓐV.ⓛW.T) (ⓐV.ⓛW.U) +| ntaa_pure: ∀L,V,W,T,U. ntaa h L T U → ntaa h L (ⓐV.U) W → + ntaa h L (ⓐV.T) (ⓐV.U) +| ntaa_cast: ∀L,T,U,W. ntaa h L T U → ntaa h L U W → ntaa h L (ⓝU. T) U +| ntaa_conv: ∀L,T,U1,U2,V2. ntaa h L T U1 → L ⊢ U1 ⬌* U2 → ntaa h L U2 V2 → + ntaa h L T U2 +. + +interpretation "native type assignment (term) alternative" + 'NativeTypeAlt h L T U = (ntaa h L T U). + +(* Advanced inversion lemmas ************************************************) + +fact ntaa_inv_bind1_aux: ∀h,L,T,U. ⦃h, L⦄ ⊢ T :: U → ∀J,X,Y. T = ⓑ{J}Y.X → + ∃∃Z1,Z2. ⦃h, L⦄ ⊢ Y :: Z1 & ⦃h, L.ⓑ{J}Y⦄ ⊢ X :: Z2 & + L ⊢ ⓑ{J}Y.Z2 ⬌* U. +#h #L #T #U #H elim H -L -T -U +[ #L #k #J #X #Y #H destruct +| #L #K #V #W #U #i #_ #_ #_ #_ #J #X #Y #H destruct +| #L #K #W #V #U #i #_ #_ #_ #_ #J #X #Y #H destruct +| #I #L #V #W #T #U #HVW #HTU #_ #_ #J #X #Y #H destruct /2 width=3/ +| #L #V #W #T #U #_ #_ #_ #_ #J #X #Y #H destruct +| #L #V #W #T #U #_ #_ #_ #_ #J #X #Y #H destruct +| #L #T #U #W #_ #_ #_ #_ #J #X #Y #H destruct +| #L #T #U1 #U2 #V2 #_ #HU12 #_ #IHTU1 #_ #J #X #Y #H destruct + elim (IHTU1 ????) -IHTU1 [5: // |2,3,4: skip ] #Z1 #Z2 #HZ1 #HZ2 #HU1 + lapply (cpcs_trans … HU1 … HU12) -U1 /2 width=3/ +] +qed. + +lemma ntaa_inv_bind1: ∀h,J,L,Y,X,U. ⦃h, L⦄ ⊢ ⓑ{J}Y.X :: U → + ∃∃Z1,Z2. ⦃h, L⦄ ⊢ Y :: Z1 & ⦃h, L.ⓑ{J}Y⦄ ⊢ X :: Z2 & + L ⊢ ⓑ{J}Y.Z2 ⬌* U. +/2 width=3/ qed-. + +lemma ntaa_nta: ∀h,L,T,U. ⦃h, L⦄ ⊢ T :: U → ⦃h, L⦄ ⊢ T : U. +#h #L #T #U #H elim H -L -T -U +// /2 width=1/ /2 width=2/ /2 width=3/ /2 width=6/ +qed-. + +(* Properties on relocation *************************************************) + +lemma ntaa_lift: ∀h,L1,T1,U1. ⦃h, L1⦄ ⊢ T1 :: U1 → ∀L2,d,e. ⇩[d, e] L2 ≡ L1 → + ∀T2. ⇧[d, e] T1 ≡ T2 → ∀U2. ⇧[d, e] U1 ≡ U2 → ⦃h, L2⦄ ⊢ T2 :: U2. +#h #L1 #T1 #U1 #H elim H -L1 -T1 -U1 +[ #L1 #k #L2 #d #e #HL21 #X1 #H1 #X2 #H2 + >(lift_inv_sort1 … H1) -X1 + >(lift_inv_sort1 … H2) -X2 // +| #L1 #K1 #V1 #W1 #W #i #HLK1 #_ #HW1 #IHVW1 #L2 #d #e #HL21 #X #H #U2 #HWU2 + elim (lift_inv_lref1 … H) * #Hid #H destruct + [ elim (lift_trans_ge … HW1 … HWU2 ?) -W // #W2 #HW12 #HWU2 + elim (ldrop_trans_le … HL21 … HLK1 ?) -L1 /2 width=2/ #X #HLK2 #H + elim (ldrop_inv_skip2 … H ?) -H /2 width=1/ -Hid #K2 #V2 #HK21 #HV12 #H destruct + /3 width=8/ + | lapply (lift_trans_be … HW1 … HWU2 ? ?) -W // /2 width=1/ #HW1U2 + lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 // -Hid /3 width=8/ + ] +| #L1 #K1 #W1 #V1 #W #i #HLK1 #_ #HW1 #IHWV1 #L2 #d #e #HL21 #X #H #U2 #HWU2 + elim (lift_inv_lref1 … H) * #Hid #H destruct + [ elim (lift_trans_ge … HW1 … HWU2 ?) -W // (cprs_inv_sort1 … H) -H // +| +| +| +| +| #L1 #V1 #W1 #T1 #U1 #_ #_ #IHTU1 #IHUW1 #L2 #HL12 #T2 #H + elim (cprs_inv_appl1 … H) -H * + [ #V2 #T0 #HV12 #HT10 #H destruct + elim (nta_fwd_correct h L2 (ⓐV1.T1) (ⓐV1.U1) ?) [2: /3 width=2/ ] #U + @(nta_conv … (ⓐV2.U1)) (* /2 width=1/*) [ /4 width=2/] (**) (* explicit constructor, /5 width=5/ is too slow *) + | #V2 #W2 #T0 #HV12 #HT10 #HT02 + lapply (IHTU1 … HL12 (ⓛW2.T0) ?) -IHTU1 /2 width=1/ -HT10 #H + elim (nta_inv_bind1 … H) -H #W #U0 #HW2 #HTU0 #HU01 + elim (cpcs_inv_abst1 … HU01) -HU01 #W #U #HU1 #HU0 + lapply (IHUW1 … HL12 (ⓐV2.ⓛW.U) ?) -IHUW1 -HL12 /2 width=1/ -HV12 #H + + + + elim (nta_fwd_pure1 … H) -H #W0 #U2 #HVU2 #H #HW01 + elim (nta_inv_bind1 … H) -H #W3 #U3 #HW3 #HU3 #H + elim (cpcs_inv_abst1 … H) -H #W4 #U4 +*) +(* +axiom nta_ltpr_tpr_conf: ∀h,L1,T1,U. ⦃h, L1⦄ ⊢ T1 : U → ∀L2. L1 ➡ L2 → + ∀T2. T1 ➡ T2 → ⦃h, L2⦄ ⊢ T2 : U. +#h #L1 #T1 #U #H @(nta_ind_alt … H) -L1 -T1 -U +[ #L1 #k #L2 #_ #T2 #H + >(tpr_inv_atom1 … H) -H // +| #L1 #K1 #V1 #W #U #i #HLK1 #_ #HWU #IHV1 #L2 #HL12 #T2 #H + >(tpr_inv_atom1 … H) -T2 + elim (ltpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #HLK2 #H + elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct /3 width=6/ +| #L1 #K1 #W1 #V1 #U1 #i #HLK1 #HWV1 #HWU1 #IHWV1 #L2 #HL12 #T2 #H + >(tpr_inv_atom1 … H) -T2 + elim (ltpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #HLK2 #H + elim (ltpr_inv_pair1 … H) -H #K2 #W2 #HK12 #HW12 #H destruct + lapply (ldrop_fwd_ldrop2 … HLK2) #HLK + elim (lift_total V1 0 (i+1)) #W #HW + lapply (nta_lift h … HLK … HWU1 … HW) /2 width=1/ -HLK -HW + elim (lift_total W2 0 (i+1)) #U2 #HWU2 + lapply (tpr_lift … HW12 … HWU1 … HWU2) -HWU1 #HU12 + @(nta_conv … U2) /2 width=1/ /3 width=6/ (**) (* explicit constructor, /3 width=6/ is too slow *) +| #I #L1 #V1 #W1 #T1 #U1 #_ #_ #IHVW1 #IHTU1 #L2 #HL12 #X #H + elim (tpr_inv_bind1 … H) -H * + [ #V2 #T0 #T2 #HV12 #HT10 #HT02 #H destruct + lapply (IHVW1 … HL12 … HV12) #HV2W1 + lapply (IHVW1 L2 … V1 ?) // -IHVW1 #HWV1 + lapply (IHTU1 (L2.ⓑ{I}V2) … HT10) -HT10 /2 width=1/ #HT0U1 + lapply (IHTU1 (L2.ⓑ{I}V1) ? T1 ?) -IHTU1 // /2 width=1/ -HL12 #H + lapply (tps_lsubs_trans … HT02 (L2.ⓑ{I}V2) ?) -HT02 /2 width=1/ #HT02 + lapply (nta_tps_conf … HT0U1 … HT02) -T0 #HT2U1 + elim (nta_fwd_correct … H) -H #U2 #HU12 + @(nta_conv … (ⓑ{I}V2.U1)) /2 width=2/ /3 width=1/ (**) (* explicit constructor, /4 width=6/ is too slow *) + | #T #HT1 #HTX #H destruct + lapply (IHVW1 … HL12 V1 ?) -IHVW1 // #HVW1 + elim (lift_total X 0 1) #Y #HXY + lapply (tpr_lift … HTX … HT1 … HXY) -T #H + lapply (IHTU1 (L2.ⓓV1) … H) -T1 /2 width=1/ -L1 #H + elim (nta_fwd_correct … H) #T1 #HUT1 + elim (nta_thin_conf … H L2 0 (0+1) ? ?) -H /2 width=1/ /3 width=1/ #T #U #HTU #H + normalize in ⊢ (??%??? → ?); #HU1 + lapply (delift_inv_lift1_eq … H L2 … HXY) -Y /2 width=1/ #H destruct + @(nta_conv … U) // /2 width=2/ + ] +| #L1 #V1 #W1 #T1 #U1 #_ #_ #IHVW1 #IHTU1 #L2 #HL12 #X #H + elim (tpr_inv_appl1 … H) -H * + [ #V2 #Y #HV12 #HY #H destruct + elim (tpr_inv_abst1 … HY) -HY #W2 #T2 #HW12 #HT12 #H destruct + lapply (IHTU1 L2 ? (ⓛW1.T1) ?) // #H + elim (nta_fwd_correct … H) -H #X #H + elim (nta_inv_bind1 … H) -H #W #U #HW #HU #_ + @(nta_conv … (ⓐV2.ⓛW1.U1)) /4 width=2/ (**) (* explicit constructor, /5 width=5/ is too slow *) + | #V2 #W2 #T0 #T2 #HV12 #HT02 #H1 #H2 destruct + lapply (IHVW1 … HL12 … HV12) #HVW2 + lapply (IHVW1 … HL12 V1 ?) -IHVW1 // #HV1W2 + lapply (IHTU1 … HL12 (ⓛW2.T2) ?) -IHTU1 -HL12 /2 width=1/ -HT02 #H1 + elim (nta_fwd_correct … H1) #T #H2 + elim (nta_inv_bind1 … H1) -H1 #W #U2 #HW2 #HTU2 #H + elim (cpcs_inv_abst … H Abst W2) -H #_ #HU21 + elim (nta_inv_bind1 … H2) -H2 #W0 #U0 #_ #H #_ -T -W0 + lapply (lsubn_nta_trans … HTU2 (L2.ⓓV2) ?) -HTU2 /2 width=1/ #HTU2 + @(nta_conv … (ⓓV2.U2)) /2 width=2/ /3 width=2/ (**) (* explicit constructor, /4 width=5/ is too slow *) + | #V0 #V2 #W0 #W2 #T0 #T2 #_ #_ #_ #_ #H destruct + ] +| #L1 #V1 #W1 #T1 #U1 #_ #_ #IHTU1 #IHUW1 #L2 #HL12 #X #H + elim (tpr_inv_appl1 … H) -H * + [ #V2 #T2 #HV12 #HT12 #H destruct + elim (nta_fwd_correct h L2 (ⓐV1.T1) (ⓐV1.U1) ?) [2: /3 width=2/ ] #U + @(nta_conv … (ⓐV2.U1)) /2 width=1/ /4 width=2/ (**) (* explicit constructor, /5 width=5/ is too slow *) + | #V2 #W2 #T0 #T2 #HV12 #HT02 #H1 #H2 destruct + lapply (IHTU1 … HL12 (ⓛW2.T2) ?) -IHTU1 /2 width=1/ -T0 #H + elim (nta_inv_bind1 … H) -H #W #U2 #HW2 #HTU2 #HU21 + lapply (IHUW1 … HL12 (ⓐV2.U1) ?) -IHUW1 -HL12 /2 width=1/ #H + elim (nta_inv_pure1 … H) -H #V0 #U0 #U #HV20 #HU10 #HU0W1 #HU0 + @(nta_conv … (ⓓV2.U2)) + [2: @nta_bind // + @(lsubn_nta_trans … HTU2) @lsubn_abbr // +(* + lapply (IH … HV1 … HL12 … HV12) -HV1 -HV12 /width=5/ #HB + lapply (IH … HB0 … HL12 W2 ?) -HB0 /width=5/ #HB0 + lapply (IH … HA0 … (L2.ⓛW2) … HT02) -IH -HA0 -HT02 /width=5/ -T0 /2 width=1/ -L1 -V1 /4 width=7/ +*) +*) +(* +axiom pippo: ⦃h, L⦄ ⊢ ⓐV.X : Y → + ∃∃W,T. L ⊢ X ➡* ⓛW.T & ⦃h, L⦄ ⊢ ⓐV : W. + +*) +(* SEGMENT 2 +| #L1 #T1 #U1 #W1 #_ #_ #IHTU1 #IHUW1 #L2 #d #e #HL12 #X #H + elim (tpss_inv_flat1 … H) -H #U2 #T2 #HU12 #HT12 #H destruct + lapply (cpr_tpss … HU12) /4 width=4/ +| #L1 #T1 #U11 #U12 #U #_ #HU112 #_ #IHTU11 #IHU12 #L2 #d #e #HL12 #T2 #HT12 + @(nta_conv … U11) /2 width=5/ (**) (* explicot constructor, /3 width=7/ is too slow *) +] +qed. +*) + +(* SEGMENT 3 +fact nta_ltpr_tpr_conf_aux: ∀h,L,T,L1,T1,U. ⦃h, L1⦄ ⊢ T1 : U → L = L1 → T = T1 → + ∀L2. L1 ➡ L2 → ∀T2. T1 ➡ T2 → ⦃h, L2⦄ ⊢ T2 : U. + + + | #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HW02 #HT02 #HV02 #H1 #H2 destruct + elim (nta_inv_abbr … HT1) -HT1 #B0 #HW0 #HT0 + lapply (IH … HW0 … HL12 … HW02) -HW0 /width=5/ #HW2 + lapply (IH … HV1 … HL12 … HV10) -HV1 -HV10 /width=5/ #HV0 + lapply (IH … HT0 … (L2.ⓓW2) … HT02) -IH -HT0 -HT02 /width=5/ -V1 -T0 /2 width=1/ -L1 -W0 #HT2 + @(nta_abbr … HW2) -HW2 + @(nta_appl … HT2) -HT2 /3 width=7/ (**) (* explict constructors, /5 width=7/ is too slow *) + ] +| #L1 #V1 #T1 #A #HV1 #HT1 #H1 #H2 #L2 #HL12 #X #H destruct + elim (tpr_inv_cast1 … H) -H + [ * #V2 #T2 #HV12 #HT12 #H destruct + lapply (IH … HV1 … HL12 … HV12) -HV1 -HV12 /width=5/ #HV2 + lapply (IH … HT1 … HL12 … HT12) -IH -HT1 -HL12 -HT12 /width=5/ -L1 -V1 -T1 /2 width=1/ + | -HV1 #HT1X + lapply (IH … HT1 … HL12 … HT1X) -IH -HT1 -HL12 -HT1X /width=5/ + ] +] +qed. + +/2 width=9/ qed. + +axiom nta_ltpr_conf: ∀L1,T,A. L1 ⊢ T : A → ∀L2. L1 ➡ L2 → L2 ⊢ T : A. +/2 width=5/ qed. + +axiom nta_tpr_conf: ∀L,T1,A. L ⊢ T1 : A → ∀T2. T1 ➡ T2 → L ⊢ T2 : A. +/2 width=5/ qed. +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_ltpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_ltpss.etc new file mode 100644 index 000000000..828fd82e0 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_ltpss.etc @@ -0,0 +1,121 @@ +(**************************************************************************) +(* ___ *) +(* ||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/equivalence/cpcs_ltpss.ma". +include "basic_2/dynamic/nta_nta.ma". + +(* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************) + +(* Properties about parallel unfold *****************************************) + +lemma nta_ltpss_tpss_conf: ∀h,L1,T1,U. ⦃h, L1⦄ ⊢ T1 : U → + ∀L2,d,e. L1 ▶* [d, e] L2 → + ∀T2. L2 ⊢ T1 ▶* [d, e] T2 → ⦃h, L2⦄ ⊢ T2 : U. +#h #L1 #T1 #U #H @(nta_ind_alt … H) -L1 -T1 -U +[ #L1 #k #L2 #d #e #_ #T2 #H + >(tpss_inv_sort1 … H) -H // +| #L1 #K1 #V1 #W #U #i #HLK1 #_ #HWU #IHV1 #L2 #d #e #HL12 #T2 #H + elim (tpss_inv_lref1 … H) -H + [ #H destruct + elim (lt_or_ge i d) #Hdi + [ elim (ltpss_ldrop_conf_le … HL12 … HLK1 ?) -L1 /2 width=2/ #X #H #HLK2 + elim (ltpss_inv_tpss11 … H ?) -H /2 width=1/ -Hdi #K2 #V2 #HK12 #HV12 #H destruct + /3 width=7/ + | elim (lt_or_ge i (d + e)) #Hide [ | -Hdi ] + [ elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HLK2 + elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K2 #V2 #HK12 #HV12 #H destruct + /3 width=7/ + | lapply (ltpss_ldrop_conf_ge … HL12 … HLK1 ?) -L1 // -Hide /3 width=7/ + ] + ] + | * #K2 #V2 #W2 #Hdi #Hide #HLK2 #HVW2 #HWT2 + elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HL2K0 + elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K0 #V0 #HK12 #HV12 #H destruct + lapply (ldrop_mono … HL2K0 … HLK2) -HL2K0 #H destruct + lapply (ldrop_fwd_ldrop2 … HLK2) -HLK2 #HLK2 + lapply (tpss_trans_eq … HV12 HVW2) -V2 /3 width=9/ + ] +| #L1 #K1 #W1 #V1 #U1 #i #HLK1 #HWV1 #HWU1 #IHWV1 #L2 #d #e #HL12 #T2 #H + elim (tpss_inv_lref1 … H) -H [ | -HWV1 -HWU1 -IHWV1 ] + [ #H destruct + elim (lift_total V1 0 (i+1)) #W #HW + elim (lt_or_ge i d) #Hdi [ -HWV1 ] + [ elim (ltpss_ldrop_conf_le … HL12 … HLK1 ?) -L1 /2 width=2/ #X #H #HLK2 + elim (ltpss_inv_tpss11 … H ?) -H /2 width=1/ -Hdi #K2 #W2 #HK12 #HW12 #H destruct + lapply (ldrop_fwd_ldrop2 … HLK2) #HLK + lapply (nta_lift h … HLK … HWU1 … HW) /2 width=4/ -HW + elim (lift_total W2 0 (i+1)) #U2 #HWU2 + lapply (tpss_lift_ge … HW12 … HLK … HWU1 … HWU2) -HLK -HWU1 // #HU12 + lapply (cpr_tpss … HU12) -HU12 #HU12 + @(nta_conv … U2) /2 width=1/ /3 width=6/ (**) (* explicit constructor, /4 width=6/ is too slow *) + | elim (lt_or_ge i (d + e)) #Hide [ -HWV1 | -IHWV1 -HW -Hdi ] + [ elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HLK2 + elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K2 #W2 #HK12 #HW12 #H destruct + lapply (ldrop_fwd_ldrop2 … HLK2) #HLK + lapply (nta_lift h … HLK … HWU1 … HW) /2 width=4/ -HW + elim (lift_total W2 0 (i+1)) #U2 #HWU2 + lapply (tpss_lift_ge … HW12 … HLK … HWU1 … HWU2) -HLK -HWU1 // #HU12 + lapply (cpr_tpss … HU12) -HU12 #HU12 + @(nta_conv … U2) /2 width=1/ /3 width=6/ (**) (* explicit constructor, /4 width=6/ is too slow *) + | lapply (ltpss_ldrop_conf_ge … HL12 … HLK1 ?) -L1 // -Hide /2 width=6/ + ] + ] + | * #K2 #V2 #W2 #Hdi #Hide #HLK2 #_ #_ + elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HL2K0 + elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K0 #V0 #_ #_ #H destruct + lapply (ldrop_mono … HL2K0 … HLK2) -HL2K0 -HLK2 #H destruct + ] +| #I #L1 #V1 #W1 #T1 #U1 #_ #_ #IHVW1 #IHTU1 #L2 #d #e #HL12 #X #H + elim (tpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct + lapply (cpr_tpss … HV12) #HV + lapply (IHTU1 (L2.ⓑ{I}V1) (d+1) e ? T1 ?) // /2 width=1/ #H + elim (nta_fwd_correct … H) -H #U2 #HU12 + @(nta_conv … (ⓑ{I}V2.U1)) /3 width=2/ /3 width=4/ /4 width=4/ (**) (* explicit constructor, /5 width=6/ is too slow *) +| #L1 #V1 #W1 #T1 #U1 #_ #_ #IHVW1 #IHTU1 #L2 #d #e #HL12 #X #H + elim (tpss_inv_flat1 … H) -H #V2 #Y #HV12 #HY #H destruct + elim (tpss_inv_bind1 … HY) -HY #W2 #T2 #HW12 #HT12 #H destruct + lapply (cpr_tpss … HV12) #HV + lapply (IHTU1 L2 d e ? (ⓛW1.T1) ?) // #H + elim (nta_fwd_correct … H) -H #X #H + elim (nta_inv_bind1 … H) -H #W #U #HW #HU #_ + @(nta_conv … (ⓐV2.ⓛW1.U1)) /3 width=2/ /3 width=4/ /4 width=5/ (**) (* explicit constructor, /5 width=5/ is too slow *) +| #L1 #V1 #W1 #T1 #U1 #_ #_ #IHTU1 #IHUW1 #L2 #d #e #HL12 #X #H + elim (tpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct + lapply (cpr_tpss … HV12) #HV + elim (nta_fwd_correct h L2 (ⓐV1.T1) (ⓐV1.U1) ?) [2: /3 width=4/ ] #U #HU + @(nta_conv … (ⓐV2.U1)) // /3 width=1/ /4 width=5/ (**) (* explicit constructor, /5 width=5/ is too slow *) +| #L1 #T1 #U1 #W1 #_ #_ #IHTU1 #IHUW1 #L2 #d #e #HL12 #X #H + elim (tpss_inv_flat1 … H) -H #U2 #T2 #HU12 #HT12 #H destruct + lapply (cpr_tpss … HU12) /4 width=4/ +| #L1 #T1 #U11 #U12 #U #_ #HU112 #_ #IHTU11 #IHU12 #L2 #d #e #HL12 #T2 #HT12 + @(nta_conv … U11) /2 width=5/ (**) (* explicot constructor, /3 width=7/ is too slow *) +] +qed. + +lemma nta_ltpss_tps_conf: ∀h,L1,T1,U. ⦃h, L1⦄ ⊢ T1 : U → + ∀L2,d,e. L1 ▶* [d, e] L2 → + ∀T2. L2 ⊢ T1 ▶ [d, e] T2 → ⦃h, L2⦄ ⊢ T2 : U. +/3 width=7/ qed. + +lemma nta_ltpss_conf: ∀h,L1,T,U. ⦃h, L1⦄ ⊢ T : U → + ∀L2,d,e. L1 ▶* [d, e] L2 → ⦃h, L2⦄ ⊢ T : U. +/2 width=7/ qed. + +lemma nta_tpss_conf: ∀h,L,T1,U. ⦃h, L⦄ ⊢ T1 : U → + ∀T2,d,e. L ⊢ T1 ▶* [d, e] T2 → ⦃h, L⦄ ⊢ T2 : U. +/2 width=7/ qed. + +lemma nta_tps_conf: ∀h,L,T1,U. ⦃h, L⦄ ⊢ T1 : U → + ∀T2,d,e. L ⊢ T1 ▶ [d, e] T2 → ⦃h, L⦄ ⊢ T2 : U. +/2 width=7/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_nta.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_nta.etc new file mode 100644 index 000000000..05eb6c55d --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_nta.etc @@ -0,0 +1,59 @@ +(**************************************************************************) +(* ___ *) +(* ||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/dynamic/nta_lift.ma". + +(* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************) + +(* Main properties **********************************************************) + +(* Basic_1: was: ty3_unique *) +theorem nta_mono: ∀h,L,T,U1. ⦃h, L⦄ ⊢ T : U1 → ∀U2. ⦃h, L⦄ ⊢ T : U2 → + L ⊢ U1 ⬌* U2. +#h #L #T #U1 #H elim H -L -T -U1 +[ #L #k #X #H + lapply (nta_inv_sort1 … H) -H // +| #L #K #V #W11 #W12 #i #HLK #_ #HW112 #IHVW11 #X #H + elim (nta_inv_lref1 … H) -H * #K0 #V0 #W21 #W22 #HLK0 #HVW21 #HW212 #HX + lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct + lapply (ldrop_fwd_ldrop2 … HLK) -HLK #HLK + @(cpcs_trans … HX) -X /3 width=9 by cpcs_lift/ (**) (* to slow without trace *) +| #L #K #W #V1 #V #i #HLK #_ #HWV #_ #X #H + elim (nta_inv_lref1 … H) -H * #K0 #W0 #V2 #V0 #HLK0 #_ #HWV0 #HX + lapply (ldrop_mono … HLK0 … HLK) -HLK0 -HLK #H destruct + lapply (lift_mono … HWV0 … HWV) -HWV0 -HWV #H destruct // +| #I #L #V #W1 #T #U1 #_ #_ #_ #IHTU1 #X #H + elim (nta_inv_bind1 … H) -H #W2 #U2 #_ #HTU2 #H + @(cpcs_trans … H) -X /3 width=1/ +| #L #V #W1 #T #U1 #_ #_ #_ #IHTU1 #X #H + elim (nta_fwd_pure1 … H) -H #U2 #W2 #_ #HTU2 #H + @(cpcs_trans … H) -X /3 width=1/ +| #L #V #W1 #T #U1 #_ #_ #IHTU1 #_ #X #H + elim (nta_fwd_pure1 … H) -H #U2 #W2 #_ #HTU2 #H + @(cpcs_trans … H) -X /3 width=1/ +| #L #T #U1 #_ #_ #X #H + elim (nta_inv_cast1 … H) -H // +| #L #T #U11 #U12 #V12 #_ #HU112 #_ #IHTU11 #_ #U2 #HTU2 + @(cpcs_canc_sn … HU112) -U12 /2 width=1/ +] +qed-. + +(* Advanced properties ******************************************************) + +lemma nta_cast_alt: ∀h,L,T,W,U. ⦃h, L⦄ ⊢ T : W → ⦃h, L⦄ ⊢ T : U → + ⦃h, L⦄ ⊢ ⓝW.T : U. +#h #L #T #W #U #HTW #HTU +lapply (nta_mono … HTW … HTU) #HWU +elim (nta_fwd_correct … HTU) -HTU /3 width=3/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_sta.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_sta.etc new file mode 100644 index 000000000..6268b98b1 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_sta.etc @@ -0,0 +1,42 @@ +(**************************************************************************) +(* ___ *) +(* ||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/static/sta.ma". +include "basic_2/equivalence/cpcs_cpcs.ma". +include "basic_2/dynamic/nta.ma". + +(* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************) + +(* Properties on static type assignment *************************************) + +lemma nta_fwd_sta: ∀h,L,T,U. ⦃h, L⦄ ⊢ T : U → + ∃∃U0. ⦃h, L⦄ ⊢ T • U0 & L ⊢ U0 ⬌* U. +#h #L #T #U #H elim H -L -T -U +[ /2 width=3/ +| #L #K #V #W1 #V1 #i #HLK #_ #HWV1 * #W0 #HVW0 #HW01 + elim (lift_total W0 0 (i+1)) #V0 #HWV0 + lapply (ldrop_fwd_ldrop2 … HLK) #HLK0 + lapply (cpcs_lift … HLK0 … HWV0 … HWV1 HW01) -HLK0 -HWV1 -HW01 /3 width=6/ +| #L #K #W #V1 #W1 #i #HLK #HWV1 #HW1 * /3 width=6/ +| #I #L #V #W #T #U #_ #_ * #W0 #_ #_ * /3 width=3/ +| #L #V #W #T #U #_ #_ * #W0 #_ #HW0 * #X #H #HX + elim (sta_inv_bind1 … H) -H #U0 #HTU0 #H destruct + @(ex2_1_intro … (ⓐV.ⓛW.U0)) /2 width=1/ /3 width=1/ +| #L #V #W #T #U #_ #_ * #U0 #HTU0 #HU0 #_ -W + @(ex2_1_intro … (ⓐV.U0)) /2 width=1/ +| #L #T #U #HTU * #U0 #HTU0 #HU0 /3 width=3/ +| #L #T #U1 #U2 #V2 #_ #HU12 #_ * #U0 #HTU0 #HU01 #_ + lapply (cpcs_trans … HU01 … HU12) -U1 /2 width=3/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_thin.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_thin.etc new file mode 100644 index 000000000..f927f841a --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_thin.etc @@ -0,0 +1,116 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/thin_ldrop.ma". +include "basic_2/equivalence/cpcs_delift.ma". +include "basic_2/dynamic/nta_lift.ma". + +(* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************) + +(* Properties on basic local environment thinning ***************************) + +(* Note: this is known as the substitution lemma *) +(* Basic_1: was only: ty3_gen_cabbr *) +lemma nta_thin_conf: ∀h,L1,T1,U1. ⦃h, L1⦄ ⊢ T1 : U1 → + ∀L2,d,e. ≽ [d, e] L1 → L1 ▼*[d, e] ≡ L2 → + ∃∃T2,U2. ⦃h, L2⦄ ⊢ T2 : U2 & + L1 ⊢ T1 ▼*[d, e] ≡ T2 & L1 ⊢ U1 ▼*[d, e] ≡ U2. +#h #L1 #T1 #U1 #H elim H -L1 -T1 -U1 +[ /2 width=5/ +| #L1 #K1 #V1 #W1 #U1 #i #HLK1 #HVW1 #HWU1 #IHVW1 #L2 #d #e #HL1 #HL12 + elim (lt_or_ge i d) #Hdi [ -HVW1 ] + [ lapply (sfr_ldrop_trans_ge … HLK1 … HL1 ?) -HL1 /2 width=2/ #H + lapply (sfr_inv_skip … H ?) -H /2 width=1/ #HK1 + elim (thin_ldrop_conf_le … HL12 … HLK1 ?) -HL12 /2 width=2/ #X #H #HLK2 + elim (thin_inv_delift1 … H ?) -H /2 width=1/ #K2 #V2 #HK12 #HV12 #H destruct + elim (IHVW1 … HK1 HK12) -IHVW1 -HK1 -HK12 #X2 #W2 #HVW2 #H #HW12 + lapply (delift_mono … H … HV12) -H -HV12 #H destruct + elim (lift_total W2 0 (i+1)) #U2 #HWU2 + lapply (ldrop_fwd_ldrop2 … HLK1) -V1 #HLK1 + lapply (delift_lift_ge … HW12 … HLK1 HWU1 … HWU2) -HW12 -HLK1 -HWU1 // + >minus_plus minus_plus #HU1 + lapply (lift_conf_be … HWU2 … HW2U ?) -W2 /2 width=1/ #HU2 + lapply (delift_lift_div_be … HU1 … HU2 ? ?) -U // /2 width=1/ /3 width=8/ + | lapply (transitive_le … (i+1) Hide ?) /2 width=1/ #Hdei + lapply (thin_ldrop_conf_ge … HL12 … HLK1 ?) -HL12 -HLK1 // #HL2K1 + elim (lift_split … HWU1 d (i+1-e) ? ? ?) -HWU1 // /2 width=1/ #W + commutative_plus minus_plus commutative_plus 0 & L ⊢ U0 ⬌* U + ). +#h #L #T #U #l #H elim H -L -T -U -l +[ #L #k #j #H destruct +| #L #K #V #W #U #i #l #HLK #HVW #HWU #_ #j #H destruct /3 width=8/ +| #L #K #W #V #U #i #l #HLK #HWV #HWU #_ #j #H destruct /3 width=8/ +| #I #L #V #W #T #U #l1 #l2 #_ #_ #_ #_ #j #H destruct +| #L #V #W1 #W2 #T #U #l1 #l2 #_ #_ #_ #_ #j #H destruct +| #L #V #T #U #W #l #_ #_ #_ #_ #j #H destruct +| #L #T #U #W #l1 #l2 #_ #_ #_ #_ #j #H destruct +| #L #T #U1 #U2 #V2 #l #_ #HU12 #_ #IHTU1 #_ #j #H destruct + elim (IHTU1 ??) -IHTU1 [4: // |2: skip ] * #K #V #W #U0 #HLK #HVW #HWU0 [2: #H ] #HU01 + lapply (cpcs_trans … HU01 … HU12) -U1 /3 width=8/ +] +qed. + +lemma snta_inv_lref1: ∀h,L,U,i,l. ⦃h, L⦄ ⊢ #i :[l] U → + (∃∃K,V,W,U0. ⇩[0, i] L ≡ K. ⓓV & ⦃h, K⦄ ⊢ V :[l] W & + ⇧[0, i + 1] W ≡ U0 & L ⊢ U0 ⬌* U + ) ∨ + (∃∃K,W,V,U0. ⇩[0, i] L ≡ K. ⓛW & ⦃h, K⦄ ⊢ W :[l-1] V & + ⇧[0, i + 1] W ≡ U0 & l > 0 & L ⊢ U0 ⬌* U + ). +/2 width=3/ qed-. + +fact snta_inv_bind1_aux: ∀h,L,T,U,l. ⦃h, L⦄ ⊢ T :[l] U → ∀J,X,Y. T = ⓑ{J}Y.X → + ∃∃Z1,Z2,l0. ⦃h, L⦄ ⊢ Y :[l0] Z1 & + ⦃h, L.ⓑ{J}Y⦄ ⊢ X :[l] Z2 & + L ⊢ ⓑ{J}Y.Z2 ⬌* U. +#h #L #T #U #l #H elim H -L -T -U -l +[ #L #k #J #X #Y #H destruct +| #L #K #V #W #U #i #l #_ #_ #_ #_ #J #X #Y #H destruct +| #L #K #W #V #U #i #l #_ #_ #_ #_ #J #X #Y #H destruct +| #I #L #V #W #T #U #l1 #l2 #HVW #HTU #_ #_ #J #X #Y #H destruct /2 width=3/ +| #L #V #W1 #W2 #T #U #l1 #l2 #_ #_ #_ #_ #J #X #Y #H destruct +| #L #V #T #U #W #l #_ #_ #_ #_ #J #X #Y #H destruct +| #L #T #U #W #l1 #l2 #_ #_ #_ #_ #J #X #Y #H destruct +| #L #T #U1 #U2 #V2 #l #_ #HU12 #_ #IHTU1 #_ #J #X #Y #H destruct + elim (IHTU1 ????) -IHTU1 [5: // |2,3,4: skip ] #Z1 #Z2 #l0 #HZ1 #HZ2 #HU1 + lapply (cpcs_trans … HU1 … HU12) -U1 /2 width=3/ +] +qed. + +lemma snta_inv_bind1: ∀h,J,L,Y,X,U,l. ⦃h, L⦄ ⊢ ⓑ{J}Y.X :[l] U → + ∃∃Z1,Z2,l0. ⦃h, L⦄ ⊢ Y :[l0] Z1 & ⦃h, L.ⓑ{J}Y⦄ ⊢ X :[l] Z2 & + L ⊢ ⓑ{J}Y.Z2 ⬌* U. +/2 width=3/ qed-. + +fact snta_inv_cast1_aux: ∀h,L,T,U,l. ⦃h, L⦄ ⊢ T :[l] U → ∀X,Y. T = ⓝY.X → + ⦃h, L⦄ ⊢ X :[l] Y ∧ L ⊢ Y ⬌* U. +#h #L #T #U #l #H elim H -L -T -U -l +[ #L #k #X #Y #H destruct +| #L #K #V #W #U #i #l #_ #_ #_ #_ #X #Y #H destruct +| #L #K #W #V #U #i #l #_ #_ #_ #_ #X #Y #H destruct +| #I #L #V #W #T #U #l1 #l2 #_ #_ #_ #_ #X #Y #H destruct +| #L #V #W1 #W2 #T #U #l1 #l2 #_ #_ #_ #_ #X #Y #H destruct +| #L #V #T #U #W #l #_ #_ #_ #_ #X #Y #H destruct +| #L #T #U #W #l1 #l2 #HTU #_ #_ #_ #X #Y #H destruct /2 width=1/ +| #L #T #U1 #U2 #V2 #l #_ #HU12 #_ #IHTU1 #_ #X #Y #H destruct + elim (IHTU1 ???) -IHTU1 [4: // |2,3: skip ] #HXY #HU1 + lapply (cpcs_trans … HU1 … HU12) -U1 /2 width=1/ +] +qed. + +lemma snta_inv_cast1: ∀h,L,X,Y,U,l. ⦃h, L⦄ ⊢ ⓝY.X :[l] U → + ⦃h, L⦄ ⊢ X :[l] Y ∧ L ⊢ Y ⬌* U. +/2 width=3/ qed-. + +(* Properties on relocation *************************************************) + +lemma snta_lift: ∀h,L1,T1,U1,l. ⦃h, L1⦄ ⊢ T1 :[l] U1 → + ∀L2,d,e. ⇩[d, e] L2 ≡ L1 → + ∀T2. ⇧[d, e] T1 ≡ T2 → ∀U2. ⇧[d, e] U1 ≡ U2 → + ⦃h, L2⦄ ⊢ T2 :[l] U2. +#h #L1 #T1 #U1 #l #H elim H -L1 -T1 -U1 -l +[ #L1 #k #L2 #d #e #HL21 #X1 #H1 #X2 #H2 + >(lift_inv_sort1 … H1) -X1 + >(lift_inv_sort1 … H2) -X2 // +| #L1 #K1 #V1 #W1 #W #i #l #HLK1 #_ #HW1 #IHVW1 #L2 #d #e #HL21 #X #H #U2 #HWU2 + elim (lift_inv_lref1 … H) * #Hid #H destruct + [ elim (lift_trans_ge … HW1 … HWU2 ?) -W // #W2 #HW12 #HWU2 + elim (ldrop_trans_le … HL21 … HLK1 ?) -L1 /2 width=2/ #X #HLK2 #H + elim (ldrop_inv_skip2 … H ?) -H /2 width=1/ -Hid #K2 #V2 #HK21 #HV12 #H destruct + /3 width=8/ + | lapply (lift_trans_be … HW1 … HWU2 ? ?) -W // /2 width=1/ #HW1U2 + lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 // -Hid /3 width=8/ + ] +| #L1 #K1 #W1 #V1 #W #i #l #HLK1 #_ #HW1 #IHWV1 #L2 #d #e #HL21 #X #H #U2 #HWU2 + elim (lift_inv_lref1 … H) * #Hid #H destruct + [ elim (lift_trans_ge … HW1 … HWU2 ?) -W // (tpr_inv_atom1 … H) -H // +| #L1 #K1 #V1 #W #U #i1 #l #HLK1 #_ #HWU #IHV1 #L2 #HL12 #T2 #H #Hl -IH + >(tpr_inv_atom1 … H) -T2 + elim (ltpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #HLK2 #H + elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct /3 width=6/ +| #L1 #K1 #W1 #V1 #U1 #i1 #l #HLK1 #HWV1 #HWU1 #IHWV1 #L2 #HL12 #T2 #H #Hl -IH +(* + >(tpr_inv_atom1 … H) -T2 + elim (ltpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #HLK2 #H + elim (ltpr_inv_pair1 … H) -H #K2 #W2 #HK12 #HW12 #H destruct + lapply (ldrop_fwd_ldrop2 … HLK2) #HLK + elim (lift_total V1 0 (i+1)) #W #HW + lapply (snta_lift h … HLK … HWU1 … HW) /2 width=1/ -HLK -HW + elim (lift_total W2 0 (i+1)) #U2 #HWU2 + lapply (tpr_lift … HW12 … HWU1 … HWU2) -HWU1 #HU12 + @(snta_conv … U2) /2 width=1/ /3 width=6/ (**) (* explicit constructor, /3 width=6/ is too slow *) +*) +| #I #L1 #V1 #W1 #T1 #U1 #l1 #l2 #_ #_ #IHVW1 #IHTU1 #L2 #HL12 #X #H #Hl -IH +(* + elim (tpr_inv_bind1 … H) -H * + [ #V2 #T #T2 #HV12 #HT1 #HT2 #H destruct + lapply (IHVW1 … HL12 … HV12) #HV2W1 + lapply (IHVW1 L2 … V1 ?) // -IHVW1 #HWV1 + lapply (IHTU1 (L2.ⓑ{I}V2) … HT1) -HT1 /2 width=1/ #HTU1 + lapply (IHTU1 (L2.ⓑ{I}V1) ? T1 ?) -IHTU1 // /2 width=1/ -HL12 #H + lapply (tps_lsubs_trans … HT2 (L2.ⓑ{I}V2) ?) -HT2 /2 width=1/ #HT2 + lapply (snta_tps_conf … HTU1 … HT2) -T #HT2U1 + elim (snta_fwd_correct … H) -H #U2 #HU12 + @(snta_conv … (ⓑ{I}V2.U1)) /2 width=2/ /3 width=1/ (**) (* explicit constructor, /4 width=6/ is too slow *) + | #T #HT1 #HTX #H destruct + lapply (IHVW1 … HL12 V1 ?) -IHVW1 // #HVW1 + lapply (IHTU1 (L2.ⓓV1) … HT1) -T1 /2 width=1/ -L1 #H + elim (snta_fwd_correct … H) #T1 #HUT1 + elim (snta_ldrop_conf … H L2 0 1 ? ?) -H // /2 width=1/ #T0 #U0 #HTU0 #H #HU10 + lapply (delift_inv_lift1_eq … H L2 … HTX) -H -HTX /2 width=1/ #H destruct + @(snta_conv … HTU0) /2 width=2/ + ] +*) +| #L1 #V1 #W11 #W2 #T1 #U1 #l1 #l2 #_ #_ #IHVW1 #IHTU1 #L2 #HL12 #X #H #Hl -IH +(* + elim (tpr_inv_appl1 … H) -H * + [ #V2 #Y #HV12 #HY #H destruct + elim (tpr_inv_abst1 … HY) -HY #W2 #T2 #HW12 #HT12 #H destruct + lapply (IHTU1 L2 ? (ⓛW1.T1) ?) // #H + elim (snta_fwd_correct … H) -H #X #H + elim (snta_inv_bind1 … H) -H #W #U #HW #HU #_ + @(snta_conv … (ⓐV2.ⓛW1.U1)) /4 width=2/ (**) (* explicit constructor, /5 width=5/ is too slow *) + | #V2 #W2 #T0 #T2 #HV12 #HT02 #H1 #H2 destruct + lapply (IHVW1 … HL12 … HV12) #HVW2 + lapply (IHVW1 … HL12 V1 ?) -IHVW1 // #HV1W2 + lapply (IHTU1 … HL12 (ⓛW2.T2) ?) -IHTU1 -HL12 /2 width=1/ -HT02 #H1 + elim (snta_fwd_correct … H1) #T #H2 + elim (snta_inv_bind1 … H1) -H1 #W #U2 #HW2 #HTU2 #H + elim (cpcs_inv_abst … H Abst W2) -H #_ #HU21 + elim (snta_inv_bind1 … H2) -H2 #W0 #U0 #_ #H #_ -T -W0 + lapply (lsubsn_snta_trans … HTU2 (L2.ⓓV2) ?) -HTU2 /2 width=1/ #HTU2 + @(snta_conv … (ⓓV2.U2)) /2 width=2/ /3 width=2/ (**) (* explicit constructor, /4 width=5/ is too slow *) + | #V0 #V2 #W0 #W2 #T0 #T2 #_ #_ #_ #_ #H destruct + ] +*) +| #L1 #V1 #T1 #U1 #W1 #l #_ #HUW1 #IHTU1 #_ #L2 #HL12 #X #H #Hl + elim (tpr_inv_appl1 … H) -H * + [ #V2 #T2 #HV12 #HT12 #H destruct + lapply (cpr_tpr … HV12 L2) #HV + elim (snta_fwd_correct h L2 (ⓐV1.T1) (ⓐV1.U1) (l+1) ?) [2: /3 width=6/ ] #U + @(snta_conv … (ⓐV2.U1)) /2 width=1/ -HV12 /4 width=8 by snta_pure, cprs_flat_dx/ (**) (* explicit constructor, /4 width=8/ is too slow without trace *) + | #V2 #W0 #T0 #T2 #HV12 #HT02 #H1 #H2 destruct + lapply (IHTU1 … HL12 (ⓛW0.T2) ? ?) -IHTU1 // /2 width=1/ -T0 #H1 + lapply (IH … (ⓐV2.U1) … HUW1 HL12 ?) // /3 width=1/ #H2 + lapply (snta_pure … H1 H2) -H2 #H + elim (snta_inv_bind1 … H1) -H1 #V0 #U2 #l1 #HWV0 #HTU2 #HU21 + @(snta_conv … (ⓓV2.U2)) (**) (* explicit constructor *) + [2: +(* + @snta_bind /3 width=2/ /3 width=6/ (**) (* /4 width=6/ is a bit slow *) +*) + |3: @(cpcs_cpr_conf … (ⓐV1.ⓛW0.U2)) /2 width=1/ + |4: /2 width=5/ + | skip + ] +(* + elim (snta_fwd_pure1 … H) -H #T1 #W2 #HVW2 #HUT1 #HTW1 + + elim (cpcs_inv_abst1 … HU21) #W3 #U3 #HU13 #H + elim (cprs_inv_abst … H Abst W0) -H #HW03 #_ + elim (pippo … IH … HUW1 ? V2 W3 U3 HL12 ? ?) -IH -HUW1 -HL12 // /3 width=1/ -HU13 #l2 #HV2W3 + lapply (snta_conv h L2 V2 W3 W0 V0 (l1+1) ? ? ?) /2 width=1/ -HV2W3 -HW03 -HWV0 #HV2W0 +*) +(* SEGMENT 1.5 + lapply (IH … HV1 … HL12 … HV12) -HV1 -HV12 /width=5/ #HB + lapply (IH … HB0 … HL12 W2 ?) -HB0 /width=5/ #HB0 + lapply (IH … HA0 … (L2.ⓛW2) … HT02) -IH -HA0 -HT02 /width=5/ -T0 /2 width=1/ -L1 -V1 /4 width=7/ + +axiom pippo: ⦃h, L⦄ ⊢ ⓐV.X : Y → + ∃∃W,T. L ⊢ X ➡* ⓛW.T & ⦃h, L⦄ ⊢ ⓐV : W. + +*) +(* SEGMENT 2 +| #L1 #T1 #U1 #W1 #_ #_ #IHTU1 #IHUW1 #L2 #d #e #HL12 #X #H + elim (tpss_inv_flat1 … H) -H #U2 #T2 #HU12 #HT12 #H destruct + lapply (cpr_tpss … HU12) /4 width=4/ +| #L1 #T1 #U11 #U12 #U #_ #HU112 #_ #IHTU11 #IHU12 #L2 #d #e #HL12 #T2 #HT12 + @(snta_conv … U11) /2 width=5/ (**) (* explicot constructor, /3 width=7/ is too slow *) +] +qed. +*) + +(* SEGMENT 3 +fact snta_ltpr_tpr_conf_aux: ∀h,L,T,L1,T1,U. ⦃h, L1⦄ ⊢ T1 : U → L = L1 → T = T1 → + ∀L2. L1 ➡ L2 → ∀T2. T1 ➡ T2 → ⦃h, L2⦄ ⊢ T2 : U. + + + | #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HW02 #HT02 #HV02 #H1 #H2 destruct + elim (snta_inv_abbr … HT1) -HT1 #B0 #HW0 #HT0 + lapply (IH … HW0 … HL12 … HW02) -HW0 /width=5/ #HW2 + lapply (IH … HV1 … HL12 … HV10) -HV1 -HV10 /width=5/ #HV0 + lapply (IH … HT0 … (L2.ⓓW2) … HT02) -IH -HT0 -HT02 /width=5/ -V1 -T0 /2 width=1/ -L1 -W0 #HT2 + @(snta_abbr … HW2) -HW2 + @(snta_appl … HT2) -HT2 /3 width=7/ (**) (* explict constructors, /5 width=7/ is too slow *) + ] +| #L1 #V1 #T1 #A #HV1 #HT1 #H1 #H2 #L2 #HL12 #X #H destruct + elim (tpr_inv_cast1 … H) -H + [ * #V2 #T2 #HV12 #HT12 #H destruct + lapply (IH … HV1 … HL12 … HV12) -HV1 -HV12 /width=5/ #HV2 + lapply (IH … HT1 … HL12 … HT12) -IH -HT1 -HL12 -HT12 /width=5/ -L1 -V1 -T1 /2 width=1/ + | -HV1 #HT1X + lapply (IH … HT1 … HL12 … HT1X) -IH -HT1 -HL12 -HT1X /width=5/ + ] +] +qed. + +lemma snta_ltpr_tpr_conf: ∀h,L1,T1,U. ⦃h, L1⦄ ⊢ T1 : U → ∀L2. L1 ➡ L2 → + ∀T2. T1 ➡ T2 → ⦃h, L2⦄ ⊢ T2 : U. + +/2 width=9/ qed. + +axiom snta_ltpr_conf: ∀L1,T,A. L1 ⊢ T : A → ∀L2. L1 ➡ L2 → L2 ⊢ T : A. +/2 width=5/ qed. + +axiom snta_tpr_conf: ∀L,T1,A. L ⊢ T1 : A → ∀T2. T1 ➡ T2 → L ⊢ T2 : A. +/2 width=5/ qed. +*) +*)*) \ No newline at end of file diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/snta/snta_ltpss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/snta/snta_ltpss.etc new file mode 100644 index 000000000..0e5f3930e --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/snta/snta_ltpss.etc @@ -0,0 +1,123 @@ +(**************************************************************************) +(* ___ *) +(* ||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/equivalence/cpcs_ltpss.ma". +include "basic_2/dynamic/snta_snta.ma". + +(* STRATIFIED NATIVE TYPE ASSIGNMENT ON TERMS *******************************) + +(* Properties about parallel unfold *****************************************) + +lemma snta_ltpss_tpss_conf: ∀h,L1,T1,U,l. ⦃h, L1⦄ ⊢ T1 :[l] U → + ∀L2,d,e. L1 ▶* [d, e] L2 → + ∀T2. L2 ⊢ T1 ▶* [d, e] T2 → ⦃h, L2⦄ ⊢ T2 :[l] U. +#h #L1 #T1 #U #l #H elim H -L1 -T1 -U -l +[ #L1 #k #L2 #d #e #_ #T2 #H + >(tpss_inv_sort1 … H) -H // +| #L1 #K1 #V1 #W #U #i #l #HLK1 #_ #HWU #IHV1 #L2 #d #e #HL12 #T2 #H + elim (tpss_inv_lref1 … H) -H + [ #H destruct + elim (lt_or_ge i d) #Hdi + [ elim (ltpss_ldrop_conf_le … HL12 … HLK1 ?) -L1 /2 width=2/ #X #H #HLK2 + elim (ltpss_inv_tpss11 … H ?) -H /2 width=1/ -Hdi #K2 #V2 #HK12 #HV12 #H destruct + /3 width=7/ + | elim (lt_or_ge i (d + e)) #Hide [ | -Hdi ] + [ elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HLK2 + elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K2 #V2 #HK12 #HV12 #H destruct + /3 width=7/ + | lapply (ltpss_ldrop_conf_ge … HL12 … HLK1 ?) -L1 // -Hide /3 width=7/ + ] + ] + | * #K2 #V2 #W2 #Hdi #Hide #HLK2 #HVW2 #HWT2 + elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HL2K0 + elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K0 #V0 #HK12 #HV12 #H destruct + lapply (ldrop_mono … HL2K0 … HLK2) -HL2K0 #H destruct + lapply (ldrop_fwd_ldrop2 … HLK2) -HLK2 #HLK2 + lapply (tpss_trans_eq … HV12 HVW2) -V2 /3 width=9/ + ] +| #L1 #K1 #W1 #V1 #U1 #i #l #HLK1 #HWV1 #HWU1 #IHWV1 #L2 #d #e #HL12 #T2 #H + elim (tpss_inv_lref1 … H) -H [ | -HWV1 -HWU1 -IHWV1 ] + [ #H destruct + elim (lift_total V1 0 (i+1)) #W #HW + elim (lt_or_ge i d) #Hdi [ -HWV1 ] + [ elim (ltpss_ldrop_conf_le … HL12 … HLK1 ?) -L1 /2 width=2/ #X #H #HLK2 + elim (ltpss_inv_tpss11 … H ?) -H /2 width=1/ -Hdi #K2 #W2 #HK12 #HW12 #H destruct + lapply (ldrop_fwd_ldrop2 … HLK2) #HLK + lapply (snta_lift h … HLK … HWU1 … HW) [ /2 width=4/ | skip ] -HW #H + elim (lift_total W2 0 (i+1)) #U2 #HWU2 + lapply (tpss_lift_ge … HW12 … HLK … HWU1 … HWU2) -HLK -HWU1 // #HU12 + lapply (cpr_tpss … HU12) -HU12 #HU12 + @(snta_conv … U2) // /2 width=1/ /3 width=6/ (**) (* explicit constructor, /4 width=6/ is too slow *) + | elim (lt_or_ge i (d + e)) #Hide [ -HWV1 | -IHWV1 -HW -Hdi ] + [ elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HLK2 + elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K2 #W2 #HK12 #HW12 #H destruct + lapply (ldrop_fwd_ldrop2 … HLK2) #HLK + lapply (snta_lift h … HLK … HWU1 … HW) [ /2 width=4/ | skip ] -HW #H + elim (lift_total W2 0 (i+1)) #U2 #HWU2 + lapply (tpss_lift_ge … HW12 … HLK … HWU1 … HWU2) -HLK -HWU1 // #HU12 + lapply (cpr_tpss … HU12) -HU12 #HU12 + @(snta_conv … U2) // /2 width=1/ /3 width=6/ (**) (* explicit constructor, /4 width=6/ is too slow *) + | lapply (ltpss_ldrop_conf_ge … HL12 … HLK1 ?) -L1 // -Hide /2 width=6/ + ] + ] + | * #K2 #V2 #W2 #Hdi #Hide #HLK2 #_ #_ + elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HL2K0 + elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K0 #V0 #_ #_ #H destruct + lapply (ldrop_mono … HL2K0 … HLK2) -HL2K0 -HLK2 #H destruct + ] +| #I #L1 #V1 #W1 #T1 #U1 #l1 #l2 #_ #_ #IHVW1 #IHTU1 #L2 #d #e #HL12 #X #H + elim (tpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct + lapply (cpr_tpss … HV12) #HV + lapply (IHTU1 (L2.ⓑ{I}V1) (d+1) e ? T1 ?) // /2 width=1/ #H + elim (snta_fwd_correct … H) -H #U2 #HU12 + @(snta_conv … (ⓑ{I}V2.U1)) /3 width=2/ /3 width=4/ /4 width=4/ (**) (* explicit constructor, /5 width=6/ is too slow *) +| #L1 #V1 #W11 #W12 #T1 #U1 #l1 #l2 #_ #_ #IHVW1 #IHTU1 #L2 #d #e #HL12 #X #H + elim (tpss_inv_flat1 … H) -H #V2 #Y #HV12 #HY #H destruct + elim (tpss_inv_bind1 … HY) -HY #W21 #T2 #HW121 #HT12 #H destruct + lapply (cpr_tpss … HV12) #HVV12 + lapply (IHTU1 L2 d e ? (ⓛW21.T2) ?) -IHTU1 // /2 width=1/ -HW121 -HT12 #H0 + elim (snta_fwd_correct … H0) #X #H + elim (snta_inv_bind1 … H) -H #W #U #l0 #HW #HU #_ + @(snta_conv … (ⓐV2.ⓛW12.U1)) /3 width=2/ /3 width=4/ /3 width=5/ (**) (* explicit constructor, /4 width=5/ is too slow *) +| #L1 #V1 #T1 #U1 #W1 #l #_ #_ #IHTU1 #IHUW1 #L2 #d #e #HL12 #X #H + elim (tpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct + lapply (cpr_tpss … HV12) #HV + elim (snta_fwd_correct h L2 (ⓐV1.T1) (ⓐV1.U1) (l+1) ?) [2: /3 width=4/ ] #U + @(snta_conv … (ⓐV2.U1)) /3 width=1/ /4 width=5/ (**) (* explicit constructor, /5 width=5/ is too slow *) +| #L1 #T1 #U1 #W1 #l1 #l2 #HTU1 #HUW1 #IHTU1 #IHUW1 #L2 #d #e #HL12 #X #H + elim (snta_fwd_correct … HTU1) -HTU1 #U #H + elim (snta_mono … HUW1 … H) -HUW1 -H #H #_ -U destruct + elim (tpss_inv_flat1 … H) -H #U2 #T2 #HU12 #HT12 #H destruct + lapply (cpr_tpss … HU12) #HU /4 width=4/ +| #L1 #T1 #U11 #U12 #U #l #_ #HU112 #_ #IHTU11 #IHU12 #L2 #d #e #HL12 #T2 #HT12 + @(snta_conv … U11) /2 width=5/ (**) (* explicit constructor, /3 width=7/ is too slow *) +] +qed. + +lemma snta_ltpss_tps_conf: ∀h,L1,T1,U,l. ⦃h, L1⦄ ⊢ T1 :[l] U → + ∀L2,d,e. L1 ▶* [d, e] L2 → + ∀T2. L2 ⊢ T1 ▶ [d, e] T2 → ⦃h, L2⦄ ⊢ T2 :[l] U. +/3 width=7/ qed. + +lemma snta_ltpss_conf: ∀h,L1,T,U,l. ⦃h, L1⦄ ⊢ T :[l] U → + ∀L2,d,e. L1 ▶* [d, e] L2 → ⦃h, L2⦄ ⊢ T :[l] U. +/2 width=7/ qed. + +lemma snta_tpss_conf: ∀h,L,T1,U,l. ⦃h, L⦄ ⊢ T1 :[l] U → + ∀T2,d,e. L ⊢ T1 ▶* [d, e] T2 → ⦃h, L⦄ ⊢ T2 :[l] U. +/2 width=7/ qed. + +lemma snta_tps_conf: ∀h,L,T1,U,l. ⦃h, L⦄ ⊢ T1 :[l] U → + ∀T2,d,e. L ⊢ T1 ▶ [d, e] T2 → ⦃h, L⦄ ⊢ T2 :[l] U. +/2 width=7/ qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/snta/snta_snta.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/snta/snta_snta.etc new file mode 100644 index 000000000..db71e1192 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/snta/snta_snta.etc @@ -0,0 +1,65 @@ +(**************************************************************************) +(* ___ *) +(* ||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/dynamic/snta_lift.ma". + +(* STRATIFIED NATIVE TYPE ASSIGNMENT ON TERMS *******************************) + +(* Main properties **********************************************************) + +theorem snta_mono: ∀h,L,T,U1,l1. ⦃h, L⦄ ⊢ T :[l1] U1 → + ∀U2,l2. ⦃h, L⦄ ⊢ T :[l2] U2 → l1 = l2 ∧ L ⊢ U1 ⬌* U2. +#h #L #T #U1 #l1 #H elim H -L -T -U1 -l1 +[ #L #k #X #l2 #H + lapply (snta_inv_sort1 … H) -H * /2 width=1/ +| #L #K #V #W11 #W12 #i #l1 #HLK #_ #HW112 #IHVW11 #X #l2 #H + elim (snta_inv_lref1 … H) -H * #K0 #V0 #W21 #W22 #HLK0 #HVW21 #HW212 #HX + lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct + lapply (ldrop_fwd_ldrop2 … HLK) -HLK #HLK + elim (IHVW11 … HVW21) -IHVW11 -HVW21 #Hl12 #HW121 + lapply (cpcs_lift … HLK … HW112 … HW212 ?) // -K -W11 -W21 /3 width=3/ +| #L #K #W #V1 #V #i #l1 #HLK #_ #HWV #IHWV1 #X #l2 #H + elim (snta_inv_lref1 … H) -H * #K0 #W0 #V2 #V0 #HLK0 #HW0V2 #HWV0 [2: #HL2 ] #HX + lapply (ldrop_mono … HLK0 … HLK) -HLK0 -HLK #H destruct + lapply (lift_mono … HWV0 … HWV) -HWV0 -HWV #H destruct + elim (IHWV1 … HW0V2) -IHWV1 -HW0V2 /3 width=1/ +| #I #L #V #W1 #T #U1 #l10 #l1 #_ #_ #_ #IHTU1 #X #l2 #H + elim (snta_inv_bind1 … H) -H #W2 #U2 #l20 #_ #HTU2 #H + elim (IHTU1 … HTU2) -IHTU1 -HTU2 #Hl12 #HU12 + lapply (cpcs_trans … (ⓑ{I}V.U1) … H) -H /2 width=1/ +| #L #V #W #W1 #T #U1 #l10 #l1 #_ #_ #_ #IHTU1 #X #l2 #H + elim (snta_fwd_pure1 … H) -H #U2 #W2 #l20 #_ #HTU2 #H + elim (IHTU1 … HTU2) -IHTU1 -HTU2 #Hl12 #HU12 + lapply (cpcs_trans … (ⓐV.ⓛW1.U1) … H) -H /2 width=1/ +| #L #V #T #U1 #W1 #l1 #_ #_ #IHTU1 #_ #X #l2 #H + elim (snta_fwd_pure1 … H) -H #U2 #W2 #l20 #_ #HTU2 #H + elim (IHTU1 … HTU2) -IHTU1 -HTU2 #Hl12 #HU12 + lapply (cpcs_trans … (ⓐV.U1) … H) -H /2 width=1/ +| #L #T #U1 #W1 #l10 #l1 #_ #_ #IHTU1 #_ #X #l2 #H + elim (snta_inv_cast1 … H) -H #HTU1 + elim (IHTU1 … HTU1) -IHTU1 -HTU1 /2 width=1/ +| #L #T #U11 #U12 #V12 #l1 #_ #HU112 #_ #IHTU11 #_ #U2 #l2 #HTU2 + elim (IHTU11 … HTU2) -IHTU11 -HTU2 #Hl12 #H + lapply (cpcs_canc_sn … HU112 … H) -U11 /2 width=1/ +] +qed-. + +(* Advanced properties ******************************************************) + +lemma snta_cast_alt: ∀h,L,T,W,U,l. ⦃h, L⦄ ⊢ T :[l] W → ⦃h, L⦄ ⊢ T :[l] U → + ⦃h, L⦄ ⊢ ⓝW.T :[l] U. +#h #L #T #W #U #l #HTW #HTU +elim (snta_mono … HTW … HTU) #_ #HWU +elim (snta_fwd_correct … HTU) -HTU /3 width=3/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/snta/snta_thin.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/snta/snta_thin.etc new file mode 100644 index 000000000..ceb5375bf --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/snta/snta_thin.etc @@ -0,0 +1,116 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/thin_ldrop.ma". +include "basic_2/equivalence/cpcs_delift.ma". +include "basic_2/dynamic/snta_lift.ma". + +(* STRATIFIED NATIVE TYPE ASSIGNMENT ON TERMS *******************************) + +(* Properties on basic local environment thinning ***************************) + +(* Note: this is known as the substitution lemma *) +lemma snta_thin_conf: ∀h,L1,T1,U1,l. ⦃h, L1⦄ ⊢ T1 :[l] U1 → + ∀L2,d,e. ≽ [d, e] L1 → L1 ▼*[d, e] ≡ L2 → + ∃∃T2,U2. ⦃h, L2⦄ ⊢ T2 :[l] U2 & + L1 ⊢ T1 ▼*[d, e] ≡ T2 & L1 ⊢ U1 ▼*[d, e] ≡ U2. +#h #L1 #T1 #U1 #l #H elim H -L1 -T1 -U1 -l +[ /2 width=5/ +| #L1 #K1 #V1 #W1 #U1 #i #l #HLK1 #HVW1 #HWU1 #IHVW1 #L2 #d #e #HL1 #HL12 + elim (lt_or_ge i d) #Hdi [ -HVW1 ] + [ lapply (sfr_ldrop_trans_ge … HLK1 … HL1 ?) -HL1 /2 width=2/ #H + lapply (sfr_inv_skip … H ?) -H /2 width=1/ #HK1 + elim (thin_ldrop_conf_le … HL12 … HLK1 ?) -HL12 /2 width=2/ #X #H #HLK2 + elim (thin_inv_delift1 … H ?) -H /2 width=1/ #K2 #V2 #HK12 #HV12 #H destruct + elim (IHVW1 … HK1 HK12) -IHVW1 -HK1 -HK12 #X2 #W2 #HVW2 #H #HW12 + lapply (delift_mono … H … HV12) -H -HV12 #H destruct + elim (lift_total W2 0 (i+1)) #U2 #HWU2 + lapply (ldrop_fwd_ldrop2 … HLK1) -V1 #HLK1 + lapply (delift_lift_ge … HW12 … HLK1 HWU1 … HWU2) -HW12 -HLK1 -HWU1 // + >minus_plus minus_plus #HU1 + lapply (lift_conf_be … HWU2 … HW2U ?) -W2 /2 width=1/ #HU2 + lapply (delift_lift_div_be … HU1 … HU2 ? ?) -U // /2 width=1/ /3 width=8/ + | lapply (transitive_le … (i+1) Hide ?) /2 width=1/ #Hdei + lapply (thin_ldrop_conf_ge … HL12 … HLK1 ?) -HL12 -HLK1 // #HL2K1 + elim (lift_split … HWU1 d (i+1-e) ? ? ?) -HWU1 // /2 width=1/ #W + commutative_plus minus_plus commutative_plus ≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → + ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] → + ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ T2 ¡[h, g]. +/3 width=6 by lpr_lpx, cpr_cpx/ qed-. + +fact snv_sta_aux: ∀h,g,G0,L0,T0. + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → + ∀G,L,T. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L, T⦄ → ⦃G, L⦄ ⊢ T ¡[h, g] → + ∀l. ⦃G, L⦄ ⊢ T ▪[h, g] l+1 → + ∀U. ⦃G, L⦄ ⊢ T •[h] U → ⦃G, L⦄ ⊢ U ¡[h, g]. +/3 width=6 by sta_cpx/ qed-. + +fact snv_cpxs_lpx_aux: ∀h,g,G0,L0,T0. + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → + ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] → + ∀T2. ⦃G, L1⦄ ⊢ T1 ➡*[h, g] T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → ⦃G, L2⦄ ⊢ T2 ¡[h, g]. +#h #g #G0 #L0 #T0 #IH #G #L1 #T1 #HLT0 #HT1 #T2 #H +@(cpxs_ind … H) -T2 /4 width=6 by fpbg_fpbs_trans, cpxs_fpbs/ +qed-. + +fact snv_cprs_lpr_aux: ∀h,g,G0,L0,T0. + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → + ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] → + ∀T2. ⦃G, L1⦄ ⊢ T1 ➡* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ T2 ¡[h, g]. +/3 width=10 by snv_cpxs_lpx_aux, cprs_cpxs, lpr_lpx/ qed-. + +fact snv_lstas_aux: ∀h,g,G0,L0,T0. + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → + ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] → + ∀l1,l2. l2 ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 → + ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, l2] U1 → ⦃G, L1⦄ ⊢ U1 ¡[h, g]. +/3 width=12 by snv_cpxs_lpx_aux, lstas_cpxs/ qed-. + +fact da_cprs_lpr_aux: ∀h,g,G0,L0,T0. + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) → + ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] → + ∀l. ⦃G, L1⦄ ⊢ T1 ▪[h, g] l → + ∀T2. ⦃G, L1⦄ ⊢ T1 ➡* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ T2 ▪[h, g] l. +#h #g #G0 #L0 #T0 #IH2 #IH1 #G #L1 #T1 #HLT0 #HT1 #l #Hl #T2 #H +@(cprs_ind … H) -T2 /4 width=10 by snv_cprs_lpr_aux, fpbg_fpbs_trans, cprs_fpbs/ +qed-. + +fact da_cpcs_aux: ∀h,g,G0,L0,T0. + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) → + ∀G,L,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L, T1⦄ → ⦃G, L⦄ ⊢ T1 ¡[h, g] → + ∀T2. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L, T2⦄ → ⦃G, L⦄ ⊢ T2 ¡[h, g] → + ∀l1. ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 → ∀l2. ⦃G, L⦄ ⊢ T2 ▪[h, g] l2 → + ⦃G, L⦄ ⊢ T1 ⬌* T2 → l1 = l2. +#h #g #G0 #L0 #T0 #IH2 #IH1 #G #L #T1 #HLT01 #HT1 #T2 #HLT02 #HT2 #l1 #Hl1 #l2 #Hl2 #H +elim (cpcs_inv_cprs … H) -H /4 width=18 by da_cprs_lpr_aux, da_mono/ +qed-. + +fact sta_cpr_lpr_aux: ∀h,g,G0,L0,T0. + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) → + ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] → + ∀l. ⦃G, L1⦄ ⊢ T1 ▪[h, g] l+1 → + ∀U1. ⦃G, L1⦄ ⊢ T1 •[h] U1 → + ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → + ∃∃U2. ⦃G, L2⦄ ⊢ T2 •[h] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2. +#h #g #G0 #L0 #T0 #IH #G #L1 #T1 #H01 #HT1 #l #Hl #U1 #HTU1 #T2 #HT12 #L2 #HL12 +elim (IH … H01 … 1 … Hl U1 … HT12 … HL12) -H01 -Hl -HT12 -HL12 +/3 width=3 by lstas_inv_SO, sta_lstas, ex2_intro/ +qed-. + +fact lstas_cprs_lpr_aux: ∀h,g,G0,L0,T0. + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) → + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) → + ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] → + ∀l1,l2. l2 ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 → + ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, l2] U1 → + ∀T2. ⦃G, L1⦄ ⊢ T1 ➡* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → + ∃∃U2. ⦃G, L2⦄ ⊢ T2 •*[h, l2] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2. +#h #g #G0 #L0 #T0 #IH3 #IH2 #IH1 #G #L1 #T1 #H01 #HT1 #l1 #l2 #Hl21 #Hl1 #U1 #HTU1 #T2 #H +@(cprs_ind … H) -T2 [ /2 width=10 by/ ] +#T #T2 #HT1T #HTT2 #IHT1 #L2 #HL12 +elim (IHT1 L1) // -IHT1 #U #HTU #HU1 +elim (IH1 … Hl21 … HTU … HTT2 … HL12) -IH1 -HTU -HTT2 +[2: /3 width=12 by da_cprs_lpr_aux/ +|3: /3 width=10 by snv_cprs_lpr_aux/ +|4: /3 width=5 by fpbg_fpbs_trans, cprs_fpbs/ +] -G0 -L0 -T0 -T1 -T -l1 +/4 width=5 by lpr_cpcs_conf, cpcs_trans, ex2_intro/ +qed-. + +fact lstas_cpcs_lpr_aux: ∀h,g,G0,L0,T0. + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) → + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) → + ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] → + ∀l,l1. l ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 → ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, l] U1 → + ∀T2. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T2⦄ → ⦃G, L1⦄ ⊢ T2 ¡[h, g] → + ∀l2. l ≤ l2 → ⦃G, L1⦄ ⊢ T2 ▪[h, g] l2 → ∀U2. ⦃G, L1⦄ ⊢ T2 •*[h, l] U2 → + ⦃G, L1⦄ ⊢ T1 ⬌* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ U1 ⬌* U2. +#h #g #G0 #L0 #T0 #IH3 #IH2 #IH1 #G #L1 #T1 #H01 #HT1 #l #l1 #Hl1 #HTl1 #U1 #HTU1 #T2 #H02 #HT2 #l2 #Hl2 #HTl2 #U2 #HTU2 #H #L2 #HL12 +elim (cpcs_inv_cprs … H) -H #T #H1 #H2 +elim (lstas_cprs_lpr_aux … H01 HT1 … Hl1 HTl1 … HTU1 … H1 … HL12) -T1 /2 width=1 by/ #W1 #H1 #HUW1 +elim (lstas_cprs_lpr_aux … H02 HT2 … Hl2 HTl2 … HTU2 … H2 … HL12) -T2 /2 width=1 by/ #W2 #H2 #HUW2 -L0 -T0 +lapply (lstas_mono … H1 … H2) -h -T -l #H destruct /2 width=3 by cpcs_canc_dx/ +qed-. + +fact lstas_cpds_aux: ∀h,g,G0,L0,T0. + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) → + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) → + ∀G,L,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L, T1⦄ → ⦃G, L⦄ ⊢ T1 ¡[h, g] → + ∀l1,l2. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 → + ∀U1. ⦃G, L⦄ ⊢ T1 •*[h, l2] U1 → ∀T2. ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2 → + ∃∃U2,l. l ≤ l2 & ⦃G, L⦄ ⊢ T2 •*[h, l] U2 & ⦃G, L⦄ ⊢ U1 •*⬌*[h, g] U2. +#h #g #G0 #L0 #T0 #IH3 #IH2 #IH1 #G #L #T1 #H01 #HT1 #l1 #l2 #Hl21 #Hl1 #U1 #HTU1 #T2 * #T #l0 #l #Hl0 #H #HT1T #HTT2 +lapply (da_mono … H … Hl1) -H #H destruct +lapply (lstas_da_conf … HTU1 … Hl1) #Hl12 +elim (le_or_ge l2 l) #Hl2 +[ lapply (lstas_conf_le … HTU1 … HT1T) -HT1T + /5 width=11 by cpds_cpes_dx, monotonic_le_minus_l, ex3_2_intro, ex4_3_intro/ +| lapply (lstas_da_conf … HT1T … Hl1) #Hl1l + lapply (lstas_conf_le … HT1T … HTU1) -HTU1 // #HTU1 + elim (lstas_cprs_lpr_aux … IH3 IH2 IH1 … Hl1l … HTU1 … HTT2 L) -IH2 -IH1 -Hl1l -HTU1 -HTT2 + /3 width=12 by snv_lstas_aux, cpcs_cpes, fpbg_fpbs_trans, lstas_fpbs, monotonic_le_minus_l, ex3_2_intro/ +] +qed-. + +fact cpds_cpr_lpr_aux: ∀h,g,G0,L0,T0. + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) → + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) → + ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] → + ∀U1. ⦃G, L1⦄ ⊢ T1 •*➡*[h, g] U1 → + ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → + ∃∃U2. ⦃G, L2⦄ ⊢ T2 •*➡*[h, g] U2 & ⦃G, L2⦄ ⊢ U1 ➡* U2. +#h #g #G0 #L0 #T0 #IH2 #IH1 #G #L1 #T1 #H01 #HT1 #U1 * #W1 #l1 #l2 #Hl21 #Hl1 #HTW1 #HWU1 #T2 #HT12 #L2 #HL12 +elim (IH1 … H01 … HTW1 … HT12 … HL12) -IH1 // #W2 #HTW2 #HW12 +lapply (IH2 … H01 … Hl1 … HT12 … HL12) -L0 -T0 // -T1 +lapply (lpr_cprs_conf … HL12 … HWU1) -L1 #HWU1 +lapply (cpcs_canc_sn … HW12 HWU1) -W1 #H +elim (cpcs_inv_cprs … H) -H /3 width=7 by ex4_3_intro, ex2_intro/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/snv/snv_da_lpr.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/snv/snv_da_lpr.etc new file mode 100644 index 000000000..119a40243 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/snv/snv_da_lpr.etc @@ -0,0 +1,93 @@ +(**************************************************************************) +(* ___ *) +(* ||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/static/lsubd_da.ma". +include "basic_2/computation/cpds_cpds.ma". +include "basic_2/dynamic/snv_aaa.ma". +include "basic_2/dynamic/snv_cpcs.ma". + +(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************) + +(* Properties on degree assignment for terms ********************************) + +fact da_cpr_lpr_aux: ∀h,g,G0,L0,T0. + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) → + ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_da_cpr_lpr h g G1 L1 T1. +#h #g #G0 #L0 #T0 #IH2 #IH1 #G1 #L1 * * [|||| * ] +[ #k #_ #_ #_ #_ #l #H2 #X3 #H3 #L2 #_ -IH2 -IH1 + lapply (da_inv_sort … H2) -H2 + lapply (cpr_inv_sort1 … H3) -H3 #H destruct /2 width=1 by da_sort/ +| #i #HG0 #HL0 #HT0 #H1 #l #H2 #X3 #H3 #L2 #HL12 destruct -IH2 + elim (snv_inv_lref … H1) -H1 #I0 #K0 #X0 #H #HX0 + elim (da_inv_lref … H2) -H2 * #K1 [ #V1 | #W1 #l1 ] #HLK1 [ #HV1 | #HW1 #H ] destruct + lapply (ldrop_mono … H … HLK1) -H #H destruct + elim (cpr_inv_lref1 … H3) -H3 + [1,3: #H destruct + lapply (fqup_lref … G1 … HLK1) + elim (lpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #H #HLK2 + elim (lpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct + /4 width=10 by da_ldef, da_ldec, fqup_fpbg/ + |2,4: * #K0 #V0 #W0 #H #HVW0 #HW0 + lapply (ldrop_mono … H … HLK1) -H #H destruct + lapply (fqup_lref … G1 … HLK1) + elim (lpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #H #HLK2 + elim (lpr_inv_pair1 … H) -H #K2 #V2 #HK12 #_ #H destruct + lapply (ldrop_fwd_drop2 … HLK2) -V2 + /4 width=8 by da_lift, fqup_fpbg/ + ] +| #p #_ #_ #HT0 #H1 destruct -IH2 -IH1 + elim (snv_inv_gref … H1) +| #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #l #H2 #X3 #H3 #L2 #HL12 destruct -IH2 + elim (snv_inv_bind … H1) -H1 #_ #HT1 + lapply (da_inv_bind … H2) -H2 + elim (cpr_inv_bind1 … H3) -H3 * + [ #V2 #T2 #HV12 #HT12 #H destruct + /4 width=9 by da_bind, fqup_fpbg, lpr_pair/ + | #T2 #HT12 #HT2 #H1 #H2 destruct + /4 width=11 by da_inv_lift, fqup_fpbg, lpr_pair, ldrop_drop/ + ] +| #V1 #T1 #HG0 #HL0 #HT0 #H1 #l #H2 #X3 #H3 #L2 #HL12 destruct + elim (snv_inv_appl … H1) -H1 #b0 #W1 #W0 #T0 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HT10 + lapply (da_inv_flat … H2) -H2 #Hl + elim (cpr_inv_appl1 … H3) -H3 * + [ #V2 #T2 #HV12 #HT12 #H destruct -IH2 /4 width=7 by da_flat, fqup_fpbg/ + | #b #V2 #W #W2 #U1 #U2 #HV12 #HW2 #HU12 #H1 #H2 destruct + elim (snv_inv_bind … HT1) -HT1 #HW #HU1 + lapply (da_inv_bind … Hl) -Hl #Hl + elim (cpds_inv_abst1 … HT10) -HT10 #W3 #U3 #HW3 #_ #H destruct -U3 + lapply (cprs_div … HW3 … HW10) -W3 #HWW1 + lapply (da_sta_conf … HVW1 … Hl0) ≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) → + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) → + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → + ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_snv_cpx_lpx h g G1 L1 T1. +#h #g #G0 #L0 #T0 #IH3 #IH2 #IH1 #G1 #L1 * * [|||| * ] +[ #k #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #_ destruct -IH3 -IH2 -IH1 -H1 + elim (cpx_inv_sort1 … H2) -H2 // * // +| #i #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #HL12 destruct -IH3 -IH2 + elim (snv_inv_lref … H1) -H1 #I #K1 #V1 #HLK1 #HV1 + elim (lpx_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2 + elim (lpx_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct + lapply (fqup_lref … G1 … HLK1) #HKL + elim (cpx_inv_lref1 … H2) -H2 + [ #H destruct -HLK1 /4 width=10 by fqup_fpbg, snv_lref/ + | * #I0 #K0 #V0 #W0 #H #HVW0 #W0 -HV12 + lapply (ldrop_mono … H … HLK1) -HLK1 -H #H destruct + lapply (ldrop_fwd_drop2 … HLK2) -HLK2 /4 width=8 by fqup_fpbg, snv_lift/ + ] +| #p #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #HL12 destruct -IH3 -IH2 -IH1 + elim (snv_inv_gref … H1) +| #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #HL12 destruct -IH3 -IH2 + elim (snv_inv_bind … H1) -H1 #HV1 #HT1 + elim (cpx_inv_bind1 … H2) -H2 * + [ #V2 #T2 #HV12 #HT12 #H destruct /4 width=8 by fqup_fpbg, snv_bind, lpx_pair/ + | #T2 #HT12 #HXT2 #H1 #H2 destruct -HV1 + /4 width=10 by fqup_fpbg, snv_inv_lift, lpx_pair, ldrop_drop/ + ] +| #V1 #T1 #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #HL12 destruct + elim (snv_inv_appl … H1) -H1 #a #W10 #W1 #U1 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HTU1 + elim (cpx_inv_appl1 … H2) -H2 * + [ #V2 #T2 #HV12 #HT12 #H destruct + lapply (IH1 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #HV2 + lapply (IH1 … HT12 … HL12) /2 width=1 by fqup_fpbg/ #HT2 +(* lapply (IH2 … Hl0 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #H2l0 + elim (sta_cpr_lpr_aux … IH3 … Hl0 … HVW1 … HV12 … HL12) -Hl0 -HVW1 -HV12 /2 width=1 by fqup_fpbg/ -HV1 #W2 #HVW2 #HW12 + elim (cpds_cpr_lpr_aux … IH2 IH3 … HTU1 … HT12 … HL12) /2 width=1 by fqup_fpbg/ -HT12 -HTU1 #X #HTU2 #H + elim (cprs_inv_abst1 … H) -H #W20 #U2 #HW120 #_ #H destruct + lapply (lpr_cprs_conf … HL12 … HW10) -L1 #HW10 + lapply (cpcs_cprs_strap1 … HW10 … HW120) -W1 #HW120 + lapply (cpcs_canc_sn … HW12 HW120) -W10 #HW20 + elim (cpcs_inv_cprs … HW20) -HW20 #W0 #HW20 #HW200 + lapply (cpds_cprs_trans … (ⓛ{a}W0.U2) HTU2 ?) + /2 width=7 by snv_appl, cprs_bind/ *) + | #b #V2 #W20 #W2 #T20 #T2 #HV12 #HW202 #HT202 #H1 #H2 destruct + elim (snv_inv_bind … HT1) -HT1 #HW20 #HT20 + elim (cpds_inv_abst1 … HTU1) -HTU1 #W30 #T30 #HW230 #_ #H destruct -T30 + lapply (cprs_div … HW10 … HW230) -W30 #HW120 + lapply (snv_sta_aux … IH1 … Hl0 … HVW1) /2 width=1 by fqup_fpbg/ #HW10 + lapply (da_sta_conf … HVW1 … Hl0) ≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) → + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) → + (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) → + ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_lstas_cpr_lpr h g G1 L1 T1. +#h #g #G0 #L0 #T0 #IH3 #IH2 #IH1 #G1 #L1 * * [|||| * ] +[ #k #_ #_ #_ #_ #l1 #l2 #_ #_ #X2 #H2 #X3 #H3 #L2 #_ -IH3 -IH2 -IH1 + >(lstas_inv_sort1 … H2) -X2 + >(cpr_inv_sort1 … H3) -X3 /2 width=3 by ex2_intro/ +| #i #HG0 #HL0 #HT0 #H1 #l1 #l2 @(nat_ind_plus … l2) -l2 [ #_ | #l2 #_ #Hl21 ] #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct -IH3 + [ lapply (lstas_inv_O … H2) -H2 #H destruct -IH1 -H1 -l1 /4 width=5 by lpr_cpcs_conf, cpr_cpcs_dx, ex2_intro/ ] + elim (snv_inv_lref … H1) -H1 #I0 #K0 #X0 #HK0 #HX0 + elim (da_inv_lref … Hl1) -Hl1 * #K1 [ #V1 | #W1 #l0 ] #HLK1 [ #HVl1 | #HWl1 #H destruct ] + lapply (ldrop_mono … HK0 … HLK1) -HK0 #H destruct + elim (lstas_inv_lref1 … H2) -H2 * #K0 #V0 #W0 [2,4: #X0 ] #HK0 [1,2: #_ -X0 ] #HVW0 #HX2 + lapply (ldrop_mono … HK0 … HLK1) -HK0 #H destruct + [ lapply (le_plus_to_le_r … Hl21) -Hl21 #Hl21 ] + lapply (fqup_lref … G1 … HLK1) #HKV1 + elim (lpr_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2 + elim (lpr_inv_pair1 … H) -H #K2 [ #W2 | #V2 ] #HK12 [ #HW12 | #HV12 ] #H destruct + lapply (ldrop_fwd_drop2 … HLK2) #H2 + elim (cpr_inv_lref1 … H3) -H3 + [1,3: #H destruct -HLK1 + |2,4: * #K0 #V0 #X0 #H #HVX0 #HX0 + lapply (ldrop_mono … H … HLK1) -H -HLK1 #H destruct + ] + [ lapply (IH2 … HWl1 … HW12 … HK12) /2 width=1 by fqup_fpbg/ -IH2 #H + elim (da_inv_sta … H) -H + elim (IH1 … HWl1 … HVW0 … HW12 … HK12) -IH1 -HVW0 /2 width=1 by fqup_fpbg/ #V2 #HWV2 #HV2 + elim (lift_total V2 0 (i+1)) + /3 width=12 by cpcs_lift, lstas_ldec, ex2_intro/ + | elim (IH1 … HVl1 … HVW0 … HV12 … HK12) -IH1 -HVl1 -HVW0 -HV12 -HK12 -IH2 /2 width=1 by fqup_fpbg/ #W2 #HVW2 #HW02 + elim (lift_total W2 0 (i+1)) + /4 width=12 by cpcs_lift, lstas_ldef, ex2_intro/ + | elim (IH1 … HVl1 … HVW0 … HVX0 … HK12) -IH1 -HVl1 -HVW0 -HVX0 -HK12 -IH2 -V2 /2 width=1 by fqup_fpbg/ -l1 #W2 #HXW2 #HW02 + elim (lift_total W2 0 (i+1)) + /3 width=12 by cpcs_lift, lstas_lift, ex2_intro/ + ] +| #p #_ #_ #HT0 #H1 destruct -IH3 -IH2 -IH1 + elim (snv_inv_gref … H1) +| #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct -IH3 -IH2 + elim (snv_inv_bind … H1) -H1 #_ #HT1 + lapply (da_inv_bind … Hl1) -Hl1 #Hl1 + elim (lstas_inv_bind1 … H2) -H2 #U1 #HTU1 #H destruct + elim (cpr_inv_bind1 … H3) -H3 * + [ #V2 #T2 #HV12 #HT12 #H destruct + elim (IH1 … Hl1 … HTU1 … HT12 (L2.ⓑ{I}V2)) -IH1 -Hl1 -HTU1 -HT12 /2 width=1 by fqup_fpbg, lpr_pair/ -T1 + /4 width=5 by cpcs_bind2, lpr_cpr_conf, lstas_bind, ex2_intro/ + | #T3 #HT13 #HXT3 #H1 #H2 destruct + elim (IH1 … Hl1 … HTU1 … HT13 (L2.ⓓV1)) -IH1 -Hl1 -HTU1 -HT13 /2 width=1 by fqup_fpbg, lpr_pair/ -T1 -HL12 #U3 #HTU3 #HU13 + elim (lstas_inv_lift1 … HTU3 L2 … HXT3) -T3 + /5 width=8 by cpcs_cpr_strap1, cpcs_bind1, cpr_zeta, ldrop_drop, ex2_intro/ + ] +| #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct + elim (snv_inv_appl … H1) -H1 #a #W1 #W10 #U10 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HTU10 + lapply (da_inv_flat … Hl1) -Hl1 #Hl1 + elim (lstas_inv_appl1 … H2) -H2 #U1 #HTU1 #H destruct + elim (cpr_inv_appl1 … H3) -H3 * + [ #V2 #T2 #HV12 #HT12 #H destruct -a -l0 -W1 -W10 -U10 -HV1 -IH3 -IH2 + elim (IH1 … Hl1 … HTU1 … HT12 … HL12) -IH1 -Hl1 -HTU1 + /4 width=5 by fqup_fpbg, cpcs_flat, lpr_cpr_conf, lstas_appl, ex2_intro/ + | #b #V2 #W2 #W3 #T2 #T3 #HV12 #HW23 #HT23 #H1 #H2 destruct + elim (snv_inv_bind … HT1) -HT1 #HW2 #HT2 + lapply (da_inv_bind … Hl1) -Hl1 #Hl1 + elim (lstas_inv_bind1 … HTU1) -HTU1 #U2 #HTU2 #H destruct + elim (cpds_inv_abst1 … HTU10) -HTU10 #W0 #U0 #HW20 #_ #H destruct + lapply (cprs_div … HW10 … HW20) -W0 #HW12 + lapply (da_sta_conf … HVW1 … Hl0) iter_SO // +qed-. + +lemma lstas_inv_gref1: ∀h,G,L,X,p,l. ⦃G, L⦄ ⊢ §p •*[h, l+1] X → ⊥. +#h #G #L #X #p #l #H elim (lstas_inv_step_sn … H) -H +#U #H #HUX elim (sta_inv_gref1 … H) +qed-. + +lemma lstas_inv_bind1: ∀h,a,I,G,L,V,T,X,l. ⦃G, L⦄ ⊢ ⓑ{a,I}V.T •*[h, l] X → + ∃∃U. ⦃G, L.ⓑ{I}V⦄ ⊢ T •*[h, l] U & X = ⓑ{a,I}V.U. +#h #a #I #G #L #V #T #X #l #H @(lstas_ind_dx … H) -X -l /2 width=3 by ex2_intro/ +#l #X #X0 #_ #HX0 * #U #HTU #H destruct +elim (sta_inv_bind1 … HX0) -HX0 #U0 #HU0 #H destruct /3 width=3 by lstar_dx, ex2_intro/ +qed-. + +lemma lstas_inv_appl1: ∀h,G,L,V,T,X,l. ⦃G, L⦄ ⊢ ⓐV.T •*[h, l] X → + ∃∃U. ⦃G, L⦄ ⊢ T •*[h, l] U & X = ⓐV.U. +#h #G #L #V #T #X #l #H @(lstas_ind_dx … H) -X -l /2 width=3 by ex2_intro/ +#l #X #X0 #_ #HX0 * #U #HTU #H destruct +elim (sta_inv_appl1 … HX0) -HX0 #U0 #HU0 #H destruct /3 width=3 by lstar_dx, ex2_intro/ +qed-. + +lemma lstas_inv_cast1: ∀h,G,L,W,T,U,l. ⦃G, L⦄ ⊢ ⓝW.T •*[h, l+1] U → ⦃G, L⦄ ⊢ T •*[h, l+1] U. +#h #G #L #W #T #X #l #H elim (lstas_inv_step_sn … H) -H +#U #H #HUX lapply (sta_inv_cast1 … H) -H /2 width=3 by lstar_S/ +qed-. + +(* Basic properties *********************************************************) + +lemma lstas_refl: ∀h,G,L. reflexive … (lstas h G L 0). +// qed. + +lemma sta_lstas: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ⦃G, L⦄ ⊢ T •*[h, 1] U. +/2 width=1 by lstar_step/ qed. + +lemma lstas_step_sn: ∀h,G,L,T1,U1,U2,l. ⦃G, L⦄ ⊢ T1 •[h] U1 → ⦃G, L⦄ ⊢ U1 •*[h, l] U2 → + ⦃G, L⦄ ⊢ T1 •*[h, l+1] U2. +/2 width=3 by lstar_S/ qed. + +lemma lstas_step_dx: ∀h,G,L,T1,T2,U2,l. ⦃G, L⦄ ⊢ T1 •*[h, l] T2 → ⦃G, L⦄ ⊢ T2 •[h] U2 → + ⦃G, L⦄ ⊢ T1 •*[h, l+1] U2. +/2 width=3 by lstar_dx/ qed. + +lemma lstas_split: ∀h,G,L. inv_ltransitive … (lstas h G L). +/2 width=1 by lstar_inv_ltransitive/ qed-. + +lemma lstas_sort: ∀h,G,L,l,k. ⦃G, L⦄ ⊢ ⋆k •*[h, l] ⋆((next h)^l k). +#h #G #L #l @(nat_ind_plus … l) -l // +#l #IHl #k >iter_SO /2 width=3 by sta_sort, lstas_step_dx/ +qed. + +lemma lstas_bind: ∀h,I,G,L,V,T,U,l. ⦃G, L.ⓑ{I}V⦄ ⊢ T •*[h, l] U → + ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V.T •*[h, l] ⓑ{a,I}V.U. +#h #I #G #L #V #T #U #l #H @(lstas_ind_dx … H) -U -l /3 width=3 by sta_bind, lstar_O, lstas_step_dx/ +qed. + +lemma lstas_appl: ∀h,G,L,T,U,l. ⦃G, L⦄ ⊢ T •*[h, l] U → + ∀V.⦃G, L⦄ ⊢ ⓐV.T •*[h, l] ⓐV.U. +#h #G #L #T #U #l #H @(lstas_ind_dx … H) -U -l /3 width=3 by sta_appl, lstar_O, lstas_step_dx/ +qed. + +lemma lstas_cast: ∀h,G,L,T,U,l. ⦃G, L⦄ ⊢ T •*[h, l+1] U → + ∀W. ⦃G, L⦄ ⊢ ⓝW.T •*[h, l+1] U. +#h #G #L #T #U #l #H elim (lstas_inv_step_sn … H) -H /3 width=3 by sta_cast, lstas_step_sn/ +qed. + +(* Basic_1: removed theorems 7: + sty1_abbr sty1_appl sty1_bind sty1_cast2 + sty1_correct sty1_lift sty1_trans +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/lstas_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/lstas_aaa.etc new file mode 100644 index 000000000..7497f44b6 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/lstas_aaa.etc @@ -0,0 +1,23 @@ +(**************************************************************************) +(* ___ *) +(* ||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/static/sta_aaa.ma". +include "basic_2/unfold/lstas.ma". + +(* NAT-ITERATED STATIC TYPE ASSIGNMENT FOR TERMS ****************************) + +(* Properties on atomic arity assignment for terms **************************) + +lemma lstas_aaa_conf: ∀h,G,L,l. Conf3 … (aaa G L) (lstas h G L l). +/3 width=6 by sta_aaa_conf, lstar_Conf3/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/lstas_alt.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/lstas_alt.etc new file mode 100644 index 000000000..0ad7b9bbc --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/lstas_alt.etc @@ -0,0 +1,102 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/statictypestaralt_6.ma". +include "basic_2/unfold/lstas_lift.ma". + +(* NAT-ITERATED STATIC TYPE ASSIGNMENT FOR TERMS ****************************) + +(* alternative definition of lstas *) +inductive lstasa (h): genv → relation4 lenv nat term term ≝ +| lstasa_O : ∀G,L,T. lstasa h G L 0 T T +| lstasa_sort: ∀G,L,l,k. lstasa h G L l (⋆k) (⋆((next h)^l k)) +| lstasa_ldef: ∀G,L,K,V,W,U,i,l. ⇩[i] L ≡ K.ⓓV → lstasa h G K (l+1) V W → + ⇧[0, i+1] W ≡ U → lstasa h G L (l+1) (#i) U +| lstasa_ldec: ∀G,L,K,W,V,V0,U,i,l. ⇩[i] L ≡ K.ⓛW → ⦃G, K⦄ ⊢ W •[h] V0 → + lstasa h G K l W V → ⇧[0, i+1] V ≡ U → lstasa h G L (l+1) (#i) U +| lstasa_bind: ∀a,I,G,L,V,T,U,l. lstasa h G (L.ⓑ{I}V) l T U → + lstasa h G L l (ⓑ{a,I}V.T) (ⓑ{a,I}V.U) +| lstasa_appl: ∀G,L,V,T,U,l. lstasa h G L l T U → lstasa h G L l (ⓐV.T) (ⓐV.U) +| lstasa_cast: ∀G,L,W,T,U,l. lstasa h G L (l+1) T U → lstasa h G L (l+1) (ⓝW.T) U +. + +interpretation "nat-iterated static type assignment (term) alternative" + 'StaticTypeStarAlt h G L l T U = (lstasa h G L l T U). + +(* Base properties **********************************************************) + +lemma sta_lstasa: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ⦃G, L⦄ ⊢ T ••*[h, 1] U. +#h #G #L #T #U #H elim H -G -L -T -U +/2 width=8 by lstasa_O, lstasa_sort, lstasa_ldef, lstasa_ldec, lstasa_bind, lstasa_appl, lstasa_cast/ +qed. + +lemma lstasa_step_dx: ∀h,G,L,T1,T,l. ⦃G, L⦄ ⊢ T1 ••*[h, l] T → + ∀T2. ⦃G, L⦄ ⊢ T •[h] T2 → ⦃G, L⦄ ⊢ T1 ••*[h, l+1] T2. +#h #G #L #T1 #T #l #H elim H -G -L -T1 -T -l +[ /2 width=1 by sta_lstasa/ +| #G #L #l #k #X #H >(sta_inv_sort1 … H) -X >commutative_plus // +| #G #L #K #V #W #U #i #l #HLK #_ #HWU #IHVW #U2 #HU2 + lapply (drop_fwd_drop2 … HLK) #H + elim (sta_inv_lift1 … HU2 … H … HWU) -H -U /3 width=6 by lstasa_ldef/ +| #G #L #K #W #V #V0 #U #i #l #HLK #HWl0 #_ #HVU #IHWV #U2 #HU2 + lapply (drop_fwd_drop2 … HLK) #H + elim (sta_inv_lift1 … HU2 … H … HVU) -H -U /3 width=8 by lstasa_ldec/ +| #a #I #G #L #V #T1 #U1 #l #_ #IHTU1 #X #H + elim (sta_inv_bind1 … H) -H #U #HU1 #H destruct /3 width=1 by lstasa_bind/ +| #G #L #V #T1 #U1 #l #_ #IHTU1 #X #H + elim (sta_inv_appl1 … H) -H #U #HU1 #H destruct /3 width=1 by lstasa_appl/ +| /3 width=1 by lstasa_cast/ +] +qed. + +(* Main properties **********************************************************) + +theorem lstas_lstasa: ∀h,G,L,T,U,l. ⦃G, L⦄ ⊢ T •*[h, l] U → ⦃G, L⦄ ⊢ T ••*[h, l] U. +#h #G #L #T #U #l #H @(lstas_ind_dx … H) -U -l /2 width=3 by lstasa_step_dx, lstasa_O/ +qed. + +(* Main inversion lemmas ****************************************************) + +theorem lstasa_inv_lstas: ∀h,G,L,T,U,l. ⦃G, L⦄ ⊢ T ••*[h, l] U → ⦃G, L⦄ ⊢ T •*[h, l] U. +#h #G #L #T #U #l #H elim H -G -L -T -U -l +/2 width=8 by lstas_inv_SO, lstas_ldec, lstas_ldef, lstas_cast, lstas_appl, lstas_bind/ +qed-. + +(* Advanced eliminators *****************************************************) + +lemma lstas_ind_alt: ∀h. ∀R:genv→relation4 lenv nat term term. + (∀G,L,T. R G L O T T) → + (∀G,L,l,k. R G L l (⋆k) (⋆((next h)^l k))) → ( + ∀G,L,K,V,W,U,i,l. + ⇩[i] L ≡ K.ⓓV → ⦃G, K⦄ ⊢ V •*[h, l+1] W → ⇧[O, i+1] W ≡ U → + R G K (l+1) V W → R G L (l+1) (#i) U + ) → ( + ∀G,L,K,W,V,V0,U,i,l. + ⇩[i] L ≡ K.ⓛW → ⦃G, K⦄ ⊢ W •[h] V0 → + ⦃G, K⦄ ⊢ W •*[h, l]V → ⇧[O, i+1] V ≡ U → + R G K l W V → R G L (l+1) (#i) U + ) → ( + ∀a,I,G,L,V,T,U,l. ⦃G, L.ⓑ{I}V⦄ ⊢ T •*[h, l] U → + R G (L.ⓑ{I}V) l T U → R G L l (ⓑ{a,I}V.T) (ⓑ{a,I}V.U) + ) → ( + ∀G,L,V,T,U,l. ⦃G, L⦄ ⊢ T •*[h, l] U → + R G L l T U → R G L l (ⓐV.T) (ⓐV.U) + ) → ( + ∀G,L,W,T,U,l. ⦃G, L⦄⊢ T •*[h, l+1] U → + R G L (l+1) T U → R G L (l+1) (ⓝW.T) U + ) → + ∀G,L,l,T,U. ⦃G, L⦄ ⊢ T •*[h, l] U → R G L l T U. +#h #R #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #IH7 #G #L #l #T #U #H +elim (lstas_lstasa … H) /3 width=10 by lstasa_inv_lstas/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/lstas_da.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/lstas_da.etc new file mode 100644 index 000000000..8b11d1dc0 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/lstas_da.etc @@ -0,0 +1,40 @@ +(**************************************************************************) +(* ___ *) +(* ||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/unfold/lstas.ma". +include "basic_2/static/da_sta.ma". + +(* NAT-ITERATED STATIC TYPE ASSIGNMENT FOR TERMS ****************************) + +(* Properties on degree assignment for terms ********************************) + +lemma lstas_da_conf: ∀h,g,G,L,T,U,l1. ⦃G, L⦄ ⊢ T •*[h, l1] U → + ∀l2. ⦃G, L⦄ ⊢ T ▪[h, g] l2 → ⦃G, L⦄ ⊢ U ▪[h, g] l2-l1. +#h #g #G #L #T #U #l1 #H @(lstas_ind_dx … H) -U -l1 // +#l1 #U #U0 #_ #HU0 #IHTU #l2 #HT +(plus_minus_m_m … Hl12) in ⊢ (%→?); -Hl12 >commutative_plus #H +elim (lstas_split … H) -H #U #HTU +>(lstas_mono … HTU … HTU1) -T // +qed-. + +(* Advanced properties ******************************************************) + +lemma lstas_sta_conf_pos: ∀h,G,L,T,U1. ⦃G, L⦄ ⊢ T •[h] U1 → + ∀U2,l. ⦃G, L⦄ ⊢ T •*[h, l+1] U2 → ⦃G, L⦄ ⊢ U1 •*[h, l] U2. +#h #G #L #T #U1 #HTU1 #U2 #l #HTU2 +lapply (lstas_conf_le … T U1 1 … HTU2) -HTU2 /2 width=1 by sta_lstas/ +qed-. + +lemma lstas_strip_pos: ∀h,G,L,T1,U1. ⦃G, L⦄ ⊢ T1 •[h] U1 → + ∀T2,l. ⦃G, L⦄ ⊢ T1 •*[h, l+1] T2 → + ∃∃U2. ⦃G, L⦄ ⊢ T2 •[h] U2 & ⦃G, L⦄ ⊢ U1 •*[h, l+1] U2. +#h #G #L #T1 #U1 #HTU1 #T2 #l #HT12 +elim (lstas_fwd_correct … HTU1 … HT12) +lapply (lstas_sta_conf_pos … HTU1 … HT12) -T1 /3 width=5 by lstas_step_dx, ex2_intro/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/sta.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/sta.etc new file mode 100644 index 000000000..fc6bf6a2a --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/sta.etc @@ -0,0 +1,143 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/statictype_5.ma". +include "basic_2/grammar/genv.ma". +include "basic_2/substitution/drop.ma". +include "basic_2/static/sh.ma". + +(* STATIC TYPE ASSIGNMENT ON TERMS ******************************************) + +(* activate genv *) +inductive sta (h:sh): relation4 genv lenv term term ≝ +| sta_sort: ∀G,L,k. sta h G L (⋆k) (⋆(next h k)) +| sta_ldef: ∀G,L,K,V,W,U,i. ⇩[i] L ≡ K.ⓓV → sta h G K V W → + ⇧[0, i + 1] W ≡ U → sta h G L (#i) U +| sta_ldec: ∀G,L,K,W,V,U,i. ⇩[i] L ≡ K.ⓛW → sta h G K W V → + ⇧[0, i + 1] W ≡ U → sta h G L (#i) U +| sta_bind: ∀a,I,G,L,V,T,U. sta h G (L.ⓑ{I}V) T U → + sta h G L (ⓑ{a,I}V.T) (ⓑ{a,I}V.U) +| sta_appl: ∀G,L,V,T,U. sta h G L T U → sta h G L (ⓐV.T) (ⓐV.U) +| sta_cast: ∀G,L,W,T,U. sta h G L T U → sta h G L (ⓝW.T) U +. + +interpretation "static type assignment (term)" + 'StaticType h G L T U = (sta h G L T U). + +(* Basic inversion lemmas ************************************************) + +fact sta_inv_sort1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀k0. T = ⋆k0 → + U = ⋆(next h k0). +#h #G #L #T #U * -G -L -T -U +[ #G #L #k #k0 #H destruct // +| #G #L #K #V #W #U #i #_ #_ #_ #k0 #H destruct +| #G #L #K #W #V #U #i #_ #_ #_ #k0 #H destruct +| #a #I #G #L #V #T #U #_ #k0 #H destruct +| #G #L #V #T #U #_ #k0 #H destruct +| #G #L #W #T #U #_ #k0 #H destruct +qed-. + +(* Basic_1: was: sty0_gen_sort *) +lemma sta_inv_sort1: ∀h,G,L,U,k. ⦃G, L⦄ ⊢ ⋆k •[h] U → U = ⋆(next h k). +/2 width=5 by sta_inv_sort1_aux/ qed-. + +fact sta_inv_lref1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀j. T = #j → + (∃∃K,V,W. ⇩[j] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •[h] W & + ⇧[0, j+1] W ≡ U + ) ∨ + (∃∃K,W,V. ⇩[j] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W •[h] V & + ⇧[0, j+1] W ≡ U + ). +#h #G #L #T #U * -G -L -T -U +[ #G #L #k #j #H destruct +| #G #L #K #V #W #U #i #HLK #HVW #HWU #j #H destruct /3 width=6 by or_introl, ex3_3_intro/ +| #G #L #K #W #V #U #i #HLK #HWV #HWU #j #H destruct /3 width=6 by or_intror, ex3_3_intro/ +| #a #I #G #L #V #T #U #_ #j #H destruct +| #G #L #V #T #U #_ #j #H destruct +| #G #L #W #T #U #_ #j #H destruct +] +qed-. + +(* Basic_1: was sty0_gen_lref *) +lemma sta_inv_lref1: ∀h,G,L,U,i. ⦃G, L⦄ ⊢ #i •[h] U → + (∃∃K,V,W. ⇩[i] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •[h] W & + ⇧[0, i+1] W ≡ U + ) ∨ + (∃∃K,W,V. ⇩[i] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W •[h] V & + ⇧[0, i+1] W ≡ U + ). +/2 width=3 by sta_inv_lref1_aux/ qed-. + +fact sta_inv_gref1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀p0. T = §p0 → ⊥. +#h #G #L #T #U * -G -L -T -U +[ #G #L #k #p0 #H destruct +| #G #L #K #V #W #U #i #_ #_ #_ #p0 #H destruct +| #G #L #K #W #V #U #i #_ #_ #_ #p0 #H destruct +| #a #I #G #L #V #T #U #_ #p0 #H destruct +| #G #L #V #T #U #_ #p0 #H destruct +| #G #L #W #T #U #_ #p0 #H destruct +qed-. + +lemma sta_inv_gref1: ∀h,G,L,U,p. ⦃G, L⦄ ⊢ §p •[h] U → ⊥. +/2 width=8 by sta_inv_gref1_aux/ qed-. + +fact sta_inv_bind1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀b,J,X,Y. T = ⓑ{b,J}Y.X → + ∃∃Z. ⦃G, L.ⓑ{J}Y⦄ ⊢ X •[h] Z & U = ⓑ{b,J}Y.Z. +#h #G #L #T #U * -G -L -T -U +[ #G #L #k #b #J #X #Y #H destruct +| #G #L #K #V #W #U #i #_ #_ #_ #b #J #X #Y #H destruct +| #G #L #K #W #V #U #i #_ #_ #_ #b #J #X #Y #H destruct +| #a #I #G #L #V #T #U #HTU #b #J #X #Y #H destruct /2 width=3 by ex2_intro/ +| #G #L #V #T #U #_ #b #J #X #Y #H destruct +| #G #L #W #T #U #_ #b #J #X #Y #H destruct +] +qed-. + +(* Basic_1: was: sty0_gen_bind *) +lemma sta_inv_bind1: ∀h,b,J,G,L,Y,X,U. ⦃G, L⦄ ⊢ ⓑ{b,J}Y.X •[h] U → + ∃∃Z. ⦃G, L.ⓑ{J}Y⦄ ⊢ X •[h] Z & U = ⓑ{b,J}Y.Z. +/2 width=3 by sta_inv_bind1_aux/ qed-. + +fact sta_inv_appl1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀X,Y. T = ⓐY.X → + ∃∃Z. ⦃G, L⦄ ⊢ X •[h] Z & U = ⓐY.Z. +#h #G #L #T #U * -G -L -T -U +[ #G #L #k #X #Y #H destruct +| #G #L #K #V #W #U #i #_ #_ #_ #X #Y #H destruct +| #G #L #K #W #V #U #i #_ #_ #_ #X #Y #H destruct +| #a #I #G #L #V #T #U #_ #X #Y #H destruct +| #G #L #V #T #U #HTU #X #Y #H destruct /2 width=3 by ex2_intro/ +| #G #L #W #T #U #_ #X #Y #H destruct +] +qed-. + +(* Basic_1: was: sty0_gen_appl *) +lemma sta_inv_appl1: ∀h,G,L,Y,X,U. ⦃G, L⦄ ⊢ ⓐY.X •[h] U → + ∃∃Z. ⦃G, L⦄ ⊢ X •[h] Z & U = ⓐY.Z. +/2 width=3 by sta_inv_appl1_aux/ qed-. + +fact sta_inv_cast1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀X,Y. T = ⓝY.X → + ⦃G, L⦄ ⊢ X •[h] U. +#h #G #L #T #U * -G -L -T -U +[ #G #L #k #X #Y #H destruct +| #G #L #K #V #W #U #i #_ #_ #_ #X #Y #H destruct +| #G #L #K #W #V #U #i #_ #_ #_ #X #Y #H destruct +| #a #I #G #L #V #T #U #_ #X #Y #H destruct +| #G #L #V #T #U #_ #X #Y #H destruct +| #G #L #W #T #U #HTU #X #Y #H destruct // +] +qed-. + +(* Basic_1: was: sty0_gen_cast *) +lemma sta_inv_cast1: ∀h,G,L,X,Y,U. ⦃G, L⦄ ⊢ ⓝY.X •[h] U → ⦃G, L⦄ ⊢ X •[h] U. +/2 width=4 by sta_inv_cast1_aux/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/sta_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/sta_aaa.etc new file mode 100644 index 000000000..affd2eded --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/sta_aaa.etc @@ -0,0 +1,52 @@ +(**************************************************************************) +(* ___ *) +(* ||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/static/sta.ma". +include "basic_2/static/aaa_lift.ma". + +(* STATIC TYPE ASSIGNMENT FOR TERMS *****************************************) + +(* Properties on atomic arity assignment for terms **************************) + +lemma aaa_sta: ∀h,G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∃U. ⦃G, L⦄ ⊢ T •[h] U. +#h #G #L #T #A #H elim H -G -L -T -A +[ /2 width=2 by sta_sort, ex_intro/ +| * #G #L #K [ #V | #W ] #B #i #HLK #_ * [ #W | #V ] #HVW + elim (lift_total W 0 (i+1)) /3 width=7 by sta_ldef, sta_ldec, ex_intro/ +| #a #G #L #V #T #B #A #_ #_ #_ * /3 width=2 by sta_bind, ex_intro/ +| #a #G #L #V #T #B #A #_ #_ #_ * /3 width=2 by sta_bind, ex_intro/ +| #G #L #V #T #B #A #_ #_ #_ * /3 width=2 by sta_appl, ex_intro/ +| #G #L #W #T #A #_ #_ #_ * /3 width=2 by sta_cast, ex_intro/ +] +qed-. + +lemma sta_aaa_conf: ∀h,G,L. Conf3 … (aaa G L) (sta h G L). +#h #G #L #T #A #H elim H -G -L -T -A +[ #G #L #k #U #H + lapply (sta_inv_sort1 … H) -H #H destruct // +| #I #G #L #K #V #B #i #HLK #HV #IHV #U #H + elim (sta_inv_lref1 … H) -H * #K0 #V0 #W0 #HLK0 #HVW0 #HU + lapply (drop_mono … HLK0 … HLK) -HLK0 #H0 destruct + lapply (drop_fwd_drop2 … HLK) -HLK #HLK + @(aaa_lift … HLK … HU) -HU -L /2 width=2 by/ +| #a #G #L #V #T #B #A #HV #_ #_ #IHT #X #H + elim (sta_inv_bind1 … H) -H #U #HTU #H destruct /3 width=2 by aaa_abbr/ +| #a #G #L #V #T #B #A #HV #_ #_ #IHT #X #H + elim (sta_inv_bind1 … H) -H #U #HTU #H destruct /3 width=2 by aaa_abst/ +| #G #L #V #T #B #A #HV #_ #_ #IHT #X #H + elim (sta_inv_appl1 … H) -H #U #HTU #H destruct /3 width=3 by aaa_appl/ +| #G #L #V #T #A #_ #_ #IHV #IHT #X #H + lapply (sta_inv_cast1 … H) -H /2 width=2 by/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/sta_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/sta_lift.etc new file mode 100644 index 000000000..4d342878f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/sta_lift.etc @@ -0,0 +1,113 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/drop_drop.ma". +include "basic_2/static/sta.ma". + +(* STATIC TYPE ASSIGNMENT ON TERMS ******************************************) + +(* Properties on relocation *************************************************) + +(* Basic_1: was: sty0_lift *) +lemma sta_lift: ∀h,G. l_liftable (sta h G). +#h #G #L1 #T1 #U1 #H elim H -G -L1 -T1 -U1 +[ #G #L1 #k #L2 #s #d #e #HL21 #X1 #H1 #X2 #H2 + >(lift_inv_sort1 … H1) -X1 + >(lift_inv_sort1 … H2) -X2 // +| #G #L1 #K1 #V1 #W1 #W #i #HLK1 #_ #HW1 #IHVW1 #L2 #s #d #e #HL21 #X #H #U2 #HWU2 + elim (lift_inv_lref1 … H) * #Hid #H destruct + [ elim (lift_trans_ge … HW1 … HWU2) -W // #W2 #HW12 #HWU2 + elim (drop_trans_le … HL21 … HLK1) -L1 /2 width=2 by lt_to_le/ #X #HLK2 #H + elim (drop_inv_skip2 … H) -H /2 width=1 by lt_plus_to_minus_r/ -Hid #K2 #V2 #HK21 #HV12 #H destruct + /3 width=9 by sta_ldef/ + | lapply (lift_trans_be … HW1 … HWU2 ? ?) -W /2 width=1 by le_S/ #HW1U2 + lapply (drop_trans_ge … HL21 … HLK1 ?) -L1 /3 width=9 by sta_ldef, drop_inv_gen/ + ] +| #G #L1 #K1 #W1 #V1 #W #i #HLK1 #_ #HW1 #IHWV1 #L2 #s #d #e #HL21 #X #H #U2 #HWU2 + elim (lift_inv_lref1 … H) * #Hid #H destruct + [ elim (lift_trans_ge … HW1 … HWU2) -W // (lift_inv_sort2 … H) -X /2 width=3 by sta_sort, lift_sort, ex2_intro/ +| #G #L2 #K2 #V2 #W2 #W #i #HLK2 #HVW2 #HW2 #IHVW2 #L1 #s #d #e #HL21 #X #H + elim (lift_inv_lref2 … H) * #Hid #H destruct [ -HVW2 | -IHVW2 ] + [ elim (drop_conf_lt … HL21 … HLK2) -L2 // #K1 #V1 #HLK1 #HK21 #HV12 + elim (IHVW2 … HK21 … HV12) -K2 -V2 #W1 #HW12 #HVW1 + elim (lift_trans_le … HW12 … HW2) -W2 // >minus_plus minus_minus_m_m /3 width=8 by sta_ldef, le_S, ex2_intro/ + ] +| #G #L2 #K2 #W2 #V2 #W #i #HLK2 #HWV2 #HW2 #IHWV2 #L1 #s #d #e #HL21 #X #H + elim (lift_inv_lref2 … H) * #Hid #H destruct [ -HWV2 | -IHWV2 ] + [ elim (drop_conf_lt … HL21 … HLK2) -L2 // #K1 #W1 #HLK1 #HK21 #HW12 + elim (IHWV2 … HK21 … HW12) -K2 #V1 #_ #HWV1 + elim (lift_trans_le … HW12 … HW2) -W2 // >minus_plus minus_minus_m_m /3 width=8 by sta_ldec, le_S, ex2_intro/ + ] +| #a #I #G #L2 #V2 #T2 #U2 #_ #IHTU2 #L1 #s #d #e #HL21 #X #H + elim (lift_inv_bind2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct + elim (IHTU2 (L1.ⓑ{I}V1) … HT12) -IHTU2 -HT12 /3 width=5 by sta_bind, drop_skip, lift_bind, ex2_intro/ +| #G #L2 #V2 #T2 #U2 #_ #IHTU2 #L1 #s #d #e #HL21 #X #H + elim (lift_inv_flat2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct + elim (IHTU2 … HL21 … HT12) -L2 -HT12 /3 width=5 by sta_appl, lift_flat, ex2_intro/ +| #G #L2 #W2 #T2 #U2 #_ #IHTU2 #L1 #s #d #e #HL21 #X #H + elim (lift_inv_flat2 … H) -H #W1 #T1 #_ #HT12 #H destruct + elim (IHTU2 … HL21 … HT12) -L2 -HT12 /3 width=3 by sta_cast, ex2_intro/ +] +qed-. + +(* Advanced forward lemmas **************************************************) + +(* Basic_1: was: sty0_correct *) +lemma sta_fwd_correct: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∃T0. ⦃G, L⦄ ⊢ U •[h] T0. +#h #G #L #T #U #H elim H -G -L -T -U +[ /2 width=2/ +| #G #L #K #V #W #W0 #i #HLK #_ #HW0 * #V0 #HWV0 + lapply (drop_fwd_drop2 … HLK) -HLK #HLK + elim (lift_total V0 0 (i+1)) /3 width=11 by ex_intro, sta_lift/ +| #G #L #K #W #V #V0 #i #HLK #HWV #HWV0 #_ + lapply (drop_fwd_drop2 … HLK) -HLK #HLK + elim (lift_total V 0 (i+1)) /3 width=11 by ex_intro, sta_lift/ +| #a #I #G #L #V #T #U #_ * /3 width=2 by sta_bind, ex_intro/ +| #G #L #V #T #U #_ * #T0 #HUT0 /3 width=2 by sta_appl, ex_intro/ +| #G #L #W #T #U #_ * /2 width=2 by ex_intro/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/sta_llpx_sn.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/sta_llpx_sn.etc new file mode 100644 index 000000000..3adf28fc4 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/sta_llpx_sn.etc @@ -0,0 +1,43 @@ +(**************************************************************************) +(* ___ *) +(* ||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/llpx_sn_drop.ma". +include "basic_2/static/sta.ma". + +(* STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS ******************************) + +(* Properties on lazy sn pointwise extensions *******************************) + +lemma sta_llpx_sn_conf: ∀R. (∀L. reflexive … (R L)) → l_liftable R → + ∀h,G. s_r_confluent1 … (sta h G) (llpx_sn R 0). +#R #H1R #H2R #h #G #Ls #T1 #T2 #H elim H -G -Ls -T1 -T2 +[ /3 width=4 by llpx_sn_fwd_length, llpx_sn_sort/ +| #G #Ls #Ks #V1s #W2s #V2s #i #HLKs #_ #HVW2s #IHV12s #Ld #H elim (llpx_sn_inv_lref_ge_sn … H … HLKs) // -H + #Kd #V1d #HLKd #HV1s #HV1sd + lapply (drop_fwd_drop2 … HLKs) -HLKs #HLKs + lapply (drop_fwd_drop2 … HLKd) -HLKd #HLKd + @(llpx_sn_lift_le … HLKs HLKd … HVW2s) -HLKs -HLKd -HVW2s /2 width=1 by/ (**) (* full auto too slow *) +| #G #Ls #Ks #V1s #W1s #V2s #i #HLKs #_ #HV12s #IHVW1s #Ld #H elim (llpx_sn_inv_lref_ge_sn … H … HLKs) // -H + #Kd #V1d #HLKd #HV1s #HV1sd + lapply (drop_fwd_drop2 … HLKs) -HLKs #HLKs + lapply (drop_fwd_drop2 … HLKd) -HLKd #HLKd + @(llpx_sn_lift_le … HLKs HLKd … HV12s) -HLKs -HLKd -HV12s /2 width=1 by/ (**) (* full auto too slow *) +| #a #I #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_bind_O … H) -H + /4 width=5 by llpx_sn_bind_repl_SO, llpx_sn_bind/ +| #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H + /3 width=1 by llpx_sn_flat/ +| #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H + /3 width=1 by llpx_sn_flat/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/sta_sta.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/sta_sta.etc new file mode 100644 index 000000000..6d54d56d7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/sta_sta.etc @@ -0,0 +1,43 @@ +(**************************************************************************) +(* ___ *) +(* ||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/substitution/drop_drop.ma". +include "basic_2/static/sta.ma". + +(* STATIC TYPE ASSIGNMENT ON TERMS ******************************************) + +(* Main properties **********************************************************) + +(* Note: apparently this was missing in basic_1 *) +theorem sta_mono: ∀h,G,L. singlevalued … (sta h G L). +#h #G #L #T #U1 #H elim H -G -L -T -U1 +[ #G #L #k #X #H >(sta_inv_sort1 … H) -X // +| #G #L #K #V #W #U1 #i #HLK #_ #HWU1 #IHVW #U2 #H + elim (sta_inv_lref1 … H) -H * #K0 #V0 #W0 #HLK0 #HVW0 #HW0U2 + lapply (drop_mono … HLK0 … HLK) -HLK -HLK0 #H destruct + lapply (IHVW … HVW0) -IHVW -HVW0 #H destruct + >(lift_mono … HWU1 … HW0U2) -W0 -U1 // +| #G #L #K #W #V #U1 #i #HLK #_ #HWU1 #IHWV #U2 #H + elim (sta_inv_lref1 … H) -H * #K0 #W0 #V0 #HLK0 #HWV0 #HV0U2 + lapply (drop_mono … HLK0 … HLK) -HLK -HLK0 #H destruct + lapply (IHWV … HWV0) -IHWV -HWV0 #H destruct + >(lift_mono … HWU1 … HV0U2) -W -U1 // +| #a #I #G #L #V #T #U1 #_ #IHTU1 #X #H + elim (sta_inv_bind1 … H) -H #U2 #HTU2 #H destruct /3 width=1 by eq_f/ +| #G #L #V #T #U1 #_ #IHTU1 #X #H + elim (sta_inv_appl1 … H) -H #U2 #HTU2 #H destruct /3 width=1 by eq_f/ +| #G #L #W #T #U1 #_ #IHTU1 #U2 #H + lapply (sta_inv_cast1 … H) -H /2 width=1 by/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/statictype_5.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/statictype_5.etc new file mode 100644 index 000000000..9249be4e0 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/statictype_5.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 • break [ term 46 h ] break term 46 T2 )" + non associative with precedence 45 + for @{ 'StaticType $h $G $L $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/statictypestaralt_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/statictypestaralt_6.etc new file mode 100644 index 000000000..a6e46be62 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/statictypestaralt_6.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 • • * break [ term 46 h , break term 46 l ] break term 46 T2 )" + non associative with precedence 45 + for @{ 'StaticTypeStarAlt $h $G $L $l $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/tshf/chnf.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/tshf/chnf.etc new file mode 100644 index 000000000..f6106d38d --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/tshf/chnf.etc @@ -0,0 +1,40 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( L ⊢ break 𝐇𝐍 ⦃ term 46 T ⦄ )" + non associative with precedence 45 + for @{ 'HdNormal $L $T }. + +include "basic_2/reduction/cpr_tshf.ma". + +(* CONTEXT-SENSITIVE WEAK HEAD NORMAL TERMS *********************************) + +definition chnf: lenv → predicate term ≝ λL. NF … (cpr L) tshf. + +interpretation + "context-sensitive head normality (term)" + 'HdNormal L T = (chnf L T). + +(* Basic inversion lemmas ***************************************************) + +lemma chnf_inv_tshf: ∀L,T. L ⊢ 𝐇𝐍⦃T⦄ → T ≈ T. +normalize /2 width=1/ +qed-. + +(* Basic properties *********************************************************) + +lemma tshf_thnf: ∀T. T ≈ T → ⋆ ⊢ 𝐇𝐍⦃T⦄. +#T #HT #T2 #H elim (cpr_fwd_tshf1 … H) -H // +#H elim H // +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/tshf/cpr_tshf.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/tshf/cpr_tshf.etc new file mode 100644 index 000000000..0fc5e1d0c --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/tshf/cpr_tshf.etc @@ -0,0 +1,46 @@ +(**************************************************************************) +(* ___ *) +(* ||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/grammar/tshf.ma". +include "basic_2/reduction/cpr.ma". + +(* CONTEXT-SENSITIVE PARALLEL REDUCTION FOR TERMS ***************************) + +(* Forward lemmas on same head forms for terms ******************************) + +lemma cpr_fwd_tshf1: ∀L,T1,T2. L ⊢ T1 ➡ T2 → T1 ≈ T1 → + T2 ≈ T1 ∨ (L = ⋆ → ⊥). +#L #T1 #T2 #H elim H -L -T1 -T2 +[ /2 width=1/ +| #L #K #V1 #V2 #W2 #i #HLK #_ #_ #_ #_ + @or_intror #H destruct + lapply (ldrop_inv_atom1 … HLK) -HLK #H destruct +| #a #I #L #V1 #V2 #T1 #T2 #_ #_ #_ #_ #H + elim (tshf_inv_bind1 … H) -H #W2 #U2 #H1 * #H2 destruct /2 width=1/ +| #I #L #V1 #V2 #T1 #T2 #_ #_ #_ #IHT12 #H + elim (tshf_inv_flat1 … H) -H #W2 #U2 #HT1U2 #HT1 #_ #H1 #H2 destruct + lapply (IHT12 HT1U2) -IHT12 -HT1U2 * #HUT2 /3 width=1/ + lapply (simple_tshf_repl_sn … HUT2 HT1) /3 width=1/ +| #L #V #T #T1 #T2 #_ #_ #_ #H + elim (tshf_inv_bind1 … H) -H #W2 #U2 #H1 * #H2 destruct +| #L #V #T1 #T2 #_ #_ #H + elim (tshf_inv_flat1 … H) -H #W2 #U2 #_ #_ #_ #H destruct +| #a #L #V1 #V2 #W #T1 #T2 #_ #_ #_ #_ #H + elim (tshf_inv_flat1 … H) -H #W2 #U2 #_ #H + elim (simple_inv_bind … H) +| #a #L #V2 #V1 #V #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #_ #H + elim (tshf_inv_flat1 … H) -H #U1 #U2 #_ #H + elim (simple_inv_bind … H) +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/tshf/tshf.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/tshf/tshf.etc new file mode 100644 index 000000000..583c3f46f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/tshf/tshf.etc @@ -0,0 +1,98 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( L ⊢ break term 46 T1 ≈ break term 46 T2 )" + non associative with precedence 45 + for @{ 'Hom $L $T1 $T2 }. + +notation "hvbox( L ⊢ break 𝐇𝐑 ⦃ term 46 T ⦄ )" + non associative with precedence 45 + for @{ 'HdReducible $L $T }. + +notation "hvbox( L ⊢ break 𝐇𝐈 ⦃ term 46 T ⦄ )" + non associative with precedence 45 + for @{ 'NotHdReducible $L $T }. + +include "basic_2/grammar/term_simple.ma". + +(* SAME HEAD TERM FORMS *****************************************************) + +inductive tshf: relation term ≝ + | tshf_atom: ∀I. tshf (⓪{I}) (⓪{I}) + | tshf_abbr: ∀V1,V2,T1,T2. tshf (-ⓓV1. T1) (-ⓓV2. T2) + | tshf_abst: ∀a,V1,V2,T1,T2. tshf (ⓛ{a}V1. T1) (ⓛ{a}V2. T2) + | tshf_appl: ∀V1,V2,T1,T2. tshf T1 T2 → 𝐒⦃T1⦄ → 𝐒⦃T2⦄ → + tshf (ⓐV1. T1) (ⓐV2. T2) +. + +interpretation "same head form (term)" 'napart T1 T2 = (tshf T1 T2). + +(* Basic properties *********************************************************) + +lemma tshf_sym: ∀T1,T2. T1 ≈ T2 → T2 ≈ T1. +#T1 #T2 #H elim H -T1 -T2 /2 width=1/ +qed. + +lemma tshf_refl2: ∀T1,T2. T1 ≈ T2 → T2 ≈ T2. +#T1 #T2 #H elim H -T1 -T2 // /2 width=1/ +qed. + +lemma tshf_refl1: ∀T1,T2. T1 ≈ T2 → T1 ≈ T1. +/3 width=2/ qed. + +lemma simple_tshf_repl_dx: ∀T1,T2. T1 ≈ T2 → 𝐒⦃T1⦄ → 𝐒⦃T2⦄. +#T1 #T2 #H elim H -T1 -T2 // +[ #V1 #V2 #T1 #T2 #H + elim (simple_inv_bind … H) +| #a #V1 #V2 #T1 #T2 #H + elim (simple_inv_bind … H) +] +qed. (**) (* remove from index *) + +lemma simple_tshf_repl_sn: ∀T1,T2. T1 ≈ T2 → 𝐒⦃T2⦄ → 𝐒⦃T1⦄. +/3 width=3/ qed-. + +(* Basic inversion lemmas ***************************************************) + +fact tshf_inv_bind1_aux: ∀T1,T2. T1 ≈ T2 → ∀a,I,W1,U1. T1 = ⓑ{a,I}W1.U1 → + ∃∃W2,U2. T2 = ⓑ{a,I}W2. U2 & + (Bind2 a I = Bind2 false Abbr ∨ I = Abst). +#T1 #T2 * -T1 -T2 +[ #J #a #I #W1 #U1 #H destruct +| #V1 #V2 #T1 #T2 #a #I #W1 #U1 #H destruct /3 width=3/ +| #b #V1 #V2 #T1 #T2 #a #I #W1 #U1 #H destruct /3 width=3/ +| #V1 #V2 #T1 #T2 #_ #_ #_ #a #I #W1 #U1 #H destruct +] +qed. + +lemma tshf_inv_bind1: ∀a,I,W1,U1,T2. ⓑ{a,I}W1.U1 ≈ T2 → + ∃∃W2,U2. T2 = ⓑ{a,I}W2. U2 & + (Bind2 a I = Bind2 false Abbr ∨ I = Abst). +/2 width=5/ qed-. + +fact tshf_inv_flat1_aux: ∀T1,T2. T1 ≈ T2 → ∀I,W1,U1. T1 = ⓕ{I}W1.U1 → + ∃∃W2,U2. U1 ≈ U2 & 𝐒⦃U1⦄ & 𝐒⦃U2⦄ & + I = Appl & T2 = ⓐW2. U2. +#T1 #T2 * -T1 -T2 +[ #J #I #W1 #U1 #H destruct +| #V1 #V2 #T1 #T2 #I #W1 #U1 #H destruct +| #a #V1 #V2 #T1 #T2 #I #W1 #U1 #H destruct +| #V1 #V2 #T1 #T2 #HT12 #HT1 #HT2 #I #W1 #U1 #H destruct /2 width=5/ +] +qed. + +lemma tshf_inv_flat1: ∀I,W1,U1,T2. ⓕ{I}W1.U1 ≈ T2 → + ∃∃W2,U2. U1 ≈ U2 & 𝐒⦃U1⦄ & 𝐒⦃U2⦄ & + I = Appl & T2 = ⓐW2. U2. +/2 width=4/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xpr_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xpr_aaa.etc new file mode 100644 index 000000000..98fe01347 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xpr_aaa.etc @@ -0,0 +1,25 @@ +(**************************************************************************) +(* ___ *) +(* ||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/static/ssta_aaa.ma". +include "basic_2/reducibility/cpr_aaa.ma". +include "basic_2/reducibility/xpr.ma". + +(* EXTENDED PARALLEL REDUCTION ON TERMS *************************************) + +(* Properties on atomic arity assignment for terms **************************) + +lemma xpr_aaa: ∀h,g,L,T,A. L ⊢ T ⁝ A → ∀U. ⦃h, L⦄ ⊢ T •➡[g] U → L ⊢ U ⁝ A. +#h #g #L #T #A #HT #U * /2 width=3/ /2 width=6/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xpr_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xpr_lift.etc new file mode 100644 index 000000000..8f5deca51 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xpr_lift.etc @@ -0,0 +1,48 @@ +(**************************************************************************) +(* ___ *) +(* ||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/static/ssta_lift.ma". +include "basic_2/reducibility/cpr_lift.ma". +include "basic_2/reducibility/xpr.ma". + +(* EXTENDED PARALLEL REDUCTION ON TERMS *************************************) + +(* Advanced inversion lemmas ************************************************) + +lemma xpr_inv_abst1: ∀h,g,a,L,V1,T1,U2. ⦃h, L⦄ ⊢ ⓛ{a}V1.T1 •➡[g] U2 → + ∃∃V2,T2. L ⊢ V1 ➡ V2 & ⦃h, L. ⓛV1⦄ ⊢ T1 •➡[g] T2 & + U2 = ⓛ{a}V2. T2. +#h #g #a #L #V1 #T1 #U2 * +[ #H elim (cpr_inv_abst1 … H Abst V1) /3 width=5/ +| #l #H elim (ssta_inv_bind1 … H) /3 width=5/ +] +qed-. + +(* Relocation properties ****************************************************) + +lemma xpr_lift: ∀L,K,d,e. ⇩[d, e] L ≡ K → + ∀T1,U1. ⇧[d, e] T1 ≡ U1 → ∀T2,U2. ⇧[d, e] T2 ≡ U2 → + ∀h,g. ⦃h, K⦄ ⊢ T1 •➡[g] T2 → ⦃h, L⦄ ⊢ U1 •➡[g] U2. +#L #K #d #e #HLK #T1 #U1 #HTU1 #T2 #U2 #HTU2 #h #g * +/3 width=9/ /3 width=10/ +qed. + +lemma xpr_inv_lift1: ∀L,K,d,e. ⇩[d, e] L ≡ K → + ∀T1,U1. ⇧[d, e] T1 ≡ U1 → ∀h,g,U2. ⦃h, L⦄ ⊢ U1 •➡[g] U2 → + ∃∃T2. ⇧[d, e] T2 ≡ U2 & ⦃h, K⦄ ⊢ T1 •➡[g] T2. +#L #K #d #e #HLK #T1 #U1 #HTU1 #h #g #U2 * [ #HU12 | #l #HU12 ] +[ elim (cpr_inv_lift1 … HLK … HTU1 … HU12) -L -U1 /3 width=3/ +| elim (ssta_inv_lift1 … HU12 … HLK … HTU1) -L -U1 /3 width=4/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xpr_lsubss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xpr_lsubss.etc new file mode 100644 index 000000000..bc66cd2cd --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xpr_lsubss.etc @@ -0,0 +1,28 @@ +(**************************************************************************) +(* ___ *) +(* ||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/static/lsubss_ssta.ma". +include "basic_2/reducibility/xpr.ma". + +(* EXTENDED PARALLEL REDUCTION ON TERMS *************************************) + +(* Properties on lenv ref for stratified type assignment ********************) + +lemma lsubss_xpr_trans: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 → + ∀T1,T2. ⦃h, L2⦄ ⊢ T1 •➡[g] T2 → ⦃h, L1⦄ ⊢ T1 •➡[g] T2. +#h #g #L1 #L2 #HL12 #T1 #T2 * [ | #l ] #HT12 +[ lapply (lsubss_fwd_lsubs2 … HL12) -HL12 /3 width=3/ +| /3 width=4/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xprs.etc new file mode 100644 index 000000000..bffc4e735 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xprs.etc @@ -0,0 +1,72 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +notation "hvbox( ⦃ term 46 h , break term 46 L ⦄ ⊢ break term 46 T1 • ➡ * break [ term 46 g ] break term 46 T2 )" + non associative with precedence 45 + for @{ 'XPRedStar $h $g $L $T1 $T2 }. + +notation "hvbox( ⦃ term 46 h , break term 46 L ⦄ ⊢ • ⬊ * break [ term 46 g ] break term 46 T2 )" + non associative with precedence 45 + for @{ 'XSN $h $g $L $T }. + +include "basic_2/static/lsubss.ma". +include "basic_2/reducibility/xpr.ma". +(* +include "basic_2/reducibility/cnf.ma". +*) +(* EXTENDED PARALLEL COMPUTATION ON TERMS ***********************************) + +definition xprs: ∀h. sd h → lenv → relation term ≝ + λh,g,L. TC … (xpr h g L). + +interpretation "extended parallel computation (term)" + 'XPRedStar h g L T1 T2 = (xprs h g L T1 T2). + +(* Basic eliminators ********************************************************) + +lemma xprs_ind: ∀h,g,L,T1. ∀R:predicate term. R T1 → + (∀T,T2. ⦃h, L⦄ ⊢ T1 •➡*[g] T → ⦃h, L⦄ ⊢ T •➡[g] T2 → R T → R T2) → + ∀T2. ⦃h, L⦄ ⊢ T1 •➡*[g] T2 → R T2. +#h #g #L #T1 #R #HT1 #IHT1 #T2 #HT12 +@(TC_star_ind … HT1 IHT1 … HT12) // +qed-. + +lemma xprs_ind_dx: ∀h,g,L,T2. ∀R:predicate term. R T2 → + (∀T1,T. ⦃h, L⦄ ⊢ T1 •➡[g] T → ⦃h, L⦄ ⊢ T •➡*[g] T2 → R T → R T1) → + ∀T1. ⦃h, L⦄ ⊢ T1 •➡*[g] T2 → R T1. +#h #g #L #T2 #R #HT2 #IHT2 #T1 #HT12 +@(TC_star_ind_dx … HT2 IHT2 … HT12) // +qed-. + +(* Basic properties *********************************************************) + +lemma xprs_refl: ∀h,g,L. reflexive … (xprs h g L). +/2 width=1/ qed. + +lemma xprs_strap1: ∀h,g,L,T1,T,T2. + ⦃h, L⦄ ⊢ T1 •➡*[g] T → ⦃h, L⦄ ⊢ T •➡[g] T2 → ⦃h, L⦄ ⊢ T1 •➡*[g] T2. +/2 width=3/ qed. + +lemma xprs_strap2: ∀h,g,L,T1,T,T2. + ⦃h, L⦄ ⊢ T1 •➡[g] T → ⦃h, L⦄ ⊢ T •➡*[g] T2 → ⦃h, L⦄ ⊢ T1 •➡*[g] T2. +/2 width=3/ qed. + +(* Basic inversion lemmas ***************************************************) +(* +axiom xprs_inv_cnf1: ∀L,T,U. L ⊢ T ➡* U → L ⊢ 𝐍⦃T⦄ → T = U. +#L #T #U #H @(xprs_ind_dx … H) -T // +#T0 #T #H1T0 #_ #IHT #H2T0 +lapply (H2T0 … H1T0) -H1T0 #H destruct /2 width=1/ +qed-. +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xprs_aaa.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xprs_aaa.etc new file mode 100644 index 000000000..5beb8fe19 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xprs_aaa.etc @@ -0,0 +1,24 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/xpr_aaa.ma". +include "basic_2/computation/xprs.ma". + +(* EXTENDED PARALLEL COMPUTATION ON TERMS ***********************************) + +(* Properties on atomic arity assignment for terms **************************) + +lemma xprs_aaa: ∀h,g,L,T,A. L ⊢ T ⁝ A → ∀U. ⦃h, L⦄ ⊢ T •➡*[g] U → L ⊢ U ⁝ A. +#h #g #L #T #A #HT #U #H @(xprs_ind … H) -U // /2 width=5/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xprs_cprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xprs_cprs.etc new file mode 100644 index 000000000..13a4f8889 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xprs_cprs.etc @@ -0,0 +1,24 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/cprs.ma". +include "basic_2/computation/xprs.ma". + +(* EXTENDED PARALLEL COMPUTATION ON TERMS ***********************************) + +(* properties on context sensitive parallel computation for terms ***********) + +lemma cprs_xprs: ∀h,g,L,T1,T2. L ⊢ T1 ➡* T2 → ⦃h, L⦄ ⊢ T1 •➡*[g] T2. +#h #g #L #T1 #T2 #H @(cprs_ind … H) -T2 // /3 width=3/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xprs_lift.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xprs_lift.etc new file mode 100644 index 000000000..cb151a194 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xprs_lift.etc @@ -0,0 +1,50 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/xpr_lift.ma". +include "basic_2/computation/cprs.ma". +include "basic_2/computation/xprs.ma". + +(* EXTENDED PARALLEL COMPUTATION ON TERMS ***********************************) + +(* Advanced forward lemmas **************************************************) + +lemma xprs_fwd_abst1: ∀h,g,a,L,V1,T1,U2. ⦃h, L⦄ ⊢ ⓛ{a}V1. T1 •➡*[g] U2 → + ∃∃V2,T2. L ⊢ V1 ➡* V2 & U2 = ⓛ{a}V2. T2. +#h #g #a #L #V1 #T1 #U2 #H @(xprs_ind … H) -U2 /2 width=4/ +#U #U2 #_ #HU2 * #V #T #HV1 #H destruct +elim (xpr_inv_abst1 … HU2) -HU2 #V2 #T2 #HV2 #_ #H destruct /3 width=4/ +qed-. + +(* Relocation properties ****************************************************) + +lemma xprs_lift: ∀L,K,d,e. ⇩[d, e] L ≡ K → ∀T1,U1. ⇧[d, e] T1 ≡ U1 → + ∀h,g,T2. ⦃h, K⦄ ⊢ T1 •➡*[g] T2 → ∀U2. ⇧[d, e] T2 ≡ U2 → + ⦃h, L⦄ ⊢ U1 •➡*[g] U2. +#L #K #d #e #HLK #T1 #U1 #HTU1 #h #g #T2 #HT12 @(xprs_ind … HT12) -T2 +[ -HLK #T2 #HT12 + <(lift_mono … HTU1 … HT12) -T1 // +| -HTU1 #T #T2 #_ #HT2 #IHT2 #U2 #HTU2 + elim (lift_total T d e) #U #HTU + lapply (xpr_lift … HLK … HTU … HTU2 … HT2) -T2 -HLK /3 width=3/ +] +qed. + +lemma xprs_inv_lift1: ∀L,K,d,e. ⇩[d, e] L ≡ K → + ∀T1,U1. ⇧[d, e] T1 ≡ U1 → ∀h,g,U2. ⦃h, L⦄ ⊢ U1 •➡*[g] U2 → + ∃∃T2. ⇧[d, e] T2 ≡ U2 & ⦃h, K⦄ ⊢ T1 •➡*[g] T2. +#L #K #d #e #HLK #T1 #U1 #HTU1 #h #g #U2 #HU12 @(xprs_ind … HU12) -U2 /2 width=3/ +-HTU1 #U #U2 #_ #HU2 * #T #HTU #HT1 +elim (xpr_inv_lift1 … HLK … HTU … HU2) -U -HLK /3 width=5/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xprs_lsubss.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xprs_lsubss.etc new file mode 100644 index 000000000..c883c14f3 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xprs_lsubss.etc @@ -0,0 +1,27 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reducibility/xpr_lsubss.ma". +include "basic_2/computation/xprs.ma". + +(* EXTENDED PARALLEL COMPUTATION ON TERMS ***********************************) + +(* Properties on lenv ref for stratified type assignment ********************) + +lemma lsubss_xprs_trans: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 → + ∀T1,T2. ⦃h, L2⦄ ⊢ T1 •➡*[g] T2 → ⦃h, L1⦄ ⊢ T1 •➡*[g] T2. +#h #g #L1 #L2 #HL12 #T1 #T2 #H @(xprs_ind … H) -T2 // +#T #T2 #_ #HT2 #IHT1 +lapply (lsubss_xpr_trans … HL12 … HT2) -L2 /2 width=3/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xprs_xprs.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xprs_xprs.etc new file mode 100644 index 000000000..9593f0550 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_2A1/xpr/xprs_xprs.etc @@ -0,0 +1,20 @@ +(**************************************************************************) +(* ___ *) +(* ||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/computation/xprs.ma". + +(* EXTENDED PARALLEL COMPUTATION ON TERMS ***********************************) + +theorem xprs_trans: ∀h,g,L. transitive … (xprs h g L). +/2 width=3/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_new/ceq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_new/ceq.etc new file mode 100644 index 000000000..57ecbaf68 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_new/ceq.etc @@ -0,0 +1,42 @@ +(**************************************************************************) +(* ___ *) +(* ||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/syntax/lenv.ma". + +(* CONTEXT-SENSITIVE EQUIVALENCES FOR TERMS *********************************) + +definition ceq: relation3 lenv term term ≝ λL,T1,T2. T1 = T2. + +definition cfull: relation3 lenv term term ≝ λL,T1,T2. ⊤. + +(* Basic properties *********************************************************) + +lemma ceq_refl (L): reflexive … (ceq L). +// qed. + +lemma cfull_refl (L): reflexive … (cfull L). +// qed. + +lemma ceq_sym (L): symmetric … (ceq L). +// qed-. + +lemma cfull_sym (L): symmetric … (cfull L). +// qed-. + +lemma cfull_top (R:relation3 lenv term term) (L) (T1) (T2): + R L T1 T2 → cfull L T1 T2. +// qed-. + +lemma ceq_cfull (L) (T1) (T2): ceq L T1 T2 → cfull L T1 T2. +// qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_new/ceq_ceq.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_new/ceq_ceq.etc new file mode 100644 index 000000000..b17b186e2 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_new/ceq_ceq.etc @@ -0,0 +1,37 @@ +(**************************************************************************) +(* ___ *) +(* ||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/syntax/ceq.ma". + +(* CONTEXT-SENSITIVE EQUIVALENCES FOR TERMS *********************************) + +(* Main properties **********************************************************) + +theorem ceq_trans (L): Transitive … (ceq L). +// qed-. + +lemma ceq_canc_sn (L): left_cancellable … (ceq L). +// qed-. + +lemma ceq_canc_dx (L): right_cancellable … (ceq L). +// qed-. + +theorem cfull_trans (L): Transitive … (cfull L). +// qed-. + +lemma cfull_canc_sn (L): left_cancellable … (cfull L). +// qed-. + +lemma cfull_canc_dx (L): right_cancellable … (cfull L). +// qed-. \ No newline at end of file diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_new/cpr/cpr_cir.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_new/cpr/cpr_cir.etc new file mode 100644 index 000000000..1f2f97e32 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_new/cpr/cpr_cir.etc @@ -0,0 +1,49 @@ +(**************************************************************************) +(* ___ *) +(* ||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/reduction/cir.ma". +include "basic_2/reduction/cpr.ma". + +(* CONTEXT-SENSITIVE PARALLEL REDUCTION FOR TERMS ***************************) + +(* Advanced forward lemmas on irreducibility ********************************) + +lemma cpr_fwd_cir: ∀G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡ T2 → ⦃G, L⦄ ⊢ ➡ 𝐈⦃T1⦄ → T2 = T1. +#G #L #T1 #T2 #H elim H -G -L -T1 -T2 +[ // +| #G #L #K #V1 #V2 #W2 #i #HLK #_ #HVW2 #IHV12 #H + elim (cir_inv_delta … HLK) // +| #a * #G #L #V1 #V2 #T1 #T2 #_ #_ #IHV1 #IHT1 #H + [ elim (cir_inv_bind … H) -H #HV1 #HT1 * #H destruct + lapply (IHV1 … HV1) -IHV1 -HV1 #H destruct + lapply (IHT1 … HT1) -IHT1 #H destruct // + | elim (cir_inv_ib2 … H) -H /3 width=2 by or_introl, eq_f2/ + ] +| * #G #L #V1 #V2 #T1 #T2 #_ #_ #IHV1 #IHT1 #H + [ elim (cir_inv_appl … H) -H #HV1 #HT1 #_ + >IHV1 -IHV1 // -HV1 >IHT1 -IHT1 // + | elim (cir_inv_ri2 … H) /2 width=1 by/ + ] +| #G #L #V1 #T1 #T #T2 #_ #_ #_ #H + elim (cir_inv_ri2 … H) /2 width=1 by or_introl/ +| #G #L #V1 #T1 #T2 #_ #_ #H + elim (cir_inv_ri2 … H) /2 width=1 by/ +| #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #H + elim (cir_inv_appl … H) -H #_ #_ #H + elim (simple_inv_bind … H) +| #a #G #L #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #_ #H + elim (cir_inv_appl … H) -H #_ #_ #H + elim (simple_inv_bind … H) +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_new/cpr/cpr_cir.ma b/matita/matita/contribs/lambdadelta/basic_2/etc_new/cpr/cpr_cir.ma deleted file mode 100644 index 1f2f97e32..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc_new/cpr/cpr_cir.ma +++ /dev/null @@ -1,49 +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/reduction/cir.ma". -include "basic_2/reduction/cpr.ma". - -(* CONTEXT-SENSITIVE PARALLEL REDUCTION FOR TERMS ***************************) - -(* Advanced forward lemmas on irreducibility ********************************) - -lemma cpr_fwd_cir: ∀G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡ T2 → ⦃G, L⦄ ⊢ ➡ 𝐈⦃T1⦄ → T2 = T1. -#G #L #T1 #T2 #H elim H -G -L -T1 -T2 -[ // -| #G #L #K #V1 #V2 #W2 #i #HLK #_ #HVW2 #IHV12 #H - elim (cir_inv_delta … HLK) // -| #a * #G #L #V1 #V2 #T1 #T2 #_ #_ #IHV1 #IHT1 #H - [ elim (cir_inv_bind … H) -H #HV1 #HT1 * #H destruct - lapply (IHV1 … HV1) -IHV1 -HV1 #H destruct - lapply (IHT1 … HT1) -IHT1 #H destruct // - | elim (cir_inv_ib2 … H) -H /3 width=2 by or_introl, eq_f2/ - ] -| * #G #L #V1 #V2 #T1 #T2 #_ #_ #IHV1 #IHT1 #H - [ elim (cir_inv_appl … H) -H #HV1 #HT1 #_ - >IHV1 -IHV1 // -HV1 >IHT1 -IHT1 // - | elim (cir_inv_ri2 … H) /2 width=1 by/ - ] -| #G #L #V1 #T1 #T #T2 #_ #_ #_ #H - elim (cir_inv_ri2 … H) /2 width=1 by or_introl/ -| #G #L #V1 #T1 #T2 #_ #_ #H - elim (cir_inv_ri2 … H) /2 width=1 by/ -| #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #H - elim (cir_inv_appl … H) -H #_ #_ #H - elim (simple_inv_bind … H) -| #a #G #L #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #_ #H - elim (cir_inv_appl … H) -H #_ #_ #H - elim (simple_inv_bind … H) -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_new/lazyor_5.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_new/lazyor_5.etc new file mode 100644 index 000000000..70d3a1c66 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_new/lazyor_5.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( L1 ⋓ break [ term 46 T , break term 46 f ] break term 46 L2 ≡ break term 46 L )" + non associative with precedence 45 + for @{ 'LazyOr $L1 $T $f $L2 $L }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_new/lrsubeq_4.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_new/lrsubeq_4.etc new file mode 100644 index 000000000..6135be4d4 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_new/lrsubeq_4.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( L1 break ⊆ [ term 46 l , break term 46 m ] break term 46 L2 )" + non associative with precedence 45 + for @{ 'LRSubEq $L1 $l $k $L2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_new/psubst_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_new/psubst_6.etc new file mode 100644 index 000000000..56cb72ec4 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_new/psubst_6.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 break ▶ [ term 46 l , break term 46 m ] break term 46 T2 )" + non associative with precedence 45 + for @{ 'PSubst $G $L $T1 $l $k $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_new/psubststar_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_new/psubststar_6.etc new file mode 100644 index 000000000..90362edb6 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_new/psubststar_6.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 break ▶ * [ term 46 l , break term 46 m ] break term 46 T2 )" + non associative with precedence 45 + for @{ 'PSubstStar $G $L $T1 $l $k $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc_new/psubststaralt_6.etc b/matita/matita/contribs/lambdadelta/basic_2/etc_new/psubststaralt_6.etc new file mode 100644 index 000000000..80a29a841 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/etc_new/psubststaralt_6.etc @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 break ▶ ▶ * [ term 46 l , break term 46 m ] break term 46 T2 )" + non associative with precedence 45 + for @{ 'PSubstStarAlt $G $L $T1 $l $k $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/aarity.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/aarity.ma deleted file mode 100644 index 7f44246c7..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/aarity.ma +++ /dev/null @@ -1,73 +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 *) -(* *) -(**************************************************************************) - -(* THE FORMAL SYSTEM λδ: MATITA SOURCE FILES - * Initial invocation: - Patience on me to gain peace and perfection! - - *) - -include "ground_2/lib/star.ma". -include "basic_2/notation/constructors/item0_0.ma". -include "basic_2/notation/constructors/snitem2_2.ma". - -(* ATOMIC ARITY *************************************************************) - -inductive aarity: Type[0] ≝ - | AAtom: aarity (* atomic aarity construction *) - | APair: aarity → aarity → aarity (* binary aarity construction *) -. - -interpretation "atomic arity construction (atomic)" - 'Item0 = AAtom. - -interpretation "atomic arity construction (binary)" - 'SnItem2 A1 A2 = (APair A1 A2). - -(* Basic inversion lemmas ***************************************************) - -fact destruct_apair_apair_aux: ∀A1,A2,B1,B2. ②B1.A1 = ②B2.A2 → B1 = B2 ∧ A1 = A2. -#A1 #A2 #B1 #B2 #H destruct /2 width=1 by conj/ -qed-. - -lemma discr_apair_xy_x: ∀A,B. ②B.A = B → ⊥. -#A #B elim B -B -[ #H destruct -| #Y #X #IHY #_ #H elim (destruct_apair_apair_aux … H) -H /2 width=1 by/ (**) (* destruct lemma needed *) -] -qed-. - -lemma discr_tpair_xy_y: ∀B,A. ②B. A = A → ⊥. -#B #A elim A -A -[ #H destruct -| #Y #X #_ #IHX #H elim (destruct_apair_apair_aux … H) -H /2 width=1 by/ (**) (* destruct lemma needed *) -] -qed-. - -(* Basic properties *********************************************************) - -lemma eq_aarity_dec: ∀A1,A2:aarity. Decidable (A1 = A2). -#A1 elim A1 -A1 -[ #A2 elim A2 -A2 /2 width=1 by or_introl/ - #B2 #A2 #_ #_ @or_intror #H destruct -| #B1 #A1 #IHB1 #IHA1 #A2 elim A2 -A2 - [ -IHB1 -IHA1 @or_intror #H destruct - | #B2 #A2 #_ #_ elim (IHB1 B2) -IHB1 - [ #H destruct elim (IHA1 A2) -IHA1 - [ #H destruct /2 width=1 by or_introl/ - | #HA12 @or_intror #H destruct /2 width=1 by/ - ] - | -IHA1 #HB12 @or_intror #H destruct /2 width=1 by/ - ] - ] -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/append.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/append.ma deleted file mode 100644 index cdbb45d48..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/append.ma +++ /dev/null @@ -1,69 +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 "ground_2/notation/functions/append_2.ma". -include "basic_2/notation/functions/snbind2_3.ma". -include "basic_2/notation/functions/snabbr_2.ma". -include "basic_2/notation/functions/snabst_2.ma". -include "basic_2/grammar/lenv.ma". - -(* APPEND FOR LOCAL ENVIRONMENTS ********************************************) - -rec definition append L K on K ≝ match K with -[ LAtom ⇒ L -| LPair K I V ⇒ (append L K).ⓑ{I}V -]. - -interpretation "append (local environment)" 'Append L1 L2 = (append L1 L2). - -interpretation "local environment tail binding construction (binary)" - 'SnBind2 I T L = (append (LPair LAtom I T) L). - -interpretation "tail abbreviation (local environment)" - 'SnAbbr T L = (append (LPair LAtom Abbr T) L). - -interpretation "tail abstraction (local environment)" - 'SnAbst L T = (append (LPair LAtom Abst T) L). - -definition d_appendable_sn: predicate (lenv→relation term) ≝ λR. - ∀K,T1,T2. R K T1 T2 → ∀L. R (L@@K) T1 T2. - -(* Basic properties *********************************************************) - -lemma append_atom: ∀L. L @@ ⋆ = L. -// qed. - -lemma append_pair: ∀I,L,K,V. L@@(K.ⓑ{I}V) = (L@@K).ⓑ{I}V. -// qed. - -lemma append_atom_sn: ∀L. ⋆@@L = L. -#L elim L -L // -#L #I #V >append_pair // -qed. - -lemma append_assoc: associative … append. -#L1 #L2 #L3 elim L3 -L3 // -qed. - -lemma append_shift: ∀L,K,I,V. L@@(ⓑ{I}V.K) = (L.ⓑ{I}V)@@K. -#L #K #I #V append_pair #H -elim (destruct_lpair_lpair_aux … H) -H /2 width=1 by/ (**) (* destruct lemma needed *) -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/append_length.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/append_length.ma deleted file mode 100644 index 21e5a868e..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/append_length.ma +++ /dev/null @@ -1,116 +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/grammar/lenv_length.ma". -include "basic_2/grammar/append.ma". - -(* APPEND FOR LOCAL ENVIRONMENTS ********************************************) - -(* Properties with length for local environments ****************************) - -lemma append_length: ∀L1,L2. |L1 @@ L2| = |L1| + |L2|. -#L1 #L2 elim L2 -L2 // -#L2 #I #V2 >append_pair >length_pair >length_pair // -qed. - -lemma ltail_length: ∀I,L,V. |ⓑ{I}V.L| = ⫯|L|. -#I #L #V >append_length // -qed. - -(* Basic_1: was just: chead_ctail *) -lemma lpair_ltail: ∀L,I,V. ∃∃J,K,W. L.ⓑ{I}V = ⓑ{J}W.K & |L| = |K|. -#L elim L -L /2 width=5 by ex2_3_intro/ -#L #Z #X #IHL #I #V elim (IHL Z X) -IHL -#J #K #W #H #_ >H -H >ltail_length -@(ex2_3_intro … J (K.ⓑ{I}V) W) /2 width=1 by length_pair/ -qed-. - -(* Advanced inversion lemmas on length for local environments ***************) - -(* Basic_2A1: was: length_inv_pos_dx_ltail *) -lemma length_inv_succ_dx_ltail: ∀L,l. |L| = ⫯l → - ∃∃I,K,V. |K| = l & L = ⓑ{I}V.K. -#Y #l #H elim (length_inv_succ_dx … H) -H #I #L #V #Hl #HLK destruct -elim (lpair_ltail L I V) /2 width=5 by ex2_3_intro/ -qed-. - -(* Basic_2A1: was: length_inv_pos_sn_ltail *) -lemma length_inv_succ_sn_ltail: ∀L,l. ⫯l = |L| → - ∃∃I,K,V. l = |K| & L = ⓑ{I}V.K. -#Y #l #H elim (length_inv_succ_sn … H) -H #I #L #V #Hl #HLK destruct -elim (lpair_ltail L I V) /2 width=5 by ex2_3_intro/ -qed-. - -(* Inversion lemmas with length for local environments **********************) - -(* Basic_2A1: was: append_inj_sn *) -lemma append_inj_length_sn: ∀K1,K2,L1,L2. L1 @@ K1 = L2 @@ K2 → |K1| = |K2| → - L1 = L2 ∧ K1 = K2. -#K1 elim K1 -K1 -[ * /2 width=1 by conj/ - #K2 #I2 #V2 #L1 #L2 #_ >length_atom >length_pair - #H destruct -| #K1 #I1 #V1 #IH * - [ #L1 #L2 #_ >length_atom >length_pair - #H destruct - | #K2 #I2 #V2 #L1 #L2 #H1 #H2 - elim (destruct_lpair_lpair_aux … H1) -H1 #H1 #H3 #H4 destruct (**) (* destruct lemma needed *) - elim (IH … H1) -IH -H1 /2 width=1 by conj/ - ] -] -qed-. - -(* Note: lemma 750 *) -(* Basic_2A1: was: append_inj_dx *) -lemma append_inj_length_dx: ∀K1,K2,L1,L2. L1 @@ K1 = L2 @@ K2 → |L1| = |L2| → - L1 = L2 ∧ K1 = K2. -#K1 elim K1 -K1 -[ * /2 width=1 by conj/ - #K2 #I2 #V2 #L1 #L2 >append_atom >append_pair #H destruct - >length_pair >append_length >plus_n_Sm - #H elim (plus_xSy_x_false … H) -| #K1 #I1 #V1 #IH * - [ #L1 #L2 >append_pair >append_atom #H destruct - >length_pair >append_length >plus_n_Sm #H - lapply (discr_plus_x_xy … H) -H #H destruct - | #K2 #I2 #V2 #L1 #L2 >append_pair >append_pair #H1 #H2 - elim (destruct_lpair_lpair_aux … H1) -H1 #H1 #H3 #H4 destruct (**) (* destruct lemma needed *) - elim (IH … H1) -IH -H1 /2 width=1 by conj/ - ] -] -qed-. - -(* Advanced inversion lemmas ************************************************) - -lemma append_inj_dx: ∀L,K1,K2. L@@K1 = L@@K2 → K1 = K2. -#L #K1 #K2 #H elim (append_inj_length_dx … H) -H // -qed-. - -lemma append_inv_refl_dx: ∀L,K. L@@K = L → K = ⋆. -#L #K #H elim (append_inj_dx … (⋆) … H) // -qed-. - -lemma append_inv_pair_dx: ∀I,L,K,V. L@@K = L.ⓑ{I}V → K = ⋆.ⓑ{I}V. -#I #L #K #V #H elim (append_inj_dx … (⋆.ⓑ{I}V) … H) // -qed-. - -(* Basic eliminators ********************************************************) - -(* Basic_1: was: c_tail_ind *) -lemma lenv_ind_alt: ∀R:predicate lenv. - R (⋆) → (∀I,L,T. R L → R (ⓑ{I}T.L)) → - ∀L. R L. -#R #IH1 #IH2 #L @(f_ind … length … L) -L #x #IHx * // -IH1 -#L #I #V #H destruct elim (lpair_ltail L I V) /4 width=1 by/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/ceq.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/ceq.ma deleted file mode 100644 index abd6b25b3..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/ceq.ma +++ /dev/null @@ -1,42 +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/grammar/lenv.ma". - -(* CONTEXT-SENSITIVE EQUIVALENCES FOR TERMS *********************************) - -definition ceq: relation3 lenv term term ≝ λL,T1,T2. T1 = T2. - -definition cfull: relation3 lenv term term ≝ λL,T1,T2. ⊤. - -(* Basic properties *********************************************************) - -lemma ceq_refl (L): reflexive … (ceq L). -// qed. - -lemma cfull_refl (L): reflexive … (cfull L). -// qed. - -lemma ceq_sym (L): symmetric … (ceq L). -// qed-. - -lemma cfull_sym (L): symmetric … (cfull L). -// qed-. - -lemma cfull_top (R:relation3 lenv term term) (L) (T1) (T2): - R L T1 T2 → cfull L T1 T2. -// qed-. - -lemma ceq_cfull (L) (T1) (T2): ceq L T1 T2 → cfull L T1 T2. -// qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/ceq_ceq.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/ceq_ceq.ma deleted file mode 100644 index 142f3b863..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/ceq_ceq.ma +++ /dev/null @@ -1,37 +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/grammar/ceq.ma". - -(* CONTEXT-SENSITIVE EQUIVALENCES FOR TERMS *********************************) - -(* Main properties **********************************************************) - -theorem ceq_trans (L): Transitive … (ceq L). -// qed-. - -lemma ceq_canc_sn (L): left_cancellable … (ceq L). -// qed-. - -lemma ceq_canc_dx (L): right_cancellable … (ceq L). -// qed-. - -theorem cfull_trans (L): Transitive … (cfull L). -// qed-. - -lemma cfull_canc_sn (L): left_cancellable … (cfull L). -// qed-. - -lemma cfull_canc_dx (L): right_cancellable … (cfull L). -// qed-. \ No newline at end of file diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/cl_restricted_weight.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/cl_restricted_weight.ma deleted file mode 100644 index fcf56071b..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/cl_restricted_weight.ma +++ /dev/null @@ -1,51 +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/notation/functions/weight_2.ma". -include "basic_2/grammar/lenv_weight.ma". - -(* WEIGHT OF A RESTRICTED CLOSURE *******************************************) - -definition rfw: lenv → term → ? ≝ λL,T. ♯{L} + ♯{T}. - -interpretation "weight (restricted closure)" 'Weight L T = (rfw L T). - -(* Basic properties *********************************************************) - -(* Basic_1: was: flt_shift *) -lemma rfw_shift: ∀p,I,K,V,T. ♯{K.ⓑ{I}V, T} < ♯{K, ⓑ{p,I}V.T}. -normalize /2 width=1 by monotonic_le_plus_r/ -qed. - -lemma rfw_tpair_sn: ∀I,L,V,T. ♯{L, V} < ♯{L, ②{I}V.T}. -normalize in ⊢ (?→?→?→?→?%%); // -qed. - -lemma rfw_tpair_dx: ∀I,L,V,T. ♯{L, T} < ♯{L, ②{I}V.T}. -normalize in ⊢ (?→?→?→?→?%%); // -qed. - -lemma rfw_lpair_sn: ∀I,L,V,T. ♯{L, V} < ♯{L.ⓑ{I}V, T}. -normalize /3 width=1 by monotonic_lt_plus_l, monotonic_le_plus_r/ -qed. - -lemma rfw_lpair_dx: ∀I,L,V,T. ♯{L, T} < ♯{L.ⓑ{I}V, T}. -normalize /3 width=1 by monotonic_lt_plus_l, monotonic_le_plus_r/ -qed. - -(* Basic_1: removed theorems 7: - flt_thead_sx flt_thead_dx flt_trans - flt_arith0 flt_arith1 flt_arith2 flt_wf_ind -*) -(* Basic_1: removed local theorems 1: q_ind *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/cl_weight.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/cl_weight.ma deleted file mode 100644 index bd837d4df..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/cl_weight.ma +++ /dev/null @@ -1,49 +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/notation/functions/weight_3.ma". -include "basic_2/grammar/lenv_weight.ma". -include "basic_2/grammar/genv.ma". - -(* WEIGHT OF A CLOSURE ******************************************************) - -(* activate genv *) -definition fw: genv → lenv → term → ? ≝ λG,L,T. ♯{L} + ♯{T}. - -interpretation "weight (closure)" 'Weight G L T = (fw G L T). - -(* Basic properties *********************************************************) - -(* Basic_1: was: flt_shift *) -lemma fw_shift: ∀p,I,G,K,V,T. ♯{G, K.ⓑ{I}V, T} < ♯{G, K, ⓑ{p,I}V.T}. -normalize /2 width=1 by monotonic_le_plus_r/ -qed. - -lemma fw_tpair_sn: ∀I,G,L,V,T. ♯{G, L, V} < ♯{G, L, ②{I}V.T}. -normalize in ⊢ (?→?→?→?→?→?%%); // -qed. - -lemma fw_tpair_dx: ∀I,G,L,V,T. ♯{G, L, T} < ♯{G, L, ②{I}V.T}. -normalize in ⊢ (?→?→?→?→?→?%%); // -qed. - -lemma fw_lpair_sn: ∀I,G,L,V,T. ♯{G, L, V} < ♯{G, L.ⓑ{I}V, T}. -normalize /3 width=1 by monotonic_lt_plus_l, monotonic_le_plus_r/ -qed. - -(* Basic_1: removed theorems 7: - flt_thead_sx flt_thead_dx flt_trans - flt_arith0 flt_arith1 flt_arith2 flt_wf_ind -*) -(* Basic_1: removed local theorems 1: q_ind *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/genv.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/genv.ma deleted file mode 100644 index c614e0f4e..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/genv.ma +++ /dev/null @@ -1,41 +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 "ground_2/lib/list2.ma". -include "basic_2/notation/constructors/star_0.ma". -include "basic_2/notation/constructors/dxbind2_3.ma". -include "basic_2/notation/constructors/dxabbr_2.ma". -include "basic_2/notation/constructors/dxabst_2.ma". -include "basic_2/grammar/term.ma". - -(* GLOBAL ENVIRONMENTS ******************************************************) - -(* global environments *) -definition genv ≝ list2 bind2 term. - -interpretation "sort (global environment)" - 'Star = (nil2 bind2 term). - -interpretation "global environment binding construction (binary)" - 'DxBind2 L I T = (cons2 bind2 term I T L). - -interpretation "abbreviation (global environment)" - 'DxAbbr L T = (cons2 bind2 term Abbr T L). - -interpretation "abstraction (global environment)" - 'DxAbst L T = (cons2 bind2 term Abst T L). - -(* Basic properties *********************************************************) - -axiom eq_genv_dec: ∀G1,G2:genv. Decidable (G1 = G2). diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/item.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/item.ma deleted file mode 100644 index ab861be57..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/item.ma +++ /dev/null @@ -1,88 +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 "ground_2/lib/bool.ma". -include "ground_2/lib/arith.ma". - -(* ITEMS ********************************************************************) - -(* atomic items *) -inductive item0: Type[0] ≝ - | Sort: nat → item0 (* sort: starting at 0 *) - | LRef: nat → item0 (* reference by index: starting at 0 *) - | GRef: nat → item0 (* reference by position: starting at 0 *) -. - -(* binary binding items *) -inductive bind2: Type[0] ≝ - | Abbr: bind2 (* abbreviation *) - | Abst: bind2 (* abstraction *) -. - -(* binary non-binding items *) -inductive flat2: Type[0] ≝ - | Appl: flat2 (* application *) - | Cast: flat2 (* explicit type annotation *) -. - -(* binary items *) -inductive item2: Type[0] ≝ - | Bind2: bool → bind2 → item2 (* polarized binding item *) - | Flat2: flat2 → item2 (* non-binding item *) -. - -(* Basic inversion lemmas ***************************************************) - -fact destruct_sort_sort_aux: ∀s1,s2. Sort s1 = Sort s2 → s1 = s2. -#s1 #s2 #H destruct // -qed-. - -(* Basic properties *********************************************************) - -lemma eq_item0_dec: ∀I1,I2:item0. Decidable (I1 = I2). -* #i1 * #i2 [2,3,4,6,7,8: @or_intror #H destruct ] -[2: elim (eq_nat_dec i1 i2) |1,3: elim (eq_nat_dec i1 i2) ] /2 width=1 by or_introl/ -#Hni12 @or_intror #H destruct /2 width=1 by/ -qed-. - -(* Basic_1: was: bind_dec *) -lemma eq_bind2_dec: ∀I1,I2:bind2. Decidable (I1 = I2). -* * /2 width=1 by or_introl/ -@or_intror #H destruct -qed-. - -(* Basic_1: was: flat_dec *) -lemma eq_flat2_dec: ∀I1,I2:flat2. Decidable (I1 = I2). -* * /2 width=1 by or_introl/ -@or_intror #H destruct -qed-. - -(* Basic_1: was: kind_dec *) -lemma eq_item2_dec: ∀I1,I2:item2. Decidable (I1 = I2). -* [ #p1 ] #I1 * [1,3: #p2 ] #I2 -[2,3: @or_intror #H destruct -| elim (eq_bool_dec p1 p2) #Hp - [ elim (eq_bind2_dec I1 I2) /2 width=1 by or_introl/ #HI ] - @or_intror #H destruct /2 width=1 by/ -| elim (eq_flat2_dec I1 I2) /2 width=1 by or_introl/ #HI - @or_intror #H destruct /2 width=1 by/ -] -qed-. - -(* Basic_1: removed theorems 21: - s_S s_plus s_plus_sym s_minus minus_s_s s_le s_lt s_inj s_inc - s_arith0 s_arith1 - r_S r_plus r_plus_sym r_minus r_dis s_r r_arith0 r_arith1 - not_abbr_abst bind_dec_not -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/lenv.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/lenv.ma deleted file mode 100644 index 80738ebbd..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/lenv.ma +++ /dev/null @@ -1,71 +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/notation/constructors/star_0.ma". -include "basic_2/notation/constructors/dxbind2_3.ma". -include "basic_2/notation/constructors/dxabbr_2.ma". -include "basic_2/notation/constructors/dxabst_2.ma". -include "basic_2/grammar/term.ma". - -(* LOCAL ENVIRONMENTS *******************************************************) - -(* local environments *) -inductive lenv: Type[0] ≝ -| LAtom: lenv (* empty *) -| LPair: lenv → bind2 → term → lenv (* binary binding construction *) -. - -interpretation "sort (local environment)" - 'Star = LAtom. - -interpretation "local environment binding construction (binary)" - 'DxBind2 L I T = (LPair L I T). - -interpretation "abbreviation (local environment)" - 'DxAbbr L T = (LPair L Abbr T). - -interpretation "abstraction (local environment)" - 'DxAbst L T = (LPair L Abst T). - -(* Basic properties *********************************************************) - -lemma eq_lenv_dec: ∀L1,L2:lenv. Decidable (L1 = L2). -#L1 elim L1 -L1 [| #L1 #I1 #V1 #IHL1 ] * [2,4: #L2 #I2 #V2 ] -[1,4: @or_intror #H destruct -| elim (eq_bind2_dec I1 I2) #HI - [ elim (eq_term_dec V1 V2) #HV - [ elim (IHL1 L2) -IHL1 /2 width=1 by or_introl/ #HL ] - ] - @or_intror #H destruct /2 width=1 by/ -| /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 → - ∧∧L1 = L2 & I1 = I2 & V1 = V2. -#I1 #I2 #L1 #L2 #V1 #V2 #H destruct /2 width=1 by and3_intro/ -qed-. - -lemma discr_lpair_x_xy: ∀I,V,L. L = L.ⓑ{I}V → ⊥. -#I #V #L elim L -L -[ #H destruct -| #L #J #W #IHL #H - elim (destruct_lpair_lpair_aux … H) -H #H1 #H2 #H3 destruct /2 width=1 by/ (**) (* destruct lemma needed *) -] -qed-. - -lemma discr_lpair_xy_x: ∀I,V,L. L.ⓑ{I}V = L→ ⊥. -/2 width=4 by discr_lpair_x_xy/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/lenv_length.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/lenv_length.ma deleted file mode 100644 index a7a99ba01..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/lenv_length.ma +++ /dev/null @@ -1,58 +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/grammar/lenv.ma". - -(* LENGTH OF A LOCAL ENVIRONMENT ********************************************) - -rec definition length L ≝ match L with -[ LAtom ⇒ 0 -| LPair L _ _ ⇒ ⫯(length L) -]. - -interpretation "length (local environment)" 'card L = (length L). - -(* Basic properties *********************************************************) - -lemma length_atom: |⋆| = 0. -// qed. - -lemma length_pair: ∀I,L,V. |L.ⓑ{I}V| = ⫯|L|. -// qed. - -(* Basic inversion lemmas ***************************************************) - -lemma length_inv_zero_dx: ∀L. |L| = 0 → L = ⋆. -* // #L #I #V >length_pair -#H destruct -qed-. - -lemma length_inv_zero_sn: ∀L. 0 = |L| → L = ⋆. -/2 width=1 by length_inv_zero_dx/ qed-. - -(* Basic_2A1: was: length_inv_pos_dx *) -lemma length_inv_succ_dx: ∀n,L. |L| = ⫯n → - ∃∃I,K,V. |K| = n & L = K. ⓑ{I}V. -#n * /3 width=5 by injective_S, ex2_3_intro/ ->length_atom #H destruct -qed-. - -(* Basic_2A1: was: length_inv_pos_sn *) -lemma length_inv_succ_sn: ∀n,L. ⫯n = |L| → - ∃∃I,K,V. n = |K| & L = K. ⓑ{I}V. -#l #L #H lapply (sym_eq ??? H) -H -#H elim (length_inv_succ_dx … H) -H /2 width=5 by ex2_3_intro/ -qed-. - -(* Basic_2A1: removed theorems 1: length_inj *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/lenv_weight.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/lenv_weight.ma deleted file mode 100644 index c9d79e5f5..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/lenv_weight.ma +++ /dev/null @@ -1,34 +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/grammar/term_weight.ma". -include "basic_2/grammar/lenv.ma". - -(* WEIGHT OF A LOCAL ENVIRONMENT ********************************************) - -rec definition lw L ≝ match L with -[ LAtom ⇒ 0 -| LPair L _ V ⇒ lw L + ♯{V} -]. - -interpretation "weight (local environment)" 'Weight L = (lw L). - -(* Basic properties *********************************************************) - -lemma lw_pair: ∀I,L,V. ♯{L} < ♯{L.ⓑ{I}V}. -/3 width=1 by lt_plus_to_minus_r, monotonic_lt_plus_r/ qed. - -(* Basic_1: removed theorems 4: clt_cong clt_head clt_thead clt_wf_ind *) -(* Basic_1: removed local theorems 1: clt_wf__q_ind *) -(* Basic_1: note: clt_thead should be renamed clt_ctail *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/term.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/term.ma deleted file mode 100644 index ff00f4f84..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/term.ma +++ /dev/null @@ -1,153 +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/notation/constructors/item0_1.ma". -include "basic_2/notation/constructors/snitem2_3.ma". -include "basic_2/notation/constructors/snbind2_4.ma". -include "basic_2/notation/constructors/snbind2pos_3.ma". -include "basic_2/notation/constructors/snbind2neg_3.ma". -include "basic_2/notation/constructors/snflat2_3.ma". -include "basic_2/notation/constructors/star_1.ma". -include "basic_2/notation/constructors/lref_1.ma". -include "basic_2/notation/constructors/gref_1.ma". -include "basic_2/notation/constructors/snabbr_3.ma". -include "basic_2/notation/constructors/snabbrpos_2.ma". -include "basic_2/notation/constructors/snabbrneg_2.ma". -include "basic_2/notation/constructors/snabst_3.ma". -include "basic_2/notation/constructors/snabstpos_2.ma". -include "basic_2/notation/constructors/snabstneg_2.ma". -include "basic_2/notation/constructors/snappl_2.ma". -include "basic_2/notation/constructors/sncast_2.ma". -include "basic_2/grammar/item.ma". - -(* TERMS ********************************************************************) - -(* terms *) -inductive term: Type[0] ≝ - | TAtom: item0 → term (* atomic item construction *) - | TPair: item2 → term → term → term (* binary item construction *) -. - -interpretation "term construction (atomic)" - 'Item0 I = (TAtom I). - -interpretation "term construction (binary)" - 'SnItem2 I T1 T2 = (TPair I T1 T2). - -interpretation "term binding construction (binary)" - 'SnBind2 p I T1 T2 = (TPair (Bind2 p I) T1 T2). - -interpretation "term positive binding construction (binary)" - 'SnBind2Pos I T1 T2 = (TPair (Bind2 true I) T1 T2). - -interpretation "term negative binding construction (binary)" - 'SnBind2Neg I T1 T2 = (TPair (Bind2 false I) T1 T2). - -interpretation "term flat construction (binary)" - 'SnFlat2 I T1 T2 = (TPair (Flat2 I) T1 T2). - -interpretation "sort (term)" - 'Star s = (TAtom (Sort s)). - -interpretation "local reference (term)" - 'LRef i = (TAtom (LRef i)). - -interpretation "global reference (term)" - 'GRef l = (TAtom (GRef l)). - -interpretation "abbreviation (term)" - 'SnAbbr p T1 T2 = (TPair (Bind2 p Abbr) T1 T2). - -interpretation "positive abbreviation (term)" - 'SnAbbrPos T1 T2 = (TPair (Bind2 true Abbr) T1 T2). - -interpretation "negative abbreviation (term)" - 'SnAbbrNeg T1 T2 = (TPair (Bind2 false Abbr) T1 T2). - -interpretation "abstraction (term)" - 'SnAbst p T1 T2 = (TPair (Bind2 p Abst) T1 T2). - -interpretation "positive abstraction (term)" - 'SnAbstPos T1 T2 = (TPair (Bind2 true Abst) T1 T2). - -interpretation "negative abstraction (term)" - 'SnAbstNeg T1 T2 = (TPair (Bind2 false Abst) T1 T2). - -interpretation "application (term)" - 'SnAppl T1 T2 = (TPair (Flat2 Appl) T1 T2). - -interpretation "native type annotation (term)" - 'SnCast T1 T2 = (TPair (Flat2 Cast) T1 T2). - -(* Basic properties *********************************************************) - -(* Basic_1: was: term_dec *) -lemma eq_term_dec: ∀T1,T2:term. Decidable (T1 = T2). -#T1 elim T1 -T1 #I1 [| #V1 #T1 #IHV1 #IHT1 ] * #I2 [2,4: #V2 #T2 ] -[1,4: @or_intror #H destruct -| elim (eq_item2_dec I1 I2) #HI - [ elim (IHV1 V2) -IHV1 #HV - [ elim (IHT1 T2) -IHT1 /2 width=1 by or_introl/ #HT ] - ] - @or_intror #H destruct /2 width=1 by/ -| elim (eq_item0_dec I1 I2) /2 width=1 by or_introl/ #HI - @or_intror #H destruct /2 width=1 by/ -] -qed-. - -(* Basic inversion lemmas ***************************************************) - -fact destruct_tatom_tatom_aux: ∀I1,I2. ⓪{I1} = ⓪{I2} → I1 = I2. -#I1 #I2 #H destruct // -qed-. - -fact destruct_tpair_tpair_aux: ∀I1,I2,T1,T2,V1,V2. ②{I1}T1.V1 = ②{I2}T2.V2 → - ∧∧T1 = T2 & I1 = I2 & V1 = V2. -#I1 #I2 #T1 #T2 #V1 #V2 #H destruct /2 width=1 by and3_intro/ -qed-. - -lemma discr_tpair_xy_x: ∀I,T,V. ②{I}V.T = V → ⊥. -#I #T #V elim V -V -[ #J #H destruct -| #J #W #U #IHW #_ #H elim (destruct_tpair_tpair_aux … H) -H /2 width=1 by/ (**) (* destruct lemma needed *) -] -qed-. - -(* Basic_1: was: thead_x_y_y *) -lemma discr_tpair_xy_y: ∀I,V,T. ②{I}V.T = T → ⊥. -#I #V #T elim T -T -[ #J #H destruct -| #J #W #U #_ #IHU #H elim (destruct_tpair_tpair_aux … H) -H /2 width=1 by/ (**) (* destruct lemma needed *) -] -qed-. - -lemma eq_false_inv_tpair_sn: ∀I,V1,T1,V2,T2. - (②{I}V1.T1 = ②{I}V2.T2 → ⊥) → - (V1 = V2 → ⊥) ∨ (V1 = V2 ∧ (T1 = T2 → ⊥)). -#I #V1 #T1 #V2 #T2 #H -elim (eq_term_dec V1 V2) /3 width=1 by or_introl/ #HV12 destruct -@or_intror @conj // #HT12 destruct /2 width=1 by/ -qed-. - -lemma eq_false_inv_tpair_dx: ∀I,V1,T1,V2,T2. - (②{I} V1. T1 = ②{I}V2.T2 → ⊥) → - (T1 = T2 → ⊥) ∨ (T1 = T2 ∧ (V1 = V2 → ⊥)). -#I #V1 #T1 #V2 #T2 #H -elim (eq_term_dec T1 T2) /3 width=1 by or_introl/ #HT12 destruct -@or_intror @conj // #HT12 destruct /2 width=1 by/ -qed-. - -(* Basic_1: removed theorems 3: - not_void_abst not_abbr_void not_abst_void -*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/term_simple.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/term_simple.ma deleted file mode 100644 index 6332ff149..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/term_simple.ma +++ /dev/null @@ -1,42 +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/notation/relations/simple_1.ma". -include "basic_2/grammar/term.ma". - -(* SIMPLE (NEUTRAL) TERMS ***************************************************) - -inductive simple: predicate term ≝ - | simple_atom: ∀I. simple (⓪{I}) - | simple_flat: ∀I,V,T. simple (ⓕ{I} V. T) -. - -interpretation "simple (term)" 'Simple T = (simple T). - -(* Basic inversion lemmas ***************************************************) - -fact simple_inv_bind_aux: ∀T. 𝐒⦃T⦄ → ∀p,J,W,U. T = ⓑ{p,J}W.U → ⊥. -#T * -T -[ #I #p #J #W #U #H destruct -| #I #V #T #a #J #W #U #H destruct -] -qed-. - -lemma simple_inv_bind: ∀p,I,V,T. 𝐒⦃ⓑ{p,I} V. T⦄ → ⊥. -/2 width=7 by simple_inv_bind_aux/ qed-. - -lemma simple_inv_pair: ∀I,V,T. 𝐒⦃②{I}V.T⦄ → ∃J. I = Flat2 J. -* /2 width=2 by ex_intro/ -#p #I #V #T #H elim (simple_inv_bind … H) -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/term_vector.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/term_vector.ma deleted file mode 100644 index d33d4b452..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/term_vector.ma +++ /dev/null @@ -1,42 +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 "ground_2/lib/list.ma". -include "basic_2/notation/functions/snapplvector_2.ma". -include "basic_2/grammar/term_simple.ma". - -(* TERMS ********************************************************************) - -rec definition applv Vs T on Vs ≝ - match Vs with - [ nil ⇒ T - | cons hd tl ⇒ ⓐhd. (applv tl T) - ]. - -interpretation "application to vector (term)" - 'SnApplVector Vs T = (applv Vs T). - -(* Basic properties *********************************************************) - -lemma applv_nil: ∀T. Ⓐ◊.T = T. -// qed. - -lemma applv_cons: ∀V,Vs,T. ⒶV@Vs.T = ⓐV.ⒶVs.T. -// qed. - -(* Properties with simple terms *********************************************) - -lemma applv_simple: ∀T,Vs. 𝐒⦃T⦄ → 𝐒⦃ⒶVs.T⦄. -#T * // -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/term_weight.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/term_weight.ma deleted file mode 100644 index 23659262d..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/term_weight.ma +++ /dev/null @@ -1,38 +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/notation/functions/weight_1.ma". -include "basic_2/grammar/term.ma". - -(* WEIGHT OF A TERM *********************************************************) - -rec definition tw T ≝ match T with -[ TAtom _ ⇒ 1 -| TPair _ V T ⇒ tw V + tw T + 1 -]. - -interpretation "weight (term)" 'Weight T = (tw T). - -(* Basic properties *********************************************************) - -(* Basic_1: was: tweight_lt *) -lemma tw_pos: ∀T. 1 ≤ ♯{T}. -#T elim T -T // -qed. - -(* Basic_1: removed theorems 11: - wadd_le wadd_lt wadd_O weight_le weight_eq weight_add_O - weight_add_S tlt_trans tlt_head_sx tlt_head_dx tlt_wf_ind -*) -(* Basic_1: removed local theorems 1: q_ind *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/tsts.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/tsts.ma deleted file mode 100644 index d3bc8ee96..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/tsts.ma +++ /dev/null @@ -1,108 +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/notation/relations/topiso_2.ma". -include "basic_2/grammar/term_simple.ma". - -(* SAME TOP TERM STRUCTURE **************************************************) - -inductive tsts: relation term ≝ - | tsts_atom: ∀I. tsts (⓪{I}) (⓪{I}) - | tsts_pair: ∀I,V1,V2,T1,T2. tsts (②{I}V1.T1) (②{I}V2.T2) -. - -interpretation "same top structure (term)" 'TopIso T1 T2 = (tsts T1 T2). - -(* Basic inversion lemmas ***************************************************) - -fact tsts_inv_atom1_aux: ∀T1,T2. T1 ≂ T2 → ∀I. T1 = ⓪{I} → T2 = ⓪{I}. -#T1 #T2 * -T1 -T2 // -#J #V1 #V2 #T1 #T2 #I #H destruct -qed-. - -(* Basic_1: was: iso_gen_sort iso_gen_lref *) -lemma tsts_inv_atom1: ∀I,T2. ⓪{I} ≂ T2 → T2 = ⓪{I}. -/2 width=3 by tsts_inv_atom1_aux/ qed-. - -fact tsts_inv_pair1_aux: ∀T1,T2. T1 ≂ T2 → ∀I,W1,U1. T1 = ②{I}W1.U1 → - ∃∃W2,U2. T2 = ②{I}W2. U2. -#T1 #T2 * -T1 -T2 -[ #J #I #W1 #U1 #H destruct -| #J #V1 #V2 #T1 #T2 #I #W1 #U1 #H destruct /2 width=3 by ex1_2_intro/ -] -qed-. - -(* Basic_1: was: iso_gen_head *) -lemma tsts_inv_pair1: ∀I,W1,U1,T2. ②{I}W1.U1 ≂ T2 → - ∃∃W2,U2. T2 = ②{I}W2. U2. -/2 width=5 by tsts_inv_pair1_aux/ qed-. - -fact tsts_inv_atom2_aux: ∀T1,T2. T1 ≂ T2 → ∀I. T2 = ⓪{I} → T1 = ⓪{I}. -#T1 #T2 * -T1 -T2 // -#J #V1 #V2 #T1 #T2 #I #H destruct -qed-. - -lemma tsts_inv_atom2: ∀I,T1. T1 ≂ ⓪{I} → T1 = ⓪{I}. -/2 width=3 by tsts_inv_atom2_aux/ qed-. - -fact tsts_inv_pair2_aux: ∀T1,T2. T1 ≂ T2 → ∀I,W2,U2. T2 = ②{I}W2.U2 → - ∃∃W1,U1. T1 = ②{I}W1.U1. -#T1 #T2 * -T1 -T2 -[ #J #I #W2 #U2 #H destruct -| #J #V1 #V2 #T1 #T2 #I #W2 #U2 #H destruct /2 width=3 by ex1_2_intro/ -] -qed-. - -lemma tsts_inv_pair2: ∀I,T1,W2,U2. T1 ≂ ②{I}W2.U2 → - ∃∃W1,U1. T1 = ②{I}W1.U1. -/2 width=5 by tsts_inv_pair2_aux/ qed-. - -(* Basic properties *********************************************************) - -(* Basic_1: was: iso_refl *) -lemma tsts_refl: reflexive … tsts. -#T elim T -T // -qed. - -lemma tsts_sym: symmetric … tsts. -#T1 #T2 #H elim H -T1 -T2 // -qed-. - -lemma tsts_dec: ∀T1,T2. Decidable (T1 ≂ T2). -* #I1 [2: #V1 #T1 ] * #I2 [2,4: #V2 #T2 ] -[ elim (eq_item2_dec I1 I2) #HI12 - [ destruct /2 width=1 by tsts_pair, or_introl/ - | @or_intror #H - elim (tsts_inv_pair1 … H) -H #V #T #H destruct /2 width=1 by/ - ] -| @or_intror #H - lapply (tsts_inv_atom1 … H) -H #H destruct -| @or_intror #H - lapply (tsts_inv_atom2 … H) -H #H destruct -| elim (eq_item0_dec I1 I2) #HI12 - [ destruct /2 width=1 by or_introl/ - | @or_intror #H - lapply (tsts_inv_atom2 … H) -H #H destruct /2 width=1 by/ - ] -] -qed. - -lemma simple_tsts_repl_dx: ∀T1,T2. T1 ≂ T2 → 𝐒⦃T1⦄ → 𝐒⦃T2⦄. -#T1 #T2 * -T1 -T2 // -#I #V1 #V2 #T1 #T2 #H -elim (simple_inv_pair … H) -H #J #H destruct // -qed-. - -lemma simple_tsts_repl_sn: ∀T1,T2. T1 ≂ T2 → 𝐒⦃T2⦄ → 𝐒⦃T1⦄. -/3 width=3 by simple_tsts_repl_dx, tsts_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/tsts_tsts.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/tsts_tsts.ma deleted file mode 100644 index d46b497c8..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/tsts_tsts.ma +++ /dev/null @@ -1,32 +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/grammar/tsts.ma". - -(* SAME TOP TERM STRUCTURE **************************************************) - -(* Main properties **********************************************************) - -(* Basic_1: was: iso_trans *) -theorem tsts_trans: Transitive … tsts. -#T1 #T * -T1 -T // -#I #V1 #V #T1 #T #X #H -elim (tsts_inv_pair1 … H) -H #V2 #T2 #H destruct // -qed-. - -theorem tsts_canc_sn: ∀T,T1. T ≂ T1 → ∀T2. T ≂ T2 → T1 ≂ T2. -/3 width=3 by tsts_trans, tsts_sym/ qed-. - -theorem tsts_canc_dx: ∀T1,T. T1 ≂ T → ∀T2. T2 ≂ T → T1 ≂ T2. -/3 width=3 by tsts_trans, tsts_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/tsts_vector.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/tsts_vector.ma deleted file mode 100644 index e90370621..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/tsts_vector.ma +++ /dev/null @@ -1,30 +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/grammar/term_vector.ma". -include "basic_2/grammar/tsts.ma". - -(* SAME TOP TERM STRUCTURE **************************************************) - -(* Advanced inversion lemmas ************************************************) - -(* Basic_1: was only: iso_flats_lref_bind_false iso_flats_flat_bind_false *) -lemma tsts_inv_bind_applv_simple: ∀p,I,Vs,V2,T1,T2. ⒶVs.T1 ≂ ⓑ{p,I}V2.T2 → - 𝐒⦃T1⦄ → ⊥. -#p #I #Vs #V2 #T1 #T2 #H elim (tsts_inv_pair2 … H) -H -#V0 #T0 elim Vs -Vs normalize -[ #H destruct #H /2 width=5 by simple_inv_bind/ -| #V #Vs #_ #H destruct -] -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/names.txt b/matita/matita/contribs/lambdadelta/basic_2/names.txt index bf8778e2d..a1cb0e0d1 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/names.txt +++ b/matita/matita/contribs/lambdadelta/basic_2/names.txt @@ -26,9 +26,9 @@ i,j : local reference depth (de Bruijn's) k,l : global reference level m : n : type iterations -o : sort degree parameter +o : sort degree parameter (origin) p,q : binder polarity -r : reduction kind parameter (true = ordinary, false = extended) +r : s : sort index t,u : v,w : local reference position level (de Bruijn's) (RTM) diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/constructors/dxabbr_2.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/constructors/dxabbr_2.ma index afd2f1892..80ba76465 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/constructors/dxabbr_2.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/constructors/dxabbr_2.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( T1 . break ⓓ T2 )" +notation "hvbox( L . break ⓓ T1 )" left associative with precedence 48 - for @{ 'DxAbbr $T1 $T2 }. + for @{ 'DxAbbr $L $T1 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/constructors/dxabst_2.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/constructors/dxabst_2.ma index 43e324eae..5455e678e 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/constructors/dxabst_2.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/constructors/dxabst_2.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( T1 . break ⓛ T2 )" +notation "hvbox( L . break ⓛ T1 )" left associative with precedence 49 - for @{ 'DxAbst $T1 $T2 }. + for @{ 'DxAbst $L $T1 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/constructors/dxbind2_3.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/constructors/dxbind2_3.ma index bbded1eab..b276334f1 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/constructors/dxbind2_3.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/constructors/dxbind2_3.ma @@ -14,10 +14,10 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation > "hvbox( T . break ②{ term 46 I } break term 47 T1 )" +notation > "hvbox( L . break ②{ term 46 I } break term 47 T1 )" non associative with precedence 46 - for @{ 'DxBind2 $T $I $T1 }. + for @{ 'DxBind2 $L $I $T1 }. -notation "hvbox( T . break ⓑ { term 46 I } break term 48 T1 )" +notation "hvbox( L . break ⓑ { term 46 I } break term 48 T1 )" non associative with precedence 47 - for @{ 'DxBind2 $T $I $T1 }. + for @{ 'DxBind2 $L $I $T1 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpred_8.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpred_8.ma index 68a41ffc0..7e58d203e 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpred_8.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpred_8.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ≽ break [ term 46 o, break term 46 h ] break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ≽ break [ term 46 h, break term 46 o ] break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" non associative with precedence 45 for @{ 'BTPRed $h $o $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpredalt_8.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpredalt_8.ma index 97ea5b59f..2e0ebf5a0 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpredalt_8.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpredalt_8.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ≽ ≽ break [ term 46 o, break term 46 h ] break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ≽ ≽ break [ term 46 h, break term 46 o ] break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" non associative with precedence 45 for @{ 'BTPRedAlt $h $o $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpredproper_8.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpredproper_8.ma index 2dce25d43..e036aa7d5 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpredproper_8.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpredproper_8.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ≻ break [ term 46 o, break term 46 h ] break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ≻ break [ term 46 h, break term 46 o ] break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" non associative with precedence 45 for @{ 'BTPRedProper $h $o $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpredstar_8.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpredstar_8.ma index c48d221d4..6d216e2fa 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpredstar_8.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpredstar_8.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ≥ break [ term 46 o, break term 46 h ] break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ≥ break [ term 46 h, break term 46 o ] break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" non associative with precedence 45 for @{ 'BTPRedStar $h $o $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpredstaralt_8.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpredstaralt_8.ma index 79b3fd9d2..3b2cd2bfe 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpredstaralt_8.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btpredstaralt_8.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ≥ ≥ break [ term 46 o, break term 46 h ] break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ ≥ ≥ break [ term 46 h, break term 46 o ] break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" non associative with precedence 45 for @{ 'BTPRedStarAlt $h $o $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btsn_5.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btsn_5.ma index 06d5b7b88..7abf15de8 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btsn_5.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btsn_5.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦥ [ term 46 o, break term 46 h ] break ⦃ term 46 G, break term 46 L, break term 46 T ⦄ )" +notation "hvbox( ⦥ [ term 46 h, break term 46 o ] break ⦃ term 46 G, break term 46 L, break term 46 T ⦄ )" non associative with precedence 45 for @{ 'BTSN $h $o $G $L $T }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btsnalt_5.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btsnalt_5.ma index c303e309e..5e9d1ec67 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btsnalt_5.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/btsnalt_5.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦥ ⦥ [ term 46 o, break term 46 h ] break ⦃ term 46 G, break term 46 L, break term 46 T ⦄ )" +notation "hvbox( ⦥ ⦥ [ term 46 h, break term 46 o ] break ⦃ term 46 G, break term 46 L, break term 46 T ⦄ )" non associative with precedence 45 for @{ 'BTSNAlt $h $o $G $L $T }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/cosn_5.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/cosn_5.ma index e9c9e645d..ef632cba9 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/cosn_5.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/cosn_5.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( G ⊢ ~ ⬊ * break [ term 46 o , break term 46 h , break term 46 f ] break term 46 L )" +notation "hvbox( G ⊢ ~ ⬊ * break [ term 46 h , break term 46 o , break term 46 f ] break term 46 L )" non associative with precedence 45 for @{ 'CoSN $h $o $f $G $L }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/dpconvstar_8.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/dpconvstar_8.ma index 8ae707641..8d37f5217 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/dpconvstar_8.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/dpconvstar_8.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 • * ⬌ * break [ term 46 o , break term 46 h , break term 46 n1 , break term 46 n2 ] break term 46 T2 )" +notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 • * ⬌ * break [ term 46 h , break term 46 o , break term 46 n1 , break term 46 n2 ] break term 46 T2 )" non associative with precedence 45 for @{ 'DPConvStar $h $o $n1 $n2 $G $L $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/dpredstar_7.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/dpredstar_7.ma index a85c0e4f8..d9ab259ab 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/dpredstar_7.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/dpredstar_7.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 • * ➡ * break [ term 46 o , break term 46 h , break term 46 n ] break term 46 T2 )" +notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 • * ➡ * break [ term 46 h , break term 46 o , break term 46 n ] break term 46 T2 )" non associative with precedence 45 for @{ 'DPRedStar $h $o $n $G $L $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/lazybtpredstarproper_8.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/lazybtpredstarproper_8.ma index c99a3af6d..9c1252ac7 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/lazybtpredstarproper_8.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/lazybtpredstarproper_8.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ >≡ break [ term 46 o, break term 46 h ] break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" +notation "hvbox( ⦃ term 46 G1, break term 46 L1, break term 46 T1 ⦄ >≡ break [ term 46 h, break term 46 o ] break ⦃ term 46 G2, break term 46 L2 , break term 46 T2 ⦄ )" non associative with precedence 45 for @{ 'LazyBTPRedStarProper $h $o $G1 $L1 $T1 $G2 $L2 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/lazyeq_4.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/lazyeq_4.ma new file mode 100644 index 000000000..aec1914f1 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/lazyeq_4.ma @@ -0,0 +1,19 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) + +notation "hvbox( T1 ≡ break [ term 46 h , term 46 o ] break term 46 T2 )" + non associative with precedence 45 + for @{ 'LazyEq $h $o $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/lazyor_5.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/lazyor_5.ma deleted file mode 100644 index 70d3a1c66..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/lazyor_5.ma +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( L1 ⋓ break [ term 46 T , break term 46 f ] break term 46 L2 ≡ break term 46 L )" - non associative with precedence 45 - for @{ 'LazyOr $L1 $T $f $L2 $L }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/lrsubeq_4.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/lrsubeq_4.ma deleted file mode 100644 index 6135be4d4..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/lrsubeq_4.ma +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( L1 break ⊆ [ term 46 l , break term 46 m ] break term 46 L2 )" - non associative with precedence 45 - for @{ 'LRSubEq $L1 $l $k $L2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/lrsubeqv_5.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/lrsubeqv_5.ma index f39c6bcc7..d404926bf 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/lrsubeqv_5.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/lrsubeqv_5.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( G ⊢ break term 46 L1 ⫃ ¡ break [ term 46 o, break term 46 h ] break term 46 L2 )" +notation "hvbox( G ⊢ break term 46 L1 ⫃ ¡ break [ term 46 h, break term 46 o ] break term 46 L2 )" non associative with precedence 45 for @{ 'LRSubEqV $h $o $G $L1 $L2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/nativevalid_5.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/nativevalid_5.ma index 50e2452c2..4efadabad 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/nativevalid_5.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/nativevalid_5.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T ¡ break [ term 46 o, break term 46 h ] )" +notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T ¡ break [ term 46 h, break term 46 o ] )" non associative with precedence 45 for @{ 'NativeValid $h $o $G $L $T }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/nativevalid_6.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/nativevalid_6.ma index 2cd233332..d387e60be 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/nativevalid_6.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/nativevalid_6.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T ¡ break [ term 46 o , break term 46 h , break term 46 d ] )" +notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T ¡ break [ term 46 h , break term 46 o , break term 46 d ] )" non associative with precedence 45 for @{ 'NativeValid $h $o $d $G $L $T }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predeval_6.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predeval_6.ma index 80c61f26f..391f21f3c 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predeval_6.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predeval_6.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ break term 46 T1 ➡ * break [ term 46 o , break term 46 h ] break 𝐍 ⦃ term 46 T2 ⦄ )" +notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ break term 46 T1 ➡ * break [ term 46 h , break term 46 o ] break 𝐍 ⦃ term 46 T2 ⦄ )" non associative with precedence 45 for @{ 'PRedEval $h $o $G $L $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predsnstar_5.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predsnstar_5.ma index 3b12bc0e9..bb2d10464 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predsnstar_5.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predsnstar_5.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G, break term 46 L1 ⦄ ⊢ ➡ * break [ term 46 o , break term 46 h ] break term 46 L2 )" +notation "hvbox( ⦃ term 46 G, break term 46 L1 ⦄ ⊢ ➡ * break [ term 46 h , break term 46 o ] break term 46 L2 )" non associative with precedence 45 for @{ 'PRedSnStar $h $o $G $L1 $L2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predstar_6.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predstar_6.ma index b336dd9d7..265244809 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predstar_6.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/predstar_6.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ break term 46 T1 ➡ * break [ term 46 o , break term 46 h ] break term 46 T2 )" +notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ break term 46 T1 ➡ * break [ term 46 h , break term 46 o ] break term 46 T2 )" non associative with precedence 45 for @{ 'PRedStar $h $o $G $L $T1 $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/psubst_6.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/psubst_6.ma deleted file mode 100644 index 56cb72ec4..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/psubst_6.ma +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 break ▶ [ term 46 l , break term 46 m ] break term 46 T2 )" - non associative with precedence 45 - for @{ 'PSubst $G $L $T1 $l $k $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/psubststar_6.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/psubststar_6.ma deleted file mode 100644 index 90362edb6..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/psubststar_6.ma +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 break ▶ * [ term 46 l , break term 46 m ] break term 46 T2 )" - non associative with precedence 45 - for @{ 'PSubstStar $G $L $T1 $l $k $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/psubststaralt_6.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/psubststaralt_6.ma deleted file mode 100644 index 80a29a841..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/psubststaralt_6.ma +++ /dev/null @@ -1,19 +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 *) -(* *) -(**************************************************************************) - -(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) - -notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 break ▶ ▶ * [ term 46 l , break term 46 m ] break term 46 T2 )" - non associative with precedence 45 - for @{ 'PSubstStarAlt $G $L $T1 $l $k $T2 }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/sn_5.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/sn_5.ma index 050140b69..4ac3bc7aa 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/sn_5.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/sn_5.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ ⬊ * break [ term 46 o, break term 46 h ] break term 46 T )" +notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ ⬊ * break [ term 46 h, break term 46 o ] break term 46 T )" non associative with precedence 45 for @{ 'SN $h $o $G $L $T }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/sn_6.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/sn_6.ma index ea018c41b..268bd0b61 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/sn_6.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/sn_6.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( G ⊢ ⬊ * break [ term 46 o , break term 46 h , break term 46 T , break term 46 f ] break term 46 L )" +notation "hvbox( G ⊢ ⬊ * break [ term 46 h , break term 46 o , break term 46 T , break term 46 f ] break term 46 L )" non associative with precedence 45 for @{ 'SN $h $o $T $f $G $L }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/snalt_5.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/snalt_5.ma index 0c624b913..59196e5b1 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/snalt_5.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/snalt_5.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ ⬊ ⬊ * break [ term 46 o , break term 46 h ] break term 46 T )" +notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ ⬊ ⬊ * break [ term 46 h , break term 46 o ] break term 46 T )" non associative with precedence 45 for @{ 'SNAlt $h $o $G $L $T }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/snalt_6.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/snalt_6.ma index 09e6918e0..8f59a5f1c 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/snalt_6.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/snalt_6.ma @@ -14,6 +14,6 @@ (* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************) -notation "hvbox( G ⊢ ⬊ ⬊ * break [ term 46 o , break term 46 h , break term 46 T , break term 46 f ] break term 46 L )" +notation "hvbox( G ⊢ ⬊ ⬊ * break [ term 46 h , break term 46 o , break term 46 T , break term 46 f ] break term 46 L )" non associative with precedence 45 for @{ 'SNAlt $h $o $T $f $G $L }. diff --git a/matita/matita/contribs/lambdadelta/basic_2/relocation/drops_length.ma b/matita/matita/contribs/lambdadelta/basic_2/relocation/drops_length.ma index 546485cb5..7426ebb53 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/relocation/drops_length.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/relocation/drops_length.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -include "basic_2/grammar/lenv_length.ma". +include "basic_2/syntax/lenv_length.ma". include "basic_2/relocation/drops.ma". (* GENERIC SLICING FOR LOCAL ENVIRONMENTS ***********************************) @@ -37,7 +37,7 @@ theorem drops_fwd_length_eq1: ∀b1,b2,f,L1,K1. ⬇*[b1, f] L1 ≡ K1 → | #f #I1 #L1 #K1 #V1 #V2 #_ #_ #IH #X2 #Y2 #HX #H elim (length_inv_succ_sn … H) -H #I2 #L2 #V2 #H12 #H destruct elim (drops_inv_skip1 … HX) -HX #K2 #W2 #HLK2 #_ #H destruct - lapply (IH … HLK2 H12) -f /2 width=1 by/ (**) (* full auto fails *) + lapply (IH … HLK2 H12) -f >length_pair >length_pair /2 width=1 by/ (**) (* full auto fails *) ] qed-. @@ -47,8 +47,8 @@ lemma drops_fwd_fcla: ∀f,L1,L2. ⬇*[Ⓣ, f] L1 ≡ L2 → ∃∃n. 𝐂⦃f⦄ ≡ n & |L1| = |L2| + n. #f #L1 #L2 #H elim H -f -L1 -L2 [ /4 width=3 by fcla_isid, ex2_intro/ -| #f #I #L1 #L2 #V #_ * /3 width=3 by fcla_next, ex2_intro, eq_f/ -| #f #I #L1 #L2 #V1 #V2 #_ #_ * /3 width=3 by fcla_push, ex2_intro/ +| #f #I #L1 #L2 #V #_ * >length_pair /3 width=3 by fcla_next, ex2_intro, eq_f/ +| #f #I #L1 #L2 #V1 #V2 #_ #_ * >length_pair >length_pair /3 width=3 by fcla_push, ex2_intro/ ] qed-. @@ -56,7 +56,7 @@ qed-. lemma drops_fcla_fwd: ∀f,L1,L2,n. ⬇*[Ⓣ, f] L1 ≡ L2 → 𝐂⦃f⦄ ≡ n → |L1| = |L2| + n. #f #l1 #l2 #n #Hf #Hn elim (drops_fwd_fcla … Hf) -Hf -#m #Hm #H <(fcla_mono … Hm … Hn) -f // +#k #Hm #H <(fcla_mono … Hm … Hn) -f // qed-. lemma drops_fwd_fcla_le2: ∀f,L1,L2. ⬇*[Ⓣ, f] L1 ≡ L2 → @@ -68,7 +68,7 @@ qed-. lemma drops_fcla_fwd_le2: ∀f,L1,L2,n. ⬇*[Ⓣ, f] L1 ≡ L2 → 𝐂⦃f⦄ ≡ n → n ≤ |L1|. #f #L1 #L2 #n #H #Hn elim (drops_fwd_fcla_le2 … H) -H -#m #Hm #H <(fcla_mono … Hm … Hn) -f // +#k #Hm #H <(fcla_mono … Hm … Hn) -f // qed-. lemma drops_fwd_fcla_lt2: ∀f,L1,I2,K2,V2. ⬇*[Ⓣ, f] L1 ≡ K2.ⓑ{I2}V2 → @@ -82,7 +82,7 @@ lemma drops_fcla_fwd_lt2: ∀f,L1,I2,K2,V2,n. ⬇*[Ⓣ, f] L1 ≡ K2.ⓑ{I2}V2 → 𝐂⦃f⦄ ≡ n → n < |L1|. #f #L1 #I2 #K2 #V2 #n #H #Hn elim (drops_fwd_fcla_lt2 … H) -H -#m #Hm #H <(fcla_mono … Hm … Hn) -f // +#k #Hm #H <(fcla_mono … Hm … Hn) -f // qed-. (* Basic_2A1: includes: drop_fwd_length_lt4 *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/relocation/drops_lreq.ma b/matita/matita/contribs/lambdadelta/basic_2/relocation/drops_lreq.ma index c6899fd3e..c9934f664 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/relocation/drops_lreq.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/relocation/drops_lreq.ma @@ -21,8 +21,7 @@ include "basic_2/relocation/drops_lexs.ma". lemma lreq_co_dedropable: co_dedropable_sn lreq. @lexs_liftable_co_dedropable -/2 width=6 by cfull_lift, ceq_lift, cfull_refl, ceq_refl/ -qed-. +/2 width=6 by cfull_lift, ceq_lift/ qed-. lemma lreq_co_dropable_sn: co_dropable_sn lreq. @lexs_co_dropable_sn qed-. @@ -56,5 +55,4 @@ lemma drops_lreq_trans_next: ∀f1,K1,K2. K1 ≡[f1] K2 → ∃∃L2. ⬇*[b,f] L2.ⓑ{I}V ≡ K2 & L1 ≡[f2] L2 & L1.ⓑ{I}V ≡[f] L2.ⓑ{I}V. #f1 #K1 #K2 #HK12 #b #f #I #L1 #V #HLK1 #f2 #Hf2 elim (drops_lexs_trans_next … HK12 … HLK1 … Hf2) -f1 -K1 -/2 width=6 by cfull_lift, ceq_lift, cfull_refl, ceq_refl, ex3_intro/ -qed-. +/2 width=6 by cfull_lift, ceq_lift, ex3_intro/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/relocation/drops_weight.ma b/matita/matita/contribs/lambdadelta/basic_2/relocation/drops_weight.ma index 7cbe05e1e..1840b9122 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/relocation/drops_weight.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/relocation/drops_weight.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -include "basic_2/grammar/cl_restricted_weight.ma". +include "basic_2/syntax/cl_restricted_weight.ma". include "basic_2/relocation/lifts_weight.ma". include "basic_2/relocation/drops.ma". diff --git a/matita/matita/contribs/lambdadelta/basic_2/relocation/lexs.ma b/matita/matita/contribs/lambdadelta/basic_2/relocation/lexs.ma index 9587c2659..e99ea0393 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/relocation/lexs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/relocation/lexs.ma @@ -14,7 +14,7 @@ include "ground_2/relocation/rtmap_sle.ma". include "basic_2/notation/relations/relationstar_5.ma". -include "basic_2/grammar/lenv.ma". +include "basic_2/syntax/lenv.ma". (* GENERIC ENTRYWISE EXTENSION OF CONTEXT-SENSITIVE REALTIONS FOR TERMS *****) diff --git a/matita/matita/contribs/lambdadelta/basic_2/relocation/lexs_length.ma b/matita/matita/contribs/lambdadelta/basic_2/relocation/lexs_length.ma index e407927a2..972c773ed 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/relocation/lexs_length.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/relocation/lexs_length.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -include "basic_2/grammar/lenv_length.ma". +include "basic_2/syntax/lenv_length.ma". include "basic_2/relocation/lexs.ma". (* GENERIC ENTRYWISE EXTENSION OF CONTEXT-SENSITIVE REALTIONS FOR TERMS *****) @@ -22,4 +22,5 @@ include "basic_2/relocation/lexs.ma". (* Basic_2A1: includes: lpx_sn_fwd_length *) lemma lexs_fwd_length: ∀RN,RP,f,L1,L2. L1 ⦻*[RN, RP, f] L2 → |L1| = |L2|. #RM #RP #f #L1 #L2 #H elim H -f -L1 -L2 // +#f #I #L1 #L2 #V1 #V2 >length_pair >length_pair // qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/relocation/lifts.ma b/matita/matita/contribs/lambdadelta/basic_2/relocation/lifts.ma index d7176d732..73f3be9e7 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/relocation/lifts.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/relocation/lifts.ma @@ -15,7 +15,7 @@ include "ground_2/relocation/nstream_after.ma". include "basic_2/notation/relations/rliftstar_3.ma". -include "basic_2/grammar/term.ma". +include "basic_2/syntax/term.ma". (* GENERIC RELOCATION FOR TERMS *********************************************) diff --git a/matita/matita/contribs/lambdadelta/basic_2/relocation/lifts_simple.ma b/matita/matita/contribs/lambdadelta/basic_2/relocation/lifts_simple.ma index a8a9cc133..9afa0c02f 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/relocation/lifts_simple.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/relocation/lifts_simple.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -include "basic_2/grammar/term_simple.ma". +include "basic_2/syntax/term_simple.ma". include "basic_2/relocation/lifts.ma". (* GENERIC RELOCATION FOR TERMS *********************************************) diff --git a/matita/matita/contribs/lambdadelta/basic_2/relocation/lifts_vector.ma b/matita/matita/contribs/lambdadelta/basic_2/relocation/lifts_vector.ma index 1662b56d2..26d395f19 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/relocation/lifts_vector.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/relocation/lifts_vector.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -include "basic_2/grammar/term_vector.ma". +include "basic_2/syntax/term_vector.ma". include "basic_2/relocation/lifts.ma". (* GENERIC RELOCATION FOR TERM VECTORS *************************************) diff --git a/matita/matita/contribs/lambdadelta/basic_2/relocation/lifts_weight.ma b/matita/matita/contribs/lambdadelta/basic_2/relocation/lifts_weight.ma index a2e774964..c6ad5b974 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/relocation/lifts_weight.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/relocation/lifts_weight.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -include "basic_2/grammar/term_weight.ma". +include "basic_2/syntax/term_weight.ma". include "basic_2/relocation/lifts.ma". (* GENERIC RELOCATION FOR TERMS *********************************************) diff --git a/matita/matita/contribs/lambdadelta/basic_2/relocation/lreq.ma b/matita/matita/contribs/lambdadelta/basic_2/relocation/lreq.ma index b5ee58d79..aa2956699 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/relocation/lreq.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/relocation/lreq.ma @@ -13,7 +13,6 @@ (**************************************************************************) include "basic_2/notation/relations/lazyeq_3.ma". -include "basic_2/grammar/ceq.ma". include "basic_2/relocation/lexs.ma". (* RANGED EQUIVALENCE FOR LOCAL ENVIRONMENTS ********************************) diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_tsts.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_tsts.ma index 6434ff37f..c9d5f5ae9 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_tsts.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_tsts.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -include "basic_2/grammar/tsts.ma". +include "basic_2/syntax/tsts.ma". include "basic_2/computation/lpxs_cpxs.ma". (* CONTEXT-SENSITIVE EXTENDED PARALLEL COMPUTATION ON TERMS *****************) diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_tsts_vector.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_tsts_vector.ma index 738d5907a..6252ed90e 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_tsts_vector.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_tsts_vector.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -include "basic_2/grammar/tsts_vector.ma". +include "basic_2/syntax/tsts_vector.ma". include "basic_2/substitution/lift_vector.ma". include "basic_2/computation/cpxs_tsts.ma". diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_lpx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_lpx.ma index dd01e6a24..1c239f8f8 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_lpx.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_lpx.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -include "basic_2/grammar/tsts_tsts.ma". +include "basic_2/syntax/tsts_tsts.ma". include "basic_2/computation/cpxs_cpxs.ma". include "basic_2/computation/csx_alt.ma". include "basic_2/computation/csx_lift.ma". diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_vector.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_vector.ma index 95269945f..7d23b2f92 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_vector.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_vector.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -include "basic_2/grammar/term_vector.ma". +include "basic_2/syntax/term_vector.ma". include "basic_2/computation/csx.ma". (* CONTEXT-SENSITIVE EXTENDED STRONGLY NORMALIZING TERM VECTORS *************) diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/gcp.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/gcp.ma index 61e9182cd..12c661564 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/gcp.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/gcp.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -include "basic_2/grammar/genv.ma". +include "basic_2/syntax/genv.ma". include "basic_2/multiple/drops.ma". (* GENERIC COMPUTATION PROPERTIES *******************************************) diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/gcp_cr.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/gcp_cr.ma index 13b57701c..3d1143900 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/gcp_cr.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/gcp_cr.ma @@ -13,7 +13,7 @@ (**************************************************************************) include "basic_2/notation/relations/ineint_5.ma". -include "basic_2/grammar/aarity.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". diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpg.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpg.ma index 73be2e83d..b682e561d 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpg.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpg.ma @@ -15,10 +15,10 @@ include "ground_2/steps/rtc_max.ma". include "ground_2/steps/rtc_plus.ma". include "basic_2/notation/relations/predty_7.ma". -include "basic_2/grammar/lenv.ma". -include "basic_2/grammar/genv.ma". +include "basic_2/syntax/item_sh.ma". +include "basic_2/syntax/lenv.ma". +include "basic_2/syntax/genv.ma". include "basic_2/relocation/lifts.ma". -include "basic_2/static/sh.ma". (* COUNTED CONTEXT-SENSITIVE PARALLEL RT-TRANSITION FOR TERMS ***************) diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpg_simple.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpg_simple.ma index 0afd4cabb..506386e42 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpg_simple.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpg_simple.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -include "basic_2/grammar/term_simple.ma". +include "basic_2/syntax/term_simple.ma". include "basic_2/rt_transition/cpg.ma". (* COUNTED CONTEXT-SENSITIVE PARALLEL RT-TRANSITION FOR TERMS ***************) diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpm.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpm.ma index 2ff07da04..c207e05c1 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpm.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpm.ma @@ -124,8 +124,8 @@ lemma cpm_inv_atom1: ∀n,h,J,G,L,T2. ⦃G, L⦄ ⊢ ⓪{J} ➡[n, h] T2 → | ∃∃s. T2 = ⋆(next h s) & J = Sort s & n = 1 | ∃∃K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[n, h] V2 & ⬆*[1] V2 ≡ T2 & L = K.ⓓV1 & J = LRef 0 - | ∃∃m,K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[m, h] V2 & ⬆*[1] V2 ≡ T2 & - L = K.ⓛV1 & J = LRef 0 & n = ⫯m + | ∃∃k,K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[k, h] V2 & ⬆*[1] V2 ≡ T2 & + L = K.ⓛV1 & J = LRef 0 & n = ⫯k | ∃∃I,K,V,T,i. ⦃G, K⦄ ⊢ #i ➡[n, h] T & ⬆*[1] T ≡ T2 & L = K.ⓑ{I}V & J = LRef (⫯i). #n #h #J #G #L #T2 * #c #Hc #H elim (cpg_inv_atom1 … H) -H * @@ -134,7 +134,7 @@ lemma cpm_inv_atom1: ∀n,h,J,G,L,T2. ⦃G, L⦄ ⊢ ⓪{J} ➡[n, h] T2 → | #cV #K #V1 #V2 #HV12 #HVT2 #H1 #H2 #H3 destruct /4 width=6 by or5_intro2, ex4_3_intro, ex2_intro/ | #cV #K #V1 #V2 #HV12 #HVT2 #H1 #H2 #H3 destruct - elim (isrt_inv_plus_SO_dx … Hc) -Hc // #m #Hc #H destruct + elim (isrt_inv_plus_SO_dx … Hc) -Hc // #k #Hc #H destruct /4 width=9 by or5_intro3, ex5_4_intro, ex2_intro/ | #I #K #V1 #V2 #i #HV2 #HVT2 #H1 #H2 destruct /4 width=9 by or5_intro4, ex4_5_intro, ex2_intro/ @@ -153,14 +153,14 @@ lemma cpm_inv_zero1: ∀n,h,G,L,T2. ⦃G, L⦄ ⊢ #0 ➡[n, h] T2 → ∨∨ (T2 = #0 ∧ n = 0) | ∃∃K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[n, h] V2 & ⬆*[1] V2 ≡ T2 & L = K.ⓓV1 - | ∃∃m,K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[m, h] V2 & ⬆*[1] V2 ≡ T2 & - L = K.ⓛV1 & n = ⫯m. + | ∃∃k,K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[k, h] V2 & ⬆*[1] V2 ≡ T2 & + L = K.ⓛV1 & n = ⫯k. #n #h #G #L #T2 * #c #Hc #H elim (cpg_inv_zero1 … H) -H * [ #H1 #H2 destruct /4 width=1 by isrt_inv_00, or3_intro0, conj/ | #cV #K #V1 #V2 #HV12 #HVT2 #H1 #H2 destruct /4 width=8 by or3_intro1, ex3_3_intro, ex2_intro/ | #cV #K #V1 #V2 #HV12 #HVT2 #H1 #H2 destruct - elim (isrt_inv_plus_SO_dx … Hc) -Hc // #m #Hc #H destruct + elim (isrt_inv_plus_SO_dx … Hc) -Hc // #k #Hc #H destruct /4 width=8 by or3_intro2, ex4_4_intro, ex2_intro/ ] qed-. @@ -263,7 +263,7 @@ lemma cpm_inv_cast1: ∀n,h,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓝV1.U1 ➡[n, h] U2 ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[n, h] V2 & ⦃G, L⦄ ⊢ U1 ➡[n, h] T2 & U2 = ⓝV2.T2 | ⦃G, L⦄ ⊢ U1 ➡[n, h] U2 - | ∃∃m. ⦃G, L⦄ ⊢ V1 ➡[m, h] U2 & n = ⫯m. + | ∃∃k. ⦃G, L⦄ ⊢ V1 ➡[k, h] U2 & n = ⫯k. #n #h #G #L #V1 #U1 #U2 * #c #Hc #H elim (cpg_inv_cast1 … H) -H * [ #cV #cT #V2 #T2 #HV12 #HT12 #HcVT #H1 #H2 destruct elim (isrt_inv_max … Hc) -Hc #nV #nT #HcV #HcT #H destruct @@ -273,7 +273,7 @@ lemma cpm_inv_cast1: ∀n,h,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓝV1.U1 ➡[n, h] U2 | #cU #U12 #H destruct /4 width=3 by isrt_inv_plus_O_dx, or3_intro1, ex2_intro/ | #cU #H12 #H destruct - elim (isrt_inv_plus_SO_dx … Hc) -Hc // #m #Hc #H destruct + elim (isrt_inv_plus_SO_dx … Hc) -Hc // #k #Hc #H destruct /4 width=3 by or3_intro2, ex2_intro/ ] qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpm_drops.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpm_drops.ma index 786d2f9ce..fbcd7958d 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpm_drops.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpm_drops.ma @@ -42,8 +42,8 @@ lemma cpm_inv_atom1_drops: ∀n,h,I,G,L,T2. ⦃G, L⦄ ⊢ ⓪{I} ➡[n, h] T2 | ∃∃s. T2 = ⋆(next h s) & I = Sort s & n = 1 | ∃∃K,V,V2,i. ⬇*[i] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V ➡[n, h] V2 & ⬆*[⫯i] V2 ≡ T2 & I = LRef i - | ∃∃m,K,V,V2,i. ⬇*[i] L ≡ K.ⓛV & ⦃G, K⦄ ⊢ V ➡[m, h] V2 & - ⬆*[⫯i] V2 ≡ T2 & I = LRef i & n = ⫯m. + | ∃∃k,K,V,V2,i. ⬇*[i] L ≡ K.ⓛV & ⦃G, K⦄ ⊢ V ➡[k, h] V2 & + ⬆*[⫯i] V2 ≡ T2 & I = LRef i & n = ⫯k. #n #h #I #G #L #T2 * #c #Hc #H elim (cpg_inv_atom1_drops … H) -H * [ #H1 #H2 destruct lapply (isrt_inv_00 … Hc) -Hc /3 width=1 by or4_intro0, conj/ @@ -61,8 +61,8 @@ lemma cpm_inv_lref1_drops: ∀n,h,G,L,T2,i. ⦃G, L⦄ ⊢ #i ➡[n, h] T2 → ∨∨ T2 = #i ∧ n = 0 | ∃∃K,V,V2. ⬇*[i] L ≡ K. ⓓV & ⦃G, K⦄ ⊢ V ➡[n, h] V2 & ⬆*[⫯i] V2 ≡ T2 - | ∃∃m,K,V,V2. ⬇*[i] L ≡ K. ⓛV & ⦃G, K⦄ ⊢ V ➡[m, h] V2 & - ⬆*[⫯i] V2 ≡ T2 & n = ⫯m. + | ∃∃k,K,V,V2. ⬇*[i] L ≡ K. ⓛV & ⦃G, K⦄ ⊢ V ➡[k, h] V2 & + ⬆*[⫯i] V2 ≡ T2 & n = ⫯k. #n #h #G #L #T2 #i * #c #Hc #H elim (cpg_inv_lref1_drops … H) -H * [ #H1 #H2 destruct lapply (isrt_inv_00 … Hc) -Hc /3 width=1 by or3_intro0, conj/ diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpr_drops.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpr_drops.ma index 48d281e4f..c7c287036 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpr_drops.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpr_drops.ma @@ -27,7 +27,7 @@ lemma cpr_inv_atom1_drops: ∀h,I,G,L,T2. ⦃G, L⦄ ⊢ ⓪{I} ➡[h] T2 → [ /2 width=1 by or_introl/ | #s #_ #_ #H destruct | /3 width=8 by ex4_4_intro, or_intror/ -| #m #K #V1 #V2 #i #_ #_ #_ #_ #H destruct +| #k #K #V1 #V2 #i #_ #_ #_ #_ #H destruct ] qed-. @@ -40,6 +40,6 @@ lemma cpr_inv_lref1_drops: ∀h,G,L,T2,i. ⦃G, L⦄ ⊢ #i ➡[h] T2 → #h #G #L #T2 #i #H elim (cpm_inv_lref1_drops … H) -H * [ /2 width=1 by or_introl/ | /3 width=6 by ex3_3_intro, or_intror/ -| #m #K #V1 #V2 #_ #_ #_ #H destruct +| #k #K #V1 #V2 #_ #_ #_ #H destruct ] qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/s_transition/fqu.ma b/matita/matita/contribs/lambdadelta/basic_2/s_transition/fqu.ma index 043d01598..f5ef91e0c 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/s_transition/fqu.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/s_transition/fqu.ma @@ -13,8 +13,8 @@ (**************************************************************************) include "basic_2/notation/relations/supterm_6.ma". -include "basic_2/grammar/lenv.ma". -include "basic_2/grammar/genv.ma". +include "basic_2/syntax/lenv.ma". +include "basic_2/syntax/genv.ma". include "basic_2/relocation/lifts.ma". (* SUPCLOSURE ***************************************************************) diff --git a/matita/matita/contribs/lambdadelta/basic_2/s_transition/fqu_length.ma b/matita/matita/contribs/lambdadelta/basic_2/s_transition/fqu_length.ma index 9719388a5..c64b9ed5e 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/s_transition/fqu_length.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/s_transition/fqu_length.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -include "basic_2/grammar/lenv_length.ma". +include "basic_2/syntax/lenv_length.ma". include "basic_2/s_transition/fqu.ma". (* SUPCLOSURE ***************************************************************) diff --git a/matita/matita/contribs/lambdadelta/basic_2/s_transition/fqu_weight.ma b/matita/matita/contribs/lambdadelta/basic_2/s_transition/fqu_weight.ma index 8969786c9..93148750f 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/s_transition/fqu_weight.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/s_transition/fqu_weight.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -include "basic_2/grammar/cl_weight.ma". +include "basic_2/syntax/cl_weight.ma". include "basic_2/relocation/lifts_weight.ma". include "basic_2/s_transition/fqu.ma". diff --git a/matita/matita/contribs/lambdadelta/basic_2/static/aaa.ma b/matita/matita/contribs/lambdadelta/basic_2/static/aaa.ma index a57a60b24..94cfde2f5 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/static/aaa.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/static/aaa.ma @@ -13,9 +13,9 @@ (**************************************************************************) include "basic_2/notation/relations/atomicarity_4.ma". -include "basic_2/grammar/aarity.ma". -include "basic_2/grammar/lenv.ma". -include "basic_2/grammar/genv.ma". +include "basic_2/syntax/aarity.ma". +include "basic_2/syntax/lenv.ma". +include "basic_2/syntax/genv.ma". (* ATONIC ARITY ASSIGNMENT FOR TERMS ****************************************) diff --git a/matita/matita/contribs/lambdadelta/basic_2/static/frees.ma b/matita/matita/contribs/lambdadelta/basic_2/static/frees.ma index 5911dddfe..de1568f2d 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/static/frees.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/static/frees.ma @@ -14,7 +14,7 @@ include "ground_2/relocation/rtmap_sor.ma". include "basic_2/notation/relations/freestar_3.ma". -include "basic_2/grammar/lenv.ma". +include "basic_2/syntax/lenv.ma". (* CONTEXT-SENSITIVE FREE VARIABLES *****************************************) diff --git a/matita/matita/contribs/lambdadelta/basic_2/static/lfxs.ma b/matita/matita/contribs/lambdadelta/basic_2/static/lfxs.ma index 2064f1217..92888ef46 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/static/lfxs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/static/lfxs.ma @@ -14,7 +14,6 @@ include "ground_2/relocation/rtmap_id.ma". include "basic_2/notation/relations/relationstar_4.ma". -include "basic_2/grammar/ceq.ma". include "basic_2/relocation/lexs.ma". include "basic_2/static/frees.ma". diff --git a/matita/matita/contribs/lambdadelta/basic_2/static/lsubr.ma b/matita/matita/contribs/lambdadelta/basic_2/static/lsubr.ma index fe7ce2608..352626ccd 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/static/lsubr.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/static/lsubr.ma @@ -13,7 +13,7 @@ (**************************************************************************) include "basic_2/notation/relations/lrsubeqc_2.ma". -include "basic_2/grammar/lenv.ma". +include "basic_2/syntax/lenv.ma". (* RESTRICTED REFINEMENT FOR LOCAL ENVIRONMENTS *****************************) diff --git a/matita/matita/contribs/lambdadelta/basic_2/static/lsubr_length.ma b/matita/matita/contribs/lambdadelta/basic_2/static/lsubr_length.ma index e240002bf..9c6beef12 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/static/lsubr_length.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/static/lsubr_length.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -include "basic_2/grammar/lenv_length.ma". +include "basic_2/syntax/lenv_length.ma". include "basic_2/static/lsubr.ma". (* RESTRICTED REFINEMENT FOR LOCAL ENVIRONMENTS *****************************) diff --git a/matita/matita/contribs/lambdadelta/basic_2/static/sd.ma b/matita/matita/contribs/lambdadelta/basic_2/static/sd.ma deleted file mode 100644 index bf7534529..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/static/sd.ma +++ /dev/null @@ -1,124 +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/static/sh.ma". - -(* SORT DEGREE **************************************************************) - -(* sort degree specification *) -record sd (h:sh): Type[0] ≝ { - deg : relation nat; (* degree of the sort *) - deg_total: ∀s. ∃d. deg s d; (* functional relation axioms *) - deg_mono : ∀s,d1,d2. deg s d1 → deg s d2 → d1 = d2; - deg_next : ∀s,d. deg s d → deg (next h s) (⫰d) (* compatibility condition *) -}. - -(* Notable specifications ***************************************************) - -definition deg_O: relation nat ≝ λs,d. d = 0. - -definition sd_O: ∀h. sd h ≝ λh. mk_sd h deg_O …. -/2 width=2 by le_n_O_to_eq, le_n, ex_intro/ defined. - -(* Basic_2A1: includes: deg_SO_pos *) -inductive deg_SO (h:sh) (s:nat) (s0:nat): predicate nat ≝ -| deg_SO_succ : ∀n. (next h)^n s0 = s → deg_SO h s s0 (⫯n) -| deg_SO_zero: ((∃n. (next h)^n s0 = s) → ⊥) → deg_SO h s s0 0 -. - -fact deg_SO_inv_succ_aux: ∀h,s,s0,n0. deg_SO h s s0 n0 → ∀n. n0 = ⫯n → - (next h)^n s0 = s. -#h #s #s0 #n0 * -n0 -[ #n #Hn #x #H destruct // -| #_ #x #H destruct -] -qed-. - -(* Basic_2A1: was: deg_SO_inv_pos *) -lemma deg_SO_inv_succ: ∀h,s,s0,n. deg_SO h s s0 (⫯n) → (next h)^n s0 = s. -/2 width=3 by deg_SO_inv_succ_aux/ qed-. - -lemma deg_SO_refl: ∀h,s. deg_SO h s s 1. -#h #s @(deg_SO_succ … 0 ?) // -qed. - -lemma deg_SO_gt: ∀h,s1,s2. s1 < s2 → deg_SO h s1 s2 0. -#h #s1 #s2 #HK12 @deg_SO_zero * #n elim n -n normalize -[ #H destruct - elim (lt_refl_false … HK12) -| #n #_ #H - lapply (next_lt h ((next h)^n s2)) >H -H #H - lapply (transitive_lt … H HK12) -s1 #H1 - lapply (nexts_le h s2 n) #H2 - lapply (le_to_lt_to_lt … H2 H1) -h -n #H - elim (lt_refl_false … H) -] -qed. - -definition sd_SO: ∀h. nat → sd h ≝ λh,s. mk_sd h (deg_SO h s) …. -[ #s0 - lapply (nexts_dec h s0 s) * - [ * /3 width=2 by deg_SO_succ, ex_intro/ | /4 width=2 by deg_SO_zero, ex_intro/ ] -| #K0 #d1 #d2 * [ #n1 ] #H1 * [1,3: #n2 ] #H2 // - [ < H2 in H1; -H2 #H - lapply (nexts_inj … H) -H #H destruct // - | elim H1 /2 width=2 by ex_intro/ - | elim H2 /2 width=2 by ex_intro/ - ] -| #s0 #n * - [ #d #H destruct elim d -d normalize - /2 width=1 by deg_SO_gt, deg_SO_succ, next_lt/ - | #H1 @deg_SO_zero * #d #H2 destruct - @H1 -H1 @(ex_intro … (⫯d)) /2 width=1 by sym_eq/ (**) (* explicit constructor *) - ] -] -defined. - -rec definition sd_d (h:sh) (s:nat) (d:nat) on d : sd h ≝ - match d with - [ O ⇒ sd_O h - | S d ⇒ match d with - [ O ⇒ sd_SO h s - | _ ⇒ sd_d h (next h s) d - ] - ]. - -(* Basic inversion lemmas ***************************************************) - -lemma deg_inv_pred: ∀h,o,s,d. deg h o (next h s) (⫯d) → deg h o s (⫯⫯d). -#h #o #s #d #H1 -elim (deg_total h o s) #n #H0 -lapply (deg_next … H0) #H2 -lapply (deg_mono … H1 H2) -H1 -H2 #H >H >S_pred /2 width=2 by ltn_to_ltO/ -qed-. - -lemma deg_inv_prec: ∀h,o,s,n,d. deg h o ((next h)^n s) (⫯d) → deg h o s (⫯(d+n)). -#h #o #s #n elim n -n normalize /3 width=1 by deg_inv_pred/ -qed-. - -(* Basic properties *********************************************************) - -lemma deg_iter: ∀h,o,s,d,n. deg h o s d → deg h o ((next h)^n s) (d-n). -#h #o #s #d #n elim n -n normalize /3 width=1 by deg_next/ -qed. - -lemma deg_next_SO: ∀h,o,s,d. deg h o s (⫯d) → deg h o (next h s) d. -/2 width=1 by deg_next/ qed-. - -lemma sd_d_SS: ∀h,s,d. sd_d h s (⫯⫯d) = sd_d h (next h s) (⫯d). -// qed. - -lemma sd_d_correct: ∀h,d,s. deg h (sd_d h s d) s d. -#h #d elim d -d // #d elim d -d /3 width=1 by deg_inv_pred/ -qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/static/sh.ma b/matita/matita/contribs/lambdadelta/basic_2/static/sh.ma deleted file mode 100644 index d51bd1959..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/static/sh.ma +++ /dev/null @@ -1,44 +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 "ground_2/lib/arith.ma". - -(* SORT HIERARCHY ***********************************************************) - -(* sort hierarchy specification *) -record sh: Type[0] ≝ { - next : nat → nat; (* next sort in the hierarchy *) - next_lt: ∀s. s < next s (* strict monotonicity condition *) -}. - -definition sh_N: sh ≝ mk_sh S …. -// defined. - -(* Basic properties *********************************************************) - -lemma nexts_le: ∀h,s,n. s ≤ (next h)^n s. -#h #s #n elim n -n // normalize #n #IH -lapply (next_lt h ((next h)^n s)) #H -lapply (le_to_lt_to_lt … IH H) -IH -H /2 width=2 by lt_to_le/ -qed. - -lemma nexts_lt: ∀h,s,n. s < (next h)^(⫯n) s. -#h #s #n normalize -lapply (nexts_le h s n) #H -@(le_to_lt_to_lt … H) // -qed. - -axiom nexts_dec: ∀h,s1,s2. Decidable (∃n. (next h)^n s1 = s2). - -axiom nexts_inj: ∀h,s,n1,n2. (next h)^n1 s = (next h)^n2 s → n1 = n2. diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/aarity.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/aarity.ma new file mode 100644 index 000000000..7f44246c7 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/aarity.ma @@ -0,0 +1,73 @@ +(**************************************************************************) +(* ___ *) +(* ||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 *) +(* *) +(**************************************************************************) + +(* THE FORMAL SYSTEM λδ: MATITA SOURCE FILES + * Initial invocation: - Patience on me to gain peace and perfection! - + *) + +include "ground_2/lib/star.ma". +include "basic_2/notation/constructors/item0_0.ma". +include "basic_2/notation/constructors/snitem2_2.ma". + +(* ATOMIC ARITY *************************************************************) + +inductive aarity: Type[0] ≝ + | AAtom: aarity (* atomic aarity construction *) + | APair: aarity → aarity → aarity (* binary aarity construction *) +. + +interpretation "atomic arity construction (atomic)" + 'Item0 = AAtom. + +interpretation "atomic arity construction (binary)" + 'SnItem2 A1 A2 = (APair A1 A2). + +(* Basic inversion lemmas ***************************************************) + +fact destruct_apair_apair_aux: ∀A1,A2,B1,B2. ②B1.A1 = ②B2.A2 → B1 = B2 ∧ A1 = A2. +#A1 #A2 #B1 #B2 #H destruct /2 width=1 by conj/ +qed-. + +lemma discr_apair_xy_x: ∀A,B. ②B.A = B → ⊥. +#A #B elim B -B +[ #H destruct +| #Y #X #IHY #_ #H elim (destruct_apair_apair_aux … H) -H /2 width=1 by/ (**) (* destruct lemma needed *) +] +qed-. + +lemma discr_tpair_xy_y: ∀B,A. ②B. A = A → ⊥. +#B #A elim A -A +[ #H destruct +| #Y #X #_ #IHX #H elim (destruct_apair_apair_aux … H) -H /2 width=1 by/ (**) (* destruct lemma needed *) +] +qed-. + +(* Basic properties *********************************************************) + +lemma eq_aarity_dec: ∀A1,A2:aarity. Decidable (A1 = A2). +#A1 elim A1 -A1 +[ #A2 elim A2 -A2 /2 width=1 by or_introl/ + #B2 #A2 #_ #_ @or_intror #H destruct +| #B1 #A1 #IHB1 #IHA1 #A2 elim A2 -A2 + [ -IHB1 -IHA1 @or_intror #H destruct + | #B2 #A2 #_ #_ elim (IHB1 B2) -IHB1 + [ #H destruct elim (IHA1 A2) -IHA1 + [ #H destruct /2 width=1 by or_introl/ + | #HA12 @or_intror #H destruct /2 width=1 by/ + ] + | -IHA1 #HB12 @or_intror #H destruct /2 width=1 by/ + ] + ] +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/append.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/append.ma new file mode 100644 index 000000000..f78ecb55c --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/append.ma @@ -0,0 +1,69 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "ground_2/notation/functions/append_2.ma". +include "basic_2/notation/functions/snbind2_3.ma". +include "basic_2/notation/functions/snabbr_2.ma". +include "basic_2/notation/functions/snabst_2.ma". +include "basic_2/syntax/lenv.ma". + +(* APPEND FOR LOCAL ENVIRONMENTS ********************************************) + +rec definition append L K on K ≝ match K with +[ LAtom ⇒ L +| LPair K I V ⇒ (append L K).ⓑ{I}V +]. + +interpretation "append (local environment)" 'Append L1 L2 = (append L1 L2). + +interpretation "local environment tail binding construction (binary)" + 'SnBind2 I T L = (append (LPair LAtom I T) L). + +interpretation "tail abbreviation (local environment)" + 'SnAbbr T L = (append (LPair LAtom Abbr T) L). + +interpretation "tail abstraction (local environment)" + 'SnAbst L T = (append (LPair LAtom Abst T) L). + +definition d_appendable_sn: predicate (lenv→relation term) ≝ λR. + ∀K,T1,T2. R K T1 T2 → ∀L. R (L@@K) T1 T2. + +(* Basic properties *********************************************************) + +lemma append_atom: ∀L. L @@ ⋆ = L. +// qed. + +lemma append_pair: ∀I,L,K,V. L@@(K.ⓑ{I}V) = (L@@K).ⓑ{I}V. +// qed. + +lemma append_atom_sn: ∀L. ⋆@@L = L. +#L elim L -L // +#L #I #V >append_pair // +qed. + +lemma append_assoc: associative … append. +#L1 #L2 #L3 elim L3 -L3 // +qed. + +lemma append_shift: ∀L,K,I,V. L@@(ⓑ{I}V.K) = (L.ⓑ{I}V)@@K. +#L #K #I #V append_pair #H +elim (destruct_lpair_lpair_aux … H) -H /2 width=1 by/ (**) (* destruct lemma needed *) +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/append_length.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/append_length.ma new file mode 100644 index 000000000..cab2cb810 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/append_length.ma @@ -0,0 +1,116 @@ +(**************************************************************************) +(* ___ *) +(* ||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/syntax/lenv_length.ma". +include "basic_2/syntax/append.ma". + +(* APPEND FOR LOCAL ENVIRONMENTS ********************************************) + +(* Properties with length for local environments ****************************) + +lemma append_length: ∀L1,L2. |L1 @@ L2| = |L1| + |L2|. +#L1 #L2 elim L2 -L2 // +#L2 #I #V2 >append_pair >length_pair >length_pair // +qed. + +lemma ltail_length: ∀I,L,V. |ⓑ{I}V.L| = ⫯|L|. +#I #L #V >append_length // +qed. + +(* Basic_1: was just: chead_ctail *) +lemma lpair_ltail: ∀L,I,V. ∃∃J,K,W. L.ⓑ{I}V = ⓑ{J}W.K & |L| = |K|. +#L elim L -L /2 width=5 by ex2_3_intro/ +#L #Z #X #IHL #I #V elim (IHL Z X) -IHL +#J #K #W #H #_ >H -H >ltail_length +@(ex2_3_intro … J (K.ⓑ{I}V) W) /2 width=1 by length_pair/ +qed-. + +(* Advanced inversion lemmas on length for local environments ***************) + +(* Basic_2A1: was: length_inv_pos_dx_ltail *) +lemma length_inv_succ_dx_ltail: ∀L,l. |L| = ⫯l → + ∃∃I,K,V. |K| = l & L = ⓑ{I}V.K. +#Y #l #H elim (length_inv_succ_dx … H) -H #I #L #V #Hl #HLK destruct +elim (lpair_ltail L I V) /2 width=5 by ex2_3_intro/ +qed-. + +(* Basic_2A1: was: length_inv_pos_sn_ltail *) +lemma length_inv_succ_sn_ltail: ∀L,l. ⫯l = |L| → + ∃∃I,K,V. l = |K| & L = ⓑ{I}V.K. +#Y #l #H elim (length_inv_succ_sn … H) -H #I #L #V #Hl #HLK destruct +elim (lpair_ltail L I V) /2 width=5 by ex2_3_intro/ +qed-. + +(* Inversion lemmas with length for local environments **********************) + +(* Basic_2A1: was: append_inj_sn *) +lemma append_inj_length_sn: ∀K1,K2,L1,L2. L1 @@ K1 = L2 @@ K2 → |K1| = |K2| → + L1 = L2 ∧ K1 = K2. +#K1 elim K1 -K1 +[ * /2 width=1 by conj/ + #K2 #I2 #V2 #L1 #L2 #_ >length_atom >length_pair + #H destruct +| #K1 #I1 #V1 #IH * + [ #L1 #L2 #_ >length_atom >length_pair + #H destruct + | #K2 #I2 #V2 #L1 #L2 #H1 >length_pair >length_pair #H2 + elim (destruct_lpair_lpair_aux … H1) -H1 #H1 #H3 #H4 destruct (**) (* destruct lemma needed *) + elim (IH … H1) -IH -H1 /3 width=4 by conj/ + ] +] +qed-. + +(* Note: lemma 750 *) +(* Basic_2A1: was: append_inj_dx *) +lemma append_inj_length_dx: ∀K1,K2,L1,L2. L1 @@ K1 = L2 @@ K2 → |L1| = |L2| → + L1 = L2 ∧ K1 = K2. +#K1 elim K1 -K1 +[ * /2 width=1 by conj/ + #K2 #I2 #V2 #L1 #L2 >append_atom >append_pair #H destruct + >length_pair >append_length >plus_n_Sm + #H elim (plus_xSy_x_false … H) +| #K1 #I1 #V1 #IH * + [ #L1 #L2 >append_pair >append_atom #H destruct + >length_pair >append_length >plus_n_Sm #H + lapply (discr_plus_x_xy … H) -H #H destruct + | #K2 #I2 #V2 #L1 #L2 >append_pair >append_pair #H1 #H2 + elim (destruct_lpair_lpair_aux … H1) -H1 #H1 #H3 #H4 destruct (**) (* destruct lemma needed *) + elim (IH … H1) -IH -H1 /2 width=1 by conj/ + ] +] +qed-. + +(* Advanced inversion lemmas ************************************************) + +lemma append_inj_dx: ∀L,K1,K2. L@@K1 = L@@K2 → K1 = K2. +#L #K1 #K2 #H elim (append_inj_length_dx … H) -H // +qed-. + +lemma append_inv_refl_dx: ∀L,K. L@@K = L → K = ⋆. +#L #K #H elim (append_inj_dx … (⋆) … H) // +qed-. + +lemma append_inv_pair_dx: ∀I,L,K,V. L@@K = L.ⓑ{I}V → K = ⋆.ⓑ{I}V. +#I #L #K #V #H elim (append_inj_dx … (⋆.ⓑ{I}V) … H) // +qed-. + +(* Basic eliminators ********************************************************) + +(* Basic_1: was: c_tail_ind *) +lemma lenv_ind_alt: ∀R:predicate lenv. + R (⋆) → (∀I,L,T. R L → R (ⓑ{I}T.L)) → + ∀L. R L. +#R #IH1 #IH2 #L @(f_ind … length … L) -L #x #IHx * // -IH1 +#L #I #V #H destruct elim (lpair_ltail L I V) /4 width=1 by/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/cl_restricted_weight.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/cl_restricted_weight.ma new file mode 100644 index 000000000..32fd77331 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/cl_restricted_weight.ma @@ -0,0 +1,51 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/functions/weight_2.ma". +include "basic_2/syntax/lenv_weight.ma". + +(* WEIGHT OF A RESTRICTED CLOSURE *******************************************) + +definition rfw: lenv → term → ? ≝ λL,T. ♯{L} + ♯{T}. + +interpretation "weight (restricted closure)" 'Weight L T = (rfw L T). + +(* Basic properties *********************************************************) + +(* Basic_1: was: flt_shift *) +lemma rfw_shift: ∀p,I,K,V,T. ♯{K.ⓑ{I}V, T} < ♯{K, ⓑ{p,I}V.T}. +normalize /2 width=1 by monotonic_le_plus_r/ +qed. + +lemma rfw_tpair_sn: ∀I,L,V,T. ♯{L, V} < ♯{L, ②{I}V.T}. +normalize in ⊢ (?→?→?→?→?%%); // +qed. + +lemma rfw_tpair_dx: ∀I,L,V,T. ♯{L, T} < ♯{L, ②{I}V.T}. +normalize in ⊢ (?→?→?→?→?%%); // +qed. + +lemma rfw_lpair_sn: ∀I,L,V,T. ♯{L, V} < ♯{L.ⓑ{I}V, T}. +normalize /3 width=1 by monotonic_lt_plus_l, monotonic_le_plus_r/ +qed. + +lemma rfw_lpair_dx: ∀I,L,V,T. ♯{L, T} < ♯{L.ⓑ{I}V, T}. +normalize /3 width=1 by monotonic_lt_plus_l, monotonic_le_plus_r/ +qed. + +(* Basic_1: removed theorems 7: + flt_thead_sx flt_thead_dx flt_trans + flt_arith0 flt_arith1 flt_arith2 flt_wf_ind +*) +(* Basic_1: removed local theorems 1: q_ind *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/cl_weight.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/cl_weight.ma new file mode 100644 index 000000000..b93368814 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/cl_weight.ma @@ -0,0 +1,49 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/functions/weight_3.ma". +include "basic_2/syntax/lenv_weight.ma". +include "basic_2/syntax/genv.ma". + +(* WEIGHT OF A CLOSURE ******************************************************) + +(* activate genv *) +definition fw: genv → lenv → term → ? ≝ λG,L,T. ♯{L} + ♯{T}. + +interpretation "weight (closure)" 'Weight G L T = (fw G L T). + +(* Basic properties *********************************************************) + +(* Basic_1: was: flt_shift *) +lemma fw_shift: ∀p,I,G,K,V,T. ♯{G, K.ⓑ{I}V, T} < ♯{G, K, ⓑ{p,I}V.T}. +normalize /2 width=1 by monotonic_le_plus_r/ +qed. + +lemma fw_tpair_sn: ∀I,G,L,V,T. ♯{G, L, V} < ♯{G, L, ②{I}V.T}. +normalize in ⊢ (?→?→?→?→?→?%%); // +qed. + +lemma fw_tpair_dx: ∀I,G,L,V,T. ♯{G, L, T} < ♯{G, L, ②{I}V.T}. +normalize in ⊢ (?→?→?→?→?→?%%); // +qed. + +lemma fw_lpair_sn: ∀I,G,L,V,T. ♯{G, L, V} < ♯{G, L.ⓑ{I}V, T}. +normalize /3 width=1 by monotonic_lt_plus_l, monotonic_le_plus_r/ +qed. + +(* Basic_1: removed theorems 7: + flt_thead_sx flt_thead_dx flt_trans + flt_arith0 flt_arith1 flt_arith2 flt_wf_ind +*) +(* Basic_1: removed local theorems 1: q_ind *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/deq.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/deq.ma new file mode 100644 index 000000000..a14f7e3d8 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/deq.ma @@ -0,0 +1,104 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/lazyeq_4.ma". +include "basic_2/syntax/item_sd.ma". +include "basic_2/syntax/lenv.ma". + +(* DEGREE-BASED EQUIVALENCE ON TERMS ****************************************) + +inductive deq (h) (o): relation term ≝ +| deq_sort: ∀s1,s2,d. deg h o s1 d → deg h o s2 d → deq h o (⋆s1) (⋆s2) +| deq_lref: ∀i. deq h o (#i) (#i) +| deq_gref: ∀l. deq h o (§l) (§l) +| deq_pair: ∀I,V1,V2,T1,T2. deq h o V1 V2 → deq h o T1 T2 → deq h o (②{I}V1.T1) (②{I}V2.T2) +. + +interpretation + "degree-based equivalence (terms)" + 'LazyEq h o T1 T2 = (deq h o T1 T2). + +definition cdeq: ∀h. sd h → relation3 lenv term term ≝ + λh,o,L. deq h o. + +(* Basic properties *********************************************************) + +lemma deq_refl: ∀h,o. reflexive … (deq h o). +#h #o #T elim T -T /2 width=1 by deq_pair/ +* /2 width=1 by deq_lref, deq_gref/ +#s elim (deg_total h o s) /2 width=3 by deq_sort/ +qed. + +lemma deq_sym: ∀h,o. symmetric … (deq h o). +#h #o #T1 #T2 #H elim H -T1 -T2 +/2 width=3 by deq_sort, deq_lref, deq_gref, deq_pair/ +qed-. + +(* Basic inversion lemmas ***************************************************) + +fact deq_inv_sort1_aux: ∀h,o,X,Y. X ≡[h, o] Y → ∀s1. X = ⋆s1 → + ∃∃s2,d. deg h o s1 d & deg h o s2 d & Y = ⋆s2. +#h #o #X #Y * -X -Y +[ #s1 #s2 #d #Hs1 #Hs2 #s #H destruct /2 width=5 by ex3_2_intro/ +| #i #s #H destruct +| #l #s #H destruct +| #I #V1 #V2 #T1 #T2 #_ #_ #s #H destruct +] +qed-. + +lemma deq_inv_sort1: ∀h,o,Y,s1. ⋆s1 ≡[h, o] Y → + ∃∃s2,d. deg h o s1 d & deg h o s2 d & Y = ⋆s2. +/2 width=3 by deq_inv_sort1_aux/ qed-. + +fact deq_inv_lref1_aux: ∀h,o,X,Y. X ≡[h, o] Y → ∀i. X = #i → Y = #i. +#h #o #X #Y * -X -Y // +[ #s1 #s2 #d #_ #_ #j #H destruct +| #I #V1 #V2 #T1 #T2 #_ #_ #j #H destruct +] +qed-. + +lemma deq_inv_lref1: ∀h,o,Y,i. #i ≡[h, o] Y → Y = #i. +/2 width=5 by deq_inv_lref1_aux/ qed-. + +fact deq_inv_gref1_aux: ∀h,o,X,Y. X ≡[h, o] Y → ∀l. X = §l → Y = §l. +#h #o #X #Y * -X -Y // +[ #s1 #s2 #d #_ #_ #k #H destruct +| #I #V1 #V2 #T1 #T2 #_ #_ #k #H destruct +] +qed-. + +lemma deq_inv_gref1: ∀h,o,Y,l. §l ≡[h, o] Y → Y = §l. +/2 width=5 by deq_inv_gref1_aux/ qed-. + +fact deq_inv_pair1_aux: ∀h,o,X,Y. X ≡[h, o] Y → ∀I,V1,T1. X = ②{I}V1.T1 → + ∃∃V2,T2. V1 ≡[h, o] V2 & T1 ≡[h, o] T2 & Y = ②{I}V2.T2. +#h #o #X #Y * -X -Y +[ #s1 #s2 #d #_ #_ #J #W1 #U1 #H destruct +| #i #J #W1 #U1 #H destruct +| #l #J #W1 #U1 #H destruct +| #I #V1 #V2 #T1 #T2 #HV #HT #J #W1 #U1 #H destruct /2 width=5 by ex3_2_intro/ +] +qed-. + +lemma deq_inv_pair1: ∀h,o,I,V1,T1,Y. ②{I}V1.T1 ≡[h, o] Y → + ∃∃V2,T2. V1 ≡[h, o] V2 & T1 ≡[h, o] T2 & Y = ②{I}V2.T2. +/2 width=3 by deq_inv_pair1_aux/ qed-. + +(* Advanced inversion lemmas ************************************************) + +lemma deq_inv_sort1_deg: ∀h,o,Y,s1. ⋆s1 ≡[h, o] Y → ∀d. deg h o s1 d → + ∃∃s2. deg h o s2 d & Y = ⋆s2. +#h #o #Y #s1 #H #d #Hs1 elim (deq_inv_sort1 … H) -H +#s2 #x #Hx <(deg_mono h o … Hx … Hs1) -s1 -d /2 width=3 by ex2_intro/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/deq_deq.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/deq_deq.ma new file mode 100644 index 000000000..b69e2dc4e --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/deq_deq.ma @@ -0,0 +1,30 @@ +(**************************************************************************) +(* ___ *) +(* ||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/syntax/deq.ma". + +(* DEGREE-BASED EQUIVALENCE ON TERMS ****************************************) + +(* Main properties **********************************************************) + +theorem deq_trans: ∀h,o. Transitive … (deq h o). +#h #o #T1 #T #H elim H -T1 -T +[ #s1 #s #d #Hs1 #Hs #X #H + elim (deq_inv_sort1_deg … H … Hs) -s /2 width=3 by deq_sort/ +| #i1 #i #H <(deq_inv_lref1 … H) -H // +| #l1 #l #H <(deq_inv_gref1 … H) -H // +| #I #V1 #V #T1 #T #_ #_ #IHV #IHT #X #H destruct + elim (deq_inv_pair1 … H) -H /3 width=1 by deq_pair/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/genv.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/genv.ma new file mode 100644 index 000000000..8483917c4 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/genv.ma @@ -0,0 +1,41 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "ground_2/lib/list2.ma". +include "basic_2/notation/constructors/star_0.ma". +include "basic_2/notation/constructors/dxbind2_3.ma". +include "basic_2/notation/constructors/dxabbr_2.ma". +include "basic_2/notation/constructors/dxabst_2.ma". +include "basic_2/syntax/term.ma". + +(* GLOBAL ENVIRONMENTS ******************************************************) + +(* global environments *) +definition genv ≝ list2 bind2 term. + +interpretation "sort (global environment)" + 'Star = (nil2 bind2 term). + +interpretation "global environment binding construction (binary)" + 'DxBind2 L I T = (cons2 bind2 term I T L). + +interpretation "abbreviation (global environment)" + 'DxAbbr L T = (cons2 bind2 term Abbr T L). + +interpretation "abstraction (global environment)" + 'DxAbst L T = (cons2 bind2 term Abst T L). + +(* Basic properties *********************************************************) + +axiom eq_genv_dec: ∀G1,G2:genv. Decidable (G1 = G2). diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/item.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/item.ma new file mode 100644 index 000000000..ab861be57 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/item.ma @@ -0,0 +1,88 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "ground_2/lib/bool.ma". +include "ground_2/lib/arith.ma". + +(* ITEMS ********************************************************************) + +(* atomic items *) +inductive item0: Type[0] ≝ + | Sort: nat → item0 (* sort: starting at 0 *) + | LRef: nat → item0 (* reference by index: starting at 0 *) + | GRef: nat → item0 (* reference by position: starting at 0 *) +. + +(* binary binding items *) +inductive bind2: Type[0] ≝ + | Abbr: bind2 (* abbreviation *) + | Abst: bind2 (* abstraction *) +. + +(* binary non-binding items *) +inductive flat2: Type[0] ≝ + | Appl: flat2 (* application *) + | Cast: flat2 (* explicit type annotation *) +. + +(* binary items *) +inductive item2: Type[0] ≝ + | Bind2: bool → bind2 → item2 (* polarized binding item *) + | Flat2: flat2 → item2 (* non-binding item *) +. + +(* Basic inversion lemmas ***************************************************) + +fact destruct_sort_sort_aux: ∀s1,s2. Sort s1 = Sort s2 → s1 = s2. +#s1 #s2 #H destruct // +qed-. + +(* Basic properties *********************************************************) + +lemma eq_item0_dec: ∀I1,I2:item0. Decidable (I1 = I2). +* #i1 * #i2 [2,3,4,6,7,8: @or_intror #H destruct ] +[2: elim (eq_nat_dec i1 i2) |1,3: elim (eq_nat_dec i1 i2) ] /2 width=1 by or_introl/ +#Hni12 @or_intror #H destruct /2 width=1 by/ +qed-. + +(* Basic_1: was: bind_dec *) +lemma eq_bind2_dec: ∀I1,I2:bind2. Decidable (I1 = I2). +* * /2 width=1 by or_introl/ +@or_intror #H destruct +qed-. + +(* Basic_1: was: flat_dec *) +lemma eq_flat2_dec: ∀I1,I2:flat2. Decidable (I1 = I2). +* * /2 width=1 by or_introl/ +@or_intror #H destruct +qed-. + +(* Basic_1: was: kind_dec *) +lemma eq_item2_dec: ∀I1,I2:item2. Decidable (I1 = I2). +* [ #p1 ] #I1 * [1,3: #p2 ] #I2 +[2,3: @or_intror #H destruct +| elim (eq_bool_dec p1 p2) #Hp + [ elim (eq_bind2_dec I1 I2) /2 width=1 by or_introl/ #HI ] + @or_intror #H destruct /2 width=1 by/ +| elim (eq_flat2_dec I1 I2) /2 width=1 by or_introl/ #HI + @or_intror #H destruct /2 width=1 by/ +] +qed-. + +(* Basic_1: removed theorems 21: + s_S s_plus s_plus_sym s_minus minus_s_s s_le s_lt s_inj s_inc + s_arith0 s_arith1 + r_S r_plus r_plus_sym r_minus r_dis s_r r_arith0 r_arith1 + not_abbr_abst bind_dec_not +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/item_sd.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/item_sd.ma new file mode 100644 index 000000000..3387066d3 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/item_sd.ma @@ -0,0 +1,124 @@ +(**************************************************************************) +(* ___ *) +(* ||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/syntax/item_sh.ma". + +(* SORT DEGREE **************************************************************) + +(* sort degree specification *) +record sd (h:sh): Type[0] ≝ { + deg : relation nat; (* degree of the sort *) + deg_total: ∀s. ∃d. deg s d; (* functional relation axioms *) + deg_mono : ∀s,d1,d2. deg s d1 → deg s d2 → d1 = d2; + deg_next : ∀s,d. deg s d → deg (next h s) (⫰d) (* compatibility condition *) +}. + +(* Notable specifications ***************************************************) + +definition deg_O: relation nat ≝ λs,d. d = 0. + +definition sd_O: ∀h. sd h ≝ λh. mk_sd h deg_O …. +/2 width=2 by le_n_O_to_eq, le_n, ex_intro/ defined. + +(* Basic_2A1: includes: deg_SO_pos *) +inductive deg_SO (h:sh) (s:nat) (s0:nat): predicate nat ≝ +| deg_SO_succ : ∀n. (next h)^n s0 = s → deg_SO h s s0 (⫯n) +| deg_SO_zero: ((∃n. (next h)^n s0 = s) → ⊥) → deg_SO h s s0 0 +. + +fact deg_SO_inv_succ_aux: ∀h,s,s0,n0. deg_SO h s s0 n0 → ∀n. n0 = ⫯n → + (next h)^n s0 = s. +#h #s #s0 #n0 * -n0 +[ #n #Hn #x #H destruct // +| #_ #x #H destruct +] +qed-. + +(* Basic_2A1: was: deg_SO_inv_pos *) +lemma deg_SO_inv_succ: ∀h,s,s0,n. deg_SO h s s0 (⫯n) → (next h)^n s0 = s. +/2 width=3 by deg_SO_inv_succ_aux/ qed-. + +lemma deg_SO_refl: ∀h,s. deg_SO h s s 1. +#h #s @(deg_SO_succ … 0 ?) // +qed. + +lemma deg_SO_gt: ∀h,s1,s2. s1 < s2 → deg_SO h s1 s2 0. +#h #s1 #s2 #HK12 @deg_SO_zero * #n elim n -n normalize +[ #H destruct + elim (lt_refl_false … HK12) +| #n #_ #H + lapply (next_lt h ((next h)^n s2)) >H -H #H + lapply (transitive_lt … H HK12) -s1 #H1 + lapply (nexts_le h s2 n) #H2 + lapply (le_to_lt_to_lt … H2 H1) -h -n #H + elim (lt_refl_false … H) +] +qed. + +definition sd_SO: ∀h. nat → sd h ≝ λh,s. mk_sd h (deg_SO h s) …. +[ #s0 + lapply (nexts_dec h s0 s) * + [ * /3 width=2 by deg_SO_succ, ex_intro/ | /4 width=2 by deg_SO_zero, ex_intro/ ] +| #K0 #d1 #d2 * [ #n1 ] #H1 * [1,3: #n2 ] #H2 // + [ < H2 in H1; -H2 #H + lapply (nexts_inj … H) -H #H destruct // + | elim H1 /2 width=2 by ex_intro/ + | elim H2 /2 width=2 by ex_intro/ + ] +| #s0 #n * + [ #d #H destruct elim d -d normalize + /2 width=1 by deg_SO_gt, deg_SO_succ, next_lt/ + | #H1 @deg_SO_zero * #d #H2 destruct + @H1 -H1 @(ex_intro … (⫯d)) /2 width=1 by sym_eq/ (**) (* explicit constructor *) + ] +] +defined. + +rec definition sd_d (h:sh) (s:nat) (d:nat) on d : sd h ≝ + match d with + [ O ⇒ sd_O h + | S d ⇒ match d with + [ O ⇒ sd_SO h s + | _ ⇒ sd_d h (next h s) d + ] + ]. + +(* Basic inversion lemmas ***************************************************) + +lemma deg_inv_pred: ∀h,o,s,d. deg h o (next h s) (⫯d) → deg h o s (⫯⫯d). +#h #o #s #d #H1 +elim (deg_total h o s) #n #H0 +lapply (deg_next … H0) #H2 +lapply (deg_mono … H1 H2) -H1 -H2 #H >H >S_pred /2 width=2 by ltn_to_ltO/ +qed-. + +lemma deg_inv_prec: ∀h,o,s,n,d. deg h o ((next h)^n s) (⫯d) → deg h o s (⫯(d+n)). +#h #o #s #n elim n -n normalize /3 width=1 by deg_inv_pred/ +qed-. + +(* Basic properties *********************************************************) + +lemma deg_iter: ∀h,o,s,d,n. deg h o s d → deg h o ((next h)^n s) (d-n). +#h #o #s #d #n elim n -n normalize /3 width=1 by deg_next/ +qed. + +lemma deg_next_SO: ∀h,o,s,d. deg h o s (⫯d) → deg h o (next h s) d. +/2 width=1 by deg_next/ qed-. + +lemma sd_d_SS: ∀h,s,d. sd_d h s (⫯⫯d) = sd_d h (next h s) (⫯d). +// qed. + +lemma sd_d_correct: ∀h,d,s. deg h (sd_d h s d) s d. +#h #d elim d -d // #d elim d -d /3 width=1 by deg_inv_pred/ +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/item_sh.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/item_sh.ma new file mode 100644 index 000000000..d51bd1959 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/item_sh.ma @@ -0,0 +1,44 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "ground_2/lib/arith.ma". + +(* SORT HIERARCHY ***********************************************************) + +(* sort hierarchy specification *) +record sh: Type[0] ≝ { + next : nat → nat; (* next sort in the hierarchy *) + next_lt: ∀s. s < next s (* strict monotonicity condition *) +}. + +definition sh_N: sh ≝ mk_sh S …. +// defined. + +(* Basic properties *********************************************************) + +lemma nexts_le: ∀h,s,n. s ≤ (next h)^n s. +#h #s #n elim n -n // normalize #n #IH +lapply (next_lt h ((next h)^n s)) #H +lapply (le_to_lt_to_lt … IH H) -IH -H /2 width=2 by lt_to_le/ +qed. + +lemma nexts_lt: ∀h,s,n. s < (next h)^(⫯n) s. +#h #s #n normalize +lapply (nexts_le h s n) #H +@(le_to_lt_to_lt … H) // +qed. + +axiom nexts_dec: ∀h,s1,s2. Decidable (∃n. (next h)^n s1 = s2). + +axiom nexts_inj: ∀h,s,n1,n2. (next h)^n1 s = (next h)^n2 s → n1 = n2. diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/lenv.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/lenv.ma new file mode 100644 index 000000000..cfefa7fd8 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/lenv.ma @@ -0,0 +1,75 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/constructors/star_0.ma". +include "basic_2/notation/constructors/dxbind2_3.ma". +include "basic_2/notation/constructors/dxabbr_2.ma". +include "basic_2/notation/constructors/dxabst_2.ma". +include "basic_2/syntax/term.ma". + +(* LOCAL ENVIRONMENTS *******************************************************) + +(* local environments *) +inductive lenv: Type[0] ≝ +| LAtom: lenv (* empty *) +| LPair: lenv → bind2 → term → lenv (* binary binding construction *) +. + +interpretation "sort (local environment)" + 'Star = LAtom. + +interpretation "local environment binding construction (binary)" + 'DxBind2 L I T = (LPair L I T). + +interpretation "abbreviation (local environment)" + 'DxAbbr L T = (LPair L Abbr T). + +interpretation "abstraction (local environment)" + 'DxAbst L T = (LPair L Abst T). + +definition ceq: relation3 lenv term term ≝ λL,T1,T2. T1 = T2. + +definition cfull: relation3 lenv term term ≝ λL,T1,T2. ⊤. + +(* Basic properties *********************************************************) + +lemma eq_lenv_dec: ∀L1,L2:lenv. Decidable (L1 = L2). +#L1 elim L1 -L1 [| #L1 #I1 #V1 #IHL1 ] * [2,4: #L2 #I2 #V2 ] +[1,4: @or_intror #H destruct +| elim (eq_bind2_dec I1 I2) #HI + [ elim (eq_term_dec V1 V2) #HV + [ elim (IHL1 L2) -IHL1 /2 width=1 by or_introl/ #HL ] + ] + @or_intror #H destruct /2 width=1 by/ +| /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 → + ∧∧L1 = L2 & I1 = I2 & V1 = V2. +#I1 #I2 #L1 #L2 #V1 #V2 #H destruct /2 width=1 by and3_intro/ +qed-. + +lemma discr_lpair_x_xy: ∀I,V,L. L = L.ⓑ{I}V → ⊥. +#I #V #L elim L -L +[ #H destruct +| #L #J #W #IHL #H + elim (destruct_lpair_lpair_aux … H) -H #H1 #H2 #H3 destruct /2 width=1 by/ (**) (* destruct lemma needed *) +] +qed-. + +lemma discr_lpair_xy_x: ∀I,V,L. L.ⓑ{I}V = L→ ⊥. +/2 width=4 by discr_lpair_x_xy/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/lenv_length.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/lenv_length.ma new file mode 100644 index 000000000..41e09d5d5 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/lenv_length.ma @@ -0,0 +1,58 @@ +(**************************************************************************) +(* ___ *) +(* ||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/syntax/lenv.ma". + +(* LENGTH OF A LOCAL ENVIRONMENT ********************************************) + +rec definition length L ≝ match L with +[ LAtom ⇒ 0 +| LPair L _ _ ⇒ ⫯(length L) +]. + +interpretation "length (local environment)" 'card L = (length L). + +(* Basic properties *********************************************************) + +lemma length_atom: |⋆| = 0. +// qed. + +lemma length_pair: ∀I,L,V. |L.ⓑ{I}V| = ⫯|L|. +// qed. + +(* Basic inversion lemmas ***************************************************) + +lemma length_inv_zero_dx: ∀L. |L| = 0 → L = ⋆. +* // #L #I #V >length_pair +#H destruct +qed-. + +lemma length_inv_zero_sn: ∀L. 0 = |L| → L = ⋆. +/2 width=1 by length_inv_zero_dx/ qed-. + +(* Basic_2A1: was: length_inv_pos_dx *) +lemma length_inv_succ_dx: ∀n,L. |L| = ⫯n → + ∃∃I,K,V. |K| = n & L = K. ⓑ{I}V. +#n * [ >length_atom #H destruct ] +#L #I #V >length_pair /3 width=5 by ex2_3_intro, injective_S/ +qed-. + +(* Basic_2A1: was: length_inv_pos_sn *) +lemma length_inv_succ_sn: ∀n,L. ⫯n = |L| → + ∃∃I,K,V. n = |K| & L = K. ⓑ{I}V. +#l #L #H lapply (sym_eq ??? H) -H +#H elim (length_inv_succ_dx … H) -H /2 width=5 by ex2_3_intro/ +qed-. + +(* Basic_2A1: removed theorems 1: length_inj *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/lenv_weight.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/lenv_weight.ma new file mode 100644 index 000000000..1a61b7d4f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/lenv_weight.ma @@ -0,0 +1,34 @@ +(**************************************************************************) +(* ___ *) +(* ||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/syntax/term_weight.ma". +include "basic_2/syntax/lenv.ma". + +(* WEIGHT OF A LOCAL ENVIRONMENT ********************************************) + +rec definition lw L ≝ match L with +[ LAtom ⇒ 0 +| LPair L _ V ⇒ lw L + ♯{V} +]. + +interpretation "weight (local environment)" 'Weight L = (lw L). + +(* Basic properties *********************************************************) + +lemma lw_pair: ∀I,L,V. ♯{L} < ♯{L.ⓑ{I}V}. +/3 width=1 by lt_plus_to_minus_r, monotonic_lt_plus_r/ qed. + +(* Basic_1: removed theorems 4: clt_cong clt_head clt_thead clt_wf_ind *) +(* Basic_1: removed local theorems 1: clt_wf__q_ind *) +(* Basic_1: note: clt_thead should be renamed clt_ctail *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/term.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/term.ma new file mode 100644 index 000000000..ccbb494dd --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/term.ma @@ -0,0 +1,153 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/constructors/item0_1.ma". +include "basic_2/notation/constructors/snitem2_3.ma". +include "basic_2/notation/constructors/snbind2_4.ma". +include "basic_2/notation/constructors/snbind2pos_3.ma". +include "basic_2/notation/constructors/snbind2neg_3.ma". +include "basic_2/notation/constructors/snflat2_3.ma". +include "basic_2/notation/constructors/star_1.ma". +include "basic_2/notation/constructors/lref_1.ma". +include "basic_2/notation/constructors/gref_1.ma". +include "basic_2/notation/constructors/snabbr_3.ma". +include "basic_2/notation/constructors/snabbrpos_2.ma". +include "basic_2/notation/constructors/snabbrneg_2.ma". +include "basic_2/notation/constructors/snabst_3.ma". +include "basic_2/notation/constructors/snabstpos_2.ma". +include "basic_2/notation/constructors/snabstneg_2.ma". +include "basic_2/notation/constructors/snappl_2.ma". +include "basic_2/notation/constructors/sncast_2.ma". +include "basic_2/syntax/item.ma". + +(* TERMS ********************************************************************) + +(* terms *) +inductive term: Type[0] ≝ + | TAtom: item0 → term (* atomic item construction *) + | TPair: item2 → term → term → term (* binary item construction *) +. + +interpretation "term construction (atomic)" + 'Item0 I = (TAtom I). + +interpretation "term construction (binary)" + 'SnItem2 I T1 T2 = (TPair I T1 T2). + +interpretation "term binding construction (binary)" + 'SnBind2 p I T1 T2 = (TPair (Bind2 p I) T1 T2). + +interpretation "term positive binding construction (binary)" + 'SnBind2Pos I T1 T2 = (TPair (Bind2 true I) T1 T2). + +interpretation "term negative binding construction (binary)" + 'SnBind2Neg I T1 T2 = (TPair (Bind2 false I) T1 T2). + +interpretation "term flat construction (binary)" + 'SnFlat2 I T1 T2 = (TPair (Flat2 I) T1 T2). + +interpretation "sort (term)" + 'Star s = (TAtom (Sort s)). + +interpretation "local reference (term)" + 'LRef i = (TAtom (LRef i)). + +interpretation "global reference (term)" + 'GRef l = (TAtom (GRef l)). + +interpretation "abbreviation (term)" + 'SnAbbr p T1 T2 = (TPair (Bind2 p Abbr) T1 T2). + +interpretation "positive abbreviation (term)" + 'SnAbbrPos T1 T2 = (TPair (Bind2 true Abbr) T1 T2). + +interpretation "negative abbreviation (term)" + 'SnAbbrNeg T1 T2 = (TPair (Bind2 false Abbr) T1 T2). + +interpretation "abstraction (term)" + 'SnAbst p T1 T2 = (TPair (Bind2 p Abst) T1 T2). + +interpretation "positive abstraction (term)" + 'SnAbstPos T1 T2 = (TPair (Bind2 true Abst) T1 T2). + +interpretation "negative abstraction (term)" + 'SnAbstNeg T1 T2 = (TPair (Bind2 false Abst) T1 T2). + +interpretation "application (term)" + 'SnAppl T1 T2 = (TPair (Flat2 Appl) T1 T2). + +interpretation "native type annotation (term)" + 'SnCast T1 T2 = (TPair (Flat2 Cast) T1 T2). + +(* Basic properties *********************************************************) + +(* Basic_1: was: term_dec *) +lemma eq_term_dec: ∀T1,T2:term. Decidable (T1 = T2). +#T1 elim T1 -T1 #I1 [| #V1 #T1 #IHV1 #IHT1 ] * #I2 [2,4: #V2 #T2 ] +[1,4: @or_intror #H destruct +| elim (eq_item2_dec I1 I2) #HI + [ elim (IHV1 V2) -IHV1 #HV + [ elim (IHT1 T2) -IHT1 /2 width=1 by or_introl/ #HT ] + ] + @or_intror #H destruct /2 width=1 by/ +| elim (eq_item0_dec I1 I2) /2 width=1 by or_introl/ #HI + @or_intror #H destruct /2 width=1 by/ +] +qed-. + +(* Basic inversion lemmas ***************************************************) + +fact destruct_tatom_tatom_aux: ∀I1,I2. ⓪{I1} = ⓪{I2} → I1 = I2. +#I1 #I2 #H destruct // +qed-. + +fact destruct_tpair_tpair_aux: ∀I1,I2,T1,T2,V1,V2. ②{I1}T1.V1 = ②{I2}T2.V2 → + ∧∧T1 = T2 & I1 = I2 & V1 = V2. +#I1 #I2 #T1 #T2 #V1 #V2 #H destruct /2 width=1 by and3_intro/ +qed-. + +lemma discr_tpair_xy_x: ∀I,T,V. ②{I}V.T = V → ⊥. +#I #T #V elim V -V +[ #J #H destruct +| #J #W #U #IHW #_ #H elim (destruct_tpair_tpair_aux … H) -H /2 width=1 by/ (**) (* destruct lemma needed *) +] +qed-. + +(* Basic_1: was: thead_x_y_y *) +lemma discr_tpair_xy_y: ∀I,V,T. ②{I}V.T = T → ⊥. +#I #V #T elim T -T +[ #J #H destruct +| #J #W #U #_ #IHU #H elim (destruct_tpair_tpair_aux … H) -H /2 width=1 by/ (**) (* destruct lemma needed *) +] +qed-. + +lemma eq_false_inv_tpair_sn: ∀I,V1,T1,V2,T2. + (②{I}V1.T1 = ②{I}V2.T2 → ⊥) → + (V1 = V2 → ⊥) ∨ (V1 = V2 ∧ (T1 = T2 → ⊥)). +#I #V1 #T1 #V2 #T2 #H +elim (eq_term_dec V1 V2) /3 width=1 by or_introl/ #HV12 destruct +@or_intror @conj // #HT12 destruct /2 width=1 by/ +qed-. + +lemma eq_false_inv_tpair_dx: ∀I,V1,T1,V2,T2. + (②{I} V1. T1 = ②{I}V2.T2 → ⊥) → + (T1 = T2 → ⊥) ∨ (T1 = T2 ∧ (V1 = V2 → ⊥)). +#I #V1 #T1 #V2 #T2 #H +elim (eq_term_dec T1 T2) /3 width=1 by or_introl/ #HT12 destruct +@or_intror @conj // #HT12 destruct /2 width=1 by/ +qed-. + +(* Basic_1: removed theorems 3: + not_void_abst not_abbr_void not_abst_void +*) diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/term_simple.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/term_simple.ma new file mode 100644 index 000000000..50e259544 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/term_simple.ma @@ -0,0 +1,42 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/simple_1.ma". +include "basic_2/syntax/term.ma". + +(* SIMPLE (NEUTRAL) TERMS ***************************************************) + +inductive simple: predicate term ≝ + | simple_atom: ∀I. simple (⓪{I}) + | simple_flat: ∀I,V,T. simple (ⓕ{I} V. T) +. + +interpretation "simple (term)" 'Simple T = (simple T). + +(* Basic inversion lemmas ***************************************************) + +fact simple_inv_bind_aux: ∀T. 𝐒⦃T⦄ → ∀p,J,W,U. T = ⓑ{p,J}W.U → ⊥. +#T * -T +[ #I #p #J #W #U #H destruct +| #I #V #T #a #J #W #U #H destruct +] +qed-. + +lemma simple_inv_bind: ∀p,I,V,T. 𝐒⦃ⓑ{p,I} V. T⦄ → ⊥. +/2 width=7 by simple_inv_bind_aux/ qed-. + +lemma simple_inv_pair: ∀I,V,T. 𝐒⦃②{I}V.T⦄ → ∃J. I = Flat2 J. +* /2 width=2 by ex_intro/ +#p #I #V #T #H elim (simple_inv_bind … H) +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/term_vector.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/term_vector.ma new file mode 100644 index 000000000..1de2ef352 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/term_vector.ma @@ -0,0 +1,42 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "ground_2/lib/list.ma". +include "basic_2/notation/functions/snapplvector_2.ma". +include "basic_2/syntax/term_simple.ma". + +(* TERMS ********************************************************************) + +rec definition applv Vs T on Vs ≝ + match Vs with + [ nil ⇒ T + | cons hd tl ⇒ ⓐhd. (applv tl T) + ]. + +interpretation "application to vector (term)" + 'SnApplVector Vs T = (applv Vs T). + +(* Basic properties *********************************************************) + +lemma applv_nil: ∀T. Ⓐ◊.T = T. +// qed. + +lemma applv_cons: ∀V,Vs,T. ⒶV@Vs.T = ⓐV.ⒶVs.T. +// qed. + +(* Properties with simple terms *********************************************) + +lemma applv_simple: ∀T,Vs. 𝐒⦃T⦄ → 𝐒⦃ⒶVs.T⦄. +#T * // +qed. diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/term_weight.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/term_weight.ma new file mode 100644 index 000000000..9076a9b2f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/term_weight.ma @@ -0,0 +1,38 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/functions/weight_1.ma". +include "basic_2/syntax/term.ma". + +(* WEIGHT OF A TERM *********************************************************) + +rec definition tw T ≝ match T with +[ TAtom _ ⇒ 1 +| TPair _ V T ⇒ tw V + tw T + 1 +]. + +interpretation "weight (term)" 'Weight T = (tw T). + +(* Basic properties *********************************************************) + +(* Basic_1: was: tweight_lt *) +lemma tw_pos: ∀T. 1 ≤ ♯{T}. +#T elim T -T // +qed. + +(* Basic_1: removed theorems 11: + wadd_le wadd_lt wadd_O weight_le weight_eq weight_add_O + weight_add_S tlt_trans tlt_head_sx tlt_head_dx tlt_wf_ind +*) +(* Basic_1: removed local theorems 1: q_ind *) diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/tsts.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/tsts.ma new file mode 100644 index 000000000..281f7fc81 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/tsts.ma @@ -0,0 +1,108 @@ +(**************************************************************************) +(* ___ *) +(* ||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/notation/relations/topiso_2.ma". +include "basic_2/syntax/term_simple.ma". + +(* SAME TOP TERM STRUCTURE **************************************************) + +inductive tsts: relation term ≝ + | tsts_atom: ∀I. tsts (⓪{I}) (⓪{I}) + | tsts_pair: ∀I,V1,V2,T1,T2. tsts (②{I}V1.T1) (②{I}V2.T2) +. + +interpretation "same top structure (term)" 'TopIso T1 T2 = (tsts T1 T2). + +(* Basic inversion lemmas ***************************************************) + +fact tsts_inv_atom1_aux: ∀T1,T2. T1 ≂ T2 → ∀I. T1 = ⓪{I} → T2 = ⓪{I}. +#T1 #T2 * -T1 -T2 // +#J #V1 #V2 #T1 #T2 #I #H destruct +qed-. + +(* Basic_1: was: iso_gen_sort iso_gen_lref *) +lemma tsts_inv_atom1: ∀I,T2. ⓪{I} ≂ T2 → T2 = ⓪{I}. +/2 width=3 by tsts_inv_atom1_aux/ qed-. + +fact tsts_inv_pair1_aux: ∀T1,T2. T1 ≂ T2 → ∀I,W1,U1. T1 = ②{I}W1.U1 → + ∃∃W2,U2. T2 = ②{I}W2. U2. +#T1 #T2 * -T1 -T2 +[ #J #I #W1 #U1 #H destruct +| #J #V1 #V2 #T1 #T2 #I #W1 #U1 #H destruct /2 width=3 by ex1_2_intro/ +] +qed-. + +(* Basic_1: was: iso_gen_head *) +lemma tsts_inv_pair1: ∀I,W1,U1,T2. ②{I}W1.U1 ≂ T2 → + ∃∃W2,U2. T2 = ②{I}W2. U2. +/2 width=5 by tsts_inv_pair1_aux/ qed-. + +fact tsts_inv_atom2_aux: ∀T1,T2. T1 ≂ T2 → ∀I. T2 = ⓪{I} → T1 = ⓪{I}. +#T1 #T2 * -T1 -T2 // +#J #V1 #V2 #T1 #T2 #I #H destruct +qed-. + +lemma tsts_inv_atom2: ∀I,T1. T1 ≂ ⓪{I} → T1 = ⓪{I}. +/2 width=3 by tsts_inv_atom2_aux/ qed-. + +fact tsts_inv_pair2_aux: ∀T1,T2. T1 ≂ T2 → ∀I,W2,U2. T2 = ②{I}W2.U2 → + ∃∃W1,U1. T1 = ②{I}W1.U1. +#T1 #T2 * -T1 -T2 +[ #J #I #W2 #U2 #H destruct +| #J #V1 #V2 #T1 #T2 #I #W2 #U2 #H destruct /2 width=3 by ex1_2_intro/ +] +qed-. + +lemma tsts_inv_pair2: ∀I,T1,W2,U2. T1 ≂ ②{I}W2.U2 → + ∃∃W1,U1. T1 = ②{I}W1.U1. +/2 width=5 by tsts_inv_pair2_aux/ qed-. + +(* Basic properties *********************************************************) + +(* Basic_1: was: iso_refl *) +lemma tsts_refl: reflexive … tsts. +#T elim T -T // +qed. + +lemma tsts_sym: symmetric … tsts. +#T1 #T2 #H elim H -T1 -T2 // +qed-. + +lemma tsts_dec: ∀T1,T2. Decidable (T1 ≂ T2). +* #I1 [2: #V1 #T1 ] * #I2 [2,4: #V2 #T2 ] +[ elim (eq_item2_dec I1 I2) #HI12 + [ destruct /2 width=1 by tsts_pair, or_introl/ + | @or_intror #H + elim (tsts_inv_pair1 … H) -H #V #T #H destruct /2 width=1 by/ + ] +| @or_intror #H + lapply (tsts_inv_atom1 … H) -H #H destruct +| @or_intror #H + lapply (tsts_inv_atom2 … H) -H #H destruct +| elim (eq_item0_dec I1 I2) #HI12 + [ destruct /2 width=1 by or_introl/ + | @or_intror #H + lapply (tsts_inv_atom2 … H) -H #H destruct /2 width=1 by/ + ] +] +qed. + +lemma simple_tsts_repl_dx: ∀T1,T2. T1 ≂ T2 → 𝐒⦃T1⦄ → 𝐒⦃T2⦄. +#T1 #T2 * -T1 -T2 // +#I #V1 #V2 #T1 #T2 #H +elim (simple_inv_pair … H) -H #J #H destruct // +qed-. + +lemma simple_tsts_repl_sn: ∀T1,T2. T1 ≂ T2 → 𝐒⦃T2⦄ → 𝐒⦃T1⦄. +/3 width=3 by simple_tsts_repl_dx, tsts_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/tsts_tsts.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/tsts_tsts.ma new file mode 100644 index 000000000..59dfd02e4 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/tsts_tsts.ma @@ -0,0 +1,32 @@ +(**************************************************************************) +(* ___ *) +(* ||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/syntax/tsts.ma". + +(* SAME TOP TERM STRUCTURE **************************************************) + +(* Main properties **********************************************************) + +(* Basic_1: was: iso_trans *) +theorem tsts_trans: Transitive … tsts. +#T1 #T * -T1 -T // +#I #V1 #V #T1 #T #X #H +elim (tsts_inv_pair1 … H) -H #V2 #T2 #H destruct // +qed-. + +theorem tsts_canc_sn: ∀T,T1. T ≂ T1 → ∀T2. T ≂ T2 → T1 ≂ T2. +/3 width=3 by tsts_trans, tsts_sym/ qed-. + +theorem tsts_canc_dx: ∀T1,T. T1 ≂ T → ∀T2. T2 ≂ T → T1 ≂ T2. +/3 width=3 by tsts_trans, tsts_sym/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/tsts_vector.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/tsts_vector.ma new file mode 100644 index 000000000..9341af67b --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/tsts_vector.ma @@ -0,0 +1,30 @@ +(**************************************************************************) +(* ___ *) +(* ||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/syntax/term_vector.ma". +include "basic_2/syntax/tsts.ma". + +(* SAME TOP TERM STRUCTURE **************************************************) + +(* Advanced inversion lemmas ************************************************) + +(* Basic_1: was only: iso_flats_lref_bind_false iso_flats_flat_bind_false *) +lemma tsts_inv_bind_applv_simple: ∀p,I,Vs,V2,T1,T2. ⒶVs.T1 ≂ ⓑ{p,I}V2.T2 → + 𝐒⦃T1⦄ → ⊥. +#p #I #Vs #V2 #T1 #T2 #H elim (tsts_inv_pair2 … H) -H +#V0 #T0 elim Vs -Vs normalize +[ #H destruct #H /2 width=5 by simple_inv_bind/ +| #V #Vs #_ #H destruct +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/web/basic_2_src.tbl b/matita/matita/contribs/lambdadelta/basic_2/web/basic_2_src.tbl index 172b43b1d..cd88f565a 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/web/basic_2_src.tbl +++ b/matita/matita/contribs/lambdadelta/basic_2/web/basic_2_src.tbl @@ -162,10 +162,6 @@ table { ] class "green" [ { "static typing" * } { - [ { "parameters" * } { - [ "sh" "sd" * ] - } - ] [ { "restricted ref. for atomic arity assignment" * } { [ "lsuba ( ? ⊢ ? ⫃⁝ ? )" "lsuba_drops" + "lsuba_lsubr" + "lsuba_aaa" + "lsuba_lsuba" * ] } @@ -241,13 +237,13 @@ table { } ] class "red" - [ { "grammar" * } { + [ { "syntax" * } { [ { "append for local environments" * } { [ "append ( ? @@ ? )" "append_length" * ] } ] - [ { "context-sensitive equivalences for terms" * } { - [ "ceq" "ceq_ceq" * ] + [ { "degree-based equivalence for terms" * } { + [ "deq ( ? ≡[?,?] ? ) " "deq_deq" * ] } ] [ { "same top term structure" * } { @@ -255,17 +251,34 @@ table { } ] [ { "closures" * } { - [ "cl_weight ( ♯{?,?,?} )" "cl_restricted_weight ( ♯{?,?} )" * ] + [ "cl_weight ( ♯{?,?,?} )" * ] + [ "cl_restricted_weight ( ♯{?,?} )" * ] } ] - [ { "internal syntax" * } { + [ { "global environments" * } { [ "genv" * ] - [ "lenv" "lenv_weight ( ♯{?} )" "lenv_length ( |?| )" * ] - [ "term" "term_weight ( ♯{?} )" "term_simple ( 𝐒⦃?⦄ )" "term_vector ( Ⓐ?.? )" * ] + } + ] + [ { "local environments" * } { + [ "lenv_length ( |?| )" * ] + [ "lenv_weight ( ♯{?} )" * ] + [ "lenv" * ] + } + ] + [ { "terms" * } { + [ "term_vector ( Ⓐ?.? )" * ] + [ "term_simple ( 𝐒⦃?⦄ )" * ] + [ "term_weight ( ♯{?} )" * ] + [ "term" * ] + } + ] + [ { "items" * } { + [ "item_sd" * ] + [ "item_sh" * ] [ "item" * ] } ] - [ { "external syntax" * } { + [ { "atomic arities" * } { [ "aarity" * ] } ] diff --git a/matita/matita/contribs/lambdadelta/replace.sh b/matita/matita/contribs/lambdadelta/replace.sh index 739dd9871..2f053dec9 100644 --- a/matita/matita/contribs/lambdadelta/replace.sh +++ b/matita/matita/contribs/lambdadelta/replace.sh @@ -1,6 +1,6 @@ #!/bin/sh -#for MA in `find -name "*.ma"`; do -for MA in `find -name "cpg*.ma" -or -name "cpx*.ma"`; do +for MA in `find -name "*.ma"`; do +#for MA in `find -name "cpg*.ma" -or -name "cpx*.ma"`; do echo ${MA}; sed "s!$1!$2!g" ${MA} > ${MA}.new if diff ${MA} ${MA}.new > /dev/null; then rm -f ${MA}.new;