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/arith/nat_lt_plus.ma".
16 include "ground/arith/ynat_plus.ma".
17 include "ground/arith/ynat_lt_succ.ma".
19 (* STRICT ORDER FOR NON-NEGATIVE INTEGERS WITH INFINITY *********************)
21 (* Constructions with yplus *************************************************)
24 lemma ylt_plus_inf (x) (y):
25 x < ∞ → y < ∞ → x + y < ∞.
27 elim (ylt_des_gen_sn … Hx) -Hx #m #H destruct
28 elim (ylt_des_gen_sn … Hy) -Hy #n #H destruct
32 (*** ylt_plus_dx1_trans *)
33 lemma ylt_plus_dx_sn (z) (x) (y):
36 #o #m #Hom @(ynat_split_nat_inf … y) - y //
37 /3 width=1 by ylt_inj, nle_plus_bi/
40 (*** ylt_plus_dx2_trans *)
41 lemma ylt_plus_dx_dx (z) (x) (y):
44 /2 width=1 by ylt_plus_dx_sn/
47 (*** monotonic_ylt_plus_dx_inj *)
48 lemma ylt_plus_bi_dx_inj (o) (x) (y):
49 x < y → x + yinj_nat o < y + yinj_nat o.
51 @(nat_ind_succ … o) -o //
52 #n #IH >ysucc_inj <yplus_succ_dx <yplus_succ_dx
53 /2 width=1 by ylt_succ_bi/
56 (*** monotonic_ylt_plus_sn_inj *)
57 lemma ylt_plus_bi_sn_inj (o) (x) (y):
58 x < y → yinj_nat o + x < yinj_nat o + y.
59 /2 width=1 by ylt_plus_bi_dx_inj/ qed.
61 (*** monotonic_ylt_plus_dx *)
62 lemma ylt_plus_bi_dx (z) (x) (y):
63 x < y → z < ∞ → x + z < y + z.
65 elim (ylt_des_gen_sn … Hz) -Hz #o #H destruct
66 /2 width=1 by ylt_plus_bi_dx_inj/
69 (*** monotonic_ylt_plus_sn *)
70 lemma ylt_plus_bi_sn (z) (x) (y):
71 x < y → z < ∞ → z + x < z + y.
72 #z #x #y #Hxy #Hz <yplus_comm <yplus_comm in ⊢ (??%);
73 /2 width=1 by ylt_plus_bi_dx/
76 (* Inversions with yplus ****************************************************)
78 (*** yplus_inv_monotonic_dx *)
79 lemma eq_inv_yplus_bi_dx (z) (x) (y):
80 z < ∞ → x + z = y + z → x = y.
82 elim (ylt_des_gen_sn … H) -H #o #H destruct
83 /2 width=2 by eq_inv_yplus_bi_dx_inj/
86 (*** yplus_inv_monotonic_23 *)
87 lemma yplus_inv_plus_bi_23 (z) (x1) (x2) (y1) (y2):
88 z < ∞ → x1 + z + y1 = x2 + z + y2 → x1 + y1 = x2 + y2.
89 #z #x1 #x2 #y1 #y2 #Hz
90 <yplus_plus_comm_23 <yplus_plus_comm_23 in ⊢ (???%→?); #H
91 @(eq_inv_yplus_bi_dx … H) // (* * auto does not work *)
94 (*** ylt_inv_plus_Y *)
95 lemma ylt_inv_plus_inf (x) (y):
96 x + y < ∞ → ∧∧ x < ∞ & y < ∞.
98 elim (ylt_des_gen_sn … H) -H #o #H
99 elim (eq_inv_yplus_inj … H) -H
103 (* Destructions with yplus **************************************************)
105 (*** ylt_inv_monotonic_plus_dx *)
106 lemma ylt_des_plus_bi_dx (z) (x) (y):
107 x + z < y + z → x < y.
108 #z @(ynat_split_nat_inf … z) -z
109 [ #o #x @(ynat_split_nat_inf … x) -x
110 [ #m #y @(ynat_split_nat_inf … y) -y //
111 #n <yplus_inj_bi <yplus_inj_bi #H
112 /4 width=2 by ylt_inv_inj_bi, ylt_inj, nlt_inv_plus_bi_dx/
113 | #y <yplus_inf_sn #H
114 elim (ylt_inv_inf_sn … H)
116 | #x #y <yplus_inf_dx #H
117 elim (ylt_inv_inf_sn … H)
121 lemma ylt_des_plus_bi_sn (z) (x) (y):
122 z + x < z + y → x < y.
123 /2 width=2 by ylt_des_plus_bi_dx/ qed-.