(** The order tactic enriched with some knowledge of 0,1,2 *)

(* Specifications: *)
Theorem lt_1_l : forall n m, 0 < n -> n < m -> 1 < m.
(** *** More Trichotomy, decidability and double negation elimination *)
(** The following theorem is cleary redundant, but helps not to remember whether one has to say [le_gt_cases] or [lt_ge_cases]. *)
Theorem lt_ge_cases : forall n m, n < m \/ n >= m.
Theorem le_ge_cases : forall n m, n <= m \/ n >= m.
Theorem lt_gt_cases : forall n m, n ~= m <-> n < m \/ n > m.
(** Decidability of equality, even though true in each finite ring, does not have a uniform proof. Otherwise, the proof for two fixed numbers would reduce to a normal form that will say if the numbers are equal or not, which cannot be true in all finite rings. Therefore, we prove decidability in the presence of order. *)
Theorem eq_decidable : forall n m, decidable (n == m).
(** DNE stands for double-negation elimination. *)
Theorem eq_dne : forall n m, ~ ~ n == m <-> n == m.
Theorem le_ngt : forall n m, n <= m <-> ~ n > m.
Theorem lt_dne : forall n m, ~ ~ n < m <-> n < m.
Theorem nle_gt : forall n m, ~ n <= m <-> n > m.
Theorem le_dne : forall n m, ~ ~ n <= m <-> n <= m.
Theorem nlt_succ_r : forall n m, ~ m < S n <-> n < m.
(** The difference between integers and natural numbers is that for every integer there is a predecessor, which is not true for natural numbers. However, for both classes, every number that is bigger than some other number has a predecessor. The proof of this fact by regular induction does not go through, so we need to use strong (course-of-value) induction. *)
Theorem lt_exists_pred :
forall z n, z < n -> exists k, n == S k /\ z <= k.
Lemma lt_succ_pred : forall z n, z < n -> S (P n) == n.
Section WF.