]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/etc/append/crr_append.etc
milestone update in ground_2 and basic_2A
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / etc / append / crr_append.etc
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/relocation/ldrop_append.ma".
16 include "basic_2/reduction/crr.ma".
17
18 (* REDUCIBLE TERMS FOR CONTEXT-SENSITIVE REDUCTION **************************)
19
20 (* Advanved properties ******************************************************)
21
22 lemma crr_append_sn: ∀G,L,K,T. ⦃G, L⦄ ⊢ ➡ 𝐑⦃T⦄  → ⦃G, K @@ L⦄ ⊢ ➡ 𝐑⦃T⦄.
23 #G #L #K0 #T #H elim H -L -T /2 width=1/
24 #L #K #V #i #HLK
25 lapply (ldrop_fwd_length_lt2 … HLK) #Hi
26 lapply (ldrop_O1_append_sn_le … HLK … K0) -HLK /2 width=2/ -Hi /2 width=3/
27 qed.
28
29 lemma trr_crr: ∀G,L,T. ⦃G, ⋆⦄ ⊢ ➡ 𝐑⦃T⦄ → ⦃G, L⦄ ⊢ ➡ 𝐑⦃T⦄.
30 #G #L #T #H lapply (crr_append_sn … H) //
31 qed.
32
33 (* Advanced inversion lemmas ************************************************)
34
35 fact crr_inv_labst_last_aux: ∀G,L1,T,W. ⦃G, L1⦄ ⊢ ➡ 𝐑⦃T⦄  →
36                              ∀L2. L1 = ⋆.ⓛW @@ L2 → ⦃G, L2⦄ ⊢ ➡ 𝐑⦃T⦄.
37 #G #L1 #T #W #H elim H -L1 -T /2 width=1/ /3 width=1/
38 [ #L1 #K1 #V1 #i #HLK1 #L2 #H destruct
39   lapply (ldrop_fwd_length_lt2 … HLK1)
40   >append_length >commutative_plus normalize in ⊢ (??% → ?); #H
41   elim (le_to_or_lt_eq i (|L2|)) /2 width=1/ -H #Hi destruct
42   [ elim (ldrop_O1_lt … Hi) #I2 #K2 #V2 #HLK2
43     lapply (ldrop_O1_inv_append1_le … HLK1 … HLK2) -HLK1 /2 width=2/ -Hi
44     normalize #H destruct /2 width=3/
45   | lapply (ldrop_O1_inv_append1_ge … HLK1 ?) -HLK1 // <minus_n_n #H
46     lapply (ldrop_inv_O2 … H) -H #H destruct
47   ]
48 | #a #I #L1 #V #T #HI #_ #IHT #L2 #H destruct /3 width=1/
49 ]
50 qed.
51
52 lemma crr_inv_labst_last: ∀G,L,T,W. ⦃G, ⋆.ⓛW @@ L⦄ ⊢ ➡ 𝐑⦃T⦄  → ⦃G, L⦄ ⊢ ➡ 𝐑⦃T⦄.
53 /2 width=4/ qed-.
54
55 lemma crr_inv_trr: ∀G,T,W. ⦃G, ⋆.ⓛW⦄ ⊢ ➡ 𝐑⦃T⦄  → ⦃G, ⋆⦄ ⊢ ➡ 𝐑⦃T⦄.
56 /2 width=4/ qed-.