1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "ground_2/ynat/ynat_plus.ma".
16 include "basic_2/grammar/leq.ma".
18 (* EQUIVALENCE FOR LOCAL ENVIRONMENTS ***************************************)
20 (* Main properties **********************************************************)
22 theorem leq_trans: ∀d,e. Transitive … (leq d e).
23 #d #e #L1 #L2 #H elim H -L1 -L2 -d -e
24 [ #d #e #X #H lapply (leq_inv_atom1 … H) -H
26 | #I1 #I #L1 #L #V1 #V #_ #IHL1 #X #H elim (leq_inv_zero1 … H) -H
27 #I2 #L2 #V2 #HL2 #H destruct /3 width=1 by leq_zero/
28 | #I #L1 #L #V #e #_ #IHL1 #X #H elim (leq_inv_pair1 … H) -H //
29 #L2 #HL2 #H destruct /3 width=1 by leq_pair/
30 | #I1 #I #L1 #L #V1 #V #d #e #_ #IHL1 #X #H elim (leq_inv_succ1 … H) -H //
31 #I2 #L2 #V2 #HL2 #H destruct /3 width=1 by leq_succ/
35 theorem leq_canc_sn: ∀d,e,L,L1,L2. L ≃[d, e] L1 → L ≃[d, e] L2 → L1 ≃[d, e] L2.
36 /3 width=3 by leq_trans, leq_sym/ qed-.
38 theorem leq_canc_dx: ∀d,e,L,L1,L2. L1 ≃[d, e] L → L2 ≃[d, e] L → L1 ≃[d, e] L2.
39 /3 width=3 by leq_trans, leq_sym/ qed-.
41 theorem leq_join: ∀L1,L2,d,i. L1 ≃[d, i] L2 →
42 ∀e. L1 ≃[i+d, e] L2 → L1 ≃[d, i+e] L2.
43 #L1 #L2 #d #i #H elim H -L1 -L2 -d -i //
44 [ #I #L1 #L2 #V #e #_ #IHL12 #e #H
45 lapply (leq_inv_succ … H ?) -H // >ypred_succ /3 width=1 by leq_pair/
46 | #I1 #I2 #L1 #L2 #V1 #V2 #d #e #_ #IHL12 #e #H
47 lapply (leq_inv_succ … H ?) -H // >yplus_succ2 >ypred_succ /3 width=1 by leq_succ/