]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/substitution/lpx_sn_lpx_sn.ma
update in lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / substitution / lpx_sn_lpx_sn.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_2A/substitution/lpx_sn.ma".
16
17 (* SN POINTWISE EXTENSION OF A CONTEXT-SENSITIVE REALTION FOR TERMS *********)
18
19 definition lpx_sn_confluent: relation (relation3 lenv term term) ≝ λR1,R2.
20                              ∀L0,T0,T1. R1 L0 T0 T1 → ∀T2. R2 L0 T0 T2 →
21                              ∀L1. lpx_sn R1 L0 L1 → ∀L2. lpx_sn R2 L0 L2 →
22                              ∃∃T. R2 L1 T1 T & R1 L2 T2 T.
23
24 definition lpx_sn_transitive: relation (relation3 lenv term term) ≝ λR1,R2.
25                               ∀L1,T1,T. R1 L1 T1 T → ∀L2. lpx_sn R1 L1 L2 →
26                               ∀T2. R2 L2 T T2 → R1 L1 T1 T2.
27
28 (* Main properties **********************************************************)
29
30 theorem lpx_sn_trans: ∀R. lpx_sn_transitive R R → Transitive … (lpx_sn R).
31 #R #HR #L1 #L #H elim H -L1 -L //
32 #I #L1 #L #V1 #V #HL1 #HV1 #IHL1 #X #H
33 elim (lpx_sn_inv_pair1 … H) -H #L2 #V2 #HL2 #HV2 #H destruct /3 width=5 by lpx_sn_pair/
34 qed-.
35
36 theorem lpx_sn_conf: ∀R1,R2. lpx_sn_confluent R1 R2 →
37                      confluent2 … (lpx_sn R1) (lpx_sn R2).
38 #R1 #R2 #HR12 #L0 @(f_ind … length … L0) -L0 #x #IH *
39 [ #_ #X1 #H1 #X2 #H2 -x
40   >(lpx_sn_inv_atom1 … H1) -X1
41   >(lpx_sn_inv_atom1 … H2) -X2 /2 width=3 by lpx_sn_atom, ex2_intro/
42 | #L0 #I #V0 #Hx #X1 #H1 #X2 #H2 destruct
43   elim (lpx_sn_inv_pair1 … H1) -H1 #L1 #V1 #HL01 #HV01 #H destruct
44   elim (lpx_sn_inv_pair1 … H2) -H2 #L2 #V2 #HL02 #HV02 #H destruct
45   elim (IH … HL01 … HL02) -IH normalize // #L #HL1 #HL2
46   elim (HR12 … HV01 … HV02 … HL01 … HL02) -L0 -V0 /3 width=5 by lpx_sn_pair, ex2_intro/
47 ]
48 qed-.