From: Ferruccio Guidi Date: Wed, 20 Jul 2011 20:11:07 +0000 (+0000) Subject: two more main properties of drop closed X-Git-Tag: make_still_working~2356 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=2d6cfac2387447f5682591e19cdbfeb82a15b851;p=helm.git two more main properties of drop closed --- diff --git a/matita/matita/lib/lambda-delta/ground.ma b/matita/matita/lib/lambda-delta/ground.ma index ac8147dfc..b8c67bbcc 100644 --- a/matita/matita/lib/lambda-delta/ground.ma +++ b/matita/matita/lib/lambda-delta/ground.ma @@ -19,19 +19,33 @@ include "lambda-delta/notation.ma". lemma plus_plus_comm_23: ∀m,n,p. m + n + p = m + p + n. // qed. +lemma minus_plus_comm: ∀a,b,c. a - b - c = a - (c + b). +// qed. + lemma minus_le: ∀m,n. m - n ≤ m. /2/ qed. lemma plus_plus_minus_m_m: ∀e1,e2,d. e1 ≤ e2 → d + e1 + (e2 - e1) = d + e2. /2/ qed. +lemma le_O_to_eq_O: ∀n. n ≤ 0 → n = 0. +/2/ qed. + +lemma plus_le_minus: ∀a,b,c. a + b ≤ c → a ≤ c - b. +/2/ qed. + lemma le_plus_minus_comm: ∀n,m,p. p ≤ m → (m + n) - p = (m - p) + n. #n #m #p #lepm @plus_to_minus (commutative_plus p) (le_O_to_eq_O … H) -H // +| #m #IHm #p elim p -p // + #p #_ #n #Hpm minus_plus minus_plus (plus_minus_m_m e 1) /2/ +qed. + +(* Basic inversion lemmas ***************************************************) + +lemma drop_inv_refl_aux: ∀d,e,L2,L1. ↑[d, e] L2 ≡ L1 → d = 0 → e = 0 → L1 = L2. #d #e #L2 #L1 #H elim H -H d e L2 L1 -[ #L #H elim (lt_refl_false … H) -| #L1 #L2 #I #V #e #HL12 #_ #_ #_ #K #J #W #H destruct -L1 I V // -| #L1 #L2 #I #V1 #V2 #d #e #_ #_ #_ #_ #H elim (plus_S_eq_O_false … H) +[ // +| #L1 #L2 #I #V #e #_ #_ #_ #H + elim (plus_S_eq_O_false … H) +| #L1 #L2 #I #V1 #V2 #d #e #_ #_ #_ #H + elim (plus_S_eq_O_false … H) ] qed. -lemma drop_inv_drop1: ∀e,L2,K,I,V. ↑[0, e] L2 ≡ K. 𝕓{I} V → 0 < e → - ↑[0, e - 1] L2 ≡ K. +lemma drop_inv_refl: ∀L2,L1. ↑[0, 0] L2 ≡ L1 → L1 = L2. /2 width=5/ qed. +lemma drop_inv_O1_aux: ∀d,e,L2,L1. ↑[d, e] L2 ≡ L1 → d = 0 → + ∀K,I,V. L1 = K. 𝕓{I} V → + (e = 0 ∧ L2 = K. 𝕓{I} V) ∨ + (0 < e ∧ ↑[d, e - 1] L2 ≡ K). +#d #e #L2 #L1 #H elim H -H d e L2 L1 +[ /3/ +| #L1 #L2 #I #V #e #HL12 #_ #_ #K #J #W #H destruct -L1 I V /3/ +| #L1 #L2 #I #V1 #V2 #d #e #_ #_ #_ #H elim (plus_S_eq_O_false … H) +] +qed. + +lemma drop_inv_O1: ∀e,L2,K,I,V. ↑[0, e] L2 ≡ K. 𝕓{I} V → + (e = 0 ∧ L2 = K. 𝕓{I} V) ∨ + (0 < e ∧ ↑[0, e - 1] L2 ≡ K). +/2/ qed. + +lemma drop_inv_drop1: ∀e,L2,K,I,V. + ↑[0, e] L2 ≡ K. 𝕓{I} V → 0 < e → ↑[0, e - 1] L2 ≡ K. +#e #L2 #K #I #V #H #He +elim (drop_inv_O1 … H) -H * // #H destruct -e; +elim (lt_refl_false … He) +qed. + lemma drop_inv_skip2_aux: ∀d,e,L1,L2. ↑[d, e] L2 ≡ L1 → 0 < d → ∀I,K2,V2. L2 = K2. 𝕓{I} V2 → ∃∃K1,V1. ↑[d - 1, e] K2 ≡ K1 & diff --git a/matita/matita/lib/lambda-delta/substitution/drop_main.ma b/matita/matita/lib/lambda-delta/substitution/drop_main.ma index 67a1df4c1..72d980e9b 100644 --- a/matita/matita/lib/lambda-delta/substitution/drop_main.ma +++ b/matita/matita/lib/lambda-delta/substitution/drop_main.ma @@ -30,19 +30,48 @@ lemma drop_conf_ge: ∀d1,e1,L,L1. ↑[d1, e1] L1 ≡ L → lapply (transitive_le 1 … Hdee2) // #He2 lapply (drop_inv_drop1 … H ?) -H // -He2 #HL2 lapply (transitive_le (1+e) … Hdee2) // #Hee2 - >(plus_minus_m_m (e2-e) 1 ?) [ @drop_drop >minus_minus_comm /3/ | /2/ ] + @drop_drop_lt >minus_minus_comm /3/ (**) (* explicit constructor *) ] qed. -axiom drop_conf_lt: ∀d1,e1,L,L1. ↑[d1, e1] L1 ≡ L → +lemma drop_conf_lt: ∀d1,e1,L,L1. ↑[d1, e1] L1 ≡ L → ∀e2,K2,I,V2. ↑[0, e2] K2. 𝕓{I} V2 ≡ L → e2 < d1 → let d ≝ d1 - e2 - 1 in ∃∃K1,V1. ↑[0, e2] K1. 𝕓{I} V1 ≡ L1 & ↑[d, e1] K1 ≡ K2 & ↑[d,e1] V1 ≡ V2. +#d1 #e1 #L #L1 #H elim H -H d1 e1 L L1 +[ #L0 #e2 #K2 #I #V2 #_ #H + elim (lt_zero_false … H) +| #L1 #L2 #I #V #e #_ #_ #e2 #K2 #J #V2 #_ #H + elim (lt_zero_false … H) +| #L1 #L2 #I #V1 #V2 #d #e #HL12 #HV12 #IHL12 #e2 #K2 #J #V #H #He2d + elim (drop_inv_O1 … H) -H * + [ -IHL12 He2d #H1 #H2 destruct -e2 K2 J V /2 width=5/ + | -HL12 -HV12 #He #HLK + elim (IHL12 … HLK ?) -IHL12 HLK [