]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/etc/lpx_sn/llpx_sn_alt.etc
milestone update in ground_2 and basic_2A
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / etc / lpx_sn / llpx_sn_alt.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/substitution/cofrees_alt.ma".
16 include "basic_2/substitution/llpx_sn_alt_rec.ma".
17
18 (* LAZY SN POINTWISE EXTENSION OF A CONTEXT-SENSITIVE REALTION FOR TERMS ****)
19
20 (* alternative definition of llpx_sn (not recursive) *)
21 definition llpx_sn_alt: relation4 bind2 lenv term term → relation4 ynat term lenv lenv ≝
22                         λR,d,T,L1,L2. |L1| = |L2| ∧
23                         (∀I1,I2,K1,K2,V1,V2,i. d ≤ yinj i → (L1 ⊢ i ~ϵ 𝐅*[d]⦃T⦄ → ⊥) →
24                            ⇩[i] L1 ≡ K1.ⓑ{I1}V1 → ⇩[i] L2 ≡ K2.ⓑ{I2}V2 →
25                            I1 = I2 ∧ R I1 K1 V1 V2
26                         ).
27
28 (* Main properties **********************************************************)
29
30 theorem llpx_sn_llpx_sn_alt: ∀R,T,L1,L2,d. llpx_sn R d T L1 L2 → llpx_sn_alt R d T L1 L2.
31 #R #U #L1 @(f2_ind … rfw … L1 U) -L1 -U
32 #n #IHn #L1 #U #Hn #L2 #d #H elim (llpx_sn_inv_alt_r … H) -H
33 #HL12 #IHU @conj //
34 #I1 #I2 #K1 #K2 #V1 #V2 #i #Hdi #H #HLK1 #HLK2 elim (frees_inv_ge … H) -H //
35 [ -n #HnU elim (IHU … HnU HLK1 HLK2) -IHU -HnU -HLK1 -HLK2 /2 width=1 by conj/
36 | * #J1 #K10 #W10 #j #Hdj #Hji #HLK10 #HnW10 #HnU destruct
37   lapply (ldrop_fwd_drop2 … HLK10) #H
38   lapply (ldrop_conf_ge … H … HLK1 ?) -H /2 width=1 by lt_to_le/ <minus_plus #HK10
39   elim (ldrop_O1_lt (Ⓕ) L2 j) [2: <HL12 /2 width=5 by ldrop_fwd_length_lt2/ ] #J2 #K20 #W20 #HLK20
40   lapply (ldrop_fwd_drop2 … HLK20) #H
41   lapply (ldrop_conf_ge … H … HLK2 ?) -H /2 width=1 by lt_to_le/ <minus_plus #HK20
42   elim (IHn K10 W10 … K20 0) -IHn -HL12 /3 width=6 by ldrop_fwd_rfw/
43   elim (IHU … HnU HLK10 HLK20) -IHU -HnU -HLK10 -HLK20 //
44 ]
45 qed.
46
47 theorem llpx_sn_alt_inv_llpx_sn: ∀R,T,L1,L2,d. llpx_sn_alt R d T L1 L2 → llpx_sn R d T L1 L2.
48 #R #U #L1 @(f2_ind … rfw … L1 U) -L1 -U
49 #n #IHn #L1 #U #Hn #L2 #d * #HL12 #IHU @llpx_sn_intro_alt_r //
50 #I1 #I2 #K1 #K2 #V1 #V2 #i #Hdi #HnU #HLK1 #HLK2 destruct
51 elim (IHU … HLK1 HLK2) /3 width=6 by nlift_frees/
52 #H #HV12 @and3_intro // @IHn -IHn /3 width=6 by ldrop_fwd_rfw/
53 lapply (ldrop_fwd_drop2 … HLK1) #H1
54 lapply (ldrop_fwd_drop2 … HLK2) -HLK2 #H2
55 @conj [ @(ldrop_fwd_length_eq1 … H1 H2) // ] -HL12
56 #Z1 #Z2 #Y1 #Y2 #X1 #X2 #j #_
57 >(minus_plus_m_m j (i+1)) in ⊢ (%→?); >commutative_plus <minus_plus
58 #HnV1 #HKY1 #HKY2 (**) (* full auto too slow *)
59 lapply (ldrop_trans_ge … H1 … HKY1 ?) -H1 -HKY1 // #HLY1
60 lapply (ldrop_trans_ge … H2 … HKY2 ?) -H2 -HKY2 // #HLY2
61 /4 width=14 by frees_be, yle_plus_dx2_trans, yle_succ_dx/
62 qed-.