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 "nat/compare.ma".
16 include "dama/bishop_set.ma".
18 definition nat_excess : nat → nat → CProp ≝ λn,m. m<n.
22 (∀ n:nat. R O n) → (∀n:nat. R (S n) O) → (∀n,m:nat. R n m → R (S n) (S m)) →
24 intros 5;elim n; [apply H]
25 cases m;[ apply H1| apply H2; apply H3 ]
28 alias symbol "lt" = "natural 'less than'".
29 lemma nat_discriminable: ∀x,y:nat.x < y ∨ x = y ∨ y < x.
30 intros (x y); apply (nat_elim2 ???? x y);
31 [1: intro;left;cases n; [right;reflexivity] left; apply lt_O_S;
32 |2: intro;right;apply lt_O_S;
34 [1: cases H1; [left; left; apply le_S_S; assumption]
35 left;right;rewrite > H2; reflexivity;
36 |2: right;apply le_S_S; assumption]]
39 lemma nat_excess_cotransitive: cotransitive ? nat_excess.
40 intros 3 (x y z); unfold nat_excess; simplify; intros;
41 cases (nat_discriminable x z); [2: left; assumption] cases H1; clear H1;
42 [1: right; apply (trans_lt ??? H H2);
43 |2: right; rewrite < H2; assumption;]
46 lemma nat_ordered_set : ordered_set.
47 letin hos ≝ (mk_half_ordered_set nat (λT,R:Type.λf:T→T→R.f) ? nat_excess ? nat_excess_cotransitive);
48 [ intros; left; intros; reflexivity;
49 | intro x; intro H; apply (not_le_Sn_n ? H);]
50 constructor 1; apply hos;
53 interpretation "ordered set N" 'N = nat_ordered_set.
55 alias id "le" = "cic:/matita/nat/orders/le.ind#xpointer(1/1)".
56 lemma os_le_to_nat_le:
57 ∀a,b:nat_ordered_set.a ≤ b → le a b.
58 intros; normalize in H; apply (not_lt_to_le b a H);
61 lemma nat_le_to_os_le:
62 ∀a,b:nat_ordered_set.le a b → a ≤ b.
63 intros 3; apply (le_to_not_lt a b);assumption;