+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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, L⦄ ⊢ 𝐍 break ⦃ term 46 T ⦄ )"
- non associative with precedence 45
- for @{ 'Normal $L $T }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 T ⦄ )"
+ non associative with precedence 45
+ for @{ 'Normal $G $L $T }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 h, break term 46 L ⦄ ⊢ 𝐍 break [ term 46 g ] break ⦃ term 46 T ⦄ )"
- non associative with precedence 45
- for @{ 'Normal $h $g $L $T }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 h , break term 46 g ] break ⦃ term 46 T ⦄ )"
+ non associative with precedence 45
+ for @{ 'Normal $h $g $G $L $T }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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, L⦄ ⊢ 𝐈 break ⦃ term 46 T ⦄ )"
- non associative with precedence 45
- for @{ 'NotReducible $L $T }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 T ⦄ )"
+ non associative with precedence 45
+ for @{ 'NotReducible $G $L $T }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 h, break term 46 L ⦄ ⊢ 𝐈 break [ term 46 g ] break ⦃ term 46 T ⦄ )"
- non associative with precedence 45
- for @{ 'NotReducible $h $g $L $T }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 h , break term 46 g ] break ⦃ term 46 T ⦄ )"
+ non associative with precedence 45
+ for @{ 'NotReducible $h $g $G $L $T }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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, L⦄ ⊢ break term 46 T1 ➡ break term 46 T2 )"
- non associative with precedence 45
- for @{ 'PRed $L $T1 $T2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 T2 )"
+ non associative with precedence 45
+ for @{ 'PRed $G $L $T1 $T2 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 h, break term 46 L ⦄ ⊢ break term 46 T1 ➡ break [ term 46 g ] break term 46 T2 )"
- non associative with precedence 45
- for @{ 'PRed $h $g $L $T1 $T2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 g ] break term 46 T2 )"
+ non associative with precedence 45
+ for @{ 'PRed $h $g $G $L $T1 $T2 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 L2 )"
- non associative with precedence 45
- for @{ 'PRedSn $L1 $L2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 @{ 'PRedSn $G $L1 $L2 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 h, break term 46 L1 ⦄ ⊢ ➡ break [ term 46 g ] break term 46 L2 )"
- non associative with precedence 45
- for @{ 'PRedSn $h $g $L1 $L2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 L2 )"
+ non associative with precedence 45
+ for @{ 'PRedSn $h $g $G $L1 $L2 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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, L⦄ ⊢ 𝐑 break ⦃ term 46 T ⦄ )"
- non associative with precedence 45
- for @{ 'Reducible $L $T }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 T ⦄ )"
+ non associative with precedence 45
+ for @{ 'Reducible $G $L $T }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The 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 h, break term 46 L ⦄ ⊢ 𝐑 break [ term 46 g ] break ⦃ term 46 T ⦄ )"
- non associative with precedence 45
- for @{ 'Reducible $h $g $L $T }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The 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 h , break term 46 g ] break ⦃ term 46 T ⦄ )"
+ non associative with precedence 45
+ for @{ 'Reducible $h $g $G $L $T }.
(* *)
(**************************************************************************)
-include "basic_2/notation/relations/notreducible_2.ma".
+include "basic_2/notation/relations/notreducible_3.ma".
include "basic_2/reduction/crr.ma".
(* CONTEXT-SENSITIVE IRREDUCIBLE TERMS **************************************)
-definition cir: lenv → predicate term ≝ λL,T. ⦃G, L⦄ ⊢ 𝐑⦃T⦄ → ⊥.
+definition cir: relation3 genv lenv term ≝ λG,L,T. ⦃G, L⦄ ⊢ 𝐑⦃T⦄ → ⊥.
interpretation "context-sensitive irreducibility (term)"
- 'NotReducible L T = (cir L T).
+ 'NotReducible G L T = (cir G L T).
(* Basic inversion lemmas ***************************************************)
-lemma cir_inv_delta: ∀L,K,V,i. ⇩[0, i] L ≡ K.ⓓV → ⦃G, L⦄ ⊢ 𝐈⦃#i⦄ → ⊥.
+lemma cir_inv_delta: ∀G,L,K,V,i. ⇩[0, i] L ≡ K.ⓓV → ⦃G, L⦄ ⊢ 𝐈⦃#i⦄ → ⊥.
/3 width=3/ qed-.
-lemma cir_inv_ri2: ∀I,L,V,T. ri2 I → ⦃G, L⦄ ⊢ 𝐈⦃②{I}V.T⦄ → ⊥.
+lemma cir_inv_ri2: ∀I,G,L,V,T. ri2 I → ⦃G, L⦄ ⊢ 𝐈⦃②{I}V.T⦄ → ⊥.
/3 width=1/ qed-.
-lemma cir_inv_ib2: ∀a,I,L,V,T. ib2 a I → ⦃G, L⦄ ⊢ 𝐈⦃ⓑ{a,I}V.T⦄ →
- ⦃G, L⦄ ⊢ 𝐈⦃V⦄ ∧ L.ⓑ{I}V ⊢ 𝐈⦃T⦄.
+lemma cir_inv_ib2: ∀a,I,G,L,V,T. ib2 a I → ⦃G, L⦄ ⊢ 𝐈⦃ⓑ{a,I}V.T⦄ →
+ ⦃G, L⦄ ⊢ 𝐈⦃V⦄ ∧ ⦃G, L.ⓑ{I}V⦄ ⊢ 𝐈⦃T⦄.
/4 width=1/ qed-.
-lemma cir_inv_bind: ∀a,I,L,V,T. ⦃G, L⦄ ⊢ 𝐈⦃ⓑ{a,I}V.T⦄ →
- ∧∧ ⦃G, L⦄ ⊢ 𝐈⦃V⦄ & L.ⓑ{I}V ⊢ 𝐈⦃T⦄ & ib2 a I.
+lemma cir_inv_bind: ∀a,I,G,L,V,T. ⦃G, L⦄ ⊢ 𝐈⦃ⓑ{a,I}V.T⦄ →
+ ∧∧ ⦃G, L⦄ ⊢ 𝐈⦃V⦄ & ⦃G, L.ⓑ{I}V⦄ ⊢ 𝐈⦃T⦄ & ib2 a I.
#a * [ elim a -a ]
-[ #L #V #T #H elim H -H /3 width=1/
-|*: #L #V #T #H elim (cir_inv_ib2 … H) -H /2 width=1/ /3 width=1/
-]
+#G #L #V #T #H [ elim H -H /3 width=1/ ]
+elim (cir_inv_ib2 … H) -H /2 width=1/ /3 width=1/
qed-.
-lemma cir_inv_appl: ∀L,V,T. ⦃G, L⦄ ⊢ 𝐈⦃ⓐV.T⦄ → ∧∧ ⦃G, L⦄ ⊢ 𝐈⦃V⦄ & ⦃G, L⦄ ⊢ 𝐈⦃T⦄ & 𝐒⦃T⦄.
-#L #V #T #HVT @and3_intro /3 width=1/
+lemma cir_inv_appl: ∀G,L,V,T. ⦃G, L⦄ ⊢ 𝐈⦃ⓐV.T⦄ →
+ ∧∧ ⦃G, L⦄ ⊢ 𝐈⦃V⦄ & ⦃G, L⦄ ⊢ 𝐈⦃T⦄ & 𝐒⦃T⦄.
+#G #L #V #T #HVT @and3_intro /3 width=1/
generalize in match HVT; -HVT elim T -T //
* // #a * #U #T #_ #_ #H elim H -H /2 width=1/
qed-.
-lemma cir_inv_flat: ∀I,L,V,T. ⦃G, L⦄ ⊢ 𝐈⦃ⓕ{I}V.T⦄ →
+lemma cir_inv_flat: ∀I,G,L,V,T. ⦃G, L⦄ ⊢ 𝐈⦃ⓕ{I}V.T⦄ →
∧∧ ⦃G, L⦄ ⊢ 𝐈⦃V⦄ & ⦃G, L⦄ ⊢ 𝐈⦃T⦄ & 𝐒⦃T⦄ & I = Appl.
-* #L #V #T #H
+* #G #L #V #T #H
[ elim (cir_inv_appl … H) -H /2 width=1/
| elim (cir_inv_ri2 … H) -H /2 width=1/
]
(* Basic properties *********************************************************)
-lemma cir_sort: ∀L,k. ⦃G, L⦄ ⊢ 𝐈⦃⋆k⦄.
-/2 width=3 by crr_inv_sort/ qed.
+lemma cir_sort: ∀G,L,k. ⦃G, L⦄ ⊢ 𝐈⦃⋆k⦄.
+/2 width=4 by crr_inv_sort/ qed.
-lemma cir_gref: ∀L,p. ⦃G, L⦄ ⊢ 𝐈⦃§p⦄.
-/2 width=3 by crr_inv_gref/ qed.
+lemma cir_gref: ∀G,L,p. ⦃G, L⦄ ⊢ 𝐈⦃§p⦄.
+/2 width=4 by crr_inv_gref/ qed.
-lemma tir_atom: ∀I. ⋆ ⊢ 𝐈⦃⓪{I}⦄.
-/2 width=2 by trr_inv_atom/ qed.
+lemma tir_atom: ∀G,I. ⦃G, ⋆⦄ ⊢ 𝐈⦃⓪{I}⦄.
+/2 width=3 by trr_inv_atom/ qed.
-lemma cir_ib2: ∀a,I,L,V,T. ib2 a I → ⦃G, L⦄ ⊢ 𝐈⦃V⦄ → L.ⓑ{I}V ⊢ 𝐈⦃T⦄ → ⦃G, L⦄ ⊢ 𝐈⦃ⓑ{a,I}V.T⦄.
-#a #I #L #V #T #HI #HV #HT #H
+lemma cir_ib2: ∀a,I,G,L,V,T.
+ ib2 a I → ⦃G, L⦄ ⊢ 𝐈⦃V⦄ → ⦃G, L.ⓑ{I}V⦄ ⊢ 𝐈⦃T⦄ → ⦃G, L⦄ ⊢ 𝐈⦃ⓑ{a,I}V.T⦄.
+#a #I #G #L #V #T #HI #HV #HT #H
elim (crr_inv_ib2 … HI H) -HI -H /2 width=1/
qed.
-lemma cir_appl: ∀L,V,T. ⦃G, L⦄ ⊢ 𝐈⦃V⦄ → ⦃G, L⦄ ⊢ 𝐈⦃T⦄ → 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ 𝐈⦃ⓐV.T⦄.
-#L #V #T #HV #HT #H1 #H2
+lemma cir_appl: ∀G,L,V,T. ⦃G, L⦄ ⊢ 𝐈⦃V⦄ → ⦃G, L⦄ ⊢ 𝐈⦃T⦄ → 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ 𝐈⦃ⓐV.T⦄.
+#G #L #V #T #HV #HT #H1 #H2
elim (crr_inv_appl … H2) -H2 /2 width=1/
qed.
(* Advanved properties ******************************************************)
-lemma cir_labst_last: ∀L,T,W. ⦃G, L⦄ ⊢ 𝐈⦃T⦄ → ⋆.ⓛW @@ ⦃G, L⦄ ⊢ 𝐈⦃T⦄.
+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: ∀T,W. ⋆ ⊢ 𝐈⦃T⦄ → ⋆.ⓛW ⊢ 𝐈⦃T⦄.
+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: ∀L,K,T. K @@ ⦃G, L⦄ ⊢ 𝐈⦃T⦄ → ⦃G, L⦄ ⊢ 𝐈⦃T⦄.
+lemma cir_inv_append_sn: ∀G,L,K,T. ⦃G, K @@ L⦄ ⊢ 𝐈⦃T⦄ → ⦃G, L⦄ ⊢ 𝐈⦃T⦄.
/3 width=1/ qed-.
-lemma cir_inv_tir: ∀T,W. ⋆.ⓛW ⊢ 𝐈⦃T⦄ → ⋆ ⊢ 𝐈⦃T⦄.
+lemma cir_inv_tir: ∀G,T,W. ⦃G, ⋆.ⓛW⦄ ⊢ 𝐈⦃T⦄ → ⦃G, ⋆⦄ ⊢ 𝐈⦃T⦄.
/3 width=1/ qed-.
(* Properties on relocation *************************************************)
-lemma cir_lift: ∀K,T. K ⊢ 𝐈⦃T⦄ → ∀L,d,e. ⇩[d, e] L ≡ K →
+lemma cir_lift: ∀G,K,T. ⦃G, K⦄ ⊢ 𝐈⦃T⦄ → ∀L,d,e. ⇩[d, e] L ≡ K →
∀U. ⇧[d, e] T ≡ U → ⦃G, L⦄ ⊢ 𝐈⦃U⦄.
/3 width=7 by crr_inv_lift/ qed.
-lemma cir_inv_lift: ∀L,U. ⦃G, L⦄ ⊢ 𝐈⦃U⦄ → ∀K,d,e. ⇩[d, e] L ≡ K →
- ∀T. ⇧[d, e] T ≡ U → K ⊢ 𝐈⦃T⦄.
+lemma cir_inv_lift: ∀G,L,U. ⦃G, L⦄ ⊢ 𝐈⦃U⦄ → ∀K,d,e. ⇩[d, e] L ≡ K →
+ ∀T. ⇧[d, e] T ≡ U → ⦃G, K⦄ ⊢ 𝐈⦃T⦄.
/3 width=7/ qed-.
(* *)
(**************************************************************************)
-include "basic_2/notation/relations/notreducible_4.ma".
+include "basic_2/notation/relations/notreducible_5.ma".
include "basic_2/reduction/cir.ma".
include "basic_2/reduction/crx.ma".
(* CONTEXT-SENSITIVE EXTENDED IRREDUCIBLE TERMS *****************************)
-definition cix: ∀h. sd h → lenv → predicate term ≝ λh,g,L,T. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄ → ⊥.
+definition cix: ∀h. sd h → relation3 genv lenv term ≝
+ λh,g,G,L,T. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄ → ⊥.
interpretation "context-sensitive extended irreducibility (term)"
- 'NotReducible h g L T = (cix h g L T).
+ 'NotReducible h g G L T = (cix h g G L T).
(* Basic inversion lemmas ***************************************************)
-lemma cix_inv_sort: ∀h,g,L,k,l. deg h g k (l+1) → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃⋆k⦄ → ⊥.
+lemma cix_inv_sort: ∀h,g,G,L,k,l. deg h g k (l+1) → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃⋆k⦄ → ⊥.
/3 width=2/ qed-.
-lemma cix_inv_delta: ∀h,g,I,L,K,V,i. ⇩[0, i] L ≡ K.ⓑ{I}V → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃#i⦄ → ⊥.
+lemma cix_inv_delta: ∀h,g,I,G,L,K,V,i. ⇩[0, i] L ≡ K.ⓑ{I}V → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃#i⦄ → ⊥.
/3 width=4/ qed-.
-lemma cix_inv_ri2: ∀h,g,I,L,V,T. ri2 I → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃②{I}V.T⦄ → ⊥.
+lemma cix_inv_ri2: ∀h,g,I,G,L,V,T. ri2 I → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃②{I}V.T⦄ → ⊥.
/3 width=1/ qed-.
-lemma cix_inv_ib2: ∀h,g,a,I,L,V,T. ib2 a I → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃ⓑ{a,I}V.T⦄ →
- ⦃G, L⦄ ⊢ 𝐈[h, g]⦃V⦄ ∧ ⦃h, L.ⓑ{I}V⦄ ⊢ 𝐈[h, g]⦃T⦄.
+lemma cix_inv_ib2: ∀h,g,a,I,G,L,V,T. ib2 a I → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃ⓑ{a,I}V.T⦄ →
+ ⦃G, L⦄ ⊢ 𝐈[h, g]⦃V⦄ ∧ ⦃G, L.ⓑ{I}V⦄ ⊢ 𝐈[h, g]⦃T⦄.
/4 width=1/ qed-.
-lemma cix_inv_bind: ∀h,g,a,I,L,V,T. ⦃G, L⦄ ⊢ 𝐈[h, g]⦃ⓑ{a,I}V.T⦄ →
- ∧∧ ⦃G, L⦄ ⊢ 𝐈[h, g]⦃V⦄ & ⦃h, L.ⓑ{I}V⦄ ⊢ 𝐈[h, g]⦃T⦄ & ib2 a I.
+lemma cix_inv_bind: ∀h,g,a,I,G,L,V,T. ⦃G, L⦄ ⊢ 𝐈[h, g]⦃ⓑ{a,I}V.T⦄ →
+ ∧∧ ⦃G, L⦄ ⊢ 𝐈[h, g]⦃V⦄ & ⦃G, L.ⓑ{I}V⦄ ⊢ 𝐈[h, g]⦃T⦄ & ib2 a I.
#h #g #a * [ elim a -a ]
-[ #L #V #T #H elim H -H /3 width=1/
-|*: #L #V #T #H elim (cix_inv_ib2 … H) -H /2 width=1/ /3 width=1/
-]
+#G #L #V #T #H [ elim H -H /3 width=1/ ]
+elim (cix_inv_ib2 … H) -H /2 width=1/ /3 width=1/
qed-.
-lemma cix_inv_appl: ∀h,g,L,V,T. ⦃G, L⦄ ⊢ 𝐈[h, g]⦃ⓐV.T⦄ →
+lemma cix_inv_appl: ∀h,g,G,L,V,T. ⦃G, L⦄ ⊢ 𝐈[h, g]⦃ⓐV.T⦄ →
∧∧ ⦃G, L⦄ ⊢ 𝐈[h, g]⦃V⦄ & ⦃G, L⦄ ⊢ 𝐈[h, g]⦃T⦄ & 𝐒⦃T⦄.
-#h #g #L #V #T #HVT @and3_intro /3 width=1/
+#h #g #G #L #V #T #HVT @and3_intro /3 width=1/
generalize in match HVT; -HVT elim T -T //
* // #a * #U #T #_ #_ #H elim H -H /2 width=1/
qed-.
-lemma cix_inv_flat: ∀h,g,I,L,V,T. ⦃G, L⦄ ⊢ 𝐈[h, g]⦃ⓕ{I}V.T⦄ →
+lemma cix_inv_flat: ∀h,g,I,G,L,V,T. ⦃G, L⦄ ⊢ 𝐈[h, g]⦃ⓕ{I}V.T⦄ →
∧∧ ⦃G, L⦄ ⊢ 𝐈[h, g]⦃V⦄ & ⦃G, L⦄ ⊢ 𝐈[h, g]⦃T⦄ & 𝐒⦃T⦄ & I = Appl.
-#h #g * #L #V #T #H
+#h #g * #G #L #V #T #H
[ elim (cix_inv_appl … H) -H /2 width=1/
| elim (cix_inv_ri2 … H) -H /2 width=1/
]
(* Basic forward lemmas *****************************************************)
-lemma cix_inv_cir: ∀h,g,L,T. ⦃G, L⦄ ⊢ 𝐈[h, g]⦃T⦄ → ⦃G, L⦄ ⊢ 𝐈⦃T⦄.
+lemma cix_inv_cir: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ 𝐈[h, g]⦃T⦄ → ⦃G, L⦄ ⊢ 𝐈⦃T⦄.
/3 width=1/ qed-.
(* Basic properties *********************************************************)
-lemma cix_sort: ∀h,g,L,k. deg h g k 0 → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃⋆k⦄.
-#h #g #L #k #Hk #H elim (crx_inv_sort … H) -L #l #Hkl
+lemma cix_sort: ∀h,g,G,L,k. deg h g k 0 → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃⋆k⦄.
+#h #g #G #L #k #Hk #H elim (crx_inv_sort … H) -L #l #Hkl
lapply (deg_mono … Hk Hkl) -h -k <plus_n_Sm #H destruct
qed.
-lemma tix_lref: ∀h,g,i. ⦃h, ⋆⦄ ⊢ 𝐈[h, g]⦃#i⦄.
-#h #g #i #H elim (trx_inv_atom … H) -H #k #l #_ #H destruct
+lemma tix_lref: ∀h,g,G,i. ⦃G, ⋆⦄ ⊢ 𝐈[h, g]⦃#i⦄.
+#h #g #G #i #H elim (trx_inv_atom … H) -H #k #l #_ #H destruct
qed.
-lemma cix_gref: ∀h,g,L,p. ⦃G, L⦄ ⊢ 𝐈[h, g]⦃§p⦄.
-#h #g #L #p #H elim (crx_inv_gref … H)
+lemma cix_gref: ∀h,g,G,L,p. ⦃G, L⦄ ⊢ 𝐈[h, g]⦃§p⦄.
+#h #g #G #L #p #H elim (crx_inv_gref … H)
qed.
-lemma cix_ib2: ∀h,g,a,I,L,V,T. ib2 a I → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃V⦄ → ⦃h, L.ⓑ{I}V⦄ ⊢ 𝐈[h, g]⦃T⦄ →
+lemma cix_ib2: ∀h,g,a,I,G,L,V,T. ib2 a I → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃V⦄ → ⦃G, L.ⓑ{I}V⦄ ⊢ 𝐈[h, g]⦃T⦄ →
⦃G, L⦄ ⊢ 𝐈[h, g]⦃ⓑ{a,I}V.T⦄.
-#h #g #a #I #L #V #T #HI #HV #HT #H
+#h #g #a #I #G #L #V #T #HI #HV #HT #H
elim (crx_inv_ib2 … HI H) -HI -H /2 width=1/
qed.
-lemma cix_appl: ∀h,g,L,V,T. ⦃G, L⦄ ⊢ 𝐈[h, g]⦃V⦄ → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃T⦄ → 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃ⓐV.T⦄.
-#h #g #L #V #T #HV #HT #H1 #H2
+lemma cix_appl: ∀h,g,G,L,V,T. ⦃G, L⦄ ⊢ 𝐈[h, g]⦃V⦄ → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃T⦄ → 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃ⓐV.T⦄.
+#h #g #G #L #V #T #HV #HT #H1 #H2
elim (crx_inv_appl … H2) -H2 /2 width=1/
qed.
(* Advanced inversion lemmas ************************************************)
-lemma cix_inv_append_sn: ∀h,g,L,K,T. ⦃h, K @@ L⦄ ⊢ 𝐈[h, g]⦃T⦄ → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃T⦄.
+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/ qed-.
-lemma cix_inv_tix: ∀h,g,L,T. ⦃G, L⦄ ⊢ 𝐈[h, g]⦃T⦄ → ⦃h, ⋆⦄ ⊢ 𝐈[h, g]⦃T⦄.
+lemma cix_inv_tix: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ 𝐈[h, g]⦃T⦄ → ⦃G, ⋆⦄ ⊢ 𝐈[h, g]⦃T⦄.
/3 width=1/ qed-.
(* Advanced properties ******************************************************)
-lemma cix_lref: ∀h,g,L,i. ⇩[0, i] L ≡ ⋆ → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃#i⦄.
-#h #g #L #i #HL #H elim (crx_inv_lref … H) -h #I #K #V #HLK
+lemma cix_lref: ∀h,g,G,L,i. ⇩[0, i] L ≡ ⋆ → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃#i⦄.
+#h #g #G #L #i #HL #H elim (crx_inv_lref … H) -h #I #K #V #HLK
lapply (ldrop_mono … HLK … HL) -L -i #H destruct
qed.
(* Properties on relocation *************************************************)
-lemma cix_lift: ∀h,g,K,T. ⦃h, K⦄ ⊢ 𝐈[h, g]⦃T⦄ → ∀L,d,e. ⇩[d, e] L ≡ K →
+lemma cix_lift: ∀h,g,G,K,T. ⦃G, K⦄ ⊢ 𝐈[h, g]⦃T⦄ → ∀L,d,e. ⇩[d, e] L ≡ K →
∀U. ⇧[d, e] T ≡ U → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃U⦄.
/3 width=7 by crx_inv_lift/ qed.
-lemma cix_inv_lift: ∀h,g,L,U. ⦃G, L⦄ ⊢ 𝐈[h, g]⦃U⦄ → ∀K,d,e. ⇩[d, e] L ≡ K →
- ∀T. ⇧[d, e] T ≡ U → ⦃h, K⦄ ⊢ 𝐈[h, g]⦃T⦄.
+lemma cix_inv_lift: ∀h,g,G,L,U. ⦃G, L⦄ ⊢ 𝐈[h, g]⦃U⦄ → ∀K,d,e. ⇩[d, e] L ≡ K →
+ ∀T. ⇧[d, e] T ≡ U → ⦃G, K⦄ ⊢ 𝐈[h, g]⦃T⦄.
/3 width=7/ qed-.
(* *)
(**************************************************************************)
-include "basic_2/notation/relations/normal_2.ma".
+include "basic_2/notation/relations/normal_3.ma".
include "basic_2/reduction/cpr.ma".
(* CONTEXT-SENSITIVE NORMAL TERMS *******************************************)
-definition cnr: lenv → predicate term ≝ λL. NF … (cpr L) (eq …).
+definition cnr: relation3 genv lenv term ≝ λG,L. NF … (cpr G L) (eq …).
interpretation
"context-sensitive normality (term)"
- 'Normal L T = (cnr L T).
+ 'Normal G L T = (cnr G L T).
(* Basic inversion lemmas ***************************************************)
-lemma cnr_inv_delta: ∀L,K,V,i. ⇩[0, i] L ≡ K.ⓓV → ⦃G, L⦄ ⊢ 𝐍⦃#i⦄ → ⊥.
-#L #K #V #i #HLK #H
+lemma cnr_inv_delta: ∀G,L,K,V,i. ⇩[0, i] L ≡ K.ⓓV → ⦃G, L⦄ ⊢ 𝐍⦃#i⦄ → ⊥.
+#G #L #K #V #i #HLK #H
elim (lift_total V 0 (i+1)) #W #HVW
lapply (H W ?) -H [ /3 width=6/ ] -HLK #H destruct
elim (lift_inv_lref2_be … HVW) -HVW //
qed-.
-lemma cnr_inv_abst: ∀a,L,V,T. ⦃G, L⦄ ⊢ 𝐍⦃ⓛ{a}V.T⦄ → ⦃G, L⦄ ⊢ 𝐍⦃V⦄ ∧ L.ⓛV ⊢ 𝐍⦃T⦄.
-#a #L #V1 #T1 #HVT1 @conj
+lemma cnr_inv_abst: ∀a,G,L,V,T. ⦃G, L⦄ ⊢ 𝐍⦃ⓛ{a}V.T⦄ → ⦃G, L⦄ ⊢ 𝐍⦃V⦄ ∧ ⦃G, L.ⓛV⦄ ⊢ 𝐍⦃T⦄.
+#a #G #L #V1 #T1 #HVT1 @conj
[ #V2 #HV2 lapply (HVT1 (ⓛ{a}V2.T1) ?) -HVT1 /2 width=2/ -HV2 #H destruct //
| #T2 #HT2 lapply (HVT1 (ⓛ{a}V1.T2) ?) -HVT1 /2 width=2/ -HT2 #H destruct //
]
qed-.
-lemma cnr_inv_abbr: ∀L,V,T. ⦃G, L⦄ ⊢ 𝐍⦃-ⓓV.T⦄ → ⦃G, L⦄ ⊢ 𝐍⦃V⦄ ∧ L.ⓓV ⊢ 𝐍⦃T⦄.
-#L #V1 #T1 #HVT1 @conj
+lemma cnr_inv_abbr: ∀G,L,V,T. ⦃G, L⦄ ⊢ 𝐍⦃-ⓓV.T⦄ → ⦃G, L⦄ ⊢ 𝐍⦃V⦄ ∧ ⦃G, L.ⓓV⦄ ⊢ 𝐍⦃T⦄.
+#G #L #V1 #T1 #HVT1 @conj
[ #V2 #HV2 lapply (HVT1 (-ⓓV2.T1) ?) -HVT1 /2 width=2/ -HV2 #H destruct //
| #T2 #HT2 lapply (HVT1 (-ⓓV1.T2) ?) -HVT1 /2 width=2/ -HT2 #H destruct //
]
qed-.
-lemma cnr_inv_zeta: ∀L,V,T. ⦃G, L⦄ ⊢ 𝐍⦃+ⓓV.T⦄ → ⊥.
-#L #V #T #H elim (is_lift_dec T 0 1)
+lemma cnr_inv_zeta: ∀G,L,V,T. ⦃G, L⦄ ⊢ 𝐍⦃+ⓓV.T⦄ → ⊥.
+#G #L #V #T #H elim (is_lift_dec T 0 1)
[ * #U #HTU
lapply (H U ?) -H /2 width=3/ #H destruct
elim (lift_inv_pair_xy_y … HTU)
| #HT
- elim (cpr_delift (⋆) V T (⋆. ⓓV) 0) // #T2 #T1 #HT2 #HT12
+ elim (cpr_delift G (⋆) V T (⋆. ⓓV) 0) // #T2 #T1 #HT2 #HT12
lapply (H (+ⓓV.T2) ?) -H /4 width=1/ -HT2 #H destruct /3 width=2/
]
qed-.
-lemma cnr_inv_appl: ∀L,V,T. ⦃G, L⦄ ⊢ 𝐍⦃ⓐV.T⦄ → ∧∧ ⦃G, L⦄ ⊢ 𝐍⦃V⦄ & ⦃G, L⦄ ⊢ 𝐍⦃T⦄ & 𝐒⦃T⦄.
-#L #V1 #T1 #HVT1 @and3_intro
+lemma cnr_inv_appl: ∀G,L,V,T. ⦃G, L⦄ ⊢ 𝐍⦃ⓐV.T⦄ → ∧∧ ⦃G, L⦄ ⊢ 𝐍⦃V⦄ & ⦃G, L⦄ ⊢ 𝐍⦃T⦄ & 𝐒⦃T⦄.
+#G #L #V1 #T1 #HVT1 @and3_intro
[ #V2 #HV2 lapply (HVT1 (ⓐV2.T1) ?) -HVT1 /2 width=1/ -HV2 #H destruct //
| #T2 #HT2 lapply (HVT1 (ⓐV1.T2) ?) -HVT1 /2 width=1/ -HT2 #H destruct //
| generalize in match HVT1; -HVT1 elim T1 -T1 * // #a * #W1 #U1 #_ #_ #H
]
qed-.
-lemma cnr_inv_tau: ∀L,V,T. ⦃G, L⦄ ⊢ 𝐍⦃ⓝV.T⦄ → ⊥.
-#L #V #T #H lapply (H T ?) -H /2 width=1/ #H
+lemma cnr_inv_tau: ∀G,L,V,T. ⦃G, L⦄ ⊢ 𝐍⦃ⓝV.T⦄ → ⊥.
+#G #L #V #T #H lapply (H T ?) -H /2 width=1/ #H
@discr_tpair_xy_y //
qed-.
(* Basic properties *********************************************************)
(* Basic_1: was: nf2_sort *)
-lemma cnr_sort: ∀L,k. ⦃G, L⦄ ⊢ 𝐍⦃⋆k⦄.
-#L #k #X #H
+lemma cnr_sort: ∀G,L,k. ⦃G, L⦄ ⊢ 𝐍⦃⋆k⦄.
+#G #L #k #X #H
>(cpr_inv_sort1 … H) //
qed.
(* Basic_1: was: nf2_abst *)
-lemma cnr_abst: ∀a,L,W,T. ⦃G, L⦄ ⊢ 𝐍⦃W⦄ → L.ⓛW ⊢ 𝐍⦃T⦄ → ⦃G, L⦄ ⊢ 𝐍⦃ⓛ{a}W.T⦄.
-#a #L #W #T #HW #HT #X #H
+lemma cnr_abst: ∀a,G,L,W,T. ⦃G, L⦄ ⊢ 𝐍⦃W⦄ → ⦃G, L.ⓛW⦄ ⊢ 𝐍⦃T⦄ → ⦃G, L⦄ ⊢ 𝐍⦃ⓛ{a}W.T⦄.
+#a #G #L #W #T #HW #HT #X #H
elim (cpr_inv_abst1 … H) -H #W0 #T0 #HW0 #HT0 #H destruct
>(HW … HW0) -W0 >(HT … HT0) -T0 //
qed.
(* Basic_1: was only: nf2_appl_lref *)
-lemma cnr_appl_simple: ∀L,V,T. ⦃G, L⦄ ⊢ 𝐍⦃V⦄ → ⦃G, L⦄ ⊢ 𝐍⦃T⦄ → 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ 𝐍⦃ⓐV.T⦄.
-#L #V #T #HV #HT #HS #X #H
+lemma cnr_appl_simple: ∀G,L,V,T. ⦃G, L⦄ ⊢ 𝐍⦃V⦄ → ⦃G, L⦄ ⊢ 𝐍⦃T⦄ → 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ 𝐍⦃ⓐV.T⦄.
+#G #L #V #T #HV #HT #HS #X #H
elim (cpr_inv_appl1_simple … H) -H // #V0 #T0 #HV0 #HT0 #H destruct
>(HV … HV0) -V0 >(HT … HT0) -T0 //
qed.
(* Basic_1: was: nf2_dec *)
-axiom cnr_dec: ∀L,T1. ⦃G, L⦄ ⊢ 𝐍⦃T1⦄ ∨
+axiom cnr_dec: ∀G,L,T1. ⦃G, L⦄ ⊢ 𝐍⦃T1⦄ ∨
∃∃T2. ⦃G, L⦄ ⊢ T1 ➡ T2 & (T1 = T2 → ⊥).
(* Basic_1: removed theorems 1: nf2_abst_shift *)
(* Main properties on context-sensitive irreducible terms *******************)
-theorem cir_cnr: ∀L,T. ⦃G, L⦄ ⊢ 𝐈⦃T⦄ → ⦃G, L⦄ ⊢ 𝐍⦃T⦄.
-/2 width=3 by cpr_fwd_cir/ qed.
+theorem cir_cnr: ∀G,L,T. ⦃G, L⦄ ⊢ 𝐈⦃T⦄ → ⦃G, L⦄ ⊢ 𝐍⦃T⦄.
+/2 width=4 by cpr_fwd_cir/ qed.
(* Main inversion lemmas on context-sensitive irreducible terms *************)
-theorem cnr_inv_cir: ∀L,T. ⦃G, L⦄ ⊢ 𝐍⦃T⦄ → ⦃G, L⦄ ⊢ 𝐈⦃T⦄.
-/2 width=4 by cnr_inv_crr/ qed-.
+theorem cnr_inv_cir: ∀G,L,T. ⦃G, L⦄ ⊢ 𝐍⦃T⦄ → ⦃G, L⦄ ⊢ 𝐈⦃T⦄.
+/2 width=5 by cnr_inv_crr/ qed-.
(* Advanced inversion lemmas on context-sensitive reducible terms ***********)
(* Note: this property is unusual *)
-lemma cnr_inv_crr: ∀L,T. ⦃G, L⦄ ⊢ 𝐑⦃T⦄ → ⦃G, L⦄ ⊢ 𝐍⦃T⦄ → ⊥.
-#L #T #H elim H -L -T
+lemma cnr_inv_crr: ∀G,L,T. ⦃G, L⦄ ⊢ 𝐑⦃T⦄ → ⦃G, L⦄ ⊢ 𝐍⦃T⦄ → ⊥.
+#G #L #T #H elim H -L -T
[ #L #K #V #i #HLK #H
elim (cnr_inv_delta … HLK H)
| #L #V #T #_ #IHV #H
(* Advanced properties ******************************************************)
(* Basic_1: was only: nf2_csort_lref *)
-lemma cnr_lref_atom: ∀L,i. ⇩[0, i] L ≡ ⋆ → ⦃G, L⦄ ⊢ 𝐍⦃#i⦄.
-#L #i #HL #X #H
+lemma cnr_lref_atom: ∀G,L,i. ⇩[0, i] L ≡ ⋆ → ⦃G, L⦄ ⊢ 𝐍⦃#i⦄.
+#G #L #i #HL #X #H
elim (cpr_inv_lref1 … H) -H // *
#K #V1 #V2 #HLK #_ #_
lapply (ldrop_mono … HL … HLK) -L #H destruct
qed.
(* Basic_1: was: nf2_lref_abst *)
-lemma cnr_lref_abst: ∀L,K,V,i. ⇩[0, i] L ≡ K. ⓛV → ⦃G, L⦄ ⊢ 𝐍⦃#i⦄.
-#L #K #V #i #HLK #X #H
+lemma cnr_lref_abst: ∀G,L,K,V,i. ⇩[0, i] L ≡ K. ⓛV → ⦃G, L⦄ ⊢ 𝐍⦃#i⦄.
+#G #L #K #V #i #HLK #X #H
elim (cpr_inv_lref1 … H) -H // *
#K0 #V1 #V2 #HLK0 #_ #_
lapply (ldrop_mono … HLK … HLK0) -L #H destruct
(* Relocation properties ****************************************************)
(* Basic_1: was: nf2_lift *)
-lemma cnr_lift: ∀L0,L,T,T0,d,e.
- â¦\83G, Lâ¦\84 â\8a¢ ð\9d\90\8dâ¦\83Tâ¦\84 â\86\92 â\87©[d, e] L0 â\89¡ L â\86\92 â\87§[d, e] T â\89¡ T0 â\86\92 L0 ⊢ 𝐍⦃T0⦄.
-#L0 #L #T #T0 #d #e #HLT #HL0 #HT0 #X #H
+lemma cnr_lift: ∀G,L0,L,T,T0,d,e. ⦃G, L⦄ ⊢ 𝐍⦃T⦄ →
+ â\87©[d, e] L0 â\89¡ L â\86\92 â\87§[d, e] T â\89¡ T0 â\86\92 â¦\83G, L0â¦\84 ⊢ 𝐍⦃T0⦄.
+#G #L0 #L #T #T0 #d #e #HLT #HL0 #HT0 #X #H
elim (cpr_inv_lift1 … H … HL0 … HT0) -L0 #T1 #HT10 #HT1
<(HLT … HT1) in HT0; -L #HT0
>(lift_mono … HT10 … HT0) -T1 -X //
qed.
(* Note: this was missing in basic_1 *)
-lemma cnr_inv_lift: ∀L0,L,T,T0,d,e.
- L0 ⊢ 𝐍⦃T0⦄ → ⇩[d, e] L0 ≡ L → ⇧[d, e] T ≡ T0 → ⦃G, L⦄ ⊢ 𝐍⦃T⦄.
-#L0 #L #T #T0 #d #e #HLT0 #HL0 #HT0 #X #H
+lemma cnr_inv_lift: ∀G,L0,L,T,T0,d,e. ⦃G, L0⦄ ⊢ 𝐍⦃T0⦄ →
+ ⇩[d, e] L0 ≡ L → ⇧[d, e] T ≡ T0 → ⦃G, L⦄ ⊢ 𝐍⦃T⦄.
+#G #L0 #L #T #T0 #d #e #HLT0 #HL0 #HT0 #X #H
elim (lift_total X d e) #X0 #HX0
lapply (cpr_lift … H … HL0 … HT0 … HX0) -L #HTX0
>(HLT0 … HTX0) in HX0; -L0 -X0 #H
(* *)
(**************************************************************************)
-include "basic_2/notation/relations/normal_4.ma".
+include "basic_2/notation/relations/normal_5.ma".
include "basic_2/reduction/cnr.ma".
include "basic_2/reduction/cpx.ma".
(* CONTEXT-SENSITIVE EXTENDED NORMAL TERMS **********************************)
-definition cnx: ∀h. sd h → lenv → predicate term ≝
- λh,g,L. NF … (cpx h g L) (eq …).
+definition cnx: ∀h. sd h → relation3 genv lenv term ≝
+ λh,g,G,L. NF … (cpx h g G L) (eq …).
interpretation
"context-sensitive extended normality (term)"
(* Basic inversion lemmas ***************************************************)
-lemma cnx_inv_sort: ∀h,g,L,k. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃⋆k⦄ → deg h g k 0.
-#h #g #L #k #H elim (deg_total h g k)
+lemma cnx_inv_sort: ∀h,g,G,L,k. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃⋆k⦄ → deg h g k 0.
+#h #g #G #L #k #H elim (deg_total h g k)
#l @(nat_ind_plus … l) -l // #l #_ #Hkl
lapply (H (⋆(next h k)) ?) -H /2 width=2/ -L -l #H destruct -H -e0 (**) (* destruct does not remove some premises *)
lapply (next_lt h k) >e1 -e1 #H elim (lt_refl_false … H)
qed-.
-lemma cnx_inv_delta: ∀h,g,I,L,K,V,i. ⇩[0, i] L ≡ K.ⓑ{I}V → ⦃G, L⦄ ⊢ 𝐍[h, g]⦃#i⦄ → ⊥.
-#h #g #I #L #K #V #i #HLK #H
+lemma cnx_inv_delta: ∀h,g,I,G,L,K,V,i. ⇩[0, i] L ≡ K.ⓑ{I}V → ⦃G, L⦄ ⊢ 𝐍[h, g]⦃#i⦄ → ⊥.
+#h #g #I #G #L #K #V #i #HLK #H
elim (lift_total V 0 (i+1)) #W #HVW
lapply (H W ?) -H [ /3 width=7/ ] -HLK #H destruct
elim (lift_inv_lref2_be … HVW) -HVW //
qed-.
-lemma cnx_inv_abst: ∀h,g,a,L,V,T. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃ⓛ{a}V.T⦄ →
- ⦃G, L⦄ ⊢ 𝐍[h, g]⦃V⦄ ∧ ⦃h, L.ⓛV⦄ ⊢ 𝐍[h, g]⦃T⦄.
-#h #g #a #L #V1 #T1 #HVT1 @conj
+lemma cnx_inv_abst: ∀h,g,a,G,L,V,T. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃ⓛ{a}V.T⦄ →
+ ⦃G, L⦄ ⊢ 𝐍[h, g]⦃V⦄ ∧ ⦃G, L.ⓛV⦄ ⊢ 𝐍[h, g]⦃T⦄.
+#h #g #a #G #L #V1 #T1 #HVT1 @conj
[ #V2 #HV2 lapply (HVT1 (ⓛ{a}V2.T1) ?) -HVT1 /2 width=2/ -HV2 #H destruct //
| #T2 #HT2 lapply (HVT1 (ⓛ{a}V1.T2) ?) -HVT1 /2 width=2/ -HT2 #H destruct //
]
qed-.
-lemma cnx_inv_abbr: ∀h,g,L,V,T. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃-ⓓV.T⦄ →
- ⦃G, L⦄ ⊢ 𝐍[h, g]⦃V⦄ ∧ ⦃h, L.ⓓV⦄ ⊢ 𝐍[h, g]⦃T⦄.
-#h #g #L #V1 #T1 #HVT1 @conj
+lemma cnx_inv_abbr: ∀h,g,G,L,V,T. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃-ⓓV.T⦄ →
+ ⦃G, L⦄ ⊢ 𝐍[h, g]⦃V⦄ ∧ ⦃G, L.ⓓV⦄ ⊢ 𝐍[h, g]⦃T⦄.
+#h #g #G #L #V1 #T1 #HVT1 @conj
[ #V2 #HV2 lapply (HVT1 (-ⓓV2.T1) ?) -HVT1 /2 width=2/ -HV2 #H destruct //
| #T2 #HT2 lapply (HVT1 (-ⓓV1.T2) ?) -HVT1 /2 width=2/ -HT2 #H destruct //
]
qed-.
-lemma cnx_inv_zeta: ∀h,g,L,V,T. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃+ⓓV.T⦄ → ⊥.
-#h #g #L #V #T #H elim (is_lift_dec T 0 1)
+lemma cnx_inv_zeta: ∀h,g,G,L,V,T. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃+ⓓV.T⦄ → ⊥.
+#h #g #G #L #V #T #H elim (is_lift_dec T 0 1)
[ * #U #HTU
lapply (H U ?) -H /2 width=3/ #H destruct
elim (lift_inv_pair_xy_y … HTU)
| #HT
- elim (cpr_delift (⋆) V T (⋆.ⓓV) 0) // #T2 #T1 #HT2 #HT12
+ elim (cpr_delift G(⋆) V T (⋆.ⓓV) 0) // #T2 #T1 #HT2 #HT12
lapply (H (+ⓓV.T2) ?) -H /5 width=1/ -HT2 #H destruct /3 width=2/
]
qed-.
-lemma cnx_inv_appl: ∀h,g,L,V,T. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃ⓐV.T⦄ →
+lemma cnx_inv_appl: ∀h,g,G,L,V,T. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃ⓐV.T⦄ →
∧∧ ⦃G, L⦄ ⊢ 𝐍[h, g]⦃V⦄ & ⦃G, L⦄ ⊢ 𝐍[h, g]⦃T⦄ & 𝐒⦃T⦄.
-#h #g #L #V1 #T1 #HVT1 @and3_intro
+#h #g #G #L #V1 #T1 #HVT1 @and3_intro
[ #V2 #HV2 lapply (HVT1 (ⓐV2.T1) ?) -HVT1 /2 width=1/ -HV2 #H destruct //
| #T2 #HT2 lapply (HVT1 (ⓐV1.T2) ?) -HVT1 /2 width=1/ -HT2 #H destruct //
| generalize in match HVT1; -HVT1 elim T1 -T1 * // #a * #W1 #U1 #_ #_ #H
]
qed-.
-lemma cnx_inv_tau: ∀h,g,L,V,T. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃ⓝV.T⦄ → ⊥.
-#h #g #L #V #T #H lapply (H T ?) -H /2 width=1/ #H
+lemma cnx_inv_tau: ∀h,g,G,L,V,T. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃ⓝV.T⦄ → ⊥.
+#h #g #G #L #V #T #H lapply (H T ?) -H /2 width=1/ #H
@discr_tpair_xy_y //
qed-.
(* Basic forward lemmas *****************************************************)
-lemma cnx_fwd_cnr: ∀h,g,L,T. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃T⦄ → ⦃G, L⦄ ⊢ 𝐍⦃T⦄.
-#h #g #L #T #H #U #HTU
+lemma cnx_fwd_cnr: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃T⦄ → ⦃G, L⦄ ⊢ 𝐍⦃T⦄.
+#h #g #G #L #T #H #U #HTU
@H /2 width=1/ (**) (* auto fails because a δ-expansion gets in the way *)
qed-.
(* Basic properties *********************************************************)
-lemma cnx_sort: ∀h,g,L,k. deg h g k 0 → ⦃G, L⦄ ⊢ 𝐍[h, g]⦃⋆k⦄.
-#h #g #L #k #Hk #X #H elim (cpx_inv_sort1 … H) -H // * #l #Hkl #_
+lemma cnx_sort: ∀h,g,G,L,k. deg h g k 0 → ⦃G, L⦄ ⊢ 𝐍[h, g]⦃⋆k⦄.
+#h #g #G #L #k #Hk #X #H elim (cpx_inv_sort1 … H) -H // * #l #Hkl #_
lapply (deg_mono … Hkl Hk) -h -L <plus_n_Sm #H destruct
qed.
-lemma cnx_sort_iter: ∀h,g,L,k,l. deg h g k l → ⦃G, L⦄ ⊢ 𝐍[h, g]⦃⋆((next h)^l k)⦄.
-#h #g #L #k #l #Hkl
+lemma cnx_sort_iter: ∀h,g,G,L,k,l. deg h g k l → ⦃G, L⦄ ⊢ 𝐍[h, g]⦃⋆((next h)^l k)⦄.
+#h #g #G #L #k #l #Hkl
lapply (deg_iter … l Hkl) -Hkl <minus_n_n /2 width=1/
qed.
-lemma cnx_abst: ∀h,g,a,L,W,T. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃W⦄ → ⦃h, L.ⓛW⦄ ⊢ 𝐍[h, g]⦃T⦄ →
+lemma cnx_abst: ∀h,g,a,G,L,W,T. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃W⦄ → ⦃G, L.ⓛW⦄ ⊢ 𝐍[h, g]⦃T⦄ →
⦃G, L⦄ ⊢ 𝐍[h, g]⦃ⓛ{a}W.T⦄.
-#h #g #a #L #W #T #HW #HT #X #H
+#h #g #a #G #L #W #T #HW #HT #X #H
elim (cpx_inv_abst1 … H) -H #W0 #T0 #HW0 #HT0 #H destruct
>(HW … HW0) -W0 >(HT … HT0) -T0 //
qed.
-lemma cnx_appl_simple: ∀h,g,L,V,T. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃V⦄ → ⦃G, L⦄ ⊢ 𝐍[h, g]⦃T⦄ → 𝐒⦃T⦄ →
+lemma cnx_appl_simple: ∀h,g,G,L,V,T. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃V⦄ → ⦃G, L⦄ ⊢ 𝐍[h, g]⦃T⦄ → 𝐒⦃T⦄ →
⦃G, L⦄ ⊢ 𝐍[h, g]⦃ⓐV.T⦄.
-#h #g #L #V #T #HV #HT #HS #X #H
+#h #g #G #L #V #T #HV #HT #HS #X #H
elim (cpx_inv_appl1_simple … H) -H // #V0 #T0 #HV0 #HT0 #H destruct
>(HV … HV0) -V0 >(HT … HT0) -T0 //
qed.
-axiom cnx_dec: ∀h,g,L,T1. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃T1⦄ ∨
+axiom cnx_dec: ∀h,g,G,L,T1. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃T1⦄ ∨
∃∃T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 & (T1 = T2 → ⊥).
(* Main properties on context-sensitive extended irreducible terms **********)
-theorem cix_cnr: ∀h,g,L,T. ⦃G, L⦄ ⊢ 𝐈[h, g]⦃T⦄ → ⦃G, L⦄ ⊢ 𝐍[h, g]⦃T⦄.
-/2 width=5 by cpx_fwd_cix/ qed.
+theorem cix_cnr: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ 𝐈[h, g]⦃T⦄ → ⦃G, L⦄ ⊢ 𝐍[h, g]⦃T⦄.
+/2 width=6 by cpx_fwd_cix/ qed.
(* Main inversion lemmas on context-sensitive extended irreducible terms ****)
-theorem cnr_inv_cix: ∀h,g,L,T. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃T⦄ → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃T⦄.
-/2 width=6 by cnx_inv_crx/ qed-.
+theorem cnr_inv_cix: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃T⦄ → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃T⦄.
+/2 width=7 by cnx_inv_crx/ qed-.
(* Advanced inversion lemmas on context-sensitive reducible terms ***********)
(* Note: this property is unusual *)
-lemma cnx_inv_crx: ∀h,g,L,T. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄ → ⦃G, L⦄ ⊢ 𝐍[h, g]⦃T⦄ → ⊥.
-#h #g #L #T #H elim H -L -T
+lemma cnx_inv_crx: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄ → ⦃G, L⦄ ⊢ 𝐍[h, g]⦃T⦄ → ⊥.
+#h #g #G #L #T #H elim H -L -T
[ #L #k #l #Hkl #H
lapply (cnx_inv_sort … H) -H #H
lapply (deg_mono … H Hkl) -h -L -k <plus_n_Sm #H destruct
(* Advanced properties ******************************************************)
-lemma cnx_lref_atom: ∀h,g,L,i. ⇩[0, i] L ≡ ⋆ → ⦃G, L⦄ ⊢ 𝐍[h, g]⦃#i⦄.
-#h #g #L #i #HL #X #H
+lemma cnx_lref_atom: ∀h,g,G,L,i. ⇩[0, i] L ≡ ⋆ → ⦃G, L⦄ ⊢ 𝐍[h, g]⦃#i⦄.
+#h #g #G #L #i #HL #X #H
elim (cpx_inv_lref1 … H) -H // *
#I #K #V1 #V2 #HLK #_ #_
lapply (ldrop_mono … HL … HLK) -L #H destruct
(* Relocation properties ****************************************************)
-lemma cnx_lift: ∀h,g,L0,L,T,T0,d,e. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃T⦄ → ⇩[d, e] L0 ≡ L →
- ⇧[d, e] T ≡ T0 → ⦃h, L0⦄ ⊢ 𝐍[h, g]⦃T0⦄.
-#h #g #L0 #L #T #T0 #d #e #HLT #HL0 #HT0 #X #H
+lemma cnx_lift: ∀h,g,G,L0,L,T,T0,d,e. ⦃G, L⦄ ⊢ 𝐍[h, g]⦃T⦄ → ⇩[d, e] L0 ≡ L →
+ ⇧[d, e] T ≡ T0 → ⦃G, L0⦄ ⊢ 𝐍[h, g]⦃T0⦄.
+#h #g #G #L0 #L #T #T0 #d #e #HLT #HL0 #HT0 #X #H
elim (cpx_inv_lift1 … H … HL0 … HT0) -L0 #T1 #HT10 #HT1
<(HLT … HT1) in HT0; -L #HT0
>(lift_mono … HT10 … HT0) -T1 -X //
qed.
-lemma cnx_inv_lift: ∀h,g,L0,L,T,T0,d,e. ⦃h, L0⦄ ⊢ 𝐍[h, g]⦃T0⦄ → ⇩[d, e] L0 ≡ L →
+lemma cnx_inv_lift: ∀h,g,G,L0,L,T,T0,d,e. ⦃G, L0⦄ ⊢ 𝐍[h, g]⦃T0⦄ → ⇩[d, e] L0 ≡ L →
⇧[d, e] T ≡ T0 → ⦃G, L⦄ ⊢ 𝐍[h, g]⦃T⦄.
-#h #g #L0 #L #T #T0 #d #e #HLT0 #HL0 #HT0 #X #H
+#h #g #G #L0 #L #T #T0 #d #e #HLT0 #HL0 #HT0 #X #H
elim (lift_total X d e) #X0 #HX0
lapply (cpx_lift … H … HL0 … HT0 … HX0) -L #HTX0
>(HLT0 … HTX0) in HX0; -L0 -X0 #H
(* *)
(**************************************************************************)
-include "basic_2/notation/relations/pred_3.ma".
+include "basic_2/notation/relations/pred_4.ma".
+include "basic_2/grammar/genv.ma".
include "basic_2/grammar/cl_shift.ma".
include "basic_2/relocation/ldrop_append.ma".
include "basic_2/substitution/lsubr.ma".
(* CONTEXT-SENSITIVE PARALLEL REDUCTION FOR TERMS ***************************)
+(* activate genv *)
(* Basic_1: includes: pr0_delta1 pr2_delta1 pr2_thin_dx *)
(* Note: cpr_flat: does not hold in basic_1 *)
-inductive cpr: lenv → relation term ≝
-| cpr_atom : ∀I,L. cpr L (⓪{I}) (⓪{I})
-| cpr_delta: ∀L,K,V,V2,W2,i.
- ⇩[0, i] L ≡ K. ⓓV → cpr K V V2 →
- ⇧[0, i + 1] V2 ≡ W2 → cpr L (#i) W2
-| cpr_bind : ∀a,I,L,V1,V2,T1,T2.
- cpr L V1 V2 → cpr (L.ⓑ{I}V1) T1 T2 →
- cpr L (ⓑ{a,I}V1.T1) (ⓑ{a,I}V2.T2)
-| cpr_flat : ∀I,L,V1,V2,T1,T2.
- cpr L V1 V2 → cpr L T1 T2 →
- cpr L (ⓕ{I} V1. T1) (ⓕ{I}V2.T2)
-| cpr_zeta : ∀L,V,T1,T,T2. cpr (L.ⓓV) T1 T →
- ⇧[0, 1] T2 ≡ T → cpr L (+ⓓV.T1) T2
-| cpr_tau : ∀L,V,T1,T2. cpr L T1 T2 → cpr L (ⓝV.T1) T2
-| cpr_beta : ∀a,L,V1,V2,W1,W2,T1,T2.
- cpr L V1 V2 → cpr L W1 W2 → cpr (L.ⓛW1) T1 T2 →
- cpr L (ⓐV1.ⓛ{a}W1.T1) (ⓓ{a}ⓝW2.V2.T2)
-| cpr_theta: ∀a,L,V1,V,V2,W1,W2,T1,T2.
- cpr L V1 V → ⇧[0, 1] V ≡ V2 → cpr L W1 W2 → cpr (L.ⓓW1) T1 T2 →
- cpr L (ⓐV1.ⓓ{a}W1.T1) (ⓓ{a}W2.ⓐV2.T2)
+inductive cpr: relation4 genv lenv term term ≝
+| cpr_atom : ∀I,G,L. cpr G L (⓪{I}) (⓪{I})
+| cpr_delta: ∀G,L,K,V,V2,W2,i.
+ ⇩[0, i] L ≡ K. ⓓV → cpr G K V V2 →
+ ⇧[0, i + 1] V2 ≡ W2 → cpr G L (#i) W2
+| cpr_bind : ∀a,I,G,L,V1,V2,T1,T2.
+ cpr G L V1 V2 → cpr G (L.ⓑ{I}V1) T1 T2 →
+ cpr G L (ⓑ{a,I}V1.T1) (ⓑ{a,I}V2.T2)
+| cpr_flat : ∀I,G,L,V1,V2,T1,T2.
+ cpr G L V1 V2 → cpr G L T1 T2 →
+ cpr G L (ⓕ{I}V1.T1) (ⓕ{I}V2.T2)
+| cpr_zeta : ∀G,L,V,T1,T,T2. cpr G (L.ⓓV) T1 T →
+ ⇧[0, 1] T2 ≡ T → cpr G L (+ⓓV.T1) T2
+| cpr_tau : ∀G,L,V,T1,T2. cpr G L T1 T2 → cpr G L (ⓝV.T1) T2
+| cpr_beta : ∀a,G,L,V1,V2,W1,W2,T1,T2.
+ cpr G L V1 V2 → cpr G L W1 W2 → cpr G (L.ⓛW1) T1 T2 →
+ cpr G L (ⓐV1.ⓛ{a}W1.T1) (ⓓ{a}ⓝW2.V2.T2)
+| cpr_theta: ∀a,G,L,V1,V,V2,W1,W2,T1,T2.
+ cpr G L V1 V → ⇧[0, 1] V ≡ V2 → cpr G L W1 W2 → cpr G (L.ⓓW1) T1 T2 →
+ cpr G L (ⓐV1.ⓓ{a}W1.T1) (ⓓ{a}W2.ⓐV2.T2)
.
interpretation "context-sensitive parallel reduction (term)"
- 'PRed L T1 T2 = (cpr L T1 T2).
+ 'PRed G L T1 T2 = (cpr G L T1 T2).
(* Basic properties *********************************************************)
-lemma lsubr_cpr_trans: lsub_trans … cpr lsubr.
-#L1 #T1 #T2 #H elim H -L1 -T1 -T2
+lemma lsubr_cpr_trans: ∀G. lsub_trans … (cpr G) lsubr.
+#G #L1 #T1 #T2 #H elim H -G -L1 -T1 -T2
[ //
-| #L1 #K1 #V1 #V2 #W2 #i #HLK1 #_ #HVW2 #IHV12 #L2 #HL12
+| #G #L1 #K1 #V1 #V2 #W2 #i #HLK1 #_ #HVW2 #IHV12 #L2 #HL12
elim (lsubr_fwd_ldrop2_abbr … HL12 … HLK1) -L1 * /3 width=6/
|3,7: /4 width=1/
|4,6: /3 width=1/
qed-.
(* Basic_1: was by definition: pr2_free *)
-lemma tpr_cpr: ∀T1,T2. ⋆ ⊢ T1 ➡ T2 → ∀L. ⦃G, L⦄ ⊢ T1 ➡ T2.
-#T1 #T2 #HT12 #L
+lemma tpr_cpr: ∀G,T1,T2. ⦃G, ⋆⦄ ⊢ T1 ➡ T2 → ∀L. ⦃G, L⦄ ⊢ T1 ➡ T2.
+#G #T1 #T2 #HT12 #L
lapply (lsubr_cpr_trans … HT12 L ?) //
qed.
(* Basic_1: includes by definition: pr0_refl *)
-lemma cpr_refl: ∀T,L. ⦃G, L⦄ ⊢ T ➡ T.
-#T elim T -T // * /2 width=1/
+lemma cpr_refl: ∀G,T,L. ⦃G, L⦄ ⊢ T ➡ T.
+#G #T elim T -T // * /2 width=1/
qed.
(* Basic_1: was: pr2_head_1 *)
-lemma cpr_pair_sn: ∀I,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡ V2 →
+lemma cpr_pair_sn: ∀I,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡ V2 →
∀T. ⦃G, L⦄ ⊢ ②{I}V1.T ➡ ②{I}V2.T.
* /2 width=1/ qed.
-lemma cpr_delift: ∀K,V,T1,L,d. ⇩[0, d] L ≡ (K.ⓓV) →
+lemma cpr_delift: ∀G,K,V,T1,L,d. ⇩[0, d] L ≡ (K.ⓓV) →
∃∃T2,T. ⦃G, L⦄ ⊢ T1 ➡ T2 & ⇧[d, 1] T ≡ T2.
-#K #V #T1 elim T1 -T1
+#G #K #V #T1 elim T1 -T1
[ * #i #L #d #HLK /2 width=4/
elim (lt_or_eq_or_gt i d) #Hid [1,3: /3 width=4/ ]
destruct
]
qed-.
-lemma cpr_append: l_appendable_sn … cpr.
-#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
+lemma cpr_append: ∀G. l_appendable_sn … (cpr G).
+#G #K #T1 #T2 #H elim H -G -K -T1 -T2 // /2 width=1/ /2 width=3/
+#G #K #K0 #V1 #V2 #W2 #i #HK0 #_ #HVW2 #IHV12 #L
lapply (ldrop_fwd_length_lt2 … HK0) #H
@(cpr_delta … (L@@K0) V1 … HVW2) //
@(ldrop_O1_append_sn_le … HK0) /2 width=2/ (**) (* /3/ does not work *)
(* Basic inversion lemmas ***************************************************)
-fact cpr_inv_atom1_aux: ∀L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡ T2 → ∀I. T1 = ⓪{I} →
+fact cpr_inv_atom1_aux: ∀G,L,T1,T2. ⦃G, 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
-| #a #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #J #H destruct
-| #a #L #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #J #H destruct
+ ∃∃K,V,V2,i. ⇩[O, i] L ≡ K. ⓓV & ⦃G, K⦄ ⊢ V ➡ V2 &
+ ⇧[O, i + 1] V2 ≡ T2 & I = LRef i.
+#G #L #T1 #T2 * -G -L -T1 -T2
+[ #I #G #L #J #H destruct /2 width=1/
+| #L #G #K #V #V2 #T2 #i #HLK #HV2 #HVT2 #J #H destruct /3 width=8/
+| #a #I #G #L #V1 #V2 #T1 #T2 #_ #_ #J #H destruct
+| #I #G #L #V1 #V2 #T1 #T2 #_ #_ #J #H destruct
+| #G #L #V #T1 #T #T2 #_ #_ #J #H destruct
+| #G #L #V #T1 #T2 #_ #J #H destruct
+| #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #J #H destruct
+| #a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #J #H destruct
]
qed-.
-lemma cpr_inv_atom1: ∀I,L,T2. ⦃G, L⦄ ⊢ ⓪{I} ➡ T2 →
+lemma cpr_inv_atom1: ∀I,G,L,T2. ⦃G, 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.
+ ∃∃K,V,V2,i. ⇩[O, i] L ≡ K. ⓓV & ⦃G, K⦄ ⊢ V ➡ V2 &
+ ⇧[O, i + 1] V2 ≡ T2 & I = LRef i.
/2 width=3 by cpr_inv_atom1_aux/ qed-.
(* Basic_1: includes: pr0_gen_sort pr2_gen_sort *)
-lemma cpr_inv_sort1: ∀L,T2,k. ⦃G, L⦄ ⊢ ⋆k ➡ T2 → T2 = ⋆k.
-#L #T2 #k #H
+lemma cpr_inv_sort1: ∀G,L,T2,k. ⦃G, L⦄ ⊢ ⋆k ➡ T2 → T2 = ⋆k.
+#G #L #T2 #k #H
elim (cpr_inv_atom1 … H) -H //
* #K #V #V2 #i #_ #_ #_ #H destruct
qed-.
(* Basic_1: includes: pr0_gen_lref pr2_gen_lref *)
-lemma cpr_inv_lref1: ∀L,T2,i. ⦃G, L⦄ ⊢ #i ➡ T2 →
+lemma cpr_inv_lref1: ∀G,L,T2,i. ⦃G, L⦄ ⊢ #i ➡ T2 →
T2 = #i ∨
- ∃∃K,V,V2. ⇩[O, i] L ≡ K. ⓓV &
- K ⊢ V ➡ V2 &
+ ∃∃K,V,V2. ⇩[O, i] L ≡ K. ⓓV & ⦃G, K⦄ ⊢ V ➡ V2 &
⇧[O, i + 1] V2 ≡ T2.
-#L #T2 #i #H
+#G #L #T2 #i #H
elim (cpr_inv_atom1 … H) -H /2 width=1/
* #K #V #V2 #j #HLK #HV2 #HVT2 #H destruct /3 width=6/
qed-.
-lemma cpr_inv_gref1: ∀L,T2,p. ⦃G, L⦄ ⊢ §p ➡ T2 → T2 = §p.
-#L #T2 #p #H
+lemma cpr_inv_gref1: ∀G,L,T2,p. ⦃G, L⦄ ⊢ §p ➡ T2 → T2 = §p.
+#G #L #T2 #p #H
elim (cpr_inv_atom1 … H) -H //
* #K #V #V2 #i #_ #_ #_ #H destruct
qed-.
-fact cpr_inv_bind1_aux: ∀L,U1,U2. ⦃G, L⦄ ⊢ U1 ➡ U2 →
+fact cpr_inv_bind1_aux: ∀G,L,U1,U2. ⦃G, L⦄ ⊢ U1 ➡ U2 →
∀a,I,V1,T1. U1 = ⓑ{a,I}V1. T1 → (
- ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡ V2 &
- L. ⓑ{I}V1 ⊢ T1 ➡ T2 &
+ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡ V2 & ⦃G, 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 #W #U1 #H destruct
-| #a #I #L #V1 #V2 #T1 #T2 #HV12 #HT12 #b #J #W #U1 #H destruct /3 width=5/
-| #I #L #V1 #V2 #T1 #T2 #_ #_ #b #J #W #U1 #H destruct
-| #L #V #T1 #T #T2 #HT1 #HT2 #b #J #W #U1 #H destruct /3 width=3/
-| #L #V #T1 #T2 #_ #b #J #W #U1 #H destruct
-| #a #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #b #J #W #U1 #H destruct
-| #a #L #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #b #J #W #U1 #H destruct
+ ∃∃T. ⦃G, L.ⓓV1⦄ ⊢ T1 ➡ T & ⇧[0, 1] U2 ≡ T &
+ a = true & I = Abbr.
+#G #L #U1 #U2 * -L -U1 -U2
+[ #I #G #L #b #J #W1 #U1 #H destruct
+| #L #G #K #V #V2 #W2 #i #_ #_ #_ #b #J #W #U1 #H destruct
+| #a #I #G #L #V1 #V2 #T1 #T2 #HV12 #HT12 #b #J #W #U1 #H destruct /3 width=5/
+| #I #G #L #V1 #V2 #T1 #T2 #_ #_ #b #J #W #U1 #H destruct
+| #G #L #V #T1 #T #T2 #HT1 #HT2 #b #J #W #U1 #H destruct /3 width=3/
+| #G #L #V #T1 #T2 #_ #b #J #W #U1 #H destruct
+| #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #b #J #W #U1 #H destruct
+| #a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #b #J #W #U1 #H destruct
]
qed-.
-lemma cpr_inv_bind1: ∀a,I,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡ U2 → (
- ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡ V2 &
- L. ⓑ{I}V1 ⊢ T1 ➡ T2 &
+lemma cpr_inv_bind1: ∀a,I,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡ U2 → (
+ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡ V2 & ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ➡ T2 &
U2 = ⓑ{a,I}V2.T2
) ∨
- ∃∃T. L.ⓓV1 ⊢ T1 ➡ T & ⇧[0, 1] U2 ≡ T & a = true & I = Abbr.
+ ∃∃T. ⦃G, L.ⓓV1⦄ ⊢ T1 ➡ T & ⇧[0, 1] U2 ≡ T &
+ a = true & I = Abbr.
/2 width=3 by cpr_inv_bind1_aux/ qed-.
(* Basic_1: includes: pr0_gen_abbr pr2_gen_abbr *)
-lemma cpr_inv_abbr1: ∀a,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓓ{a}V1.T1 ➡ U2 → (
- ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡ V2 &
- L. ⓓV1 ⊢ T1 ➡ T2 &
+lemma cpr_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
) ∨
- ∃∃T. L.ⓓV1 ⊢ T1 ➡ T & ⇧[0, 1] U2 ≡ T & a = true.
-#a #L #V1 #T1 #U2 #H
+ ∃∃T. ⦃G, L.ⓓV1⦄ ⊢ T1 ➡ T & ⇧[0, 1] U2 ≡ T & a = true.
+#a #G #L #V1 #T1 #U2 #H
elim (cpr_inv_bind1 … H) -H * /3 width=3/ /3 width=5/
qed-.
(* Basic_1: includes: pr0_gen_abst pr2_gen_abst *)
-lemma cpr_inv_abst1: ∀a,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓛ{a}V1.T1 ➡ U2 →
- ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡ V2 & L.ⓛV1 ⊢ T1 ➡ T2 &
+lemma cpr_inv_abst1: ∀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.
-#a #L #V1 #T1 #U2 #H
+#a #G #L #V1 #T1 #U2 #H
elim (cpr_inv_bind1 … H) -H *
[ /3 width=5/
| #T #_ #_ #_ #H destruct
]
qed-.
-fact cpr_inv_flat1_aux: ∀L,U,U2. ⦃G, L⦄ ⊢ U ➡ U2 →
+fact cpr_inv_flat1_aux: ∀G,L,U,U2. ⦃G, L⦄ ⊢ U ➡ U2 →
∀I,V1,U1. U = ⓕ{I}V1.U1 →
∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡ V2 & ⦃G, L⦄ ⊢ U1 ➡ T2 &
U2 = ⓕ{I} V2. T2
| (⦃G, L⦄ ⊢ U1 ➡ U2 ∧ I = Cast)
| ∃∃a,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡ V2 & ⦃G, L⦄ ⊢ W1 ➡ W2 &
- L.ⓛW1 ⊢ T1 ➡ T2 & U1 = ⓛ{a}W1.T1 &
+ ⦃G, L.ⓛW1⦄ ⊢ T1 ➡ T2 & U1 = ⓛ{a}W1.T1 &
U2 = ⓓ{a}ⓝW2.V2.T2 & I = Appl
| ∃∃a,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡ V & ⇧[0,1] V ≡ V2 &
- ⦃G, L⦄ ⊢ W1 ➡ W2 & L.ⓓW1 ⊢ T1 ➡ T2 &
+ ⦃G, L⦄ ⊢ W1 ➡ W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ➡ T2 &
U1 = ⓓ{a}W1.T1 &
U2 = ⓓ{a}W2.ⓐV2.T2 & I = Appl.
-#L #U #U2 * -L -U -U2
-[ #I #L #J #W1 #U1 #H destruct
-| #L #K #V #V2 #W2 #i #_ #_ #_ #J #W #U1 #H destruct
-| #a #I #L #V1 #V2 #T1 #T2 #_ #_ #J #W #U1 #H destruct
-| #I #L #V1 #V2 #T1 #T2 #HV12 #HT12 #J #W #U1 #H destruct /3 width=5/
-| #L #V #T1 #T #T2 #_ #_ #J #W #U1 #H destruct
-| #L #V #T1 #T2 #HT12 #J #W #U1 #H destruct /3 width=1/
-| #a #L #V1 #V2 #W1 #W2 #T1 #T2 #HV12 #HW12 #HT12 #J #W #U1 #H destruct /3 width=11/
-| #a #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 #HW12 #HT12 #J #W #U1 #H destruct /3 width=13/
+#G #L #U #U2 * -L -U -U2
+[ #I #G #L #J #W1 #U1 #H destruct
+| #G #L #K #V #V2 #W2 #i #_ #_ #_ #J #W #U1 #H destruct
+| #a #I #G #L #V1 #V2 #T1 #T2 #_ #_ #J #W #U1 #H destruct
+| #I #G #L #V1 #V2 #T1 #T2 #HV12 #HT12 #J #W #U1 #H destruct /3 width=5/
+| #G #L #V #T1 #T #T2 #_ #_ #J #W #U1 #H destruct
+| #G #L #V #T1 #T2 #HT12 #J #W #U1 #H destruct /3 width=1/
+| #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HV12 #HW12 #HT12 #J #W #U1 #H destruct /3 width=11/
+| #a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 #HW12 #HT12 #J #W #U1 #H destruct /3 width=13/
]
qed-.
-lemma cpr_inv_flat1: ∀I,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓕ{I}V1.U1 ➡ U2 →
+lemma cpr_inv_flat1: ∀I,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓕ{I}V1.U1 ➡ U2 →
∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡ V2 & ⦃G, L⦄ ⊢ U1 ➡ T2 &
U2 = ⓕ{I}V2.T2
| (⦃G, L⦄ ⊢ U1 ➡ U2 ∧ I = Cast)
| ∃∃a,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡ V2 & ⦃G, L⦄ ⊢ W1 ➡ W2 &
- L.ⓛW1 ⊢ T1 ➡ T2 & U1 = ⓛ{a}W1.T1 &
+ ⦃G, L.ⓛW1⦄ ⊢ T1 ➡ T2 & U1 = ⓛ{a}W1.T1 &
U2 = ⓓ{a}ⓝW2.V2.T2 & I = Appl
| ∃∃a,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡ V & ⇧[0,1] V ≡ V2 &
- ⦃G, L⦄ ⊢ W1 ➡ W2 & L.ⓓW1 ⊢ T1 ➡ T2 &
+ ⦃G, L⦄ ⊢ W1 ➡ W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ➡ T2 &
U1 = ⓓ{a}W1.T1 &
U2 = ⓓ{a}W2.ⓐV2.T2 & I = Appl.
/2 width=3 by cpr_inv_flat1_aux/ qed-.
(* Basic_1: includes: pr0_gen_appl pr2_gen_appl *)
-lemma cpr_inv_appl1: ∀L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓐV1.U1 ➡ U2 →
+lemma cpr_inv_appl1: ∀G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓐV1.U1 ➡ U2 →
∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡ V2 & ⦃G, L⦄ ⊢ U1 ➡ T2 &
U2 = ⓐV2.T2
| ∃∃a,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡ V2 & ⦃G, L⦄ ⊢ W1 ➡ W2 &
- L.ⓛW1 ⊢ T1 ➡ T2 &
+ ⦃G, L.ⓛW1⦄ ⊢ T1 ➡ T2 &
U1 = ⓛ{a}W1.T1 & U2 = ⓓ{a}ⓝW2.V2.T2
| ∃∃a,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡ V & ⇧[0,1] V ≡ V2 &
- ⦃G, L⦄ ⊢ W1 ➡ W2 & L.ⓓW1 ⊢ T1 ➡ T2 &
+ ⦃G, L⦄ ⊢ W1 ➡ W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ➡ T2 &
U1 = ⓓ{a}W1.T1 & U2 = ⓓ{a}W2.ⓐV2.T2.
-#L #V1 #U1 #U2 #H elim (cpr_inv_flat1 … H) -H *
+#G #L #V1 #U1 #U2 #H elim (cpr_inv_flat1 … H) -H *
[ /3 width=5/
| #_ #H destruct
| /3 width=11/
qed-.
(* Note: the main property of simple terms *)
-lemma cpr_inv_appl1_simple: ∀L,V1,T1,U. ⦃G, L⦄ ⊢ ⓐV1. T1 ➡ U → 𝐒⦃T1⦄ →
+lemma cpr_inv_appl1_simple: ∀G,L,V1,T1,U. ⦃G, L⦄ ⊢ ⓐV1. T1 ➡ U → 𝐒⦃T1⦄ →
∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡ V2 & ⦃G, L⦄ ⊢ T1 ➡ T2 &
U = ⓐV2. T2.
-#L #V1 #T1 #U #H #HT1
+#G #L #V1 #T1 #U #H #HT1
elim (cpr_inv_appl1 … H) -H *
[ /2 width=5/
| #a #V2 #W1 #W2 #U1 #U2 #_ #_ #_ #H #_ destruct
qed-.
(* Basic_1: includes: pr0_gen_cast pr2_gen_cast *)
-lemma cpr_inv_cast1: ∀L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓝ V1. U1 ➡ U2 → (
+lemma cpr_inv_cast1: ∀G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓝ V1. U1 ➡ U2 → (
∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡ V2 & ⦃G, L⦄ ⊢ U1 ➡ T2 &
U2 = ⓝ V2. T2
- ) ∨
- ⦃G, L⦄ ⊢ U1 ➡ U2.
-#L #V1 #U1 #U2 #H elim (cpr_inv_flat1 … H) -H *
+ ) ∨ ⦃G, L⦄ ⊢ U1 ➡ U2.
+#G #L #V1 #U1 #U2 #H elim (cpr_inv_flat1 … H) -H *
[ /3 width=5/
| /2 width=1/
| #a #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #H destruct
(* Basic forward lemmas *****************************************************)
-lemma cpr_fwd_bind1_minus: ∀I,L,V1,T1,T. ⦃G, L⦄ ⊢ -ⓑ{I}V1.T1 ➡ T → ∀b.
+lemma cpr_fwd_bind1_minus: ∀I,G,L,V1,T1,T. ⦃G, L⦄ ⊢ -ⓑ{I}V1.T1 ➡ T → ∀b.
∃∃V2,T2. ⦃G, L⦄ ⊢ ⓑ{b,I}V1.T1 ➡ ⓑ{b,I}V2.T2 &
T = -ⓑ{I}V2.T2.
-#I #L #V1 #T1 #T #H #b
+#I #G #L #V1 #T1 #T #H #b
elim (cpr_inv_bind1 … H) -H *
[ #V2 #T2 #HV12 #HT12 #H destruct /3 width=4/
| #T2 #_ #_ #H destruct
]
qed-.
-lemma cpr_fwd_shift1: ∀L1,L,T1,T. ⦃G, L⦄ ⊢ L1 @@ T1 ➡ T →
+lemma cpr_fwd_shift1: ∀G,L1,L,T1,T. ⦃G, L⦄ ⊢ L1 @@ T1 ➡ T →
∃∃L2,T2. |L1| = |L2| & T = L2 @@ T2.
-#L1 @(lenv_ind_dx … L1) -L1 normalize
+#G #L1 @(lenv_ind_dx … L1) -L1 normalize
[ #L #T1 #T #HT1
@(ex2_2_intro … (⋆)) // (**) (* explicit constructor *)
| #I #L1 #V1 #IH #L #T1 #X
(* Advanced forward lemmas on context-sensitive irreducible terms ***********)
-lemma cpr_fwd_cir: ∀L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡ T2 → ⦃G, L⦄ ⊢ 𝐈⦃T1⦄ → T2 = T1.
-#L #T1 #T2 #H elim H -L -T1 -T2
+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
[ //
-| #L #K #V1 #V2 #W2 #i #HLK #_ #HVW2 #IHV12 #H
+| #G #L #K #V1 #V2 #W2 #i #HLK #_ #HVW2 #IHV12 #H
elim (cir_inv_delta … HLK) //
-| #a * #L #V1 #V2 #T1 #T2 #_ #_ #IHV1 #IHT1 #H
+| #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 /2 width=1/ /3 width=2/
]
-| * #L #V1 #V2 #T1 #T2 #_ #_ #IHV1 #IHT1 #H
+| * #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/
]
-| #L #V1 #T1 #T #T2 #_ #_ #_ #H
+| #G #L #V1 #T1 #T #T2 #_ #_ #_ #H
elim (cir_inv_ri2 … H) /2 width=1/
-| #L #V1 #T1 #T2 #_ #_ #H
+| #G #L #V1 #T1 #T2 #_ #_ #H
elim (cir_inv_ri2 … H) /2 width=1/
-| #a #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #H
+| #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #H
elim (cir_inv_appl … H) -H #_ #_ #H
elim (simple_inv_bind … H)
-| #a #L #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #_ #H
+| #a #G #L #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #_ #H
elim (cir_inv_appl … H) -H #_ #_ #H
elim (simple_inv_bind … H)
]
(* Relocation properties ****************************************************)
(* Basic_1: includes: pr0_lift pr2_lift *)
-lemma cpr_lift: l_liftable cpr.
-#K #T1 #T2 #H elim H -K -T1 -T2
-[ #I #K #L #d #e #_ #U1 #H1 #U2 #H2
+lemma cpr_lift: ∀G. l_liftable (cpr G).
+#G #K #T1 #T2 #H elim H -G -K -T1 -T2
+[ #I #G #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
+| #G #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 // <minus_plus #W2 #HVW2 #HWU2
elim (ldrop_trans_le … HLK … HKV) -K /2 width=2/ #X #HLK #H
| lapply (lift_trans_be … HVW2 … HWU2 ? ?) -W2 // /2 width=1/ >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
+| #a #I #G #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
+| #I #G #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
+| #G #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
+| #G #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/
-| #a #K #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #L #d #e #HLK #X1 #HX1 #X2 #HX2
+| #a #G #K #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #L #d #e #HLK #X1 #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 #X #T3 #HX #HT23 #HX2 destruct
elim (lift_inv_flat1 … HX) -HX #W3 #V3 #HW23 #HV23 #HX destruct /4 width=5/
-| #a #K #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV1 #IHW12 #IHT12 #L #d #e #HLK #X1 #HX1 #X2 #HX2
+| #a #G #K #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV1 #IHW12 #IHT12 #L #d #e #HLK #X1 #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
qed.
(* Basic_1: includes: pr0_gen_lift pr2_gen_lift *)
-lemma cpr_inv_lift1: l_deliftable_sn cpr.
-#L #U1 #U2 #H elim H -L -U1 -U2
-[ * #L #i #K #d #e #_ #T1 #H
+lemma cpr_inv_lift1: ∀G. l_deliftable_sn (cpr G).
+#G #L #U1 #U2 #H elim H -G -L -U1 -U2
+[ * #G #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
+| #G #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_split … HVW2 d (i - e + 1)) -HVW2 [4: // |3: /2 width=1/ |2: /3 width=1/ ] -Hid -Hdie
#V1 #HV1 >plus_minus // <minus_minus // /2 width=1/ <minus_n_n <plus_n_O /3 width=8/
]
-| #a #I #L #V1 #V2 #U1 #U2 #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H
+| #a #I #G #L #V1 #V2 #U1 #U2 #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H
elim (lift_inv_bind2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct
elim (IHV12 … HLK … HWV1) -IHV12 #W2 #HW12 #HWV2
elim (IHU12 … HTU1) -IHU12 -HTU1 /3 width=5/
-| #I #L #V1 #V2 #U1 #U2 #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H
+| #I #G #L #V1 #V2 #U1 #U2 #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H
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/
-| #L #V #U1 #U #U2 #_ #HU2 #IHU1 #K #d #e #HLK #X #H
+| #G #L #V #U1 #U #U2 #_ #HU2 #IHU1 #K #d #e #HLK #X #H
elim (lift_inv_bind2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct
elim (IHU1 (K.ⓓW1) … HTU1) /2 width=1/ -L -U1 #T #HTU #HT1
elim (lift_div_le … HU2 … HTU) -U // /3 width=5/
-| #L #V #U1 #U2 #_ #IHU12 #K #d #e #HLK #X #H
+| #G #L #V #U1 #U2 #_ #IHU12 #K #d #e #HLK #X #H
elim (lift_inv_flat2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct
elim (IHU12 … HLK … HTU1) -L -U1 /3 width=3/
-| #a #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #K #d #e #HLK #X #HX
+| #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #K #d #e #HLK #X #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 … HLK … HV01) -V1 #V3 #HV32 #HV03
elim (IHT12 (K.ⓛW0) … HT01) -T1 /2 width=1/ #T3 #HT32 #HT03
elim (IHW12 … HLK … HW01) -W1 #W3 #HW32 #HW03
@ex2_intro [2: /3 width=2/ | skip |3: /2 width=1/ ] (**) (* /4 width=6/ is slow *)
-| #a #L #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV1 #IHW12 #IHT12 #K #d #e #HLK #X #HX
+| #a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV1 #IHW12 #IHT12 #K #d #e #HLK #X #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 (IHV1 … HLK … HV01) -V1 #V3 #HV3 #HV03
(* *)
(**************************************************************************)
-include "basic_2/notation/relations/pred_5.ma".
+include "basic_2/notation/relations/pred_6.ma".
include "basic_2/static/ssta.ma".
include "basic_2/reduction/cpr.ma".
(* CONTEXT-SENSITIVE EXTENDED PARALLEL REDUCTION FOR TERMS ******************)
-inductive cpx (h) (g): lenv → relation term ≝
-| cpx_atom : ∀I,L. cpx h g L (⓪{I}) (⓪{I})
-| cpx_sort : ∀L,k,l. deg h g k (l+1) → cpx h g L (⋆k) (⋆(next h k))
-| cpx_delta: ∀I,L,K,V,V2,W2,i.
- ⇩[0, i] L ≡ K.ⓑ{I}V → cpx h g K V V2 →
- ⇧[0, i + 1] V2 ≡ W2 → cpx h g L (#i) W2
-| cpx_bind : ∀a,I,L,V1,V2,T1,T2.
- cpx h g L V1 V2 → cpx h g (L. ⓑ{I}V1) T1 T2 →
- cpx h g L (ⓑ{a,I}V1.T1) (ⓑ{a,I}V2.T2)
-| cpx_flat : ∀I,L,V1,V2,T1,T2.
- cpx h g L V1 V2 → cpx h g L T1 T2 →
- cpx h g L (ⓕ{I}V1.T1) (ⓕ{I}V2.T2)
-| cpx_zeta : ∀L,V,T1,T,T2. cpx h g (L.ⓓV) T1 T →
- ⇧[0, 1] T2 ≡ T → cpx h g L (+ⓓV.T1) T2
-| cpx_tau : ∀L,V,T1,T2. cpx h g L T1 T2 → cpx h g L (ⓝV.T1) T2
-| cpx_ti : ∀L,V1,V2,T. cpx h g L V1 V2 → cpx h g L (ⓝV1.T) V2
-| cpx_beta : ∀a,L,V1,V2,W1,W2,T1,T2.
- cpx h g L V1 V2 → cpx h g L W1 W2 → cpx h g (L.ⓛW1) T1 T2 →
- cpx h g L (ⓐV1.ⓛ{a}W1.T1) (ⓓ{a}ⓝW2.V2.T2)
-| cpx_theta: ∀a,L,V1,V,V2,W1,W2,T1,T2.
- cpx h g L V1 V → ⇧[0, 1] V ≡ V2 → cpx h g L W1 W2 →
- cpx h g (L.ⓓW1) T1 T2 →
- cpx h g L (ⓐV1.ⓓ{a}W1.T1) (ⓓ{a}W2.ⓐV2.T2)
+(* avtivate genv *)
+inductive cpx (h) (g): relation4 genv lenv term term ≝
+| cpx_atom : ∀I,G,L. cpx h g G L (⓪{I}) (⓪{I})
+| cpx_sort : ∀G,L,k,l. deg h g k (l+1) → cpx h g G L (⋆k) (⋆(next h k))
+| cpx_delta: ∀I,G,L,K,V,V2,W2,i.
+ ⇩[0, i] L ≡ K.ⓑ{I}V → cpx h g G K V V2 →
+ ⇧[0, i + 1] V2 ≡ W2 → cpx h g G L (#i) W2
+| cpx_bind : ∀a,I,G,L,V1,V2,T1,T2.
+ cpx h g G L V1 V2 → cpx h g G (L.ⓑ{I}V1) T1 T2 →
+ cpx h g G L (ⓑ{a,I}V1.T1) (ⓑ{a,I}V2.T2)
+| cpx_flat : ∀I,G,L,V1,V2,T1,T2.
+ cpx h g G L V1 V2 → cpx h g G L T1 T2 →
+ cpx h g G L (ⓕ{I}V1.T1) (ⓕ{I}V2.T2)
+| cpx_zeta : ∀G,L,V,T1,T,T2. cpx h g G (L.ⓓV) T1 T →
+ ⇧[0, 1] T2 ≡ T → cpx h g G L (+ⓓV.T1) T2
+| cpx_tau : ∀G,L,V,T1,T2. cpx h g G L T1 T2 → cpx h g G L (ⓝV.T1) T2
+| cpx_ti : ∀G,L,V1,V2,T. cpx h g G L V1 V2 → cpx h g G L (ⓝV1.T) V2
+| cpx_beta : ∀a,G,L,V1,V2,W1,W2,T1,T2.
+ cpx h g G L V1 V2 → cpx h g G L W1 W2 → cpx h g G (L.ⓛW1) T1 T2 →
+ cpx h g G L (ⓐV1.ⓛ{a}W1.T1) (ⓓ{a}ⓝW2.V2.T2)
+| cpx_theta: ∀a,G,L,V1,V,V2,W1,W2,T1,T2.
+ cpx h g G L V1 V → ⇧[0, 1] V ≡ V2 → cpx h g G L W1 W2 →
+ cpx h g G (L.ⓓW1) T1 T2 →
+ cpx h g G L (ⓐV1.ⓓ{a}W1.T1) (ⓓ{a}W2.ⓐV2.T2)
.
interpretation
"context-sensitive extended parallel reduction (term)"
- 'PRed h g L T1 T2 = (cpx h g L T1 T2).
+ 'PRed h g G L T1 T2 = (cpx h g G L T1 T2).
(* Basic properties *********************************************************)
-lemma lsubr_cpx_trans: ∀h,g. lsub_trans … (cpx h g) lsubr.
-#h #g #L1 #T1 #T2 #H elim H -L1 -T1 -T2
+lemma lsubr_cpx_trans: ∀h,g,G. lsub_trans … (cpx h g G) lsubr.
+#h #g #G #L1 #T1 #T2 #H elim H -G -L1 -T1 -T2
[ //
| /2 width=2/
-| #I #L1 #K1 #V1 #V2 #W2 #i #HLK1 #_ #HVW2 #IHV12 #L2 #HL12
+| #I #G #L1 #K1 #V1 #V2 #W2 #i #HLK1 #_ #HVW2 #IHV12 #L2 #HL12
elim (lsubr_fwd_ldrop2_bind … HL12 … HLK1) -HL12 -HLK1 *
[ /3 width=7/ | /4 width=7/ ]
|4,9: /4 width=1/
qed-.
(* Note: this is "∀h,g,L. reflexive … (cpx h g L)" *)
-lemma cpx_refl: ∀h,g,T,L. ⦃G, L⦄ ⊢ T ➡[h, g] T.
-#h #g #T elim T -T // * /2 width=1/
+lemma cpx_refl: ∀h,g,G,T,L. ⦃G, L⦄ ⊢ T ➡[h, g] T.
+#h #g #G #T elim T -T // * /2 width=1/
qed.
-lemma cpr_cpx: ∀h,g,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡ T2 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2.
-#h #g #L #T1 #T2 #H elim H -L -T1 -T2 // /2 width=1/ /2 width=3/ /2 width=7/
+lemma cpr_cpx: ∀h,g,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡ T2 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2.
+#h #g #G #L #T1 #T2 #H elim H -L -T1 -T2 // /2 width=1/ /2 width=3/ /2 width=7/
qed.
-fact ssta_cpx_aux: ∀h,g,L,T1,T2,l0. ⦃G, L⦄ ⊢ T1 •[h, g] ⦃l0, T2⦄ →
+fact ssta_cpx_aux: ∀h,g,G,L,T1,T2,l0. ⦃G, L⦄ ⊢ T1 •[h, g] ⦃l0, T2⦄ →
∀l. l0 = l+1 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2.
-#h #g #L #T1 #T2 #l0 #H elim H -L -T1 -T2 -l0 /2 width=2/ /2 width=7/ /3 width=2/ /3 width=7/
+#h #g #G #L #T1 #T2 #l0 #H elim H -L -T1 -T2 -l0 /2 width=2/ /2 width=7/ /3 width=2/ /3 width=7/
qed-.
-lemma ssta_cpx: ∀h,g,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 •[h, g] ⦃l+1, T2⦄ → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2.
+lemma ssta_cpx: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 •[h, g] ⦃l+1, T2⦄ → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2.
/2 width=4 by ssta_cpx_aux/ qed.
-lemma cpx_pair_sn: ∀h,g,I,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V2 →
+lemma cpx_pair_sn: ∀h,g,I,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V2 →
∀T. ⦃G, L⦄ ⊢ ②{I}V1.T ➡[h, g] ②{I}V2.T.
#h #g * /2 width=1/ qed.
-lemma cpx_delift: ∀h,g,I,K,V,T1,L,d. ⇩[0, d] L ≡ (K.ⓑ{I}V) →
+lemma cpx_delift: ∀h,g,I,G,K,V,T1,L,d. ⇩[0, d] L ≡ (K.ⓑ{I}V) →
∃∃T2,T. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 & ⇧[d, 1] T ≡ T2.
-#h #g #I #K #V #T1 elim T1 -T1
+#h #g #I #G #K #V #T1 elim T1 -T1
[ * #i #L #d #HLK /2 width=4/
elim (lt_or_eq_or_gt i d) #Hid [1,3: /3 width=4/ ]
destruct
]
qed-.
-lemma cpx_append: ∀h,g. l_appendable_sn … (cpx h g).
-#h #g #K #T1 #T2 #H elim H -K -T1 -T2 // /2 width=1/ /2 width=3/
-#I #K #K0 #V1 #V2 #W2 #i #HK0 #_ #HVW2 #IHV12 #L
+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=1/ /2 width=3/
+#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/ (**) (* /3/ does not work *)
(* Basic inversion lemmas ***************************************************)
-fact cpx_inv_atom1_aux: ∀h,g,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 → ∀J. T1 = ⓪{J} →
+fact cpx_inv_atom1_aux: ∀h,g,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 → ∀J. T1 = ⓪{J} →
∨∨ T2 = ⓪{J}
| ∃∃k,l. deg h g k (l+1) & T2 = ⋆(next h k) & J = Sort k
- | ∃∃I,K,V,V2,i. ⇩[O, i] L ≡ K.ⓑ{I}V & ⦃h, K⦄ ⊢ V ➡[h, g] V2 &
+ | ∃∃I,K,V,V2,i. ⇩[O, i] L ≡ K.ⓑ{I}V & ⦃G, K⦄ ⊢ V ➡[h, g] V2 &
⇧[O, i + 1] V2 ≡ T2 & J = LRef i.
-#h #g #L #T1 #T2 * -L -T1 -T2
-[ #I #L #J #H destruct /2 width=1/
-| #L #k #l #Hkl #J #H destruct /3 width=5/
-| #I #L #K #V #V2 #T2 #i #HLK #HV2 #HVT2 #J #H destruct /3 width=9/
-| #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
-| #L #V1 #V2 #T #_ #J #H destruct
-| #a #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #J #H destruct
-| #a #L #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #J #H destruct
+#G #h #g #L #T1 #T2 * -L -T1 -T2
+[ #I #G #L #J #H destruct /2 width=1/
+| #G #L #k #l #Hkl #J #H destruct /3 width=5/
+| #I #G #L #K #V #V2 #T2 #i #HLK #HV2 #HVT2 #J #H destruct /3 width=9/
+| #a #I #G #L #V1 #V2 #T1 #T2 #_ #_ #J #H destruct
+| #I #G #L #V1 #V2 #T1 #T2 #_ #_ #J #H destruct
+| #G #L #V #T1 #T #T2 #_ #_ #J #H destruct
+| #G #L #V #T1 #T2 #_ #J #H destruct
+| #G #L #V1 #V2 #T #_ #J #H destruct
+| #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #J #H destruct
+| #a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #J #H destruct
]
qed-.
-lemma cpx_inv_atom1: ∀h,g,J,L,T2. ⦃G, L⦄ ⊢ ⓪{J} ➡[h, g] T2 →
+lemma cpx_inv_atom1: ∀h,g,J,G,L,T2. ⦃G, L⦄ ⊢ ⓪{J} ➡[h, g] T2 →
∨∨ T2 = ⓪{J}
| ∃∃k,l. deg h g k (l+1) & T2 = ⋆(next h k) & J = Sort k
- | ∃∃I,K,V,V2,i. ⇩[O, i] L ≡ K.ⓑ{I}V & ⦃h, K⦄ ⊢ V ➡[h, g] V2 &
+ | ∃∃I,K,V,V2,i. ⇩[O, i] L ≡ K.ⓑ{I}V & ⦃G, K⦄ ⊢ V ➡[h, g] V2 &
⇧[O, i + 1] V2 ≡ T2 & J = LRef i.
/2 width=3 by cpx_inv_atom1_aux/ qed-.
-lemma cpx_inv_sort1: ∀h,g,L,T2,k. ⦃G, L⦄ ⊢ ⋆k ➡[h, g] T2 → T2 = ⋆k ∨
+lemma cpx_inv_sort1: ∀h,g,G,L,T2,k. ⦃G, L⦄ ⊢ ⋆k ➡[h, g] T2 → T2 = ⋆k ∨
∃∃l. deg h g k (l+1) & T2 = ⋆(next h k).
-#h #g #L #T2 #k #H
+#h #g #G #L #T2 #k #H
elim (cpx_inv_atom1 … H) -H /2 width=1/ *
[ #k0 #l0 #Hkl0 #H1 #H2 destruct /3 width=4/
| #I #K #V #V2 #i #_ #_ #_ #H destruct
]
qed-.
-lemma cpx_inv_lref1: ∀h,g,L,T2,i. ⦃G, L⦄ ⊢ #i ➡[h, g] T2 →
+lemma cpx_inv_lref1: ∀h,g,G,L,T2,i. ⦃G, L⦄ ⊢ #i ➡[h, g] T2 →
T2 = #i ∨
- ∃∃I,K,V,V2. ⇩[O, i] L ≡ K. ⓑ{I}V & ⦃h, K⦄ ⊢ V ➡[h, g] V2 &
+ ∃∃I,K,V,V2. ⇩[O, i] L ≡ K. ⓑ{I}V & ⦃G, K⦄ ⊢ V ➡[h, g] V2 &
⇧[O, i + 1] V2 ≡ T2.
-#h #g #L #T2 #i #H
+#h #g #G #L #T2 #i #H
elim (cpx_inv_atom1 … H) -H /2 width=1/ *
[ #k #l #_ #_ #H destruct
| #I #K #V #V2 #j #HLK #HV2 #HVT2 #H destruct /3 width=7/
]
qed-.
-lemma cpx_inv_gref1: ∀h,g,L,T2,p. ⦃G, L⦄ ⊢ §p ➡[h, g] T2 → T2 = §p.
-#h #g #L #T2 #p #H
+lemma cpx_inv_gref1: ∀h,g,G,L,T2,p. ⦃G, L⦄ ⊢ §p ➡[h, g] T2 → T2 = §p.
+#h #g #G #L #T2 #p #H
elim (cpx_inv_atom1 … H) -H // *
[ #k #l #_ #_ #H destruct
| #I #K #V #V2 #i #_ #_ #_ #H destruct
]
qed-.
-fact cpx_inv_bind1_aux: ∀h,g,L,U1,U2. ⦃G, L⦄ ⊢ U1 ➡[h, g] U2 →
+fact cpx_inv_bind1_aux: ∀h,g,G,L,U1,U2. ⦃G, L⦄ ⊢ U1 ➡[h, g] U2 →
∀a,J,V1,T1. U1 = ⓑ{a,J}V1.T1 → (
- ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V2 & ⦃h, L.ⓑ{J}V1⦄ ⊢ T1 ➡[h, g] T2 &
+ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V2 & ⦃G, L.ⓑ{J}V1⦄ ⊢ T1 ➡[h, g] T2 &
U2 = ⓑ{a,J}V2.T2
) ∨
- ∃∃T. ⦃h, L.ⓓV1⦄ ⊢ T1 ➡[h, g] T & ⇧[0, 1] U2 ≡ T &
+ ∃∃T. ⦃G, L.ⓓV1⦄ ⊢ T1 ➡[h, g] T & ⇧[0, 1] U2 ≡ T &
a = true & J = Abbr.
-#h #g #L #U1 #U2 * -L -U1 -U2
-[ #I #L #b #J #W #U1 #H destruct
-| #L #k #l #_ #b #J #W #U1 #H destruct
-| #I #L #K #V #V2 #W2 #i #_ #_ #_ #b #J #W #U1 #H destruct
-| #a #I #L #V1 #V2 #T1 #T2 #HV12 #HT12 #b #J #W #U1 #H destruct /3 width=5/
-| #I #L #V1 #V2 #T1 #T2 #_ #_ #b #J #W #U1 #H destruct
-| #L #V #T1 #T #T2 #HT1 #HT2 #b #J #W #U1 #H destruct /3 width=3/
-| #L #V #T1 #T2 #_ #b #J #W #U1 #H destruct
-| #L #V1 #V2 #T #_ #b #J #W #U1 #H destruct
-| #a #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #b #J #W #U1 #H destruct
-| #a #L #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #b #J #W #U1 #H destruct
+#h #g #G #L #U1 #U2 * -L -U1 -U2
+[ #I #G #L #b #J #W #U1 #H destruct
+| #G #L #k #l #_ #b #J #W #U1 #H destruct
+| #I #G #L #K #V #V2 #W2 #i #_ #_ #_ #b #J #W #U1 #H destruct
+| #a #I #G #L #V1 #V2 #T1 #T2 #HV12 #HT12 #b #J #W #U1 #H destruct /3 width=5/
+| #I #G #L #V1 #V2 #T1 #T2 #_ #_ #b #J #W #U1 #H destruct
+| #G #L #V #T1 #T #T2 #HT1 #HT2 #b #J #W #U1 #H destruct /3 width=3/
+| #G #L #V #T1 #T2 #_ #b #J #W #U1 #H destruct
+| #G #L #V1 #V2 #T #_ #b #J #W #U1 #H destruct
+| #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #b #J #W #U1 #H destruct
+| #a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #b #J #W #U1 #H destruct
]
qed-.
-lemma cpx_inv_bind1: ∀h,g,a,I,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡[h, g] U2 → (
- ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V2 & ⦃h, L.ⓑ{I}V1⦄ ⊢ T1 ➡[h, g] T2 &
+lemma cpx_inv_bind1: ∀h,g,a,I,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡[h, g] U2 → (
+ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V2 & ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ➡[h, g] T2 &
U2 = ⓑ{a,I} V2. T2
) ∨
- ∃∃T. ⦃h, L.ⓓV1⦄ ⊢ T1 ➡[h, g] T & ⇧[0, 1] U2 ≡ T &
+ ∃∃T. ⦃G, L.ⓓV1⦄ ⊢ T1 ➡[h, g] T & ⇧[0, 1] U2 ≡ T &
a = true & I = Abbr.
/2 width=3 by cpx_inv_bind1_aux/ qed-.
-lemma cpx_inv_abbr1: ∀h,g,a,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓓ{a}V1.T1 ➡[h, g] U2 → (
- ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V2 & ⦃h, L.ⓓV1⦄ ⊢ T1 ➡[h, g] T2 &
+lemma cpx_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
) ∨
- ∃∃T. ⦃h, L.ⓓV1⦄ ⊢ T1 ➡[h, g] T & ⇧[0, 1] U2 ≡ T & a = true.
-#h #g #a #L #V1 #T1 #U2 #H
+ ∃∃T. ⦃G, L.ⓓV1⦄ ⊢ T1 ➡[h, g] T & ⇧[0, 1] U2 ≡ T & a = true.
+#h #g #a #G #L #V1 #T1 #U2 #H
elim (cpx_inv_bind1 … H) -H * /3 width=3/ /3 width=5/
qed-.
-lemma cpx_inv_abst1: ∀h,g,a,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓛ{a}V1.T1 ➡[h, g] U2 →
- ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V2 & ⦃h, L.ⓛV1⦄ ⊢ T1 ➡[h, g] T2 &
+lemma cpx_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 #L #V1 #T1 #U2 #H
+#h #g #a #G #L #V1 #T1 #U2 #H
elim (cpx_inv_bind1 … H) -H *
[ /3 width=5/
| #T #_ #_ #_ #H destruct
]
qed-.
-fact cpx_inv_flat1_aux: ∀h,g,L,U,U2. ⦃G, L⦄ ⊢ U ➡[h, g] U2 →
+fact cpx_inv_flat1_aux: ∀h,g,G,L,U,U2. ⦃G, L⦄ ⊢ U ➡[h, g] U2 →
∀J,V1,U1. U = ⓕ{J}V1.U1 →
∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V2 & ⦃G, L⦄ ⊢ U1 ➡[h, g] T2 &
U2 = ⓕ{J}V2.T2
| (⦃G, L⦄ ⊢ U1 ➡[h, g] U2 ∧ J = Cast)
| (⦃G, L⦄ ⊢ V1 ➡[h, g] U2 ∧ J = Cast)
| ∃∃a,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V2 & ⦃G, L⦄ ⊢ W1 ➡[h, g] W2 &
- ⦃h, L.ⓛW1⦄ ⊢ T1 ➡[h, g] T2 &
+ ⦃G, L.ⓛW1⦄ ⊢ T1 ➡[h, g] T2 &
U1 = ⓛ{a}W1.T1 &
U2 = ⓓ{a}ⓝW2.V2.T2 & J = Appl
| ∃∃a,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V & ⇧[0,1] V ≡ V2 &
- ⦃G, L⦄ ⊢ W1 ➡[h, g] W2 & ⦃h, L.ⓓW1⦄ ⊢ T1 ➡[h, g] T2 &
+ ⦃G, L⦄ ⊢ W1 ➡[h, g] W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ➡[h, g] T2 &
U1 = ⓓ{a}W1.T1 &
U2 = ⓓ{a}W2.ⓐV2.T2 & J = Appl.
-#h #g #L #U #U2 * -L -U -U2
-[ #I #L #J #W #U1 #H destruct
-| #L #k #l #_ #J #W #U1 #H destruct
-| #I #L #K #V #V2 #W2 #i #_ #_ #_ #J #W #U1 #H destruct
-| #a #I #L #V1 #V2 #T1 #T2 #_ #_ #J #W #U1 #H destruct
-| #I #L #V1 #V2 #T1 #T2 #HV12 #HT12 #J #W #U1 #H destruct /3 width=5/
-| #L #V #T1 #T #T2 #_ #_ #J #W #U1 #H destruct
-| #L #V #T1 #T2 #HT12 #J #W #U1 #H destruct /3 width=1/
-| #L #V1 #V2 #T #HV12 #J #W #U1 #H destruct /3 width=1/
-| #a #L #V1 #V2 #W1 #W2 #T1 #T2 #HV12 #HW12 #HT12 #J #W #U1 #H destruct /3 width=11/
-| #a #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 #HW12 #HT12 #J #W #U1 #H destruct /3 width=13/
+#h #g #G #L #U #U2 * -L -U -U2
+[ #I #G #L #J #W #U1 #H destruct
+| #G #L #k #l #_ #J #W #U1 #H destruct
+| #I #G #L #K #V #V2 #W2 #i #_ #_ #_ #J #W #U1 #H destruct
+| #a #I #G #L #V1 #V2 #T1 #T2 #_ #_ #J #W #U1 #H destruct
+| #I #G #L #V1 #V2 #T1 #T2 #HV12 #HT12 #J #W #U1 #H destruct /3 width=5/
+| #G #L #V #T1 #T #T2 #_ #_ #J #W #U1 #H destruct
+| #G #L #V #T1 #T2 #HT12 #J #W #U1 #H destruct /3 width=1/
+| #G #L #V1 #V2 #T #HV12 #J #W #U1 #H destruct /3 width=1/
+| #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HV12 #HW12 #HT12 #J #W #U1 #H destruct /3 width=11/
+| #a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 #HW12 #HT12 #J #W #U1 #H destruct /3 width=13/
]
qed-.
-lemma cpx_inv_flat1: ∀h,g,I,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓕ{I}V1.U1 ➡[h, g] U2 →
+lemma cpx_inv_flat1: ∀h,g,I,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓕ{I}V1.U1 ➡[h, g] U2 →
∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V2 & ⦃G, L⦄ ⊢ U1 ➡[h, g] T2 &
U2 = ⓕ{I} V2. T2
| (⦃G, L⦄ ⊢ U1 ➡[h, g] U2 ∧ I = Cast)
| (⦃G, L⦄ ⊢ V1 ➡[h, g] U2 ∧ I = Cast)
| ∃∃a,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V2 & ⦃G, L⦄ ⊢ W1 ➡[h, g] W2 &
- ⦃h, L.ⓛW1⦄ ⊢ T1 ➡[h, g] T2 &
+ ⦃G, L.ⓛW1⦄ ⊢ T1 ➡[h, g] T2 &
U1 = ⓛ{a}W1.T1 &
U2 = ⓓ{a}ⓝW2.V2.T2 & I = Appl
| ∃∃a,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V & ⇧[0,1] V ≡ V2 &
- ⦃G, L⦄ ⊢ W1 ➡[h, g] W2 & ⦃h, L.ⓓW1⦄ ⊢ T1 ➡[h, g] T2 &
+ ⦃G, L⦄ ⊢ W1 ➡[h, g] W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ➡[h, g] T2 &
U1 = ⓓ{a}W1.T1 &
U2 = ⓓ{a}W2.ⓐV2.T2 & I = Appl.
/2 width=3 by cpx_inv_flat1_aux/ qed-.
-lemma cpx_inv_appl1: ∀h,g,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓐ V1.U1 ➡[h, g] U2 →
+lemma cpx_inv_appl1: ∀h,g,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓐ V1.U1 ➡[h, g] U2 →
∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V2 & ⦃G, L⦄ ⊢ U1 ➡[h, g] T2 &
U2 = ⓐ V2. T2
| ∃∃a,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V2 & ⦃G, L⦄ ⊢ W1 ➡[h, g] W2 &
- ⦃h, L.ⓛW1⦄ ⊢ T1 ➡[h, g] T2 &
+ ⦃G, L.ⓛW1⦄ ⊢ T1 ➡[h, g] T2 &
U1 = ⓛ{a}W1.T1 & U2 = ⓓ{a}ⓝW2.V2.T2
| ∃∃a,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V & ⇧[0,1] V ≡ V2 &
- ⦃G, L⦄ ⊢ W1 ➡[h, g] W2 & ⦃h, L.ⓓW1⦄ ⊢ T1 ➡[h, g] T2 &
+ ⦃G, L⦄ ⊢ W1 ➡[h, g] W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ➡[h, g] T2 &
U1 = ⓓ{a}W1.T1 & U2 = ⓓ{a}W2. ⓐV2. T2.
-#h #g #L #V1 #U1 #U2 #H elim (cpx_inv_flat1 … H) -H *
+#h #g #G #L #V1 #U1 #U2 #H elim (cpx_inv_flat1 … H) -H *
[ /3 width=5/
|2,3: #_ #H destruct
| /3 width=11/
qed-.
(* Note: the main property of simple terms *)
-lemma cpx_inv_appl1_simple: ∀h,g,L,V1,T1,U. ⦃G, L⦄ ⊢ ⓐV1.T1 ➡[h, g] U → 𝐒⦃T1⦄ →
+lemma cpx_inv_appl1_simple: ∀h,g,G,L,V1,T1,U. ⦃G, L⦄ ⊢ ⓐV1.T1 ➡[h, g] U → 𝐒⦃T1⦄ →
∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V2 & ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 &
U = ⓐV2.T2.
-#h #g #L #V1 #T1 #U #H #HT1
+#h #g #G #L #V1 #T1 #U #H #HT1
elim (cpx_inv_appl1 … H) -H *
[ /2 width=5/
| #a #V2 #W1 #W2 #U1 #U2 #_ #_ #_ #H #_ destruct
]
qed-.
-lemma cpx_inv_cast1: ∀h,g,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓝV1.U1 ➡[h, g] U2 →
+lemma cpx_inv_cast1: ∀h,g,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓝV1.U1 ➡[h, g] U2 →
∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h, g] V2 & ⦃G, L⦄ ⊢ U1 ➡[h, g] T2 &
U2 = ⓝ V2. T2
| ⦃G, L⦄ ⊢ U1 ➡[h, g] U2
| ⦃G, L⦄ ⊢ V1 ➡[h, g] U2.
-#h #g #L #V1 #U1 #U2 #H elim (cpx_inv_flat1 … H) -H *
+#h #g #G #L #V1 #U1 #U2 #H elim (cpx_inv_flat1 … H) -H *
[ /3 width=5/
|2,3: /2 width=1/
| #a #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #H destruct
(* Basic forward lemmas *****************************************************)
-lemma cpx_fwd_bind1_minus: ∀h,g,I,L,V1,T1,T. ⦃G, L⦄ ⊢ -ⓑ{I}V1.T1 ➡[h, g] T → ∀b.
+lemma cpx_fwd_bind1_minus: ∀h,g,I,G,L,V1,T1,T. ⦃G, L⦄ ⊢ -ⓑ{I}V1.T1 ➡[h, g] T → ∀b.
∃∃V2,T2. ⦃G, L⦄ ⊢ ⓑ{b,I}V1.T1 ➡[h, g] ⓑ{b,I}V2.T2 &
T = -ⓑ{I}V2.T2.
-#h #g #I #L #V1 #T1 #T #H #b
+#h #g #I #G #L #V1 #T1 #T #H #b
elim (cpx_inv_bind1 … H) -H *
[ #V2 #T2 #HV12 #HT12 #H destruct /3 width=4/
| #T2 #_ #_ #H destruct
]
qed-.
-lemma cpx_fwd_shift1: ∀h,g,L1,L,T1,T. ⦃G, L⦄ ⊢ L1 @@ T1 ➡[h, g] T →
+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 #L1 @(lenv_ind_dx … L1) -L1 normalize
+#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
(* Advanced forward lemmas on context-sensitive extended irreducible terms **)
-lemma cpx_fwd_cix: ∀h,g,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃T1⦄ → T2 = T1.
-#h #g #L #T1 #T2 #H elim H -L -T1 -T2
+lemma cpx_fwd_cix: ∀h,g,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 → ⦃G, L⦄ ⊢ 𝐈[h, g]⦃T1⦄ → T2 = T1.
+#h #g #G #L #T1 #T2 #H elim H -G -L -T1 -T2
[ //
-| #L #k #l #Hkl #H elim (cix_inv_sort … Hkl H)
-| #I #L #K #V1 #V2 #W2 #i #HLK #_ #HVW2 #IHV12 #H
+| #G #L #k #l #Hkl #H elim (cix_inv_sort … Hkl H)
+| #I #G #L #K #V1 #V2 #W2 #i #HLK #_ #HVW2 #IHV12 #H
elim (cix_inv_delta … HLK) //
-| #a * #L #V1 #V2 #T1 #T2 #_ #_ #IHV1 #IHT1 #H
+| #a * #G #L #V1 #V2 #T1 #T2 #_ #_ #IHV1 #IHT1 #H
[ elim (cix_inv_bind … H) -H #HV1 #HT1 * #H destruct
lapply (IHV1 … HV1) -IHV1 -HV1 #H destruct
lapply (IHT1 … HT1) -IHT1 #H destruct //
| elim (cix_inv_ib2 … H) -H /2 width=1/ /3 width=2/
]
-| * #L #V1 #V2 #T1 #T2 #_ #_ #IHV1 #IHT1 #H
+| * #G #L #V1 #V2 #T1 #T2 #_ #_ #IHV1 #IHT1 #H
[ elim (cix_inv_appl … H) -H #HV1 #HT1 #_
>IHV1 -IHV1 // -HV1 >IHT1 -IHT1 //
| elim (cix_inv_ri2 … H) /2 width=1/
]
-| #L #V1 #T1 #T #T2 #_ #_ #_ #H
+| #G #L #V1 #T1 #T #T2 #_ #_ #_ #H
elim (cix_inv_ri2 … H) /2 width=1/
-| #L #V1 #T1 #T2 #_ #_ #H
+| #G #L #V1 #T1 #T2 #_ #_ #H
elim (cix_inv_ri2 … H) /2 width=1/
-| #L #V1 #V2 #T #_ #_ #H
+| #G #L #V1 #V2 #T #_ #_ #H
elim (cix_inv_ri2 … H) /2 width=1/
-| #a #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #H
+| #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #H
elim (cix_inv_appl … H) -H #_ #_ #H
elim (simple_inv_bind … H)
-| #a #L #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #_ #H
+| #a #G #L #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #_ #H
elim (cix_inv_appl … H) -H #_ #_ #H
elim (simple_inv_bind … H)
]
qed-.
-
(* Relocation properties ****************************************************)
-lemma cpx_lift: ∀h,g. l_liftable (cpx h g).
-#h #g #K #T1 #T2 #H elim H -K -T1 -T2
-[ #I #K #L #d #e #_ #U1 #H1 #U2 #H2
+lemma cpx_lift: ∀h,g,G. l_liftable (cpx h g G).
+#h #g #G #K #T1 #T2 #H elim H -G -K -T1 -T2
+[ #I #G #K #L #d #e #_ #U1 #H1 #U2 #H2
>(lift_mono … H1 … H2) -H1 -H2 //
-| #K #k #l #Hkl #L #d #e #_ #U1 #H1 #U2 #H2
+| #G #K #k #l #Hkl #L #d #e #_ #U1 #H1 #U2 #H2
>(lift_inv_sort1 … H1) -U1
>(lift_inv_sort1 … H2) -U2 /2 width=2/
-| #I #K #KV #V #V2 #W2 #i #HKV #HV2 #HVW2 #IHV2 #L #d #e #HLK #U1 #H #U2 #HWU2
+| #I #G #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 // <minus_plus #W2 #HVW2 #HWU2
elim (ldrop_trans_le … HLK … HKV) -K /2 width=2/ #X #HLK #H
| lapply (lift_trans_be … HVW2 … HWU2 ? ?) -W2 // /2 width=1/ >plus_plus_comm_23 #HVU2
lapply (ldrop_trans_ge_comm … HLK … HKV ?) -K // -Hid /3 width=7/
]
-| #a #I #K #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #d #e #HLK #U1 #H1 #U2 #H2
+| #a #I #G #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
+| #I #G #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
+| #G #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
+| #G #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/
-| #K #V1 #V2 #T #_ #IHV12 #L #d #e #HLK #U1 #H #U2 #HVU2
+| #G #K #V1 #V2 #T #_ #IHV12 #L #d #e #HLK #U1 #H #U2 #HVU2
elim (lift_inv_flat1 … H) -H #VV1 #TT1 #HVV1 #HTT1 #H destruct /3 width=5/
-| #a #K #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #L #d #e #HLK #X1 #HX1 #X2 #HX2
+| #a #G #K #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #L #d #e #HLK #X1 #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 #X #T3 #HX #HT23 #HX2 destruct
elim (lift_inv_flat1 … HX) -HX #W3 #V3 #HW23 #HV23 #HX destruct /4 width=5/
-| #a #K #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV1 #IHW12 #IHT12 #L #d #e #HLK #X1 #HX1 #X2 #HX2
+| #a #G #K #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV1 #IHW12 #IHT12 #L #d #e #HLK #X1 #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
]
qed.
-lemma cpx_inv_lift1: ∀h,g. l_deliftable_sn (cpx h g).
-#h #g #L #U1 #U2 #H elim H -L -U1 -U2
-[ * #L #i #K #d #e #_ #T1 #H
+lemma cpx_inv_lift1: ∀h,g,G. l_deliftable_sn (cpx h g G).
+#h #g #G #L #U1 #U2 #H elim H -G -L -U1 -U2
+[ * #G #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 #k #l #Hkl #K #d #e #_ #T1 #H
+| #G #L #k #l #Hkl #K #d #e #_ #T1 #H
lapply (lift_inv_sort2 … H) -H #H destruct /3 width=3/
-| #I #L #LV #V #V2 #W2 #i #HLV #HV2 #HVW2 #IHV2 #K #d #e #HLK #T1 #H
+| #I #G #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_split … HVW2 d (i - e + 1)) -HVW2 [4: // |3: /2 width=1/ |2: /3 width=1/ ] -Hid -Hdie
#V1 #HV1 >plus_minus // <minus_minus // /2 width=1/ <minus_n_n <plus_n_O /3 width=9/
]
-| #a #I #L #V1 #V2 #U1 #U2 #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H
+| #a #I #G #L #V1 #V2 #U1 #U2 #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H
elim (lift_inv_bind2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct
elim (IHV12 … HLK … HWV1) -IHV12 #W2 #HW12 #HWV2
elim (IHU12 … HTU1) -IHU12 -HTU1 /3 width=5/
-| #I #L #V1 #V2 #U1 #U2 #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H
+| #I #G #L #V1 #V2 #U1 #U2 #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H
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/
-| #L #V #U1 #U #U2 #_ #HU2 #IHU1 #K #d #e #HLK #X #H
+| #G #L #V #U1 #U #U2 #_ #HU2 #IHU1 #K #d #e #HLK #X #H
elim (lift_inv_bind2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct
elim (IHU1 (K.ⓓW1) … HTU1) /2 width=1/ -L -U1 #T #HTU #HT1
elim (lift_div_le … HU2 … HTU) -U // /3 width=5/
-| #L #V #U1 #U2 #_ #IHU12 #K #d #e #HLK #X #H
+| #G #L #V #U1 #U2 #_ #IHU12 #K #d #e #HLK #X #H
elim (lift_inv_flat2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct
elim (IHU12 … HLK … HTU1) -L -U1 /3 width=3/
-| #L #V1 #V2 #U1 #_ #IHV12 #K #d #e #HLK #X #H
+| #G #L #V1 #V2 #U1 #_ #IHV12 #K #d #e #HLK #X #H
elim (lift_inv_flat2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct
elim (IHV12 … HLK … HWV1) -L -V1 /3 width=3/
-| #a #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #K #d #e #HLK #X #HX
+| #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #K #d #e #HLK #X #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 … HLK … HV01) -V1 #V3 #HV32 #HV03
elim (IHT12 (K.ⓛW0) … HT01) -T1 /2 width=1/ #T3 #HT32 #HT03
elim (IHW12 … HLK … HW01) -W1 #W3 #HW32 #HW03
@ex2_intro [2: /3 width=2/ | skip |3: /2 width=1/ ] (**) (* /4 width=6/ is slow *)
-| #a #L #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV1 #IHW12 #IHT12 #K #d #e #HLK #X #HX
+| #a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV1 #IHW12 #IHT12 #K #d #e #HLK #X #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 (IHV1 … HLK … HV01) -V1 #V3 #HV3 #HV03
(* Properties on supclosure *************************************************)
-lemma fsupq_cpx_trans: ∀h,g,L1,L2,T1,T2. ⦃L1, T1⦄ ⊃⸮ ⦃L2, T2⦄ →
- ∀U2. ⦃h, L2⦄ ⊢ T2 ➡[h, g] U2 →
- ∃∃U1. ⦃h, L1⦄ ⊢ T1 ➡[h, g] U1 & ⦃L1, U1⦄ ⊃⸮ ⦃L2, U2⦄.
-#h #g #L1 #L2 #T1 #T2 #H elim H -L1 -L2 -T1 -T2 [1: /2 width=3/ |3,4,5: /3 width=3/ ]
-[ #I #L1 #V2 #U2 #HVU2
+lemma fsupq_cpx_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡[h, g] U2 →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡[h, g] U1 & ⦃G1, L1, U1⦄ ⊃⸮ ⦃G2, L2, U2⦄.
+#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 [1: /2 width=3/ |3,4,5: /3 width=3/ ]
+[ #I #G #L1 #V2 #U2 #HVU2
elim (lift_total U2 0 1) /4 width=9/
-| #L1 #K1 #K2 #T1 #T2 #U1 #d #e #HLK1 #HTU1 #_ #IHT12 #U2 #HTU2
+| #G1 #G2 #L1 #K1 #K2 #T1 #T2 #U1 #d #e #HLK1 #HTU1 #_ #IHT12 #U2 #HTU2
elim (IHT12 … HTU2) -IHT12 -HTU2 #T #HT1 #HT2
elim (lift_total T d e) #U #HTU
lapply (cpx_lift … HT1 … HLK1 … HTU1 … HTU) -HT1 -HTU1 /3 width=11/
]
qed-.
-lemma fsupq_ssta_trans: ∀h,g,L1,L2,T1,T2. ⦃L1, T1⦄ ⊃⸮ ⦃L2, T2⦄ →
- ∀U2,l. ⦃h, L2⦄ ⊢ T2 •[h, g] ⦃l+1, U2⦄ →
- ∃∃U1. ⦃h, L1⦄ ⊢ T1 ➡[h, g] U1 & ⦃L1, U1⦄ ⊃⸮ ⦃L2, U2⦄.
+lemma fsupq_ssta_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ →
+ ∀U2,l. ⦃G2, L2⦄ ⊢ T2 •[h, g] ⦃l+1, U2⦄ →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡[h, g] U1 & ⦃G1, L1, U1⦄ ⊃⸮ ⦃G2, L2, U2⦄.
/3 width=4 by fsupq_cpx_trans, ssta_cpx/ qed-.
-lemma fsup_cpx_trans: ∀h,g,L1,L2,T1,T2. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ →
- ∀U2. ⦃h, L2⦄ ⊢ T2 ➡[h, g] U2 →
- ∃∃U1. ⦃h, L1⦄ ⊢ T1 ➡[h, g] U1 & ⦃L1, U1⦄ ⊃⸮ ⦃L2, U2⦄.
+lemma fsup_cpx_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡[h, g] U2 →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡[h, g] U1 & ⦃G1, L1, U1⦄ ⊃⸮ ⦃G2, L2, U2⦄.
/3 width=3 by fsupq_cpx_trans, fsup_fsupq/ qed-.
-lemma fsup_ssta_trans: ∀h,g,L1,L2,T1,T2. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ →
- ∀U2,l. ⦃h, L2⦄ ⊢ T2 •[h, g] ⦃l+1, U2⦄ →
- ∃∃U1. ⦃h, L1⦄ ⊢ T1 ➡[h, g] U1 & ⦃L1, U1⦄ ⊃⸮ ⦃L2, U2⦄.
+lemma fsup_ssta_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ →
+ ∀U2,l. ⦃G2, L2⦄ ⊢ T2 •[h, g] ⦃l+1, U2⦄ →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡[h, g] U1 & ⦃G1, L1, U1⦄ ⊃⸮ ⦃G2, L2, U2⦄.
/3 width=4 by fsupq_ssta_trans, fsup_fsupq/ qed-.
(* *)
(**************************************************************************)
-include "basic_2/notation/relations/reducible_2.ma".
+include "basic_2/notation/relations/reducible_3.ma".
+include "basic_2/grammar/genv.ma".
include "basic_2/relocation/ldrop.ma".
(* CONTEXT-SENSITIVE REDUCIBLE TERMS ****************************************)
definition ib2: relation2 bool bind2 ≝
λa,I. I = Abst ∨ Bind2 a I = Bind2 false Abbr.
+(* activate genv *)
(* reducible terms *)
-inductive crr: lenv → predicate term ≝
-| crr_delta : ∀L,K,V,i. ⇩[0, i] L ≡ K.ⓓV → crr L (#i)
-| crr_appl_sn: ∀L,V,T. crr L V → crr L (ⓐV.T)
-| crr_appl_dx: ∀L,V,T. crr L T → crr L (ⓐV.T)
-| crr_ri2 : ∀I,L,V,T. ri2 I → crr L (②{I}V.T)
-| crr_ib2_sn : ∀a,I,L,V,T. ib2 a I → crr L V → crr L (ⓑ{a,I}V.T)
-| crr_ib2_dx : ∀a,I,L,V,T. ib2 a I → crr (L.ⓑ{I}V) T → crr L (ⓑ{a,I}V.T)
-| crr_beta : ∀a,L,V,W,T. crr L (ⓐV. ⓛ{a}W.T)
-| crr_theta : ∀a,L,V,W,T. crr L (ⓐV. ⓓ{a}W.T)
+inductive crr (G:genv): relation2 lenv term ≝
+| crr_delta : ∀L,K,V,i. ⇩[0, i] L ≡ K.ⓓV → crr G L (#i)
+| crr_appl_sn: ∀L,V,T. crr G L V → crr G L (ⓐV.T)
+| crr_appl_dx: ∀L,V,T. crr G L T → crr G L (ⓐV.T)
+| crr_ri2 : ∀I,L,V,T. ri2 I → crr G L (②{I}V.T)
+| crr_ib2_sn : ∀a,I,L,V,T. ib2 a I → crr G L V → crr G L (ⓑ{a,I}V.T)
+| crr_ib2_dx : ∀a,I,L,V,T. ib2 a I → crr G (L.ⓑ{I}V) T → crr G L (ⓑ{a,I}V.T)
+| crr_beta : ∀a,L,V,W,T. crr G L (ⓐV.ⓛ{a}W.T)
+| crr_theta : ∀a,L,V,W,T. crr G L (ⓐV.ⓓ{a}W.T)
.
interpretation
"context-sensitive reducibility (term)"
- 'Reducible L T = (crr L T).
+ 'Reducible G L T = (crr G L T).
(* Basic inversion lemmas ***************************************************)
-fact crr_inv_sort_aux: ∀L,T,k. ⦃G, L⦄ ⊢ 𝐑⦃T⦄ → T = ⋆k → ⊥.
-#L #T #k0 * -L -T
+fact crr_inv_sort_aux: ∀G,L,T,k. ⦃G, L⦄ ⊢ 𝐑⦃T⦄ → T = ⋆k → ⊥.
+#G #L #T #k0 * -L -T
[ #L #K #V #i #HLK #H destruct
| #L #V #T #_ #H destruct
| #L #V #T #_ #H destruct
]
qed-.
-lemma crr_inv_sort: ∀L,k. ⦃G, L⦄ ⊢ 𝐑⦃⋆k⦄ → ⊥.
-/2 width=5 by crr_inv_sort_aux/ qed-.
+lemma crr_inv_sort: ∀G,L,k. ⦃G, L⦄ ⊢ 𝐑⦃⋆k⦄ → ⊥.
+/2 width=6 by crr_inv_sort_aux/ qed-.
-fact crr_inv_lref_aux: ∀L,T,i. ⦃G, L⦄ ⊢ 𝐑⦃T⦄ → T = #i → ∃∃K,V. ⇩[0, i] L ≡ K.ⓓV.
-#L #T #j * -L -T
+fact crr_inv_lref_aux: ∀G,L,T,i. ⦃G, L⦄ ⊢ 𝐑⦃T⦄ → T = #i →
+ ∃∃K,V. ⇩[0, i] L ≡ K.ⓓV.
+#G #L #T #j * -L -T
[ #L #K #V #i #HLK #H destruct /2 width=3/
| #L #V #T #_ #H destruct
| #L #V #T #_ #H destruct
]
qed-.
-lemma crr_inv_lref: ∀L,i. ⦃G, L⦄ ⊢ 𝐑⦃#i⦄ → ∃∃K,V. ⇩[0, i] L ≡ K.ⓓV.
-/2 width=3 by crr_inv_lref_aux/ qed-.
+lemma crr_inv_lref: ∀G,L,i. ⦃G, L⦄ ⊢ 𝐑⦃#i⦄ → ∃∃K,V. ⇩[0, i] L ≡ K.ⓓV.
+/2 width=4 by crr_inv_lref_aux/ qed-.
-fact crr_inv_gref_aux: ∀L,T,p. ⦃G, L⦄ ⊢ 𝐑⦃T⦄ → T = §p → ⊥.
-#L #T #q * -L -T
+fact crr_inv_gref_aux: ∀G,L,T,p. ⦃G, L⦄ ⊢ 𝐑⦃T⦄ → T = §p → ⊥.
+#G #L #T #q * -L -T
[ #L #K #V #i #HLK #H destruct
| #L #V #T #_ #H destruct
| #L #V #T #_ #H destruct
]
qed-.
-lemma crr_inv_gref: ∀L,p. ⦃G, L⦄ ⊢ 𝐑⦃§p⦄ → ⊥.
-/2 width=5 by crr_inv_gref_aux/ qed-.
+lemma crr_inv_gref: ∀G,L,p. ⦃G, L⦄ ⊢ 𝐑⦃§p⦄ → ⊥.
+/2 width=6 by crr_inv_gref_aux/ qed-.
-lemma trr_inv_atom: ∀I. ⋆ ⊢ 𝐑⦃⓪{I}⦄ → ⊥.
-* #i #H
+lemma trr_inv_atom: ∀G,I. ⦃G, ⋆⦄ ⊢ 𝐑⦃⓪{I}⦄ → ⊥.
+#G * #i #H
[ elim (crr_inv_sort … H)
| elim (crr_inv_lref … H) -H #L #V #H
elim (ldrop_inv_atom1 … H) -H #H destruct
]
qed-.
-fact crr_inv_ib2_aux: ∀a,I,L,W,U,T. ib2 a I → ⦃G, L⦄ ⊢ 𝐑⦃T⦄ → T = ⓑ{a,I}W.U →
- ⦃G, L⦄ ⊢ 𝐑⦃W⦄ ∨ L.ⓑ{I}W ⊢ 𝐑⦃U⦄.
-#b #J #L #W0 #U #T #HI * -L -T
+fact crr_inv_ib2_aux: ∀a,I,G,L,W,U,T. ib2 a I → ⦃G, L⦄ ⊢ 𝐑⦃T⦄ → T = ⓑ{a,I}W.U →
+ ⦃G, L⦄ ⊢ 𝐑⦃W⦄ ∨ ⦃G, L.ⓑ{I}W⦄ ⊢ 𝐑⦃U⦄.
+#G #b #J #L #W0 #U #T #HI * -L -T
[ #L #K #V #i #_ #H destruct
| #L #V #T #_ #H destruct
| #L #V #T #_ #H destruct
]
qed-.
-lemma crr_inv_ib2: ∀a,I,L,W,T. ib2 a I → ⦃G, L⦄ ⊢ 𝐑⦃ⓑ{a,I}W.T⦄ →
- ⦃G, L⦄ ⊢ 𝐑⦃W⦄ ∨ L.ⓑ{I}W ⊢ 𝐑⦃T⦄.
+lemma crr_inv_ib2: ∀a,I,G,L,W,T. ib2 a I → ⦃G, L⦄ ⊢ 𝐑⦃ⓑ{a,I}W.T⦄ →
+ ⦃G, L⦄ ⊢ 𝐑⦃W⦄ ∨ ⦃G, L.ⓑ{I}W⦄ ⊢ 𝐑⦃T⦄.
/2 width=5 by crr_inv_ib2_aux/ qed-.
-fact crr_inv_appl_aux: ∀L,W,U,T. ⦃G, L⦄ ⊢ 𝐑⦃T⦄ → T = ⓐW.U →
+fact crr_inv_appl_aux: ∀G,L,W,U,T. ⦃G, L⦄ ⊢ 𝐑⦃T⦄ → T = ⓐW.U →
∨∨ ⦃G, L⦄ ⊢ 𝐑⦃W⦄ | ⦃G, L⦄ ⊢ 𝐑⦃U⦄ | (𝐒⦃U⦄ → ⊥).
-#L #W0 #U #T * -L -T
+#G #L #W0 #U #T * -L -T
[ #L #K #V #i #_ #H destruct
| #L #V #T #HV #H destruct /2 width=1/
| #L #V #T #HT #H destruct /2 width=1/
]
qed-.
-lemma crr_inv_appl: ∀L,V,T. ⦃G, L⦄ ⊢ 𝐑⦃ⓐV.T⦄ → ∨∨ ⦃G, L⦄ ⊢ 𝐑⦃V⦄ | ⦃G, L⦄ ⊢ 𝐑⦃T⦄ | (𝐒⦃T⦄ → ⊥).
+lemma crr_inv_appl: ∀G,L,V,T. ⦃G, L⦄ ⊢ 𝐑⦃ⓐV.T⦄ →
+ ∨∨ ⦃G, L⦄ ⊢ 𝐑⦃V⦄ | ⦃G, L⦄ ⊢ 𝐑⦃T⦄ | (𝐒⦃T⦄ → ⊥).
/2 width=3 by crr_inv_appl_aux/ qed-.
(* Advanved properties ******************************************************)
-lemma crr_append_sn: ∀L,K,T. ⦃G, L⦄ ⊢ 𝐑⦃T⦄ → K @@ ⦃G, L⦄ ⊢ 𝐑⦃T⦄.
-#L #K0 #T #H elim H -L -T /2 width=1/
+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: ∀L,T. ⋆ ⊢ 𝐑⦃T⦄ → ⦃G, L⦄ ⊢ 𝐑⦃T⦄.
-#L #T #H lapply (crr_append_sn … H) //
+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: ∀L1,T,W. L1 ⊢ 𝐑⦃T⦄ →
- ∀L2. L1 = ⋆.ⓛW @@ L2 → L2 ⊢ 𝐑⦃T⦄.
-#L1 #T #W #H elim H -L1 -T /2 width=1/ /3 width=1/
+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
]
qed.
-lemma crr_inv_labst_last: ∀L,T,W. ⋆.ⓛW @@ ⦃G, L⦄ ⊢ 𝐑⦃T⦄ → ⦃G, L⦄ ⊢ 𝐑⦃T⦄.
+lemma crr_inv_labst_last: ∀G,L,T,W. ⦃G, ⋆.ⓛW @@ L⦄ ⊢ 𝐑⦃T⦄ → ⦃G, L⦄ ⊢ 𝐑⦃T⦄.
/2 width=4/ qed-.
-lemma crr_inv_trr: ∀T,W. ⋆.ⓛW ⊢ 𝐑⦃T⦄ → ⋆ ⊢ 𝐑⦃T⦄.
+lemma crr_inv_trr: ∀G,T,W. ⦃G, ⋆.ⓛW⦄ ⊢ 𝐑⦃T⦄ → ⦃G, ⋆⦄ ⊢ 𝐑⦃T⦄.
/2 width=4/ qed-.
(* Properties on relocation *************************************************)
-lemma crr_lift: ∀K,T. K ⊢ 𝐑⦃T⦄ → ∀L,d,e. ⇩[d, e] L ≡ K →
+lemma crr_lift: ∀G,K,T. ⦃G, K⦄ ⊢ 𝐑⦃T⦄ → ∀L,d,e. ⇩[d, e] L ≡ K →
∀U. ⇧[d, e] T ≡ U → ⦃G, L⦄ ⊢ 𝐑⦃U⦄.
-#K #T #H elim H -K -T
+#G #K #T #H elim H -K -T
[ #K #K0 #V #i #HK0 #L #d #e #HLK #X #H
elim (lift_inv_lref1 … H) -H * #Hid #H destruct
[ elim (ldrop_trans_lt … HLK … HK0) -K // /2 width=4/
]
qed.
-lemma crr_inv_lift: ∀L,U. ⦃G, L⦄ ⊢ 𝐑⦃U⦄ → ∀K,d,e. ⇩[d, e] L ≡ K →
- ∀T. ⇧[d, e] T ≡ U → K ⊢ 𝐑⦃T⦄.
-#L #U #H elim H -L -U
+lemma crr_inv_lift: ∀G,L,U. ⦃G, L⦄ ⊢ 𝐑⦃U⦄ → ∀K,d,e. ⇩[d, e] L ≡ K →
+ ∀T. ⇧[d, e] T ≡ U → ⦃G, K⦄ ⊢ 𝐑⦃T⦄.
+#G #L #U #H elim H -L -U
[ #L #L0 #W #i #HK0 #K #d #e #HLK #X #H
elim (lift_inv_lref2 … H) -H * #Hid #H destruct
[ elim (ldrop_conf_lt … HLK … HK0) -L // /2 width=4/
elim (lift_inv_flat2 … H) -H #V #X0 #_ #H0 #H destruct
elim (lift_inv_bind2 … H0) -H0 #V0 #T #_ #_ #H0 destruct /2 width=1/
]
-qed.
+qed-.
(* *)
(**************************************************************************)
-include "basic_2/notation/relations/reducible_4.ma".
+include "basic_2/notation/relations/reducible_5.ma".
include "basic_2/static/sd.ma".
include "basic_2/reduction/crr.ma".
(* CONTEXT-SENSITIVE EXTENDED REDUCIBLE TERMS *******************************)
+(* activate genv *)
(* extended reducible terms *)
-inductive crx (h) (g): lenv → predicate term ≝
-| crx_sort : ∀L,k,l. deg h g k (l+1) → crx h g L (⋆k)
-| crx_delta : ∀I,L,K,V,i. ⇩[0, i] L ≡ K.ⓑ{I}V → crx h g L (#i)
-| crx_appl_sn: ∀L,V,T. crx h g L V → crx h g L (ⓐV.T)
-| crx_appl_dx: ∀L,V,T. crx h g L T → crx h g L (ⓐV.T)
-| crx_ri2 : ∀I,L,V,T. ri2 I → crx h g L (②{I}V.T)
-| crx_ib2_sn : ∀a,I,L,V,T. ib2 a I → crx h g L V → crx h g L (ⓑ{a,I}V.T)
-| crx_ib2_dx : ∀a,I,L,V,T. ib2 a I → crx h g (L.ⓑ{I}V) T → crx h g L (ⓑ{a,I}V.T)
-| crx_beta : ∀a,L,V,W,T. crx h g L (ⓐV. ⓛ{a}W.T)
-| crx_theta : ∀a,L,V,W,T. crx h g L (ⓐV. ⓓ{a}W.T)
+inductive crx (h) (g) (G:genv): relation2 lenv term ≝
+| crx_sort : ∀L,k,l. deg h g k (l+1) → crx h g G L (⋆k)
+| crx_delta : ∀I,L,K,V,i. ⇩[0, i] L ≡ K.ⓑ{I}V → crx h g G L (#i)
+| crx_appl_sn: ∀L,V,T. crx h g G L V → crx h g G L (ⓐV.T)
+| crx_appl_dx: ∀L,V,T. crx h g G L T → crx h g G L (ⓐV.T)
+| crx_ri2 : ∀I,L,V,T. ri2 I → crx h g G L (②{I}V.T)
+| crx_ib2_sn : ∀a,I,L,V,T. ib2 a I → crx h g G L V → crx h g G L (ⓑ{a,I}V.T)
+| crx_ib2_dx : ∀a,I,L,V,T. ib2 a I → crx h g G (L.ⓑ{I}V) T → crx h g G L (ⓑ{a,I}V.T)
+| crx_beta : ∀a,L,V,W,T. crx h g G L (ⓐV. ⓛ{a}W.T)
+| crx_theta : ∀a,L,V,W,T. crx h g G L (ⓐV. ⓓ{a}W.T)
.
interpretation
"context-sensitive extended reducibility (term)"
- 'Reducible h g L T = (crx h g L T).
+ 'Reducible h g G L T = (crx h g G L T).
(* Basic properties *********************************************************)
-lemma crr_crx: ∀h,g,L,T. ⦃G, L⦄ ⊢ 𝐑⦃T⦄ → ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄.
-#h #g #L #T #H elim H -L -T // /2 width=1/ /2 width=4/
+lemma crr_crx: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ 𝐑⦃T⦄ → ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄.
+#h #g #G #L #T #H elim H -L -T // /2 width=1/ /2 width=4/
qed.
(* Basic inversion lemmas ***************************************************)
-fact crx_inv_sort_aux: ∀h,g,L,T,k. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄ → T = ⋆k →
+fact crx_inv_sort_aux: ∀h,g,G,L,T,k. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄ → T = ⋆k →
∃l. deg h g k (l+1).
-#h #g #L #T #k0 * -L -T
+#h #g #G #L #T #k0 * -L -T
[ #L #k #l #Hkl #H destruct /2 width=2/
| #I #L #K #V #i #HLK #H destruct
| #L #V #T #_ #H destruct
]
qed-.
-lemma crx_inv_sort: ∀h,g,L,k. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃⋆k⦄ → ∃l. deg h g k (l+1).
-/2 width=4 by crx_inv_sort_aux/ qed-.
+lemma crx_inv_sort: ∀h,g,G,L,k. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃⋆k⦄ → ∃l. deg h g k (l+1).
+/2 width=5 by crx_inv_sort_aux/ qed-.
-fact crx_inv_lref_aux: ∀h,g,L,T,i. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄ → T = #i →
+fact crx_inv_lref_aux: ∀h,g,G,L,T,i. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄ → T = #i →
∃∃I,K,V. ⇩[0, i] L ≡ K.ⓑ{I}V.
-#h #g #L #T #j * -L -T
+#h #g #G #L #T #j * -L -T
[ #L #k #l #_ #H destruct
| #I #L #K #V #i #HLK #H destruct /2 width=4/
| #L #V #T #_ #H destruct
]
qed-.
-lemma crx_inv_lref: ∀h,g,L,i. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃#i⦄ → ∃∃I,K,V. ⇩[0, i] L ≡ K.ⓑ{I}V.
-/2 width=5 by crx_inv_lref_aux/ qed-.
+lemma crx_inv_lref: ∀h,g,G,L,i. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃#i⦄ → ∃∃I,K,V. ⇩[0, i] L ≡ K.ⓑ{I}V.
+/2 width=6 by crx_inv_lref_aux/ qed-.
-fact crx_inv_gref_aux: ∀h,g,L,T,p. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄ → T = §p → ⊥.
-#h #g #L #T #q * -L -T
+fact crx_inv_gref_aux: ∀h,g,G,L,T,p. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄ → T = §p → ⊥.
+#h #g #G #L #T #q * -L -T
[ #L #k #l #_ #H destruct
| #I #L #K #V #i #HLK #H destruct
| #L #V #T #_ #H destruct
]
qed-.
-lemma crx_inv_gref: ∀h,g,L,p. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃§p⦄ → ⊥.
-/2 width=7 by crx_inv_gref_aux/ qed-.
+lemma crx_inv_gref: ∀h,g,G,L,p. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃§p⦄ → ⊥.
+/2 width=8 by crx_inv_gref_aux/ qed-.
-lemma trx_inv_atom: ∀h,g,I. ⦃h, ⋆⦄ ⊢ 𝐑[h, g]⦃⓪{I}⦄ →
+lemma trx_inv_atom: ∀h,g,I,G. ⦃G, ⋆⦄ ⊢ 𝐑[h, g]⦃⓪{I}⦄ →
∃∃k,l. deg h g k (l+1) & I = Sort k.
-#h #g * #i #H
+#h #g * #i #G #H
[ elim (crx_inv_sort … H) -H /2 width=4/
| elim (crx_inv_lref … H) -H #I #L #V #H
elim (ldrop_inv_atom1 … H) -H #H destruct
]
qed-.
-fact crx_inv_ib2_aux: ∀h,g,a,I,L,W,U,T. ib2 a I → ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄ →
- T = ⓑ{a,I}W.U → ⦃G, L⦄ ⊢ 𝐑[h, g]⦃W⦄ ∨ ⦃h, L.ⓑ{I}W⦄ ⊢ 𝐑[h, g]⦃U⦄.
-#h #g #b #J #L #W0 #U #T #HI * -L -T
+fact crx_inv_ib2_aux: ∀h,g,a,I,G,L,W,U,T. ib2 a I → ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄ →
+ T = ⓑ{a,I}W.U → ⦃G, L⦄ ⊢ 𝐑[h, g]⦃W⦄ ∨ ⦃G, L.ⓑ{I}W⦄ ⊢ 𝐑[h, g]⦃U⦄.
+#h #g #b #J #G #L #W0 #U #T #HI * -L -T
[ #L #k #l #_ #H destruct
| #I #L #K #V #i #_ #H destruct
| #L #V #T #_ #H destruct
]
qed-.
-lemma crx_inv_ib2: ∀h,g,a,I,L,W,T. ib2 a I → ⦃G, L⦄ ⊢ 𝐑[h, g]⦃ⓑ{a,I}W.T⦄ →
- ⦃G, L⦄ ⊢ 𝐑[h, g]⦃W⦄ ∨ ⦃h, L.ⓑ{I}W⦄ ⊢ 𝐑[h, g]⦃T⦄.
+lemma crx_inv_ib2: ∀h,g,a,I,G,L,W,T. ib2 a I → ⦃G, L⦄ ⊢ 𝐑[h, g]⦃ⓑ{a,I}W.T⦄ →
+ ⦃G, L⦄ ⊢ 𝐑[h, g]⦃W⦄ ∨ ⦃G, L.ⓑ{I}W⦄ ⊢ 𝐑[h, g]⦃T⦄.
/2 width=5 by crx_inv_ib2_aux/ qed-.
-fact crx_inv_appl_aux: ∀h,g,L,W,U,T. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄ → T = ⓐW.U →
+fact crx_inv_appl_aux: ∀h,g,G,L,W,U,T. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄ → T = ⓐW.U →
∨∨ ⦃G, L⦄ ⊢ 𝐑[h, g]⦃W⦄ | ⦃G, L⦄ ⊢ 𝐑[h, g]⦃U⦄ | (𝐒⦃U⦄ → ⊥).
-#h #g #L #W0 #U #T * -L -T
+#h #g #G #L #W0 #U #T * -L -T
[ #L #k #l #_ #H destruct
| #I #L #K #V #i #_ #H destruct
| #L #V #T #HV #H destruct /2 width=1/
]
qed-.
-lemma crx_inv_appl: ∀h,g,L,V,T. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃ⓐV.T⦄ →
+lemma crx_inv_appl: ∀h,g,G,L,V,T. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃ⓐV.T⦄ →
∨∨ ⦃G, L⦄ ⊢ 𝐑[h, g]⦃V⦄ | ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄ | (𝐒⦃T⦄ → ⊥).
/2 width=3 by crx_inv_appl_aux/ qed-.
(* Advanved properties ******************************************************)
-lemma crx_append_sn: ∀h,g,L,K,T. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄ → ⦃h, K @@ L⦄ ⊢ 𝐑[h, g]⦃T⦄.
-#h #g #L #K0 #T #H elim H -L -T /2 width=1/ /2 width=2/
+lemma crx_append_sn: ∀h,g,G,L,K,T. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄ → ⦃G, K @@ L⦄ ⊢ 𝐑[h, g]⦃T⦄.
+#h #g #G #L #K0 #T #H elim H -L -T /2 width=1/ /2 width=2/
#I #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=4/
qed.
-lemma trx_crx: ∀h,g,L,T. ⦃h, ⋆⦄ ⊢ 𝐑[h, g]⦃T⦄ → ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄.
-#h #g #L #T #H lapply (crx_append_sn … H) //
+lemma trx_crx: ∀h,g,G,L,T. ⦃G, ⋆⦄ ⊢ 𝐑[h, g]⦃T⦄ → ⦃G, L⦄ ⊢ 𝐑[h, g]⦃T⦄.
+#h #g #G #L #T #H lapply (crx_append_sn … H) //
qed.
(* Properties on relocation *************************************************)
-lemma crx_lift: ∀h,g,K,T. ⦃h, K⦄ ⊢ 𝐑[h, g]⦃T⦄ → ∀L,d,e. ⇩[d, e] L ≡ K →
+lemma crx_lift: ∀h,g,G,K,T. ⦃G, K⦄ ⊢ 𝐑[h, g]⦃T⦄ → ∀L,d,e. ⇩[d, e] L ≡ K →
∀U. ⇧[d, e] T ≡ U → ⦃G, L⦄ ⊢ 𝐑[h, g]⦃U⦄.
-#h #g #K #T #H elim H -K -T
+#h #g #G #K #T #H elim H -K -T
[ #K #k #l #Hkl #L #d #e #_ #X #H
>(lift_inv_sort1 … H) -X /2 width=2/
| #I #K #K0 #V #i #HK0 #L #d #e #HLK #X #H
]
qed.
-lemma crx_inv_lift: ∀h,g,L,U. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃U⦄ → ∀K,d,e. ⇩[d, e] L ≡ K →
- ∀T. ⇧[d, e] T ≡ U → ⦃h, K⦄ ⊢ 𝐑[h, g]⦃T⦄.
-#h #g #L #U #H elim H -L -U
+lemma crx_inv_lift: ∀h,g,G,L,U. ⦃G, L⦄ ⊢ 𝐑[h, g]⦃U⦄ → ∀K,d,e. ⇩[d, e] L ≡ K →
+ ∀T. ⇧[d, e] T ≡ U → ⦃G, K⦄ ⊢ 𝐑[h, g]⦃T⦄.
+#h #g #G #L #U #H elim H -L -U
[ #L #k #l #Hkl #K #d #e #_ #X #H
>(lift_inv_sort2 … H) -X /2 width=2/
| #I #L #L0 #W #i #HK0 #K #d #e #HLK #X #H
(* *)
(**************************************************************************)
-include "basic_2/notation/relations/predsn_2.ma".
-include "basic_2/grammar/lpx_sn.ma".
+include "basic_2/notation/relations/predsn_3.ma".
include "basic_2/reduction/cpr.ma".
+include "basic_2/grammar/lpx_sn.ma". (**) (* disambiguation error *)
(* SN PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS *****************************)
-definition lpr: relation lenv ≝ lpx_sn cpr.
+definition lpr: relation3 genv lenv lenv ≝ λG. lpx_sn (cpr G).
interpretation "parallel reduction (local environment, sn variant)"
- 'PRedSn L1 L2 = (lpr L1 L2).
+ 'PRedSn G L1 L2 = (lpr G L1 L2).
(* Basic inversion lemmas ***************************************************)
(* Basic_1: includes: wcpr0_gen_sort *)
-lemma lpr_inv_atom1: ∀L2. ⋆ ⊢ ➡ L2 → L2 = ⋆.
+lemma lpr_inv_atom1: ∀G,L2. ⦃G, ⋆⦄ ⊢ ➡ L2 → L2 = ⋆.
/2 width=4 by lpx_sn_inv_atom1_aux/ qed-.
(* Basic_1: includes: wcpr0_gen_head *)
-lemma lpr_inv_pair1: ∀I,K1,V1,L2. K1. ⓑ{I} V1 ⊢ ➡ L2 →
- ∃∃K2,V2. K1 ⊢ ➡ K2 & K1 ⊢ V1 ➡ V2 & L2 = K2. ⓑ{I} V2.
+lemma lpr_inv_pair1: ∀I,G,K1,V1,L2. ⦃G, K1.ⓑ{I}V1⦄ ⊢ ➡ L2 →
+ ∃∃K2,V2. ⦃G, K1⦄ ⊢ ➡ K2 & ⦃G, K1⦄ ⊢ V1 ➡ V2 & L2 = K2.ⓑ{I}V2.
/2 width=3 by lpx_sn_inv_pair1_aux/ qed-.
-lemma lpr_inv_atom2: ∀L1. L1 ⊢ ➡ ⋆ → L1 = ⋆.
+lemma lpr_inv_atom2: ∀G,L1. ⦃G, L1⦄ ⊢ ➡ ⋆ → L1 = ⋆.
/2 width=4 by lpx_sn_inv_atom2_aux/ qed-.
-lemma lpr_inv_pair2: ∀I,L1,K2,V2. L1 ⊢ ➡ K2. ⓑ{I} V2 →
- ∃∃K1,V1. K1 ⊢ ➡ K2 & K1 ⊢ V1 ➡ V2 & L1 = K1. ⓑ{I} V1.
+lemma lpr_inv_pair2: ∀I,G,L1,K2,V2. ⦃G, L1⦄ ⊢ ➡ K2.ⓑ{I}V2 →
+ ∃∃K1,V1. ⦃G, K1⦄ ⊢ ➡ K2 & ⦃G, K1⦄ ⊢ V1 ➡ V2 & L1 = K1. ⓑ{I} V1.
/2 width=3 by lpx_sn_inv_pair2_aux/ qed-.
(* Basic properties *********************************************************)
(* Note: lemma 250 *)
-lemma lpr_refl: ∀L. ⦃G, L⦄ ⊢ ➡ L.
+lemma lpr_refl: ∀G,L. ⦃G, L⦄ ⊢ ➡ L.
/2 width=1 by lpx_sn_refl/ qed.
-lemma lpr_pair: ∀I,K1,K2,V1,V2. K1 ⊢ ➡ K2 → K1 ⊢ V1 ➡ V2 →
- K1.ⓑ{I}V1 ⊢ ➡ K2.ⓑ{I}V2.
+lemma lpr_pair: ∀I,G,K1,K2,V1,V2. ⦃G, K1⦄ ⊢ ➡ K2 → ⦃G, K1⦄ ⊢ V1 ➡ V2 →
+ ⦃G, K1.ⓑ{I}V1⦄ ⊢ ➡ K2.ⓑ{I}V2.
/2 width=1/ qed.
-lemma lpr_append: ∀K1,K2. K1 ⊢ ➡ K2 → ∀L1,L2. L1 ⊢ ➡ L2 →
- L1 @@ K1 ⊢ ➡ L2 @@ K2.
+lemma lpr_append: ∀G,K1,K2. ⦃G, K1⦄ ⊢ ➡ K2 → ∀L1,L2. ⦃G, L1⦄ ⊢ ➡ L2 →
+ ⦃G, L1 @@ K1⦄ ⊢ ➡ L2 @@ K2.
/3 width=1 by lpx_sn_append, cpr_append/ qed.
(* Basic forward lemmas *****************************************************)
-lemma lpr_fwd_length: ∀L1,L2. L1 ⊢ ➡ L2 → |L1| = |L2|.
+lemma lpr_fwd_length: ∀G,L1,L2. ⦃G, L1⦄ ⊢ ➡ L2 → |L1| = |L2|.
/2 width=2 by lpx_sn_fwd_length/ qed-.
(* Advanced forward lemmas **************************************************)
-lemma lpr_fwd_append1: ∀K1,L1,L. K1 @@ L1 ⊢ ➡ L →
- ∃∃K2,L2. K1 ⊢ ➡ K2 & L = K2 @@ L2.
+lemma lpr_fwd_append1: ∀G,K1,L1,L. ⦃G, K1 @@ L1⦄ ⊢ ➡ L →
+ ∃∃K2,L2. ⦃G, K1⦄ ⊢ ➡ K2 & L = K2 @@ L2.
/2 width=2 by lpx_sn_fwd_append1/ qed-.
-lemma lpr_fwd_append2: ∀L,K2,L2. ⦃G, L⦄ ⊢ ➡ K2 @@ L2 →
- ∃∃K1,L1. K1 ⊢ ➡ K2 & L = K1 @@ L1.
+lemma lpr_fwd_append2: ∀G,L,K2,L2. ⦃G, L⦄ ⊢ ➡ K2 @@ L2 →
+ ∃∃K1,L1. ⦃G, K1⦄ ⊢ ➡ K2 & L = K1 @@ L1.
/2 width=2 by lpx_sn_fwd_append2/ qed-.
(* Basic_1: removed theorems 3: wcpr0_getl wcpr0_getl_back
(* Properies on local environment slicing ***********************************)
(* Basic_1: includes: wcpr0_drop *)
-lemma lpr_ldrop_conf: dropable_sn lpr.
+lemma lpr_ldrop_conf: ∀G. dropable_sn (lpr G).
/3 width=5 by lpx_sn_deliftable_dropable, cpr_inv_lift1/ qed-.
(* Basic_1: includes: wcpr0_drop_back *)
-lemma ldrop_lpr_trans: dedropable_sn lpr.
+lemma ldrop_lpr_trans: ∀G. dedropable_sn (lpr G).
/3 width=9 by lpx_sn_liftable_dedropable, cpr_lift/ qed-.
-lemma lpr_ldrop_trans_O1: dropable_dx lpr.
+lemma lpr_ldrop_trans_O1: ∀G. dropable_dx (lpr G).
/2 width=3 by lpx_sn_dropable/ qed-.
(* Properties on context-sensitive parallel reduction for terms *************)
-lemma fsup_cpr_trans: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊃ ⦃L2, T2⦄ → ∀U2. L2 ⊢ T2 ➡ U2 →
- ∃∃L,U1. L1 ⊢ ➡ L & ⦃G, 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/ ]
-[ #L #K #U #T #d #e #HLK #HUT #He #U2 #HU2
+lemma fsup_cpr_trans: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 →
+ ∃∃L,U1. ⦃G1, L1⦄ ⊢ ➡ 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 [1,2,3,4,5: /3 width=5/ ]
+[ #G #L #K #U #T #d #e #HLK #HUT #He #U2 #HU2
elim (lift_total U2 d e) #T2 #HUT2
lapply (cpr_lift … HU2 … HLK … HUT … HUT2) -HU2 -HUT /3 width=9/
-| #L1 #K1 #K2 #T1 #T2 #U1 #d #e #HLK1 #HTU1 #_ #IHT12 #U2 #HTU2
+| #G1 #G2 #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 (ldrop_lpr_trans … HLK1 … HK1) -HLK1 -HK1 #L2 #HL12 #HL2K
(* *)
(**************************************************************************)
+include "basic_2/reduction/lpr_ldrop.ma". (**) (* disambiguation error *)
include "basic_2/grammar/lpx_sn_lpx_sn.ma".
include "basic_2/substitution/fsupp.ma".
-include "basic_2/reduction/lpr_ldrop.ma".
(* SN PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS *****************************)
(* Main properties on context-sensitive parallel reduction for terms ********)
fact cpr_conf_lpr_atom_atom:
- ∀I,L1,L2. ∃∃T. L1 ⊢ ⓪{I} ➡ T & L2 ⊢ ⓪{I} ➡ T.
+ ∀I,G,L1,L2. ∃∃T. ⦃G, L1⦄ ⊢ ⓪{I} ➡ T & ⦃G, L2⦄ ⊢ ⓪{I} ➡ T.
/2 width=3/ qed-.
fact cpr_conf_lpr_atom_delta:
- ∀L0,i. (
- ∀L,T. ⦃L0, #i⦄ ⊃+ ⦃L, T⦄ →
+ ∀G,L0,i. (
+ ∀L,T. ⦃G, L0, #i⦄ ⊃+ ⦃G, L, T⦄ →
∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
∀L1. ⦃G, L⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
- ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
+ ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
) →
∀K0,V0. ⇩[O, i] L0 ≡ K0.ⓓV0 →
- ∀V2. K0 ⊢ V0 ➡ V2 → ∀T2. ⇧[O, i + 1] V2 ≡ T2 →
- ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
- ∃∃T. L1 ⊢ #i ➡ T & L2 ⊢ T2 ➡ T.
-#L0 #i #IH #K0 #V0 #HLK0 #V2 #HV02 #T2 #HVT2 #L1 #HL01 #L2 #HL02
+ ∀V2. ⦃G, K0⦄ ⊢ V0 ➡ V2 → ∀T2. ⇧[O, i + 1] V2 ≡ T2 →
+ ∀L1. ⦃G, L0⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡ 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 (lpr_ldrop_conf … HLK0 … HL01) -HL01 #X1 #H1 #HLK1
elim (lpr_inv_pair1 … H1) -H1 #K1 #V1 #HK01 #HV01 #H destruct
elim (lpr_ldrop_conf … HLK0 … HL02) -HL02 #X2 #H2 #HLK2
elim (lpr_inv_pair1 … H2) -H2 #K2 #W2 #HK02 #_ #H destruct
lapply (ldrop_fwd_ldrop2 … HLK2) -W2 #HLK2
-lapply (fsupp_lref … HLK0) -HLK0 #HLK0
+lapply (fsupp_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)) #T #HVT
lapply (cpr_lift … HV2 … HLK2 … HVT2 … HVT) -K2 -V2 /3 width=6/
(* Basic_1: includes: pr0_delta_delta pr2_delta_delta *)
fact cpr_conf_lpr_delta_delta:
- ∀L0,i. (
- ∀L,T. ⦃L0, #i⦄ ⊃+ ⦃L, T⦄ →
+ ∀G,L0,i. (
+ ∀L,T. ⦃G, L0, #i⦄ ⊃+ ⦃G, L, T⦄ →
∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
∀L1. ⦃G, L⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
- ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
+ ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
) →
∀K0,V0. ⇩[O, i] L0 ≡ K0.ⓓV0 →
- ∀V1. K0 ⊢ V0 ➡ V1 → ∀T1. ⇧[O, i + 1] V1 ≡ T1 →
+ ∀V1. ⦃G, K0⦄ ⊢ V0 ➡ V1 → ∀T1. ⇧[O, i + 1] V1 ≡ T1 →
∀KX,VX. ⇩[O, i] L0 ≡ KX.ⓓVX →
- ∀V2. KX ⊢ VX ➡ V2 → ∀T2. ⇧[O, i + 1] V2 ≡ T2 →
- ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
- ∃∃T. L1 ⊢ T1 ➡ T & L2 ⊢ T2 ➡ T.
-#L0 #i #IH #K0 #V0 #HLK0 #V1 #HV01 #T1 #HVT1
+ ∀V2. ⦃G, KX⦄ ⊢ VX ➡ V2 → ∀T2. ⇧[O, i + 1] V2 ≡ T2 →
+ ∀L1. ⦃G, L0⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡ 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 (lpr_ldrop_conf … HLK0 … HL01) -HL01 #X1 #H1 #HLK1
elim (lpr_ldrop_conf … HLK0 … HL02) -HL02 #X2 #H2 #HLK2
elim (lpr_inv_pair1 … H2) -H2 #K2 #W2 #HK02 #_ #H destruct
lapply (ldrop_fwd_ldrop2 … HLK2) -W2 #HLK2
-lapply (fsupp_lref … HLK0) -HLK0 #HLK0
+lapply (fsupp_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)) #T #HVT
lapply (cpr_lift … HV1 … HLK1 … HVT1 … HVT) -K1 -V1
qed-.
fact cpr_conf_lpr_bind_bind:
- ∀a,I,L0,V0,T0. (
- ∀L,T. ⦃L0,ⓑ{a,I}V0.T0⦄ ⊃+ ⦃L, T⦄ →
+ ∀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⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
- ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
+ ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
) →
- ∀V1. L0 ⊢ V0 ➡ V1 → ∀T1. L0.ⓑ{I}V0 ⊢ T0 ➡ T1 →
- ∀V2. L0 ⊢ V0 ➡ V2 → ∀T2. L0.ⓑ{I}V0 ⊢ T0 ➡ T2 →
- ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
- ∃∃T. L1 ⊢ ⓑ{a,I}V1.T1 ➡ T & L2 ⊢ ⓑ{a,I}V2.T2 ➡ T.
-#a #I #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01
+ ∀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⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡ 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 (IH … HV01 … HV02 … HL01 … HL02) //
elim (IH … HT01 … HT02 (L1.ⓑ{I}V1) … (L2.ⓑ{I}V2)) -IH // /2 width=1/ /3 width=5/
qed-.
fact cpr_conf_lpr_bind_zeta:
- ∀L0,V0,T0. (
- ∀L,T. ⦃L0,+ⓓV0.T0⦄ ⊃+ ⦃L, T⦄ →
+ ∀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⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
- ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
+ ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
) →
- ∀V1. L0 ⊢ V0 ➡ V1 → ∀T1. L0.ⓓV0 ⊢ T0 ➡ T1 →
- ∀T2. L0.ⓓV0 ⊢ T0 ➡ T2 → ∀X2. ⇧[O, 1] X2 ≡ T2 →
- ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
- ∃∃T. L1 ⊢ +ⓓV1.T1 ➡ T & L2 ⊢ X2 ➡ T.
-#L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01
+ ∀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⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡ 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 (IH … HT01 … HT02 (L1.ⓓV1) … (L2.ⓓV1)) -IH -HT01 -HT02 // /2 width=1/ -L0 -V0 -T0 #T #HT1 #HT2
elim (cpr_inv_lift1 … HT2 L2 … HXT2) -T2 /2 width=1/ /3 width=3/
qed-.
fact cpr_conf_lpr_zeta_zeta:
- ∀L0,V0,T0. (
- ∀L,T. ⦃L0,+ⓓV0.T0⦄ ⊃+ ⦃L, T⦄ →
+ ∀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⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
- ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
+ ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
) →
- ∀T1. L0.ⓓV0 ⊢ T0 ➡ T1 → ∀X1. ⇧[O, 1] X1 ≡ T1 →
- ∀T2. L0.ⓓV0 ⊢ T0 ➡ T2 → ∀X2. ⇧[O, 1] X2 ≡ T2 →
- ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
- ∃∃T. L1 ⊢ X1 ➡ T & L2 ⊢ X2 ➡ T.
-#L0 #V0 #T0 #IH #T1 #HT01 #X1 #HXT1
+ ∀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⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡ 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 (IH … HT01 … HT02 (L1.ⓓV0) … (L2.ⓓV0)) -IH -HT01 -HT02 // /2 width=1/ -L0 -T0 #T #HT1 #HT2
elim (cpr_inv_lift1 … HT1 L1 … HXT1) -T1 /2 width=1/ #T1 #HT1 #HXT1
qed-.
fact cpr_conf_lpr_flat_flat:
- ∀I,L0,V0,T0. (
- ∀L,T. ⦃L0,ⓕ{I}V0.T0⦄ ⊃+ ⦃L, T⦄ →
+ ∀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⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
- ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
+ ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
) →
- ∀V1. L0 ⊢ V0 ➡ V1 → ∀T1. L0 ⊢ T0 ➡ T1 →
- ∀V2. L0 ⊢ V0 ➡ V2 → ∀T2. L0 ⊢ T0 ➡ T2 →
- ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
- ∃∃T. L1 ⊢ ⓕ{I}V1.T1 ➡ T & L2 ⊢ ⓕ{I}V2.T2 ➡ T.
-#I #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01
+ ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 →
+ ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀T2. ⦃G, L0⦄ ⊢ T0 ➡ T2 →
+ ∀L1. ⦃G, L0⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡ 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 (IH … HV01 … HV02 … HL01 … HL02) //
elim (IH … HT01 … HT02 … HL01 … HL02) // /3 width=5/
qed-.
fact cpr_conf_lpr_flat_tau:
- ∀L0,V0,T0. (
- ∀L,T. ⦃L0,ⓝV0.T0⦄ ⊃+ ⦃L, T⦄ →
+ ∀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⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
- ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
+ ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
) →
- ∀V1,T1. L0 ⊢ T0 ➡ T1 → ∀T2. L0 ⊢ T0 ➡ T2 →
- ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
- ∃∃T. L1 ⊢ ⓝV1.T1 ➡ T & L2 ⊢ T2 ➡ T.
-#L0 #V0 #T0 #IH #V1 #T1 #HT01
+ ∀V1,T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → ∀T2. ⦃G, L0⦄ ⊢ T0 ➡ T2 →
+ ∀L1. ⦃G, L0⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡ 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 (IH … HT01 … HT02 … HL01 … HL02) // -L0 -V0 -T0 /3 width=3/
qed-.
fact cpr_conf_lpr_tau_tau:
- ∀L0,V0,T0. (
- ∀L,T. ⦃L0,ⓝV0.T0⦄ ⊃+ ⦃L, T⦄ →
+ ∀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⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
- ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
+ ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
) →
- ∀T1. L0 ⊢ T0 ➡ T1 → ∀T2. L0 ⊢ T0 ➡ T2 →
- ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
- ∃∃T. L1 ⊢ T1 ➡ T & L2 ⊢ T2 ➡ T.
-#L0 #V0 #T0 #IH #T1 #HT01
+ ∀T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → ∀T2. ⦃G, L0⦄ ⊢ T0 ➡ T2 →
+ ∀L1. ⦃G, L0⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡ L2 →
+ ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡ T & ⦃G, L2⦄ ⊢ T2 ➡ T.
+#G #L0 #V0 #T0 #IH #T1 #HT01
#T2 #HT02 #L1 #HL01 #L2 #HL02
elim (IH … HT01 … HT02 … HL01 … HL02) // -L0 -V0 -T0 /2 width=3/
qed-.
fact cpr_conf_lpr_flat_beta:
- ∀a,L0,V0,W0,T0. (
- ∀L,T. ⦃L0,ⓐV0.ⓛ{a}W0.T0⦄ ⊃+ ⦃L, T⦄ →
+ ∀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⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
- ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
+ ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
) →
- ∀V1. L0 ⊢ V0 ➡ V1 → ∀T1. L0 ⊢ ⓛ{a}W0.T0 ➡ T1 →
- ∀V2. L0 ⊢ V0 ➡ V2 → ∀W2. L0 ⊢ W0 ➡ W2 → ∀T2. L0.ⓛW0 ⊢ T0 ➡ T2 →
- ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
- ∃∃T. L1 ⊢ ⓐV1.T1 ➡ T & L2 ⊢ ⓓ{a}ⓝW2.V2.T2 ➡ T.
-#a #L0 #V0 #W0 #T0 #IH #V1 #HV01 #X #H
+ ∀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⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡ 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 (IH … HV01 … HV02 … HL01 … HL02) -HV01 -HV02 /2 width=1/ #V #HV1 #HV2
pr0_cong_upsilon_cong pr0_cong_upsilon_delta
*)
fact cpr_conf_lpr_flat_theta:
- ∀a,L0,V0,W0,T0. (
- ∀L,T. ⦃L0,ⓐV0.ⓓ{a}W0.T0⦄ ⊃+ ⦃L, T⦄ →
+ ∀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⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
- ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
+ ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
) →
- ∀V1. L0 ⊢ V0 ➡ V1 → ∀T1. L0 ⊢ ⓓ{a}W0.T0 ➡ T1 →
- ∀V2. L0 ⊢ V0 ➡ V2 → ∀U2. ⇧[O, 1] V2 ≡ U2 →
- ∀W2. L0 ⊢ W0 ➡ W2 → ∀T2. L0.ⓓW0 ⊢ T0 ➡ T2 →
- ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
- ∃∃T. L1 ⊢ ⓐV1.T1 ➡ T & L2 ⊢ ⓓ{a}W2.ⓐU2.T2 ➡ T.
-#a #L0 #V0 #W0 #T0 #IH #V1 #HV01 #X #H
+ ∀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⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡ 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 (IH … HV01 … HV02 … HL01 … HL02) -HV01 -HV02 /2 width=1/ #V #HV1 #HV2
elim (lift_total V 0 1) #U #HVU
qed-.
fact cpr_conf_lpr_beta_beta:
- ∀a,L0,V0,W0,T0. (
- ∀L,T. ⦃L0,ⓐV0.ⓛ{a}W0.T0⦄ ⊃+ ⦃L, T⦄ →
+ ∀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⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
- ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
+ ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
) →
- ∀V1. L0 ⊢ V0 ➡ V1 → ∀W1. L0 ⊢ W0 ➡ W1 → ∀T1. L0.ⓛW0 ⊢ T0 ➡ T1 →
- ∀V2. L0 ⊢ V0 ➡ V2 → ∀W2. L0 ⊢ W0 ➡ W2 → ∀T2. L0.ⓛW0 ⊢ T0 ➡ T2 →
- ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
- ∃∃T. L1 ⊢ ⓓ{a}ⓝW1.V1.T1 ➡ T & L2 ⊢ ⓓ{a}ⓝW2.V2.T2 ➡ T.
-#a #L0 #V0 #W0 #T0 #IH #V1 #HV01 #W1 #HW01 #T1 #HT01
+ ∀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⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡ 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 (IH … HV01 … HV02 … HL01 … HL02) -HV01 -HV02 /2 width=1/ #V #HV1 #HV2
elim (IH … HW01 … HW02 … HL01 … HL02) /2 width=1/ #W #HW1 #HW2
(* Basic_1: was: pr0_upsilon_upsilon *)
fact cpr_conf_lpr_theta_theta:
- ∀a,L0,V0,W0,T0. (
- ∀L,T. ⦃L0,ⓐV0.ⓓ{a}W0.T0⦄ ⊃+ ⦃L, T⦄ →
+ ∀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⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
- ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
+ ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
) →
- ∀V1. L0 ⊢ V0 ➡ V1 → ∀U1. ⇧[O, 1] V1 ≡ U1 →
- ∀W1. L0 ⊢ W0 ➡ W1 → ∀T1. L0.ⓓW0 ⊢ T0 ➡ T1 →
- ∀V2. L0 ⊢ V0 ➡ V2 → ∀U2. ⇧[O, 1] V2 ≡ U2 →
- ∀W2. L0 ⊢ W0 ➡ W2 → ∀T2. L0.ⓓW0 ⊢ T0 ➡ T2 →
- ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
- ∃∃T. L1 ⊢ ⓓ{a}W1.ⓐU1.T1 ➡ T & L2 ⊢ ⓓ{a}W2.ⓐU2.T2 ➡ T.
-#a #L0 #V0 #W0 #T0 #IH #V1 #HV01 #U1 #HVU1 #W1 #HW01 #T1 #HT01
+ ∀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⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡ 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 (IH … HV01 … HV02 … HL01 … HL02) -HV01 -HV02 /2 width=1/ #V #HV1 #HV2
elim (IH … HW01 … HW02 … HL01 … HL02) /2 width=1/
/4 width=7 by cpr_bind, cpr_flat, ex2_intro/ (**) (* timeout 40 *)
qed-.
-theorem cpr_conf_lpr: lpx_sn_confluent cpr cpr.
-#L0 #T0 @(fsupp_wf_ind … L0 T0) -L0 -T0 #L #T #IH #L0 * [|*]
-[ #I0 #HL #HT #T1 #H1 #T2 #H2 #L1 #HL01 #L2 #HL02 destruct
+theorem cpr_conf_lpr: ∀G. lpx_sn_confluent (cpr G) (cpr G).
+#G #L0 #T0 @(fsupp_wf_ind … 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
* #K0 #V0 #V1 #i #HLK0 #HV01 #HVT1 #H1 destruct
/3 width=17 by cpr_conf_lpr_delta_delta/
]
-| #a #I #V0 #T0 #HL #HT #X1 #H1 #X2 #H2 #L1 #HL01 #L2 #HL02 destruct
+| #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
| /3 width=11 by cpr_conf_lpr_bind_zeta/
| /3 width=12 by cpr_conf_lpr_zeta_zeta/
]
-| #I #V0 #T0 #HL #HT #X1 #H1 #X2 #H2 #L1 #HL01 #L2 #HL02 destruct
+| #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
qed-.
(* Basic_1: includes: pr0_confluence pr2_confluence *)
-theorem cpr_conf: ∀L. confluent … (cpr L).
+theorem cpr_conf: ∀G,L. confluent … (cpr G L).
/2 width=6 by cpr_conf_lpr/ qed-.
(* Properties on context-sensitive parallel reduction for terms *************)
-lemma lpr_cpr_conf_dx: ∀L0,T0,T1. L0 ⊢ T0 ➡ T1 → ∀L1. L0 ⊢ ➡ L1 →
- ∃∃T. L1 ⊢ T0 ➡ T & L1 ⊢ T1 ➡ T.
-#L0 #T0 #T1 #HT01 #L1 #HL01
+lemma lpr_cpr_conf_dx: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡ L1 →
+ ∃∃T. ⦃G, L1⦄ ⊢ T0 ➡ T & ⦃G, L1⦄ ⊢ T1 ➡ T.
+#G #L0 #T0 #T1 #HT01 #L1 #HL01
elim (cpr_conf_lpr … HT01 T0 … HL01 … HL01) // -L0 /2 width=3/
qed-.
-lemma lpr_cpr_conf_sn: ∀L0,T0,T1. L0 ⊢ T0 ➡ T1 → ∀L1. L0 ⊢ ➡ L1 →
- ∃∃T. L1 ⊢ T0 ➡ T & L0 ⊢ T1 ➡ T.
-#L0 #T0 #T1 #HT01 #L1 #HL01
+lemma lpr_cpr_conf_sn: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡ L1 →
+ ∃∃T. ⦃G, L1⦄ ⊢ T0 ➡ T & ⦃G, L0⦄ ⊢ T1 ➡ T.
+#G #L0 #T0 #T1 #HT01 #L1 #HL01
elim (cpr_conf_lpr … HT01 T0 … L0 … HL01) // -HT01 -HL01 /2 width=3/
qed-.
(* Main properties **********************************************************)
-theorem lpr_conf: confluent … lpr.
+theorem lpr_conf: ∀G. confluent … (lpr G).
/3 width=6 by lpx_sn_conf, cpr_conf_lpr/
qed-.
(* *)
(**************************************************************************)
-include "basic_2/notation/relations/predsn_4.ma".
+include "basic_2/notation/relations/predsn_5.ma".
include "basic_2/reduction/lpr.ma".
include "basic_2/reduction/cpx.ma".
(* SN EXTENDED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ********************)
-definition lpx: ∀h. sd h → relation lenv ≝ λh,g. lpx_sn (cpx h g).
+definition lpx: ∀h. sd h → relation3 genv lenv lenv ≝
+ λh,g,G. lpx_sn (cpx h g G).
interpretation "extended parallel reduction (local environment, sn variant)"
- 'PRedSn h g L1 L2 = (lpx h g L1 L2).
+ 'PRedSn h g G L1 L2 = (lpx h g G L1 L2).
(* Basic inversion lemmas ***************************************************)
-lemma lpx_inv_atom1: ∀h,g,L2. ⦃h, ⋆⦄ ⊢ ➡[h, g] L2 → L2 = ⋆.
+lemma lpx_inv_atom1: ∀h,g,G,L2. ⦃G, ⋆⦄ ⊢ ➡[h, g] L2 → L2 = ⋆.
/2 width=4 by lpx_sn_inv_atom1_aux/ qed-.
-lemma lpx_inv_pair1: ∀h,g,I,K1,V1,L2. ⦃h, K1.ⓑ{I}V1⦄ ⊢ ➡[h, g] L2 →
- ∃∃K2,V2. ⦃h, K1⦄ ⊢ ➡[h, g] K2 & ⦃h, K1⦄ ⊢ V1 ➡[h, g] V2 &
- L2 = K2. ⓑ{I} V2.
+lemma lpx_inv_pair1: ∀h,g,I,G,K1,V1,L2. ⦃G, K1.ⓑ{I}V1⦄ ⊢ ➡[h, g] L2 →
+ ∃∃K2,V2. ⦃G, K1⦄ ⊢ ➡[h, g] K2 & ⦃G, K1⦄ ⊢ V1 ➡[h, g] V2 &
+ L2 = K2. ⓑ{I} V2.
/2 width=3 by lpx_sn_inv_pair1_aux/ qed-.
-lemma lpx_inv_atom2: ∀h,g,L1. ⦃h, L1⦄ ⊢ ➡[h, g] ⋆ → L1 = ⋆.
+lemma lpx_inv_atom2: ∀h,g,G,L1. ⦃G, L1⦄ ⊢ ➡[h, g] ⋆ → L1 = ⋆.
/2 width=4 by lpx_sn_inv_atom2_aux/ qed-.
-lemma lpx_inv_pair2: ∀h,g,I,L1,K2,V2. ⦃h, L1⦄ ⊢ ➡[h, g] K2.ⓑ{I}V2 →
- ∃∃K1,V1. ⦃h, K1⦄ ⊢ ➡[h, g] K2 & ⦃h, K1⦄ ⊢ V1 ➡[h, g] V2 &
+lemma lpx_inv_pair2: ∀h,g,I,G,L1,K2,V2. ⦃G, L1⦄ ⊢ ➡[h, g] K2.ⓑ{I}V2 →
+ ∃∃K1,V1. ⦃G, K1⦄ ⊢ ➡[h, g] K2 & ⦃G, K1⦄ ⊢ V1 ➡[h, g] V2 &
L1 = K1. ⓑ{I} V1.
/2 width=3 by lpx_sn_inv_pair2_aux/ qed-.
(* Basic properties *********************************************************)
-lemma lpx_refl: ∀h,g,L. ⦃G, L⦄ ⊢ ➡[h, g] L.
+lemma lpx_refl: ∀h,g,G,L. ⦃G, L⦄ ⊢ ➡[h, g] L.
/2 width=1 by lpx_sn_refl/ qed.
-lemma lpx_pair: ∀h,g,I,K1,K2,V1,V2. ⦃h, K1⦄ ⊢ ➡[h, g] K2 → ⦃h, K1⦄ ⊢ V1 ➡[h, g] V2 →
- ⦃h, K1.ⓑ{I}V1⦄ ⊢ ➡[h, g] K2.ⓑ{I}V2.
+lemma lpx_pair: ∀h,g,I,G,K1,K2,V1,V2. ⦃G, K1⦄ ⊢ ➡[h, g] K2 → ⦃G, K1⦄ ⊢ V1 ➡[h, g] V2 →
+ ⦃G, K1.ⓑ{I}V1⦄ ⊢ ➡[h, g] K2.ⓑ{I}V2.
/2 width=1/ qed.
-lemma lpx_append: ∀h,g,K1,K2. ⦃h, K1⦄ ⊢ ➡[h, g] K2 → ∀L1,L2. ⦃h, L1⦄ ⊢ ➡[h, g] L2 →
- ⦃h, L1 @@ K1⦄ ⊢ ➡[h, g] L2 @@ K2.
+lemma lpx_append: ∀h,g,G,K1,K2. ⦃G, K1⦄ ⊢ ➡[h, g] K2 → ∀L1,L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 →
+ ⦃G, L1 @@ K1⦄ ⊢ ➡[h, g] L2 @@ K2.
/3 width=1 by lpx_sn_append, cpx_append/ qed.
-lemma lpr_lpx: ∀h,g,L1,L2. L1 ⊢ ➡ L2 → ⦃h, L1⦄ ⊢ ➡[h, g] L2.
-#h #g #L1 #L2 #H elim H -L1 -L2 // /3 width=1/
+lemma lpr_lpx: ∀h,g,G,L1,L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L1⦄ ⊢ ➡[h, g] L2.
+#h #g #G #L1 #L2 #H elim H -L1 -L2 // /3 width=1/
qed.
(* Basic forward lemmas *****************************************************)
-lemma lpx_fwd_length: ∀h,g,L1,L2. ⦃h, L1⦄ ⊢ ➡[h, g] L2 → |L1| = |L2|.
+lemma lpx_fwd_length: ∀h,g,G,L1,L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → |L1| = |L2|.
/2 width=2 by lpx_sn_fwd_length/ qed-.
(* Advanced forward lemmas **************************************************)
-lemma lpx_fwd_append1: ∀h,g,K1,L1,L. ⦃h, K1 @@ L1⦄ ⊢ ➡[h, g] L →
- ∃∃K2,L2. ⦃h, K1⦄ ⊢ ➡[h, g] K2 & L = K2 @@ L2.
+lemma lpx_fwd_append1: ∀h,g,G,K1,L1,L. ⦃G, K1 @@ L1⦄ ⊢ ➡[h, g] L →
+ ∃∃K2,L2. ⦃G, K1⦄ ⊢ ➡[h, g] K2 & L = K2 @@ L2.
/2 width=2 by lpx_sn_fwd_append1/ qed-.
-lemma lpx_fwd_append2: ∀h,g,L,K2,L2. ⦃G, L⦄ ⊢ ➡[h, g] K2 @@ L2 →
- ∃∃K1,L1. ⦃h, K1⦄ ⊢ ➡[h, g] K2 & L = K1 @@ L1.
+lemma lpx_fwd_append2: ∀h,g,G,L,K2,L2. ⦃G, L⦄ ⊢ ➡[h, g] K2 @@ L2 →
+ ∃∃K1,L1. ⦃G, K1⦄ ⊢ ➡[h, g] K2 & L = K1 @@ L1.
/2 width=2 by lpx_sn_fwd_append2/ qed-.
(* Properties on atomic arity assignment for terms **************************)
(* Note: lemma 500 *)
-lemma aaa_cpx_lpx_conf: ∀h,g,L1,T1,A. L1 ⊢ T1 ⁝ A → ∀T2. ⦃h, L1⦄ ⊢ T1 ➡[h, g] T2 →
- ∀L2. ⦃h, L1⦄ ⊢ ➡[h, g] L2 → L2 ⊢ T2 ⁝ A.
-#h #g #L1 #T1 #A #H elim H -L1 -T1 -A
-[ #L1 #k #X #H
+lemma aaa_cpx_lpx_conf: ∀h,g,G,L1,T1,A. ⦃G, L1⦄ ⊢ T1 ⁝ A →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2 →
+ ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] 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 #L1 #K1 #V1 #B #i #HLK1 #_ #IHV1 #X #H #L2 #HL12
+| #I #G #L1 #K1 #V1 #B #i #HLK1 #_ #IHV1 #X #H #L2 #HL12
elim (cpx_inv_lref1 … H) -H
[ #H destruct
elim (lpx_ldrop_conf … HLK1 … HL12) -L1 #X #H #HLK2
elim (lpx_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
+| #a #G #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12
elim (cpx_inv_abbr1 … H) -H *
[ #V2 #T2 #HV12 #HT12 #H destruct /4 width=2/
| #T2 #HT12 #HT2 #H destruct -IHV1
- @(aaa_inv_lift (L2.ⓓV1) … HT2) -HT2 /2 width=1/ /3 width=1/
+ @(aaa_inv_lift … (L2.ⓓV1) … HT2) -HT2 /2 width=1/ /3 width=1/
]
-| #a #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12
+| #a #G #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12
elim (cpx_inv_abst1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct /4 width=1/
-| #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12
+| #G #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12
elim (cpx_inv_appl1 … H) -H *
[ #V2 #T2 #HV12 #HT12 #H destruct /3 width=3/
| #b #V2 #W1 #W2 #U1 #U2 #HV12 #HW12 #HU12 #H1 #H2 destruct
elim (aaa_inv_abst … H) -H #B0 #A0 #HW1 #HU2 #H destruct
lapply (lsuba_aaa_trans … HU2 (L2.ⓓⓝW2.V2) ?) -HU2 /3 width=3/
| #b #V #V2 #W1 #W2 #U1 #U2 #HV1 #HV2 #HW12 #HU12 #H1 #H2 destruct
- lapply (aaa_lift L2 … B … (L2.ⓓW2) … HV2) -HV2 /2 width=1/ #HV2
+ lapply (aaa_lift G L2 … B … (L2.ⓓW2) … HV2) -HV2 /2 width=1/ #HV2
lapply (IHT1 (ⓓ{b}W2.U2) … HL12) -IHT1 /2 width=1/ -L1 #H
elim (aaa_inv_abbr … H) -H /3 width=3/
]
-| #L1 #V1 #T1 #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12
+| #G #L1 #V1 #T1 #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12
elim (cpx_inv_cast1 … H) -H
[ * #V2 #T2 #HV12 #HT12 #H destruct /3 width=1/
| -IHV1 /2 width=1/
]
qed-.
-lemma aaa_cpx_conf: ∀h,g,L,T1,A. ⦃G, L⦄ ⊢ T1 ⁝ A → ∀T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 → ⦃G, L⦄ ⊢ T2 ⁝ A.
+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_lpx_conf/ qed-.
-lemma aaa_lpx_conf: ∀h,g,L1,T,A. L1 ⊢ T ⁝ A → ∀L2. ⦃h, L1⦄ ⊢ ➡[h, g] L2 → L2 ⊢ T ⁝ A.
+lemma aaa_lpx_conf: ∀h,g,G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A → ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → ⦃G, L2⦄ ⊢ T ⁝ A.
/2 width=7 by aaa_cpx_lpx_conf/ qed-.
-lemma aaa_cpr_conf: ∀L,T1,A. ⦃G, L⦄ ⊢ T1 ⁝ A → ∀T2. ⦃G, L⦄ ⊢ T1 ➡ T2 → ⦃G, L⦄ ⊢ T2 ⁝ A.
+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-.
-lemma aaa_lpr_conf: ∀L1,T,A. L1 ⊢ T ⁝ A → ∀L2. L1 ⊢ ➡ L2 → L2 ⊢ T ⁝ A.
+lemma aaa_lpr_conf: ∀G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ T ⁝ A.
/3 width=5 by aaa_lpx_conf, lpr_lpx/ qed-.
(* Properies on local environment slicing ***********************************)
-lemma lpx_ldrop_conf: ∀h,g. dropable_sn (lpx h g).
+lemma lpx_ldrop_conf: ∀h,g,G. dropable_sn (lpx h g G).
/3 width=5 by lpx_sn_deliftable_dropable, cpx_inv_lift1/ qed-.
-lemma ldrop_lpx_trans: ∀h,g. dedropable_sn (lpx h g).
+lemma ldrop_lpx_trans: ∀h,g,G. dedropable_sn (lpx h g G).
/3 width=9 by lpx_sn_liftable_dedropable, cpx_lift/ qed-.
-lemma lpx_ldrop_trans_O1: ∀h,g. dropable_dx (lpx h g).
+lemma lpx_ldrop_trans_O1: ∀h,g,G. dropable_dx (lpx h g G).
/2 width=3 by lpx_sn_dropable/ qed-.
class "water"
[ { "reduction" * } {
[ { "context-sensitive extended normal forms" * } {
- [ "cnx ( ⦃?,?⦄ ⊢ 𝐍[?]⦃?⦄ )" "cnx_lift" + "cnx_crx" + "cnx_cix" * ]
+ [ "cnx ( ⦃?,?⦄ ⊢ 𝐍[?,?]⦃?⦄ )" "cnx_lift" + "cnx_crx" + "cnx_cix" * ]
}
]
[ { "context-sensitive extended reduction" * } {
- [ "lpx ( ⦃?,?⦄ ⊢ ➡[?] ? )" "lpx_ldrop" + "lpx_aaa" * ]
- [ "cpx ( ⦃?,?⦄ ⊢ ? ➡[?] ? )" "cpx_lift" + "cpx_cix" * ]
+ [ "lpx ( ⦃?,?⦄ ⊢ ➡[?,?] ? )" "lpx_ldrop" + "lpx_aaa" * ]
+ [ "cpx ( ⦃?,?⦄ ⊢ ? ➡[?,?] ? )" "cpx_lift" + "cpx_cix" * ]
}
]
[ { "context-sensitive extended irreducible forms" * } {
- [ "cix ( ⦃?,?⦄ ⊢ 𝐈[?]⦃?⦄ )" "cix_append" + "cix_lift" * ]
+ [ "cix ( ⦃?,?⦄ ⊢ 𝐈[?,?]⦃?⦄ )" "cix_append" + "cix_lift" * ]
}
]
[ { "context-sensitive extended reducible forms" * } {
- [ "crx ( ⦃?,?⦄ ⊢ 𝐑[?]⦃?⦄ )" "crx_append" + "crx_lift" * ]
+ [ "crx ( ⦃?,?⦄ ⊢ 𝐑[?,?]⦃?⦄ )" "crx_append" + "crx_lift" * ]
}
]
[ { "context-sensitive normal forms" * } {
- [ "cnr ( ? ⊢ 𝐍⦃?⦄ )" "cnr_lift" + "cnr_crr" + "cnr_cir" * ]
+ [ "cnr ( ⦃?,?⦄ ⊢ 𝐍⦃?⦄ )" "cnr_lift" + "cnr_crr" + "cnr_cir" * ]
}
]
[ { "context-sensitive reduction" * } {
- [ "lpr ( ? ⊢ ➡ ? )" "lpr_ldrop" + "lpr_lpr" * ]
- [ "cpr ( ? ⊢ ? ➡ ? )" "cpr_lift" + "cpr_cir" * ]
+ [ "lpr ( ⦃?,?⦄ ⊢ ➡ ? )" "lpr_ldrop" + "lpr_lpr" * ]
+ [ "cpr ( ⦃?,?⦄ ⊢ ? ➡ ? )" "cpr_lift" + "cpr_cir" * ]
}
]
[ { "context-sensitive irreducible forms" * } {
- [ "cir ( ? ⊢ 𝐈⦃?⦄ )" "cir_append" + "cir_lift" * ]
+ [ "cir ( ⦃?,?⦄ ⊢ 𝐈⦃?⦄ )" "cir_append" + "cir_lift" * ]
}
]
[ { "context-sensitive reducible forms" * } {
- [ "crr ( ? ⊢ 𝐑⦃?⦄ )" "crr_append" + "crr_lift" * ]
+ [ "crr ( ⦃?,?⦄ ⊢ 𝐑⦃?⦄ )" "crr_append" + "crr_lift" * ]
}
]
}