]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/static/fle_fqup.ma
advances on cpx_lfxs_conf_fle
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / static / fle_fqup.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/lveq_length.ma".
16 include "basic_2/static/frees_fqup.ma".
17 include "basic_2/static/fle.ma".
18
19 (* FREE VARIABLES INCLUSION FOR RESTRICTED CLOSURES *************************)
20
21 (* Advanced properties ******************************************************)
22
23 lemma fle_refl: bi_reflexive … fle.
24 #L #T
25 elim (frees_total L T) #f #Hf
26 /2 width=8 by sle_refl, ex4_4_intro/
27 qed.
28
29 lemma fle_sort_length: ∀L1,L2,s1,s2. |L1| = |L2| → ⦃L1, ⋆s1⦄ ⊆ ⦃L2, ⋆s2⦄.
30 /3 width=8 by lveq_length_eq, frees_sort, sle_refl, ex4_4_intro/ qed.
31
32 lemma fle_gref_length: ∀L1,L2,l1,l2. |L1| = |L2| → ⦃L1, §l1⦄ ⊆ ⦃L2, §l2⦄.
33 /3 width=8 by lveq_length_eq, frees_gref, sle_refl, ex4_4_intro/ qed.
34
35 lemma fle_shift: ∀L1,L2. |L1| = |L2| →
36                  ∀I,T1,T2,V.  ⦃L1.ⓧ, T1⦄ ⊆ ⦃L2.ⓑ{I}V, T2⦄ →
37                  ∀p. ⦃L1.ⓧ, T1⦄ ⊆ ⦃L2, ⓑ{p,I}V.T2⦄.
38 #L1 #L2 #H1L #I #T1 #T2 #V
39 * #n #m #f2 #g2 #Hf2 #Hg2 #H2L #Hfg2 #p
40 elim (lveq_inj_length … H2L) // -H1L #H1 #H2 destruct
41 lapply (lveq_inv_bind … H2L) -H2L #HL
42 elim (frees_total L2 V) #g1 #Hg1
43 elim (sor_isfin_ex g1 (⫱g2)) /3 width=3 by frees_fwd_isfin, isfin_tl/ #g #Hg #_
44 lapply (sor_inv_sle_dx … Hg) #H0g
45 /4 width=10 by frees_bind, lveq_void_sn, sle_tl, sle_trans, ex4_4_intro/
46 qed.
47
48 lemma fle_bind_dx_sn: ∀L1,L2,V1,V2. ⦃L1, V1⦄ ⊆ ⦃L2, V2⦄ →
49                       ∀p,I,T2. ⦃L1, V1⦄ ⊆ ⦃L2, ⓑ{p,I}V2.T2⦄.
50 #L1 #L2 #V1 #V2 * #n1 #m1 #f1 #g1 #Hf1 #Hg1 #HL12 #Hfg1 #p #I #T2
51 elim (frees_total (L2.ⓧ) T2) #g2 #Hg2
52 elim (sor_isfin_ex g1 (⫱g2)) /3 width=3 by frees_fwd_isfin, isfin_tl/ #g #Hg #_
53 @(ex4_4_intro … g Hf1 … HL12) (**) (* full auto too slow *)
54 /4 width=5 by frees_bind_void, sor_inv_sle_sn, sor_tls, sle_trans/
55 qed.
56
57 lemma fle_bind_dx_dx: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊆ ⦃L2.ⓧ, T2⦄ → |L1| ≤ |L2| →
58                       ∀p,I,V2. ⦃L1, T1⦄ ⊆ ⦃L2, ⓑ{p,I}V2.T2⦄.
59 #L1 #L2 #T1 #T2 * #n1 #x1 #f2 #g2 #Hf2 #Hg2 #H #Hfg2 #HL12 #p #I #V2
60 elim (lveq_inv_void_dx_length … H HL12) -H -HL12 #m1 #HL12 #H1 #H2 destruct
61 <tls_xn in Hfg2; #Hfg2
62 elim (frees_total L2 V2) #g1 #Hg1
63 elim (sor_isfin_ex g1 (⫱g2)) /3 width=3 by frees_fwd_isfin, isfin_tl/ #g #Hg #_
64 @(ex4_4_intro … g Hf2 … HL12) (**) (* full auto too slow *)
65 /4 width=5 by frees_bind_void, sor_inv_sle_dx, sor_tls, sle_trans/
66 qed.
67
68 lemma fle_flat_dx_sn: ∀L1,L2,V1,V2. ⦃L1, V1⦄ ⊆ ⦃L2, V2⦄ →
69                       ∀I,T2. ⦃L1, V1⦄ ⊆ ⦃L2, ⓕ{I}V2.T2⦄.
70 #L1 #L2 #V1 #V2 * #n1 #m1 #f1 #g1 #Hf1 #Hg1 #HL12 #Hfg1 #I #T2
71 elim (frees_total L2 T2) #g2 #Hg2
72 elim (sor_isfin_ex g1 g2) /2 width=3 by frees_fwd_isfin/ #g #Hg #_
73 @(ex4_4_intro … g Hf1 … HL12) (**) (* full auto too slow *)
74 /4 width=5 by frees_flat, sor_inv_sle_sn, sor_tls, sle_trans/
75 qed.
76
77 lemma fle_flat_dx_dx: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊆ ⦃L2, T2⦄ →
78                       ∀I,V2. ⦃L1, T1⦄ ⊆ ⦃L2, ⓕ{I}V2.T2⦄.
79 #L1 #L2 #T1 #T2 * #n1 #m1 #f2 #g2 #Hf2 #Hg2 #HL12 #Hfg2 #I #V2
80 elim (frees_total L2 V2) #g1 #Hg1
81 elim (sor_isfin_ex g1 g2) /2 width=3 by frees_fwd_isfin/ #g #Hg #_
82 @(ex4_4_intro … g Hf2 … HL12) (**) (* full auto too slow *)
83 /4 width=5 by frees_flat, sor_inv_sle_dx, sor_tls, sle_trans/
84 qed.
85
86 (* Advanced forward lemmas ***************************************************)
87
88 lemma fle_fwd_pair_sn: ∀I1,I2,L1,L2,V1,V2,T1,T2. ⦃L1.ⓑ{I1}V1, T1⦄ ⊆ ⦃L2.ⓑ{I2}V2, T2⦄ →
89                        ⦃L1.ⓧ, T1⦄ ⊆ ⦃L2.ⓑ{I2}V2, T2⦄.
90 #I1 #I2 #L1 #L2 #V1 #V2 #T1 #T2 *
91 #n1 #n2 #f1 #f2 #Hf1 #Hf2 #HL12 #Hf12
92 elim (lveq_inv_pair_pair … HL12) -HL12 #HL12 #H1 #H2 destruct
93 elim (frees_total (L1.ⓧ) T1) #g1 #Hg1
94 lapply (lsubr_lsubf … Hg1 … Hf1) -Hf1 /2 width=1 by lsubr_unit/ #Hfg1
95 /5 width=10 by lsubf_fwd_sle, lveq_bind, sle_trans, ex4_4_intro/ (**) (* full auto too slow *)
96 qed-.