]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/relocation/sex_sex.ma
syntactic components detached from basic_2 become static_2
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / relocation / sex_sex.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 "ground_2/relocation/rtmap_sand.ma".
16 include "static_2/relocation/drops.ma".
17
18 (* GENERIC ENTRYWISE EXTENSION OF CONTEXT-SENSITIVE REALTIONS FOR TERMS *****)
19
20 (* Main properties **********************************************************)
21
22 theorem sex_trans_gen (RN1) (RP1) (RN2) (RP2) (RN) (RP):
23                       ∀L1,f.
24                       (∀g,I,K,n. ⬇*[n] L1 ≘ K.ⓘ{I} → ↑g = ⫱*[n] f → sex_transitive RN1 RN2 RN RN1 RP1 g K I) →
25                       (∀g,I,K,n. ⬇*[n] L1 ≘ K.ⓘ{I} → ⫯g = ⫱*[n] f → sex_transitive RP1 RP2 RP RN1 RP1 g K I) →
26                       ∀L0. L1 ⪤[RN1, RP1, f] L0 →
27                       ∀L2. L0 ⪤[RN2, RP2, f] L2 →
28                       L1 ⪤[RN, RP, f] L2.
29 #RN1 #RP1 #RN2 #RP2 #RN #RP #L1 elim L1 -L1
30 [ #f #_ #_ #L0 #H1 #L2 #H2
31   lapply (sex_inv_atom1 … H1) -H1 #H destruct
32   lapply (sex_inv_atom1 … H2) -H2 #H destruct
33   /2 width=1 by sex_atom/
34 | #K1 #I1 #IH #f elim (pn_split f) * #g #H destruct
35   #HN #HP #L0 #H1 #L2 #H2
36   [ elim (sex_inv_push1 … H1) -H1 #I0 #K0 #HK10 #HI10 #H destruct
37     elim (sex_inv_push1 … H2) -H2 #I2 #K2 #HK02 #HI02 #H destruct
38     lapply (HP … 0 … HI10 … HK10 … HI02) -HI10 -HI02 /2 width=2 by drops_refl/ #HI12
39     lapply (IH … HK10 … HK02) -IH -K0 /3 width=3 by sex_push, drops_drop/
40   | elim (sex_inv_next1 … H1) -H1 #I0 #K0 #HK10 #HI10 #H destruct
41     elim (sex_inv_next1 … H2) -H2 #I2 #K2 #HK02 #HI02 #H destruct
42     lapply (HN … 0 … HI10 … HK10 … HI02) -HI10 -HI02 /2 width=2 by drops_refl/ #HI12
43     lapply (IH … HK10 … HK02) -IH -K0 /3 width=3 by sex_next, drops_drop/
44   ]
45 ]
46 qed-.
47
48 theorem sex_trans (RN) (RP) (f): (∀g,I,K. sex_transitive RN RN RN RN RP g K I) →
49                                  (∀g,I,K. sex_transitive RP RP RP RN RP g K I) →
50                                  Transitive … (sex RN RP f).
51 /2 width=9 by sex_trans_gen/ qed-.
52
53 theorem sex_trans_id_cfull: ∀R1,R2,R3,L1,L,f. L1 ⪤[R1, cfull, f] L → 𝐈⦃f⦄ →
54                             ∀L2. L ⪤[R2, cfull, f] L2 → L1 ⪤[R3, cfull, f] L2.
55 #R1 #R2 #R3 #L1 #L #f #H elim H -L1 -L -f
56 [ #f #Hf #L2 #H >(sex_inv_atom1 … H) -L2 // ]
57 #f #I1 #I #K1 #K #HK1 #_ #IH #Hf #L2 #H
58 [ elim (isid_inv_next … Hf) | lapply (isid_inv_push … Hf ??) ] -Hf [5: |*: // ] #Hf
59 elim (sex_inv_push1 … H) -H #I2 #K2 #HK2 #_ #H destruct
60 /3 width=1 by sex_push/
61 qed-.
62
63 theorem sex_conf (RN1) (RP1) (RN2) (RP2):
64                  ∀L,f.
65                  (∀g,I,K,n. ⬇*[n] L ≘ K.ⓘ{I} → ↑g = ⫱*[n] f → R_pw_confluent2_sex RN1 RN2 RN1 RP1 RN2 RP2 g K I) →
66                  (∀g,I,K,n. ⬇*[n] L ≘ K.ⓘ{I} → ⫯g = ⫱*[n] f → R_pw_confluent2_sex RP1 RP2 RN1 RP1 RN2 RP2 g K I) →
67                  pw_confluent2 … (sex RN1 RP1 f) (sex RN2 RP2 f) L.
68 #RN1 #RP1 #RN2 #RP2 #L elim L -L
69 [ #f #_ #_ #L1 #H1 #L2 #H2 >(sex_inv_atom1 … H1) >(sex_inv_atom1 … H2) -H2 -H1
70   /2 width=3 by sex_atom, ex2_intro/
71 | #L #I0 #IH #f elim (pn_split f) * #g #H destruct
72   #HN #HP #Y1 #H1 #Y2 #H2
73   [ elim (sex_inv_push1 … H1) -H1 #I1 #L1 #HL1 #HI01 #H destruct
74     elim (sex_inv_push1 … H2) -H2 #I2 #L2 #HL2 #HI02 #H destruct
75     elim (HP … 0 … HI01 … HI02 … HL1 … HL2) -HI01 -HI02 /2 width=2 by drops_refl/ #I #HI1 #HI2
76     elim (IH … HL1 … HL2) -IH -HL1 -HL2 /3 width=5 by drops_drop, sex_push, ex2_intro/
77   | elim (sex_inv_next1 … H1) -H1 #I1 #L1 #HL1 #HI01 #H destruct
78     elim (sex_inv_next1 … H2) -H2 #I2 #L2 #HL2 #HI02 #H destruct
79     elim (HN … 0 … HI01 … HI02 … HL1 … HL2) -HI01 -HI02 /2 width=2 by drops_refl/ #I #HI1 #HI2
80     elim (IH … HL1 … HL2) -IH -HL1 -HL2 /3 width=5 by drops_drop, sex_next, ex2_intro/
81   ]
82 ]
83 qed-.
84
85 theorem sex_canc_sn: ∀RN,RP,f. Transitive … (sex RN RP f) →
86                                symmetric … (sex RN RP f) →
87                                left_cancellable … (sex RN RP f).
88 /3 width=3 by/ qed-.
89
90 theorem sex_canc_dx: ∀RN,RP,f. Transitive … (sex RN RP f) →
91                                symmetric … (sex RN RP f) →
92                                right_cancellable … (sex RN RP f).
93 /3 width=3 by/ qed-.
94
95 lemma sex_meet: ∀RN,RP,L1,L2.
96                 ∀f1. L1 ⪤[RN, RP, f1] L2 →
97                 ∀f2. L1 ⪤[RN, RP, f2] L2 →
98                 ∀f. f1 ⋒ f2 ≘ f → L1 ⪤[RN, RP, f] L2.
99 #RN #RP #L1 #L2 #f1 #H elim H -f1 -L1 -L2 //
100 #f1 #I1 #I2 #L1 #L2 #_ #HI12 #IH #f2 #H #f #Hf
101 elim (pn_split f2) * #g2 #H2 destruct
102 try elim (sex_inv_push … H) try elim (sex_inv_next … H) -H
103 [ elim (sand_inv_npx … Hf) | elim (sand_inv_nnx … Hf)
104 | elim (sand_inv_ppx … Hf) | elim (sand_inv_pnx … Hf)
105 ] -Hf /3 width=5 by sex_next, sex_push/
106 qed-.
107
108 lemma sex_join: ∀RN,RP,L1,L2.
109                 ∀f1. L1 ⪤[RN, RP, f1] L2 →
110                 ∀f2. L1 ⪤[RN, RP, f2] L2 →
111                 ∀f. f1 ⋓ f2 ≘ f → L1 ⪤[RN, RP, f] L2.
112 #RN #RP #L1 #L2 #f1 #H elim H -f1 -L1 -L2 //
113 #f1 #I1 #I2 #L1 #L2 #_ #HI12 #IH #f2 #H #f #Hf
114 elim (pn_split f2) * #g2 #H2 destruct
115 try elim (sex_inv_push … H) try elim (sex_inv_next … H) -H
116 [ elim (sor_inv_npx … Hf) | elim (sor_inv_nnx … Hf)
117 | elim (sor_inv_ppx … Hf) | elim (sor_inv_pnx … Hf)
118 ] -Hf /3 width=5 by sex_next, sex_push/
119 qed-.