]> matita.cs.unibo.it Git - helm.git/commitdiff
extension of a relation to binders
authorFerruccio Guidi <ferruccio.guidi@unibo.it>
Thu, 25 May 2017 10:30:15 +0000 (10:30 +0000)
committerFerruccio Guidi <ferruccio.guidi@unibo.it>
Thu, 25 May 2017 10:30:15 +0000 (10:30 +0000)
matita/matita/contribs/lambdadelta/basic_2/etc/frees/frees_bind.etc [new file with mode: 0644]
matita/matita/contribs/lambdadelta/basic_2/etc/frees/frees_drops.etc [new file with mode: 0644]
matita/matita/contribs/lambdadelta/basic_2/syntax/bind_ext2.ma [new file with mode: 0644]
matita/matita/contribs/lambdadelta/basic_2/syntax/lenv_ext2.ma [new file with mode: 0644]
matita/matita/contribs/lambdadelta/basic_2/web/basic_2_src.tbl

diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/frees/frees_bind.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/frees/frees_bind.etc
new file mode 100644 (file)
index 0000000..ffa75a1
--- /dev/null
@@ -0,0 +1,51 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+include "basic_2/syntax/bind.ma".
+include "basic_2/static/frees.ma".
+
+(* CONTEXT-SENSITIVE FREE VARIABLES FOR BINDERS *****************************)
+
+inductive freesb (L): relation2 β€¦ β‰
+| freesb_pair: βˆ€I,V,f. L βŠ’ π…*⦃V⦄ β‰‘ f β†’ freesb L (BPair I V) f
+| freesb_unit: βˆ€I,f. πˆβ¦ƒf⦄ β†’ freesb L (BUnit I) f
+.
+
+interpretation
+   "context-sensitive free variables (binder)"
+   'FreeStar L I f = (freesb L I f).
+
+(* Basic inversion lemmas ***************************************************)
+
+fact frees_inv_pair_aux: βˆ€L,Z,f. L βŠ’ π…*⦃Z⦄ β‰‘ f β†’
+                         βˆ€I,V. Z = BPair I V β†’ L βŠ’ π…*⦃V⦄ β‰‘ f.
+#L #Z #f * -Z -f
+[ #I #V #f #Hf #Z #X #H destruct //
+| #I #f #_ #Z #X #H destruct
+]
+qed-.
+
+lemma frees_inv_pair: βˆ€L,I,V,f. L βŠ’ π…*⦃BPair I V⦄ β‰‘ f β†’ L βŠ’ π…*⦃V⦄ β‰‘ f.
+/2 width=4 by frees_inv_pair_aux/ qed-.
+
+fact frees_inv_unit_aux: βˆ€L,Z,f. L βŠ’ π…*⦃Z⦄ β‰‘ f β†’
+                         βˆ€I. Z = BUnit I β†’ πˆβ¦ƒf⦄.
+#L #Z #f * -Z -f
+[ #I #V #f #_ #Z #H destruct
+| #I #f #Hf #Z #H destruct //
+]
+qed-.
+
+lemma frees_inv_unit: βˆ€L,I,f. L βŠ’ π…*⦃BUnit I⦄ β‰‘ f β†’ πˆβ¦ƒf⦄.
+/2 width=5 by frees_inv_unit_aux/ qed-.
diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/frees/frees_drops.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/frees/frees_drops.etc
new file mode 100644 (file)
index 0000000..c0e55af
--- /dev/null
@@ -0,0 +1,73 @@
+(* Note: this does not hold since L = Y.ⓧ, U = #0, f = β«―g requires T = #(-1) *)
+lemma frees_inv_drops: βˆ€f2,L,U. L βŠ’ π…*⦃U⦄ β‰‘ f2 β†’
+                       βˆ€f,K. β¬‡*[Ⓣ, f] L β‰‘ K β†’ βˆ€f1. f ~⊚ f1 β‰‘ f2 β†’
+                       βˆƒβˆƒT. K βŠ’ π…*⦃T⦄ β‰‘ f1 & β¬†*[f] T β‰‘ U.
+#f2 #L #U #H lapply (frees_fwd_isfin β€¦ H) elim H -f2 -L -U
+[ #f2 #I #Hf2 #_ #f #K #H1 #f1 #H2
+  lapply (coafter_fwd_isid2 β€¦ H2 ??) -H2 // -Hf2 #Hf1
+  elim (drops_inv_atom1 β€¦ H1) -H1 #H #Hf destruct
+  /4 width=3 by frees_atom, lifts_refl, ex2_intro/
+| #f2 #I #L #s #_ #IH #Hf2 #f #Y #H1 #f1 #H2
+  lapply (isfin_fwd_push β€¦ Hf2 ??) -Hf2 [3: |*: // ] #Hf2
+  elim (coafter_inv_xxp β€¦ H2) -H2 [1,3: * |*: // ]
+  [ #g #g1 #Hf2 #H #H0 destruct
+    elim (drops_inv_skip1 β€¦ H1) -H1 #Z #K #HLK #_ #H destruct
+  | #g #Hf2 #H destruct
+    lapply (drops_inv_drop1 β€¦ H1) -H1 #HLK
+  ]
+  elim (IH β€¦ HLK β€¦ Hf2) -L // -f2 #X #Hg1 #HX
+  lapply (lifts_inv_sort2 β€¦ HX) -HX #H destruct
+  /3 width=3 by frees_sort, lifts_sort, ex2_intro/
+| #f2 #I #L #W #_ #IH #Hf2 #f #Y #H1 #f1 #H2
+  lapply (isfin_inv_next β€¦ Hf2 ??) -Hf2 [3: |*: // ] #Hf2
+  elim (coafter_inv_xxn β€¦ H2) -H2 [ |*: // ] #g #g1 #Hf2 #H0 #H destruct
+  elim (drops_inv_skip1 β€¦ H1) -H1 #J #K #HLK #HJI #H destruct
+  elim (liftsb_inv_pair_dx β€¦ HJI) -HJI #V #HVW #H destruct
+  elim (IH β€¦ HLK β€¦ Hf2) -L // -f2 #X #Hg1 #HX
+  lapply (lifts_inj β€¦ HX β€¦ HVW) -W #H destruct
+  /3 width=3 by frees_zero, lifts_lref, ex2_intro/
+| #f2 #L #Hf2 #_ #f #Y #H1 #f1 #H2
+  lapply (coafter_fwd_isid2 β€¦ H2 ??) -H2 // -Hf2 #Hf1
+  elim (pn_split f) * #g #H destruct
+  [ elim (drops_inv_skip1 β€¦ H1) -H1 #J #K #HLK #HJI #H destruct
+    lapply  (liftsb_inv_unit_dx β€¦ HJI) -HJI #H destruct
+    /3 width=3 by frees_void, lifts_lref, ex2_intro/
+  | lapply (drops_inv_drop1 β€¦ H1) -H1 #H1
+| #f2 #I #L #j #_ #IH #Hf2 #f #Y #H1 #f1 #H2
+  lapply (isfin_fwd_push β€¦ Hf2 ??) -Hf2 [3: |*: // ] #Hf2
+  elim (coafter_inv_xxp β€¦ H2) -H2 [1,3: * |*: // ]
+  [ #g #g1 #Hf2 #H #H0 destruct
+    elim (drops_inv_skip1 β€¦ H1) -H1 #J #K #HLK #_ #H destruct
+  | #g #Hf2 #H destruct
+    lapply (drops_inv_drop1 β€¦ H1) -H1 #HLK (* cannot continue *)
+  ]
+  elim (IH β€¦ HLK β€¦ Hf2) -L // -f2 #X #Hg1 #HX
+  elim (lifts_inv_lref2 β€¦ HX) -HX #i #Hij #H destruct
+  /4 width=7 by frees_lref, lifts_lref, at_S1, at_next, ex2_intro/
+| #f2 #I #L #l #_ #IH #Hf2 #f #Y #H1 #f1 #H2
+  lapply (isfin_fwd_push β€¦ Hf2 ??) -Hf2 [3: |*: // ] #Hf2
+  elim (coafter_inv_xxp β€¦ H2) -H2 [1,3: * |*: // ]
+  [ #g #g1 #Hf2 #H #H0 destruct
+    elim (drops_inv_skip1 β€¦ H1) -H1 #J #K #HLK #_ #H destruct
+  | #g #Hf2 #H destruct
+    lapply (drops_inv_drop1 β€¦ H1) -H1 #HLK
+  ]
+  elim (IH β€¦ HLK β€¦ Hf2) -L // -f2 #X #Hg1 #HX
+  lapply (lifts_inv_gref2 β€¦ HX) -HX #H destruct
+  /3 width=3 by frees_gref, lifts_gref, ex2_intro/
+| #f2W #f2U #f2 #p #I #L #W #U #_ #_ #H1f2 #IHW #IHU #H2f2 #f #K #H1 #f1 #H2
+  elim (sor_inv_isfin3 β€¦ H1f2) // #H1f2W #H
+  lapply (isfin_inv_tl β€¦ H) -H #H1f2U
+  elim (coafter_inv_sor β€¦ H2 β€¦ H1f2) -H2 -H1f2 // #f1W #f1U #H2f2W #H #Hf1
+  elim (coafter_inv_tl0 β€¦ H) -H #g1 #H2f2U #H destruct
+  elim (IHW β€¦ H1 β€¦ H2f2W) -IHW -H2f2W // -H1f2W #V #Hf1W #HVW
+  elim (IHU β€¦ H2f2U) -IHU -H2f2U
+  /3 width=5 by frees_bind, drops_skip, lifts_bind, ext2_pair, ex2_intro/
+| #f2W #f2U #f2 #I #L #W #U #_ #_ #H1f2 #IHW #IHU #H2f2 #f #K #H1 #f1 #H2
+  elim (sor_inv_isfin3 β€¦ H1f2) // #H1f2W #H1f2U
+  elim (coafter_inv_sor β€¦ H2 β€¦ H1f2) -H2 -H1f2 // #f1W #f1U #H2f2W #H2f2U #Hf1
+  elim (IHW β€¦ H1 β€¦ H2f2W) -IHW -H2f2W // -H1f2W
+  elim (IHU β€¦ H1 β€¦ H2f2U) -L -H2f2U
+  /3 width=5 by frees_flat, lifts_flat, ex2_intro/
+]
+qed-.
diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/bind_ext2.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/bind_ext2.ma
new file mode 100644 (file)
index 0000000..c9850ef
--- /dev/null
@@ -0,0 +1,74 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+include "basic_2/syntax/bind.ma".
+
+(* EXTENSION TO BINDERS OF A RELATION FOR TERMS *****************************)
+
+inductive ext2 (R:relation term): relation bind β‰
+| ext2_unit: βˆ€I. ext2 R (BUnit I) (BUnit I)
+| ext2_pair: βˆ€I,V1,V2. R V1 V2 β†’ ext2 R (BPair I V1) (BPair I V2)
+.
+
+(* Basic_inversion lemmas **************************************************)
+
+fact ext2_inv_unit_sn_aux: βˆ€R,Z1,Z2. ext2 R Z1 Z2 β†’
+                           βˆ€I. Z1 = BUnit I β†’ Z2 = BUnit I.
+#R #Z1 #Z2 * -Z1 -Z2 #I [2: #V1 #V2 #_ ]
+#J #H destruct //
+qed-.
+
+lemma ext2_inv_unit_sn: βˆ€R,I,Z2. ext2 R (BUnit I) Z2 β†’ Z2 = BUnit I.
+/2 width=4 by ext2_inv_unit_sn_aux/ qed-.
+
+fact ext2_inv_pair_sn_aux: βˆ€R,Z1,Z2. ext2 R Z1 Z2 β†’
+                           βˆ€I,V1. Z1 = BPair I V1 β†’
+                           βˆƒβˆƒV2. R V1 V2 & Z2 = BPair I V2.
+#R #Z1 #Z2 * -Z1 -Z2 #I [2: #V1 #V2 #HV12 ]
+#J #W1 #H destruct /2 width=3 by ex2_intro/
+qed-.
+
+lemma ext2_inv_pair_sn: βˆ€R,Z2,I,V1. ext2 R (BPair I V1) Z2 β†’
+                        βˆƒβˆƒV2. R V1 V2 & Z2 = BPair I V2.
+/2 width=3 by ext2_inv_pair_sn_aux/ qed-.
+
+fact ext2_inv_unit_dx_aux: βˆ€R,Z1,Z2. ext2 R Z1 Z2 β†’
+                           βˆ€I. Z2 = BUnit I β†’ Z1 = BUnit I.
+#R #Z1 #Z2 * -Z1 -Z2 #I [2: #V1 #V2 #_ ]
+#J #H destruct //
+qed-.
+
+lemma ext2_inv_unit_dx: βˆ€R,I,Z1. ext2 R Z1 (BUnit I) β†’ Z1 = BUnit I.
+/2 width=4 by ext2_inv_unit_dx_aux/ qed-.
+
+fact ext2_inv_pair_dx_aux: βˆ€R,Z1,Z2. ext2 R Z1 Z2 β†’
+                           βˆ€I,V2. Z2 = BPair I V2 β†’
+                           βˆƒβˆƒV1. R V1 V2 & Z1 = BPair I V1.
+#R #Z1 #Z2 * -Z1 -Z2 #I [2: #V1 #V2 #HV12 ]
+#J #W2 #H destruct /2 width=3 by ex2_intro/
+qed-.
+
+lemma ext2_inv_pair_dx: βˆ€R,Z1,I,V2. ext2 R Z1 (BPair I V2) β†’
+                        βˆƒβˆƒV1. R V1 V2 & Z1 = BPair I V1.
+/2 width=3 by ext2_inv_pair_dx_aux/ qed-.
+
+(* Basic properties ********************************************************)
+
+lemma ext2_refl: βˆ€R. reflexive β€¦ R β†’ reflexive β€¦ (ext2 R).
+#R #HR * /2 width=1 by ext2_pair/
+qed.
+
+lemma ext2_sym: βˆ€R. symmetric β€¦ R β†’ symmetric β€¦ (ext2 R).
+#R #HR #T1 #T2 * /3 width=1 by ext2_unit, ext2_pair/
+qed-.
diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/lenv_ext2.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/lenv_ext2.ma
new file mode 100644 (file)
index 0000000..87795b5
--- /dev/null
@@ -0,0 +1,33 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+include "basic_2/syntax/bind_ext2.ma".
+include "basic_2/syntax/lenv.ma".
+
+(* EXTENSION TO BINDERS OF A CONTEXT-SENSITIVE RELATION FOR TERMS ***********)
+
+definition cext2: (lenv β†’ relation term) β†’ lenv β†’ relation bind β‰
+                  Ξ»R,L. ext2 (R L).
+
+(* Basic properties *********************************************************)
+
+lemma cext2_sym: βˆ€R. (βˆ€L1,L2,T1,T2. R L1 T1 T2 β†’ R L2 T2 T1) β†’
+                 βˆ€L1,L2,I1,I2. cext2 R L1 I1 I2 β†’ cext2 R L2 I2 I1.
+#R #HR #L1 #L2 #I1 #I2 * /3 width=2 by ext2_pair/
+qed-.
+
+lemma cext2_co: βˆ€R1,R2. (βˆ€L,T1,T2. R1 L T1 T2 β†’ R2 L T1 T2) β†’
+                βˆ€L,I1,I2. cext2 R1 L I1 I2 β†’ cext2 R2 L I1 I2.
+#R1 #R2 #HR #L #I1 #I2 * /3 width=2 by ext2_unit, ext2_pair/
+qed-.
index bd75595b6edff948f2dba657d20ddb8f75d5e456..3a2a50c3e83f2c530f85d0f0ae4b90c87225afce 100644 (file)
@@ -253,12 +253,14 @@ table {
           }
         ]
         [ { "local environments" * } {
+             [ "lenv_ext2" * ]
              [ "lenv_length ( |?| )" * ]
              [ "lenv_weight ( β™―{?} )" * ]
              [ "lenv" * ]
           }
         ]
         [ { "binders for local environments" * } {
+             [ "bind_ext2" * ]
              [ "bind" "bind_weight" * ]
           }
         ]