]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/etc/cpys/cpys_cpys.etc
- extended multiple substitutions now uses bounds in ynat (ie. they
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / etc / cpys / cpys_cpys.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/grammar/lpx_sn_lpx_sn.ma".
16 include "basic_2/substitution/fqup.ma".
17 include "basic_2/substitution/lpys_ldrop.ma".
18
19 (* CONTEXT-SENSITIVE EXTENDED MULTIPLE SUBSTITUTION FOR TERMS ***************)
20
21 (* Main properties **********************************************************)
22
23 theorem cpys_antisym: ∀G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ▶*× T2 → ⦃G, L⦄ ⊢ T2 ▶*× T1 → T1 = T2.
24 #G #L #T1 #T2 #H elim H -G -L -T1 -T2 //
25 [ #I #G #L #K #V1 #V2 #W2 #i #HLK #_ #HVW2 #_ #HW2 lapply (ldrop_fwd_ldrop2 … HLK) -I -V1
26   #HLK elim (cpys_inv_lift1 … HW2 … HLK … HVW2) -L -HVW2
27   #X #H #_ elim (lift_inv_lref2_be … H) -G -K -V2 -W2 -X //
28 | #a #I #G #L #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #H elim (cpys_inv_bind1 … H) -H
29   #V #T #HV2 #HT2 #H destruct
30   lapply (IHV12 HV2) #H destruct -IHV12 -HV2 /3 width=1 by eq_f2/
31 | #I #G #L #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #H elim (cpys_inv_flat1 … H) -H
32   #V #T #HV2 #HT2 #H destruct /3 width=1 by eq_f2/
33 ]
34 qed-.
35
36 theorem cpys_trans_lpys: ∀G. lpx_sn_transitive (cpys G) (cpys G).
37 #G0 #L0 #T0 @(fqup_wf_ind_eq … G0 L0 T0) -G0 -L0 -T0 #G0 #L0 #T0 #IH #G1 #L1 * [|*]
38 [ #I #HG #HL #HT #T #H1 #L2 #HL12 #T2 #HT2 destruct
39   elim (cpys_inv_atom1 … H1) -H1
40   [ #H destruct
41     elim (cpys_inv_atom1 … HT2) -HT2
42     [ #H destruct //
43     | * #I2 #K2 #V #V2 #i #HLK2 #HV2 #HVT2 #H destruct
44       elim (lpys_ldrop_trans_O1 … HL12 … HLK2) -L2 #X #HLK1 #H
45       elim (lpys_inv_pair2 … H) -H #K1 #V1 #HK12 #HV1 #H destruct
46       lapply (fqup_lref … G1 … HLK1) /3 width=10 by cpys_delta/
47     ]
48   | * #I1 #K1 #V1 #V #i #HLK1 #HV1 #HVT #H destruct
49     elim (lpys_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2
50     elim (lpys_inv_pair1 … H) -H #K2 #W2 #HK12 #_ #H destruct
51     lapply (ldrop_fwd_ldrop2 … HLK2) -W2 #HLK2
52     elim (cpys_inv_lift1 … HT2 … HLK2 … HVT) -L2 -T
53     lapply (fqup_lref … G1 … HLK1) /3 width=10 by cpys_delta/
54   ]
55 | #a #I #V1 #T1 #HG #HL #HT #X1 #H1 #L2 #HL12 #X2 #H2
56   elim (cpys_inv_bind1 … H1) -H1 #V #T #HV1 #HT1 #H destruct
57   elim (cpys_inv_bind1 … H2) -H2 #V2 #T2 #HV2 #HT2 #H destruct
58   /4 width=5 by cpys_bind, lpys_pair/
59 | #I #V1 #T1 #HG #HL #HT #X1 #H1 #L2 #HL12 #X2 #H2
60   elim (cpys_inv_flat1 … H1) -H1 #V #T #HV1 #HT1 #H destruct
61   elim (cpys_inv_flat1 … H2) -H2 #V2 #T2 #HV2 #HT2 #H destruct
62   /3 width=5 by cpys_flat/
63 ]
64 qed-.
65
66 theorem cpys_trans: ∀G,L. Transitive … (cpys G L).
67 /2 width=5 by cpys_trans_lpys/ qed-.
68
69 (* Advanced properties ******************************************************)
70
71 lemma lpys_cpys_trans: ∀G. lsub_trans … (cpys G) (lpys G).
72 /2 width=5 by cpys_trans_lpys/ qed-.