The Coq Standard Library

# Library Coq.Arith.Le

Order on natural numbers.
This file is mostly OBSOLETE now, see module PeanoNat.Nat instead.
le is defined in Init/Peano.v as:

    Inductive le (n:nat) : nat -> Prop :=
      | le_n : n <= n
      | le_S : forall m:nat, n <= m -> n <= S m

    where "n <= m" := (le n m) : nat_scope.

Require Import PeanoNat.
Local Open Scope nat_scope.

# le is an order on nat

Notation le_refl := Nat.le_refl (compat "8.4").
Notation le_trans := Nat.le_trans (compat "8.4").
Notation le_antisym := Nat.le_antisymm (compat "8.4").
Hint Resolve le_trans: arith.
Hint Immediate le_antisym: arith.

# Properties of le w.r.t 0

Notation le_0_n := Nat.le_0_l (compat "8.4"). Notation le_Sn_0 := Nat.nle_succ_0 (compat "8.4").
Lemma le_n_0_eq n : n <= 0 -> 0 = n.

# Properties of le w.r.t successor

See also Nat.succ_le_mono.
Theorem le_n_S : forall n m, n <= m -> S n <= S m.
Theorem le_S_n : forall n m, S n <= S m -> n <= m.
Notation le_n_Sn := Nat.le_succ_diag_r (compat "8.4"). Notation le_Sn_n := Nat.nle_succ_diag_l (compat "8.4").
Theorem le_Sn_le : forall n m, S n <= m -> n <= m.
Hint Resolve le_0_n le_Sn_0: arith.
Hint Resolve le_n_S le_n_Sn le_Sn_n : arith.
Hint Immediate le_n_0_eq le_Sn_le le_S_n : arith.

# Properties of le w.r.t predecessor

Notation le_pred_n := Nat.le_pred_l (compat "8.4"). Notation le_pred := Nat.pred_le_mono (compat "8.4").
Hint Resolve le_pred_n: arith.

# A different elimination principle for the order on natural numbers

Lemma le_elim_rel :
forall P:nat -> nat -> Prop,
(forall p, P 0 p) ->
(forall p (q:nat), p <= q -> P p q -> P (S p) (S q)) ->
forall n m, n <= m -> P n m.