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/relocation/lifts_lifts.ma".
16 include "basic_2/relocation/drops.ma".
18 (* GENERAL SLICING FOR LOCAL ENVIRONMENTS ***********************************)
20 (* Main properties **********************************************************)
22 (* Basic_2A1: includes: drop_conf_ge drop_conf_be drop_conf_le *)
23 theorem drops_conf: ∀L1,L,c1,f1. ⬇*[c1, f1] L1 ≡ L →
24 ∀L2,c2,f. ⬇*[c2, f] L1 ≡ L2 →
25 ∀f2. f1 ⊚ f2 ≡ f → ⬇*[c2, f2] L ≡ L2.
26 #L1 #L #c1 #f1 #H elim H -L1 -L -f1
27 [ #f1 #_ #L2 #c2 #f #HL2 #f2 #Hf12 elim (drops_inv_atom1 … HL2) -c1 -HL2
28 #H #Hf destruct @drops_atom
29 #H elim (after_inv_isid3 … Hf12) -Hf12 /2 width=1 by/
30 | #I #K1 #K #V1 #f1 #_ #IH #L2 #c2 #f #HL2 #f2 #Hf elim (after_inv_nxx … Hf) -Hf [2,3: // ]
31 #g #Hg #H destruct /3 width=3 by drops_inv_drop1/
32 | #I #K1 #K #V1 #V #f1 #_ #HV1 #IH #L2 #c2 #f #HL2 #f2 #Hf elim (after_inv_pxx … Hf) -Hf [1,3: * |*:// ]
33 #g2 #g #Hf #H1 #H2 destruct
34 [ elim (drops_inv_skip1 … HL2) -HL2 /3 width=6 by drops_skip, lifts_div/
35 | /4 width=3 by drops_inv_drop1, drops_drop/
40 (* Basic_1: was: drop1_trans *)
41 (* Basic_2A1: includes: drop_trans_ge drop_trans_le drop_trans_ge_comm
44 theorem drops_trans: ∀L1,L,c1,f1. ⬇*[c1, f1] L1 ≡ L →
45 ∀L2,c2,f2. ⬇*[c2, f2] L ≡ L2 →
46 ∀f. f1 ⊚ f2 ≡ f → ⬇*[c1∧c2, f] L1 ≡ L2.
47 #L1 #L #c1 #f1 #H elim H -L1 -L -f1
48 [ #f1 #Hf1 #L2 #c2 #f2 #HL2 #f #Hf elim (drops_inv_atom1 … HL2) -HL2
49 #H #Hf2 destruct @drops_atom #H elim (andb_inv_true_dx … H) -H
50 #H1 #H2 lapply (after_isid_inv_sn … Hf ?) -Hf
51 /3 width=3 by isid_eq_repl_back/
52 | #I #K1 #K #V1 #f1 #_ #IH #L2 #c2 #f2 #HL2 #f #Hf elim (after_inv_nxx … Hf) -Hf
53 /3 width=3 by drops_drop/
54 | #I #K1 #K #V1 #V #f1 #_ #HV1 #IH #L2 #c2 #f2 #HL2 #f #Hf elim (after_inv_pxx … Hf) -Hf [1,3: * |*: // ]
55 #g2 #g #Hg #H1 #H2 destruct
56 [ elim (drops_inv_skip1 … HL2) -HL2 /3 width=6 by drops_skip, lifts_trans/
57 | /4 width=3 by drops_inv_drop1, drops_drop/
62 (* Advanced properties ******************************************************)
64 (* Basic_2A1: includes: drop_mono *)
65 lemma drops_mono: ∀L,L1,c1,f. ⬇*[c1, f] L ≡ L1 →
66 ∀L2,c2. ⬇*[c2, f] L ≡ L2 → L1 = L2.
67 #L #L1 #c1 #f lapply (isid_after_dx 𝐈𝐝 … f)
68 /3 width=8 by drops_conf, drops_fwd_isid/
71 (* Basic_2A1: includes: drop_conf_lt *)
72 lemma drops_conf_skip1: ∀L,L2,c2,f. ⬇*[c2, f] L ≡ L2 →
73 ∀I,K1,V1,c1,f1. ⬇*[c1, f1] L ≡ K1.ⓑ{I}V1 →
75 ∃∃K2,V2. L2 = K2.ⓑ{I}V2 &
76 ⬇*[c2, f2] K1 ≡ K2 & ⬆*[f2] V2 ≡ V1.
77 #L #L2 #c2 #f #H2 #I #K1 #V1 #c1 #f1 #H1 #f2 #Hf lapply (drops_conf … H1 … H2 … Hf) -L -Hf
78 #H elim (drops_inv_skip1 … H) -H /2 width=5 by ex3_2_intro/
81 (* Basic_2A1: includes: drop_trans_lt *)
82 lemma drops_trans_skip2: ∀L1,L,c1,f1. ⬇*[c1, f1] L1 ≡ L →
83 ∀I,K2,V2,c2,f2. ⬇*[c2, f2] L ≡ K2.ⓑ{I}V2 →
85 ∃∃K1,V1. L1 = K1.ⓑ{I}V1 &
86 ⬇*[c1∧c2, f] K1 ≡ K2 & ⬆*[f] V2 ≡ V1.
87 #L1 #L #c1 #f1 #H1 #I #K2 #V2 #c2 #f2 #H2 #f #Hf
88 lapply (drops_trans … H1 … H2 … Hf) -L -Hf
89 #H elim (drops_inv_skip2 … H) -H /2 width=5 by ex3_2_intro/