1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "basic_2/substitution/lift_lift.ma".
16 include "basic_2/substitution/ldrop.ma".
18 (* DROPPING *****************************************************************)
20 (* Main properties **********************************************************)
22 (* Basic_1: was: drop_mono *)
23 theorem ldrop_mono: ∀d,e,L,L1. ⇩[d, e] L ≡ L1 →
24 ∀L2. ⇩[d, e] L ≡ L2 → L1 = L2.
25 #d #e #L #L1 #H elim H -d -e -L -L1
27 >(ldrop_inv_atom1 … H) -L2 //
29 <(ldrop_inv_refl … HL12) -L2 //
30 | #L #K #I #V #e #_ #IHLK #L2 #H
31 lapply (ldrop_inv_ldrop1 … H ?) -H // /2 width=1/
32 | #L #K1 #I #T #V1 #d #e #_ #HVT1 #IHLK1 #X #H
33 elim (ldrop_inv_skip1 … H ?) -H // <minus_plus_m_m #K2 #V2 #HLK2 #HVT2 #H destruct
34 >(lift_inj … HVT1 … HVT2) -HVT1 -HVT2
35 >(IHLK1 … HLK2) -IHLK1 -HLK2 //
39 (* Basic_1: was: drop_conf_ge *)
40 theorem ldrop_conf_ge: ∀d1,e1,L,L1. ⇩[d1, e1] L ≡ L1 →
41 ∀e2,L2. ⇩[0, e2] L ≡ L2 → d1 + e1 ≤ e2 →
42 ⇩[0, e2 - e1] L1 ≡ L2.
43 #d1 #e1 #L #L1 #H elim H -d1 -e1 -L -L1
45 >(ldrop_inv_atom1 … H) -L2 //
47 | #L #K #I #V #e #_ #IHLK #e2 #L2 #H #He2
48 lapply (ldrop_inv_ldrop1 … H ?) -H /2 width=2/ #HL2
49 <minus_plus >minus_minus_comm /3 width=1/
50 | #L #K #I #V1 #V2 #d #e #_ #_ #IHLK #e2 #L2 #H #Hdee2
51 lapply (transitive_le 1 … Hdee2) // #He2
52 lapply (ldrop_inv_ldrop1 … H ?) -H // -He2 #HL2
53 lapply (transitive_le (1 + e) … Hdee2) // #Hee2
54 @ldrop_ldrop_lt >minus_minus_comm /3 width=1/ (**) (* explicit constructor *)
58 (* Note: apparently this was missing in basic_1 *)
59 theorem ldrop_conf_be: ∀L0,L1,d1,e1. ⇩[d1, e1] L0 ≡ L1 →
60 ∀L2,e2. ⇩[0, e2] L0 ≡ L2 → d1 ≤ e2 → e2 ≤ d1 + e1 →
61 ∃∃L. ⇩[0, d1 + e1 - e2] L2 ≡ L & ⇩[0, d1] L1 ≡ L.
62 #L0 #L1 #d1 #e1 #H elim H -L0 -L1 -d1 -e1
63 [ #d1 #e1 #L2 #e2 #H >(ldrop_inv_atom1 … H) -H /2 width=3/
64 | normalize #L #I #V #L2 #e2 #HL2 #_ #He2
65 lapply (le_n_O_to_eq … He2) -He2 #H destruct
66 lapply (ldrop_inv_refl … HL2) -HL2 #H destruct /2 width=3/
67 | normalize #L0 #K0 #I #V1 #e1 #HLK0 #IHLK0 #L2 #e2 #H #_ #He21
68 lapply (ldrop_inv_O1 … H) -H * * #He2 #HL20
69 [ -IHLK0 -He21 destruct <minus_n_O /3 width=3/
70 | -HLK0 <minus_le_minus_minus_comm //
71 elim (IHLK0 … HL20 ? ?) -L0 // /2 width=1/ /2 width=3/
73 | #L0 #K0 #I #V0 #V1 #d1 #e1 >plus_plus_comm_23 #_ #_ #IHLK0 #L2 #e2 #H #Hd1e2 #He2de1
74 elim (le_inv_plus_l … Hd1e2) #_ #He2
75 <minus_le_minus_minus_comm //
76 lapply (ldrop_inv_ldrop1 … H ?) -H // #HL02
77 elim (IHLK0 … HL02 ? ?) -L0 /2 width=1/ /3 width=3/
81 (* Note: apparently this was missing in basic_1 *)
82 theorem ldrop_conf_le: ∀L0,L1,d1,e1. ⇩[d1, e1] L0 ≡ L1 →
83 ∀L2,e2. ⇩[0, e2] L0 ≡ L2 → e2 ≤ d1 →
84 ∃∃L. ⇩[0, e2] L1 ≡ L & ⇩[d1 - e2, e1] L2 ≡ L.
85 #L0 #L1 #d1 #e1 #H elim H -L0 -L1 -d1 -e1
87 lapply (ldrop_inv_atom1 … H) -H #H destruct /2 width=3/
88 | #K0 #I #V0 #L2 #e2 #H1 #H2
89 lapply (le_n_O_to_eq … H2) -H2 #H destruct
90 lapply (ldrop_inv_pair1 … H1) -H1 #H destruct /2 width=3/
91 | #K0 #K1 #I #V0 #e1 #HK01 #_ #L2 #e2 #H1 #H2
92 lapply (le_n_O_to_eq … H2) -H2 #H destruct
93 lapply (ldrop_inv_pair1 … H1) -H1 #H destruct /3 width=3/
94 | #K0 #K1 #I #V0 #V1 #d1 #e1 #HK01 #HV10 #IHK01 #L2 #e2 #H #He2d1
95 elim (ldrop_inv_O1 … H) -H *
96 [ -IHK01 -He2d1 #H1 #H2 destruct /3 width=5/
97 | -HK01 -HV10 #He2 #HK0L2
98 elim (IHK01 … HK0L2 ?) -IHK01 -HK0L2 /2 width=1/ >minus_le_minus_minus_comm // /3 width=3/
103 (* Basic_1: was: drop_trans_ge *)
104 theorem ldrop_trans_ge: ∀d1,e1,L1,L. ⇩[d1, e1] L1 ≡ L →
105 ∀e2,L2. ⇩[0, e2] L ≡ L2 → d1 ≤ e2 → ⇩[0, e1 + e2] L1 ≡ L2.
106 #d1 #e1 #L1 #L #H elim H -d1 -e1 -L1 -L
108 >(ldrop_inv_atom1 … H) -H -L2 //
111 | #L1 #L2 #I #V1 #V2 #d #e #H_ #_ #IHL12 #e2 #L #H #Hde2
112 lapply (lt_to_le_to_lt 0 … Hde2) // #He2
113 lapply (lt_to_le_to_lt … (e + e2) He2 ?) // #Hee2
114 lapply (ldrop_inv_ldrop1 … H ?) -H // #HL2
115 @ldrop_ldrop_lt // >le_plus_minus // @IHL12 /2 width=1/ (**) (* explicit constructor *)
119 (* Basic_1: was: drop_trans_le *)
120 theorem ldrop_trans_le: ∀d1,e1,L1,L. ⇩[d1, e1] L1 ≡ L →
121 ∀e2,L2. ⇩[0, e2] L ≡ L2 → e2 ≤ d1 →
122 ∃∃L0. ⇩[0, e2] L1 ≡ L0 & ⇩[d1 - e2, e1] L0 ≡ L2.
123 #d1 #e1 #L1 #L #H elim H -d1 -e1 -L1 -L
125 >(ldrop_inv_atom1 … H) -L2 /2 width=3/
126 | #K #I #V #e2 #L2 #HL2 #H
127 lapply (le_n_O_to_eq … H) -H #H destruct /2 width=3/
128 | #L1 #L2 #I #V #e #_ #IHL12 #e2 #L #HL2 #H
129 lapply (le_n_O_to_eq … H) -H #H destruct
130 elim (IHL12 … HL2 ?) -IHL12 -HL2 // #L0 #H #HL0
131 lapply (ldrop_inv_refl … H) -H #H destruct /3 width=5/
132 | #L1 #L2 #I #V1 #V2 #d #e #HL12 #HV12 #IHL12 #e2 #L #H #He2d
133 elim (ldrop_inv_O1 … H) -H *
134 [ -He2d -IHL12 #H1 #H2 destruct /3 width=5/
135 | -HL12 -HV12 #He2 #HL2
136 elim (IHL12 … HL2 ?) -L2 [ >minus_le_minus_minus_comm // /3 width=3/ | /2 width=1/ ]
141 (* Basic_1: was: drop_conf_rev *)
142 axiom ldrop_div: ∀e1,L1,L. ⇩[0, e1] L1 ≡ L → ∀e2,L2. ⇩[0, e2] L2 ≡ L →
143 ∃∃L0. ⇩[0, e1] L0 ≡ L2 & ⇩[e1, e2] L0 ≡ L1.
145 (* Basic_1: was: drop_conf_lt *)
146 lemma ldrop_conf_lt: ∀d1,e1,L,L1. ⇩[d1, e1] L ≡ L1 →
147 ∀e2,K2,I,V2. ⇩[0, e2] L ≡ K2. ⓑ{I} V2 →
148 e2 < d1 → let d ≝ d1 - e2 - 1 in
149 ∃∃K1,V1. ⇩[0, e2] L1 ≡ K1. ⓑ{I} V1 &
150 ⇩[d, e1] K2 ≡ K1 & ⇧[d, e1] V1 ≡ V2.
151 #d1 #e1 #L #L1 #H1 #e2 #K2 #I #V2 #H2 #He2d1
152 elim (ldrop_conf_le … H1 … H2 ?) -L [2: /2 width=2/] #K #HL1K #HK2
153 elim (ldrop_inv_skip1 … HK2 ?) -HK2 [2: /2 width=1/] #K1 #V1 #HK21 #HV12 #H destruct /2 width=5/
156 lemma ldrop_trans_ge_comm: ∀d1,e1,e2,L1,L2,L.
157 ⇩[d1, e1] L1 ≡ L → ⇩[0, e2] L ≡ L2 → d1 ≤ e2 →
158 ⇩[0, e2 + e1] L1 ≡ L2.
159 #e1 #e1 #e2 >commutative_plus /2 width=5/