]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/static/lfdeq_fqus.ma
- more commutations with superclosure: fpb_lfdeq
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / static / lfdeq_fqus.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/s_computation/fqus_fqup.ma".
16 include "basic_2/static/lfdeq_drops.ma".
17 include "basic_2/static/lfdeq_lfdeq.ma".
18
19 (* DEGREE-BASED EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ******)
20
21 (* Properties with supclosure ***********************************************)
22
23 lemma fqu_tdeq_conf: ∀h,o,G1,G2,L1,L2,U1,T1. ⦃G1, L1, U1⦄ ⊐ ⦃G2, L2, T1⦄ →
24                      ∀U2. U1 ≡[h, o] U2 →
25                      ∃∃L,T2. ⦃G1, L1, U2⦄ ⊐ ⦃G2, L, T2⦄ & L2 ≡[h, o, T1] L & T1 ≡[h, o] T2.
26 #h #o #G1 #G2 #L1 #L2 #U1 #T1 #H elim H -G1 -G2 -L1 -L2 -U1 -T1
27 [ #I #G #L #W #X #H >(tdeq_inv_lref1 … H) -H
28   /2 width=5 by fqu_lref_O, ex3_2_intro/
29 | #I #G #L #W1 #U1 #X #H
30   elim (tdeq_inv_pair1 … H) -H #W2 #U2 #HW12 #_ #H destruct
31   /2 width=5 by fqu_pair_sn, ex3_2_intro/
32 | #p #I #G #L #W1 #U1 #X #H
33   elim (tdeq_inv_pair1 … H) -H #W2 #U2 #HW12 #HU12 #H destruct
34   /3 width=5 by lfdeq_pair, fqu_bind_dx, ex3_2_intro/
35 | #I #G #L #W1 #U1 #X #H
36   elim (tdeq_inv_pair1 … H) -H #W2 #U2 #_ #HU12 #H destruct
37   /2 width=5 by fqu_flat_dx, ex3_2_intro/
38 | #I #G #L #W #T1 #U1 #HTU1 #U2 #HU12
39   elim (tdeq_inv_lifts … HU12 … HTU1) -U1 #T2 #HTU2 #HT12
40   /3 width=5 by fqu_drop, ex3_2_intro/
41 ]
42 qed-.
43
44 lemma tdeq_fqu_trans: ∀h,o,G1,G2,L1,L2,U1,T1. ⦃G1, L1, U1⦄ ⊐ ⦃G2, L2, T1⦄ →
45                       ∀U2. U2 ≡[h, o] U1 →
46                       ∃∃L,T2. ⦃G1, L1, U2⦄ ⊐ ⦃G2, L, T2⦄ & T2 ≡[h, o] T1 & L ≡[h, o, T1] L2.
47 #h #o #G1 #G2 #L1 #L2 #U1 #T1 #H12 #U2 #HU21
48 elim (fqu_tdeq_conf … o … H12 U2) -H12
49 /3 width=5 by lfdeq_sym, tdeq_sym, ex3_2_intro/
50 qed-.
51
52 (* Basic_2A1: was just: lleq_fqu_trans *)
53 lemma lfdeq_fqu_trans: ∀h,o,G1,G2,L2,K2,T,U. ⦃G1, L2, T⦄ ⊐ ⦃G2, K2, U⦄ →
54                        ∀L1. L1 ≡[h, o, T] L2 →
55                        ∃∃K1,U0. ⦃G1, L1, T⦄ ⊐ ⦃G2, K1, U0⦄ & U0 ≡[h, o] U & K1 ≡[h, o, U] K2.
56 #h #o #G1 #G2 #L2 #K2 #T #U #H elim H -G1 -G2 -L2 -K2 -T -U
57 [ #I #G #L2 #V2 #L1 #H elim (lfdeq_inv_zero_pair_dx … H) -H
58   #K1 #V1 #HV1 #HV12 #H destruct
59   /3 width=7 by tdeq_lfdeq_conf_sn, fqu_lref_O, ex3_2_intro/
60 | * [ #p ] #I #G #L2 #V #T #L1 #H
61   [ elim (lfdeq_inv_bind … H)
62   | elim (lfdeq_inv_flat … H)
63   ] -H
64   /2 width=5 by fqu_pair_sn, ex3_2_intro/
65 | #a #I #G #L2 #V #T #L1 #H elim (lfdeq_inv_bind … H) -H
66   /2 width=5 by fqu_bind_dx, ex3_2_intro/
67 | #I #G #L2 #V #T #L1 #H elim (lfdeq_inv_flat … H) -H
68   /2 width=5 by fqu_flat_dx, ex3_2_intro/
69 | #I #G #L2 #V2 #T #U #HTU #Y #HU
70   elim (lfdeq_fwd_dx … HU) #L1 #V1 #H destruct
71   /5 width=12 by lfdeq_inv_lifts_bi, fqu_drop, drops_refl, drops_drop, ex3_2_intro/
72 ]
73 qed-.
74
75 (* Basic_2A1: was just: lleq_fquq_trans *)
76 lemma lfdeq_fquq_trans: ∀h,o,G1,G2,L2,K2,T,U. ⦃G1, L2, T⦄ ⊐⸮ ⦃G2, K2, U⦄ →
77                         ∀L1. L1 ≡[h, o, T] L2 →
78                         ∃∃K1,U0. ⦃G1, L1, T⦄ ⊐⸮ ⦃G2, K1, U0⦄ & U0 ≡[h, o] U & K1 ≡[h, o, U] K2.
79 #h #o #G1 #G2 #L2 #K2 #T #U #H elim H -H
80 [ #H #L1 #HL12 elim (lfdeq_fqu_trans … H … HL12) -L2 /3 width=5 by fqu_fquq, ex3_2_intro/
81 | * #HG #HL #HT destruct /2 width=5 by ex3_2_intro/
82 ]
83 qed-.
84
85 (* Basic_2A1: was just: lleq_fqup_trans *)
86 lemma lfdeq_fqup_trans: ∀h,o,G1,G2,L2,K2,T,U. ⦃G1, L2, T⦄ ⊐+ ⦃G2, K2, U⦄ →
87                         ∀L1. L1 ≡[h, o, T] L2 →
88                         ∃∃K1,U0. ⦃G1, L1, T⦄ ⊐+ ⦃G2, K1, U0⦄ & U0 ≡[h, o] U & K1 ≡[h, o, U] K2.
89 #h #o #G1 #G2 #L2 #K2 #T #U #H @(fqup_ind … H) -G2 -K2 -U
90 [ #G2 #K2 #U #HTU #L1 #HL12 elim (lfdeq_fqu_trans … HTU … HL12) -L2
91   /3 width=5 by fqu_fqup, ex3_2_intro/
92 | #G #G2 #K #K2 #U #U2 #_ #HU2 #IHTU #L1 #HL12
93   elim (IHTU … HL12) -L2 #K0 #U0 #HTU #HU0 #HK0
94   elim (lfdeq_fqu_trans … HU2 … HK0) -K #K1 #U1 #HU1 #HU12 #HK12
95   elim (tdeq_fqu_trans … HU1 … HU0) -U #K3 #U3 #HU03 #HU31 #HK31
96   @(ex3_2_intro … K3 U3) (**) (* full auto too slow *)
97   /3 width=5 by lfdeq_trans, tdeq_lfdeq_conf_sn, fqup_strap1, tdeq_trans/
98 ]
99 qed-.
100
101 (* Basic_2A1: was just: lleq_fqus_trans *)
102 lemma lfdeq_fqus_trans: ∀h,o,G1,G2,L2,K2,T,U. ⦃G1, L2, T⦄ ⊐* ⦃G2, K2, U⦄ →
103                         ∀L1. L1 ≡[h, o, T] L2 →
104                         ∃∃K1,U0. ⦃G1, L1, T⦄ ⊐* ⦃G2, K1, U0⦄ & U0 ≡[h, o] U & K1 ≡[h, o, U] K2.
105 #h #o #G1 #G2 #L2 #K2 #T #U #H #L1 #HL12 elim(fqus_inv_fqup … H) -H
106 [ #H elim (lfdeq_fqup_trans … H … HL12) -L2 /3 width=5 by fqup_fqus, ex3_2_intro/
107 | * #HG #HL #HT destruct /2 width=5 by ex3_2_intro/
108 ]
109 qed-.