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_max.ma".
16 include "ground/arith/nat_le.ma".
18 (* ORDER FOR NON-NEGATIVE INTEGERS ******************************************)
20 (* Basic constructions with nmax ********************************************)
24 ∀m1. m1 ≤ n → ∀m2. m2 ≤ n → (m1 ∨ m2) ≤ n.
25 #n #m1 #H @(nle_ind_alt … H) -n -m1 //
26 #n #m1 #Hnm1 #IH #m2 @(nat_ind_succ … m2) -m2
27 [ #_ -IH /3 width=1 by nle_succ_bi/
28 | #m2 #_ #H -Hnm1 /4 width=1 by nle_inv_succ_bi, nle_succ_bi/
32 lemma nle_max_dx_refl_sn (m) (n): m ≤ (m ∨ n).
33 #m #n @(nat_ind_2_succ … m n) -m -n //
34 #m #n #IH <nmax_succ_bi /2 width=1 by nle_succ_bi/
37 lemma nle_max_dx_refl_dx (m) (n): n ≤ (m ∨ n).
40 (* Basic destructions with nmax *********************************************)
43 lemma nle_des_max_sn_sn (m1) (m2) (n): (m1 ∨ m2) ≤ n → m1 ≤ n.
44 /2 width=3 by nle_trans/ qed-.
47 lemma nle_des_max_sn_dx (m1) (m2) (n): (m1 ∨ m2) ≤ n → m2 ≤ n.
48 /2 width=3 by nle_trans/ qed-.
50 (* Advanced constructions with nmax *****************************************)
53 lemma nle_max_sn_succ_sn (m1) (m2) (n): (m1 ∨ m2) ≤ n → (↑m1 ∨ m2) ≤ ↑n.
54 /4 width=2 by nle_des_max_sn_sn, nle_des_max_sn_dx, nle_max_sn, nle_succ_bi, nle_succ_dx/ qed.
57 lemma nle_max_sn_succ_dx (m1) (m2) (n): (m1 ∨ m2) ≤ n → (m1 ∨ ↑m2) ≤ ↑n.
58 /4 width=2 by nle_des_max_sn_sn, nle_des_max_sn_dx, nle_max_sn, nle_succ_bi, nle_succ_dx/ qed.