(****************************************************************************)
(*                 The Calculus of Inductive Constructions                  *)
(*                                                                          *)
(*                                Projet Coq                                *)
(*                                                                          *)
(*                     INRIA        LRI-CNRS        ENS-CNRS                *)
(*              Rocquencourt         Orsay          Lyon                    *)
(*                                                                          *)
(*                                 Coq V6.2                                 *)
(*                               May 1st 1998                               *)
(*                                                                          *)
(****************************************************************************)
(*                                   Lt.v                                   *)
(****************************************************************************)

Require Le.

Theorem lt_n_Sn : (n:nat)(lt n (S n)).
Proof.
Auto.
Qed.
Hint lt_n_Sn.

Theorem lt_S : (n,m:nat)(lt n m)->(lt n (S m)).
Proof.
Auto.
Qed.
Hint lt_S.

Theorem lt_n_S : (n,m:nat)(lt n m)->(lt (S n) (S m)).
Proof.
Auto.
Qed.
Hint lt_n_S.

Theorem lt_S_n : (n,m:nat)(lt (S n) (S m))->(lt n m).
Proof.
Auto.
Qed.
Immediate lt_S_n.

Theorem lt_O_Sn : (n:nat)(lt O (S n)).
Proof.
Auto.
Qed.
Hint lt_O_Sn.

Theorem lt_n_O : (n:nat)~(lt n O).
Proof le_Sn_O.
Hint lt_n_O.

Theorem lt_n_n : (n:nat)~(lt n n).
Proof le_Sn_n.
Hint lt_n_n.

Lemma S_pred : (n,m:nat)(lt m n)->(n=(S (pred n))).
Proof.
Induction 1; Auto.
Qed.

Lemma lt_pred : (n,p:nat)(lt (S n) p)->(lt n (pred p)).
Proof.
Induction 1; Simpl; Auto.
Qed.
Immediate lt_pred.

Lemma lt_pred_n_n : (n:nat)(lt O n)->(lt (pred n) n).
Destruct 1; Simpl; Auto.
Save.
Hint lt_pred_n_n.

(* Relationship between le and lt *) 

Theorem lt_le_S : (n,p:nat)(lt n p)->(le (S n) p).
Proof.
Auto.
Qed.
Immediate lt_le_S.

Theorem lt_n_Sm_le : (n,m:nat)(lt n (S m))->(le n m).
Proof.
Auto.
Qed.
Immediate lt_n_Sm_le.

Theorem le_lt_n_Sm : (n,m:nat)(le n m)->(lt n (S m)).
Proof.
Auto.
Qed.
Immediate le_lt_n_Sm.

Theorem lt_le_weak : (n,m:nat)(lt n m)->(le n m).
Proof.
Auto.
Qed.
Immediate lt_le_weak.

Theorem neq_O_lt : (n:nat)(~O=n)->(lt O n).
Proof.
Induction n; Auto.
Intros; Absurd O=O; Trivial.
Qed.
Immediate neq_O_lt.

Theorem lt_O_neq : (n:nat)(lt O n)->(~O=n).
Proof.
Induction 1; Auto.
Qed.
Immediate lt_O_neq.

(* Transitivity properties *)

Theorem lt_trans : (n,m,p:nat)(lt n m)->(lt m p)->(lt n p).
Proof.
Induction 2; Auto.
Qed.

Theorem lt_le_trans : (n,m,p:nat)(lt n m)->(le m p)->(lt n p).
Proof.
Induction 2; Auto.
Qed.

Theorem le_lt_trans : (n,m,p:nat)(le n m)->(lt m p)->(lt n p).
Proof.
Induction 2; Auto.
Qed.

Theorem le_lt_or_eq : (n,m:nat)(le n m)->((lt n m) \/ n=m).
Proof.
Induction 1; Auto.
Qed.

Theorem le_or_lt : (n,m:nat)((le n m)\/(lt m n)).
Proof.
Intros n m; Pattern n m; Apply nat_double_ind; Auto.
Induction 1; Auto.
Qed.

Theorem le_not_lt : (n,m:nat)(le n m)->~(lt m n).
Proof.
Induction 1; Auto.
Red; Intros m0 H1 H2 H3; Apply H2; Auto.
Qed.
Immediate le_not_lt.

Theorem lt_not_le : (n,m:nat)(lt n m)->~(le m n).
Proof.
Red; Intros n m Lt Le; Exact (le_not_lt m n Le Lt).
Qed.
Immediate lt_not_le.

Theorem lt_not_sym : (n,m:nat)(lt n m)->~(lt m n).
Proof.
Induction 1; Auto.
Red; Intros p H1 H2 H3; Apply H2; Auto.
Qed.

Theorem nat_total_order: (m, n: nat) ~ m = n -> (lt m n) \/ (lt n m).
Proof.
Intros m n diff.
Elim (le_or_lt n m); [Intro H'0 | Auto].
Elim (le_lt_or_eq n m); Auto.
Intro H'; Elim diff; Auto.
Qed.


(* $Id: Lt.v,v 1.3 1998/04/30 16:45:44 mohring Exp $ *)
