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 "static_2/syntax/cl_restricted_weight.ma".
16 include "static_2/relocation/lifts_weight_bind.ma".
17 include "static_2/relocation/drops.ma".
19 (* GENERIC SLICING FOR LOCAL ENVIRONMENTS ***********************************)
21 (* Forward lemmas with weight for local environments ************************)
23 (* Basic_2A1: includes: drop_fwd_lw *)
24 lemma drops_fwd_lw: ∀b,f,L1,L2. ⇩*[b,f] L1 ≘ L2 → ♯❨L2❩ ≤ ♯❨L1❩.
25 #b #f #L1 #L2 #H elim H -f -L1 -L2 //
26 [ /2 width=3 by nle_trans/
27 | #f #I1 #I2 #L1 #L2 #_ #HI21 #IHL12 normalize
28 >(liftsb_fwd_bw … HI21) -HI21 /2 width=1 by nle_plus_bi_dx/
32 (* Basic_2A1: includes: drop_fwd_lw_lt *)
33 lemma drops_fwd_lw_lt: ∀f,L1,L2. ⇩*[Ⓣ,f] L1 ≘ L2 →
34 (𝐈❨f❩ → ⊥) → ♯❨L2❩ < ♯❨L1❩.
35 #f #L1 #L2 #H elim H -f -L1 -L2
36 [ #f #Hf #Hnf elim Hnf -Hnf /2 width=1 by/
37 | /3 width=3 by drops_fwd_lw, nle_nlt_trans/
38 | #f #I1 #I2 #L1 #L2 #_ #HI21 #IHL12 #H normalize in ⊢ (?%%);
39 >(liftsb_fwd_bw … HI21) -I2 /5 width=3 by pr_isi_push, nlt_plus_bi_dx/
43 (* Forward lemmas with restricted weight for closures ***********************)
45 (* Basic_2A1: includes: drop_fwd_rfw *)
46 lemma drops_bind2_fwd_rfw: ∀b,f,I,L,K,V. ⇩*[b,f] L ≘ K.ⓑ[I]V → ∀T. ♯❨K,V❩ < ♯❨L,T❩.
47 #b #f #I #L #K #V #HLK lapply (drops_fwd_lw … HLK) -HLK
48 normalize in ⊢ (%→?→?%%); /3 width=3 by nle_nlt_trans, nlt_plus_bi_sn/
51 (* Advanced inversion lemma *************************************************)
53 lemma drops_inv_x_bind_xy: ∀b,f,I,L. ⇩*[b,f] L ≘ L.ⓘ[I] → ⊥.
54 #b #f #I #L #H lapply (drops_fwd_lw … H) -b -f
55 /2 width=4 by nlt_ge_false/ (**) (* full auto is a bit slow: 19s *)