]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/relocation/drops_weight.ma
basic_2: stronger supclosure allows better inversion lemmas
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / relocation / drops_weight.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "basic_2/grammar/cl_restricted_weight.ma".
16 include "basic_2/relocation/lifts_weight.ma".
17 include "basic_2/relocation/drops.ma".
18
19 (* GENERIC SLICING FOR LOCAL ENVIRONMENTS ***********************************)
20
21 (* Forward lemmas with weight for local environments ************************)
22
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 transitive_le/
27 | #f #I #L1 #L2 #V1 #V2 #_ #HV21 #IHL12 normalize
28   >(lifts_fwd_tw … HV21) -HV21 /2 width=1 by monotonic_le_plus_l/
29 ]
30 qed-.
31
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, le_to_lt_to_lt/
38 | #f #I #L1 #L2 #V1 #V2 #_ #HV21 #IHL12 #H normalize in ⊢ (?%%); -I
39   >(lifts_fwd_tw … HV21) -V2 /5 width=3 by isid_push, monotonic_lt_plus_l/
40 ]
41 qed-.
42
43 (* Forward lemmas with restricted weight for closures ***********************)
44
45 (* Basic_2A1: includes: drop_fwd_rfw *)
46 lemma drops_pair2_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 le_to_lt_to_lt/
49 qed-.
50
51 (* Advanced inversion lemma *************************************************)
52
53 lemma drops_inv_x_pair_xy: ∀b,f,I,L,V. ⬇*[b,f] L ≡ L.ⓑ{I}V → ⊥.
54 #b #f #I #L #V #H lapply (drops_fwd_lw … H) -b -f
55 /2 width=4 by lt_le_false/ (**) (* full auto is a bit slow: 19s *)
56 qed-.