]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/relocation/sex_length.ma
renaming in basic_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / relocation / sex_length.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/syntax/lenv_length.ma".
16 include "basic_2/relocation/sex.ma".
17
18 (* GENERIC ENTRYWISE EXTENSION OF CONTEXT-SENSITIVE REALTIONS FOR TERMS *****)
19
20 (* Forward lemmas with length for local environments ************************)
21
22 lemma sex_fwd_length: ∀RN,RP,f,L1,L2. L1 ⪤[RN, RP, f] L2 → |L1| = |L2|.
23 #RN #RP #f #L1 #L2 #H elim H -f -L1 -L2 //
24 #f #I1 #I2 #L1 #L2 >length_bind >length_bind //
25 qed-.
26
27 (* Properties with length for local environments ****************************)
28
29 lemma sex_length_cfull: ∀L1,L2. |L1| = |L2| → ∀f. L1 ⪤[cfull, cfull, f] L2.
30 #L1 elim L1 -L1
31 [ #Y2 #H >(length_inv_zero_sn … H) -Y2 //
32 | #L1 #I1 #IH #Y2 #H #f
33   elim (length_inv_succ_sn … H) -H #I2 #L2 #HL12 #H destruct
34   elim (pn_split f) * #g #H destruct /3 width=1 by sex_next, sex_push/
35 ]
36 qed.
37
38 lemma sex_length_isid: ∀R,L1,L2. |L1| = |L2| →
39                        ∀f. 𝐈⦃f⦄ → L1 ⪤[R, cfull, f] L2.
40 #R #L1 elim L1 -L1
41 [ #Y2 #H >(length_inv_zero_sn … H) -Y2 //
42 | #L1 #I1 #IH #Y2 #H #f #Hf
43   elim (length_inv_succ_sn … H) -H #I2 #L2 #HL12 #H destruct
44   elim (isid_inv_gen … Hf) -Hf #g #Hg #H destruct /3 width=1 by sex_push/
45 ]
46 qed.