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/ldrop_ldrop.ma".
16 include "basic_2/reducibility/crf.ma".
18 (* CONTEXT-SENSITIVE REDUCIBLE TERMS ****************************************)
20 (* advanced inversion lemmas ************************************************)
22 lemma crf_inv_labst_last: ∀L1,T,W. L1 ⊢ 𝐑⦃T⦄ → ⇩[0, |L1|-1] L1 ≡ ⋆.ⓛW →
23 ∀L2. ⇩[|L1|-1, 1] L1 ≡ L2 → L2 ⊢ 𝐑⦃T⦄.
24 #L1 #T #W #H elim H -L1 -T /2 width=1/ /3 width=1/
25 [ #L1 #K1 #V1 #i #HLK1 #HL1 #L2 #HL12 destruct
26 lapply (ldrop_fwd_ldrop2_length … HLK1) #H
27 elim (le_to_or_lt_eq i (|L1|-1) ?) /2 width=1/ -H #Hi destruct [ -HL1 | - HL12 ]
28 [ elim (ldrop_conf_lt … HL12 … HLK1 ?) -HLK1 -HL12 // -Hi /2 width=3/
29 | lapply (ldrop_mono … HL1 … HLK1) -HL1 -HLK1 #H destruct
31 | #a #I #L1 #V #T #HI #_
32 normalize <minus_plus_m_m #IHT #HL1 #L2 #HL12
33 lapply (ldrop_fwd_ldrop2_length … HL1) #H
34 lapply (ltn_to_ltO … H) -H #H
35 @(crf_ib2_dx … HI) @IHT
42 lemma crf_inv_labst_last: ∀L,T,W. ⋆.ⓛW @@ L ⊢ 𝐑⦃T⦄ → L ⊢ 𝐑⦃T⦄.
43 #L2 #T #H elim H -L2 -T
44 [ #L2 #K2 #V2 #i #HLK2 #L1 #HL12