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/syntax/lveq_lveq.ma".
16 include "basic_2/static/frees_frees.ma".
17 include "basic_2/static/fle_fqup.ma".
19 (* FREE VARIABLES INCLUSION FOR RESTRICTED CLOSURES *************************)
21 (* Advanced inversion lemmas ************************************************)
23 lemma fle_frees_trans: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⊆ ⦃L2, T2⦄ →
24 ∀f2. L2 ⊢ 𝐅*⦃T2⦄ ≡ f2 →
25 ∃∃n1,n2,f1. L1 ⊢ 𝐅*⦃T1⦄ ≡ f1 &
26 L1 ≋ⓧ*[n1, n2] L2 & ⫱*[n1]f1 ⊆ ⫱*[n2]f2.
27 #L1 #L2 #T1 #T2 * #n1 #n2 #f1 #g2 #Hf1 #Hg2 #HL #Hn #f2 #Hf2
28 lapply (frees_mono … Hg2 … Hf2) -Hg2 -Hf2 #Hgf2
29 lapply (tls_eq_repl n2 … Hgf2) -Hgf2 #Hgf2
30 lapply (sle_eq_repl_back2 … Hn … Hgf2) -g2
31 /2 width=6 by ex3_3_intro/
34 (* Main properties **********************************************************)
36 theorem fle_trans: bi_transitive … fle.
37 #L1 #L #T1 #T * #f1 #f #HT1 #HT #Hf1 #L2 #T2 * #g #f2 #Hg #HT2 #Hf2
38 /5 width=8 by frees_mono, sle_trans, sle_eq_repl_back2, ex3_2_intro/
41 theorem fle_bind_sn: ∀L1,L2,V1,T1,T. ⦃L1, V1⦄ ⊆ ⦃L2, T⦄ → ⦃L1.ⓧ, T1⦄ ⊆ ⦃L2, T⦄ →
42 ∀p,I. ⦃L1, ⓑ{p,I}V1.T1⦄ ⊆ ⦃L2, T⦄.
43 #L1 #L2 #V1 #T1 #T * #n1 #x #f1 #g #Hf1 #Hg #H1n1 #H2n1 #H #p #I
44 elim (fle_frees_trans … H … Hg) -H #n2 #n #f2 #Hf2 #H1n2 #H2n2
45 elim (lveq_inj_void_sn … H1n1 … H1n2) -H1n2 #H1 #H2 destruct
46 elim (sor_isfin_ex f1 (⫱f2)) /3 width=3 by frees_fwd_isfin, isfin_tl/ #f #Hf #_
47 <tls_xn in H2n2; #H2n2
48 /4 width=12 by frees_bind_void, sor_inv_sle, sor_tls, ex4_4_intro/
51 theorem fle_flat_sn: ∀L1,L2,V1,T1,T. ⦃L1, V1⦄ ⊆ ⦃L2, T⦄ → ⦃L1, T1⦄ ⊆ ⦃L2, T⦄ →
52 ∀I. ⦃L1, ⓕ{I}V1.T1⦄ ⊆ ⦃L2, T⦄.
53 #L1 #L2 #V1 #T1 #T * #n1 #x #f1 #g #Hf1 #Hg #H1n1 #H2n1 #H #I
54 elim (fle_frees_trans … H … Hg) -H #n2 #n #f2 #Hf2 #H1n2 #H2n2
55 elim (lveq_inj … H1n1 … H1n2) -H1n2 #H1 #H2 destruct
56 elim (sor_isfin_ex f1 f2) /2 width=3 by frees_fwd_isfin/ #f #Hf #_
57 /4 width=12 by frees_flat, sor_inv_sle, sor_tls, ex4_4_intro/
60 theorem fle_bind: ∀L1,L2,V1,V2. ⦃L1, V1⦄ ⊆ ⦃L2, V2⦄ →
61 ∀I1,I2,T1,T2. ⦃L1.ⓑ{I1}V1, T1⦄ ⊆ ⦃L2.ⓑ{I2}V2, T2⦄ →
62 ∀p. ⦃L1, ⓑ{p,I1}V1.T1⦄ ⊆ ⦃L2, ⓑ{p,I2}V2.T2⦄.
63 #L1 #L2 #V1 #V2 #HV #I1 #I2 #T1 #T2 #HT #p
69 elim (sor_isfin_ex f1 (⫱f2)) /3 width=3 by frees_fwd_isfin, isfin_tl/ #f #Hf #_
70 elim (sor_isfin_ex g1 (⫱g2)) /3 width=3 by frees_fwd_isfin, isfin_tl/ #g #Hg #_
71 /4 width=12 by frees_bind, monotonic_sle_sor, sle_tl, ex3_2_intro/
74 theorem fle_flat: ∀L1,L2,V1,V2. ⦃L1, V1⦄ ⊆ ⦃L2, V2⦄ →
75 ∀T1,T2. ⦃L1, T1⦄ ⊆ ⦃L2, T2⦄ →
76 ∀I1,I2. ⦃L1, ⓕ{I1}V1.T1⦄ ⊆ ⦃L2, ⓕ{I2}V2.T2⦄.
77 /3 width=1 by fle_flat_sn, fle_flat_dx_dx, fle_flat_dx_sn/ qed-.