]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/etc/lfxs_fle.etc
update in ground_2 and basic_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / etc / lfxs_fle.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/static/fle_fqup.ma".
16 include "basic_2/static/fle_fid.ma".
17 include "basic_2/static/lfxs_length.ma".
18 include "basic_2/static/lfxs_fqup.ma".
19 include "basic_2/static/lfeq_fid.ma".
20
21 (* Note: "⦃L2, T1⦄ ⊆ ⦃L0, T1⦄" may not hold *)
22 definition R_lfxs_fle_compatible: predicate (relation3 …) ≝ λR.
23                                   ∀L0,T0,T1. R L0 T0 T1 →
24                                   ∀L2. L0 ⪤*[R, T0] L2 →
25                                   ∧∧ ⦃L2, T0⦄ ⊆ ⦃L0, T0⦄ & ⦃L2, T1⦄ ⊆ ⦃L2, T0⦄
26                                    & ⦃L0, T1⦄ ⊆ ⦃L0, T0⦄.
27
28 axiom fle_inv_zero_bind_dx: ∀I,K,V,X. ⦃K.ⓑ{I}V, X⦄ ⊆ ⦃K.ⓑ{I}V, #O⦄ →
29                             ∨∨ 𝐈⦃K.ⓑ{I}V, #O⦄ | ⦃K.ⓑ{I}V, X⦄ ⊆ ⦃K, V⦄.
30                                    
31 lemma fle_lfxs_conf_fle: ∀R. (* c_reflexive … R → *)
32                          R_lfxs_fle_compatible R →
33                          ∀L0,T0,T1. ⦃L0, T1⦄ ⊆ ⦃L0, T0⦄ →
34                          ∀L2. L0 ⪤*[R, T0] L2 →
35                          ∧∧ ⦃L2, T0⦄ ⊆ ⦃L0, T0⦄ & ⦃L2, T1⦄ ⊆ ⦃L2, T0⦄.
36 #R #HR #L0 #T0 @(fqup_wf_ind_eq (Ⓕ) … (⋆) L0 T0) -L0 -T0
37 #G #L #T #IH #G0 #L0 * *
38 [ #s #HG #HL #HT #X #HX #Y #HY destruct -HR -IH
39   lapply (lfxs_fwd_length … HY) -HY #H0
40   lapply (fle_inv_fid_dx … HX ?) -HX
41   /4 width=6 by fle_sort_length, fid_length, fle_fid_sn, conj/
42 | * [| #i ] #HG #HL #HT #X #HX #Y #HY destruct
43   [ elim (lfxs_inv_zero … HY) -HY *
44     [ #H1 #H2 destruct -IH /2 width=1 by conj/
45     | #I #K0 #K2 #V0 #V1 #HK02 #HV01 #H1 #H2 destruct -IH
46       elim (HR … HV01 … HK02) -HR -HV01 -HK02 #HKV1 #HKV2 #HKV3
47       @conj
48       [
49       |  
50 (*    
51         elim H2R -H2R #H2R
52         [ <(H2R G0) in HV02; -H2R #HV02
53           elim (IH … HV02 … HK02) /2 width=2 by fqu_fqup, fqu_lref_O/ -IH -HV02 -HK02 #H1V #H2V #H3V
54         | lapply (H2R … HV02) -H2R -HV02 #HV20
55           elim (IH … V0 … HK02) [|*: /2 width=4 by fqu_fqup, fqu_lref_O/ ] -IH -HK02 #H1V #_ #_
56         ]
57       | #f #I #K0 #K2 #Hf #HK02 #H1 #H2 destruct
58       ]
59     | * #I0 #K0 #V0 #V1 #HV01 #HV1X #H destruct
60       elim (lfxs_inv_zero_pair_sn … HY) -HY #K2 #V2 #HK02 #HV02 #H destruct
61     ]
62   | elim (cpx_inv_lref1 … HX) -HX
63     [ #H destruct
64       elim (lfxs_inv_lref … HY) -HY *
65       [ #H0 #H1 destruct /2 width=1 by and3_intro/
66       | #I0 #I2 #K0 #K2 #HK02 #H1 #H2 destruct
67         lapply (lfxs_fwd_length … HK02) #HK
68         elim (IH … HK02) [|*: /2 width=4 by fqu_fqup/ ] -IH -HK02
69         /3 width=5 by and3_intro, fle_lifts_SO/
70       ]
71     | * #I0 #K0 #V1 #HV1 #HV1X #H0 destruct
72       elim (lfxs_inv_lref_bind_sn … HY) -HY #I2 #K2 #HK02 #H destruct
73       lapply (lfxs_fwd_length … HK02) #HK
74       elim (IH … HK02) [|*: /2 width=4 by fqu_fqup/ ] -IH -HV1 -HK02
75       /3 width=5 by fle_lifts_SO, and3_intro/
76     ]
77   ]
78 | #l #HG #HL #HT #X #HX #Y #HY destruct -IH
79   lapply (lfxs_fwd_length … HY) -HY #H0
80   >(cpx_inv_gref1 … HX) -X
81   /3 width=1 by fle_gref_length, and3_intro/
82 | #p #I #V0 #T0 #HG #HL #HT #X #HX #Y #HY destruct
83   lapply (lfxs_fwd_length … HY) #H0
84   elim (lfxs_inv_bind … V0 ? HY) -HY // #HV0 #HT0
85   elim (cpx_inv_bind1 … HX) -HX *
86   [ #V1 #T1 #HV01 #HT01 #H destruct
87     elim (IH … HV01 … HV0) -HV01 -HV0 // #H1V #H2V #H3V
88     elim (IH … HT01 … HT0) -HT01 -HT0 -IH // #H1T #H2T #H3T
89     /4 width=3 by fle_bind_eq, fle_fwd_pair_sn, and3_intro/
90   | #T #HT #HXT #H1 #H2 destruct
91     elim (IH G0 … V0… V0 … HV0) -HV0 // #H1V #H2V #H3V
92     elim (IH … HT … HT0) -HT -HT0 -IH // #H1T #H2T #H3T
93     /3 width=5 by fle_bind, fle_inv_lifts_sn, and3_intro/
94   ]
95 | #I #V0 #X0 #HG #HL #HT #X #HX #Y #HY destruct
96   elim (lfxs_inv_flat … HY) -HY #HV0 #HX0
97   elim (cpx_inv_flat1 … HX) -HX *
98   [ #V1 #T1 #HV01 #HT01 #H destruct
99     elim (IH … HV01 … HV0) -HV01 -HV0 // #H1V #H2V #H3V
100     elim (IH … HT01 … HX0) -HT01 -HX0 -IH // #H1T #H2T #H3T
101     /3 width=3 by fle_flat, and3_intro/
102   | #HX #H destruct
103     elim (IH G0 … V0… V0 … HV0) -HV0 // #H1V #H2V #H3V
104     elim (IH … HX … HX0) -HX -HX0 -IH // #H1T #H2T #H3T
105     /4 width=3 by fle_flat_sn, fle_flat_dx_dx, fle_flat_dx_sn, and3_intro/
106   | #HX #H destruct
107     elim (IH … HX … HV0) -HX -HV0 // #H1V #H2V #H3V
108     elim (IH G0 … X0… X0 … HX0) -HX0 -IH // #H1T #H2T #H3T
109     /4 width=3 by fle_flat_sn, fle_flat_dx_dx, fle_flat_dx_sn, and3_intro/
110   | #p #V1 #W0 #W1 #T0 #T1 #HV01 #HW01 #HT01 #H1 #H2 #H3 destruct
111     elim (lfxs_inv_bind … W0 ? HX0) -HX0 // #HW0 #HT0
112     elim (IH … HV01 … HV0) -HV01 -HV0 // #H1V #H2V #H3V
113     elim (IH … HW01 … HW0) -HW01 -HW0 // #H1W #H2W #H3W
114     elim (IH … HT01 … HT0) -HT01 -HT0 -IH // #H1T #H2T #H3T
115     lapply (fle_fwd_pair_sn … H2T) -H2T #H2T
116     lapply (fle_fwd_pair_sn … H3T) -H3T #H3T
117     @and3_intro [ /3 width=5 by fle_flat, fle_bind/ ] (**) (* full auto too slow *)
118     @fle_bind_sn_ge /4 width=1 by fle_shift, fle_flat_sn, fle_flat_dx_dx, fle_flat_dx_sn, fle_bind_dx_sn/
119   | #p #V1 #X1 #W0 #W1 #T0 #T1 #HV01 #HVX1 #HW01 #HT01 #H1 #H2 #H3 destruct
120     elim (lfxs_inv_bind … W0 ? HX0) -HX0 // #HW0 #HT0
121     elim (IH … HV01 … HV0) -HV01 -HV0 // #H1V #H2V #H3V
122     elim (IH … HW01 … HW0) -HW01 -HW0 // #H1W #H2W #H3W
123     elim (IH … HT01 … HT0) -HT01 -HT0 -IH // #H1T #H2T #H3T
124     lapply (fle_fwd_pair_sn … H2T) -H2T #H2T
125     lapply (fle_fwd_pair_sn … H3T) -H3T #H3T
126     @and3_intro[ /3 width=5 by fle_flat, fle_bind/ ] (**) (* full auto too slow *)
127     @fle_bind_sn_ge //
128     [1,3: /3 width=1 by fle_flat_dx_dx, fle_bind_dx_sn/
129     |2,4: /4 width=3 by fle_flat_sn, fle_flat_dx_sn, fle_flat_dx_dx, fle_shift, fle_lifts_sn/
130     ]
131   ]
132 ]
133 *)