Definition recursion {A} : A -> (N -> A -> A) -> N -> A :=
peano_rect (fun _ => A).
#[global]
Instance recursion_wd {A} (Aeq : relation A) :
Proper (Aeq==>(Logic.eq==>Aeq==>Aeq)==>Logic.eq==>Aeq) recursion.

(* Specifications: *)
Theorem recursion_0 {A} (a:A) (f:N->A->A) : recursion a f 0 = a.
(** Specification of constants *)
Lemma one_succ : 1 = succ 0.
Lemma succ_pos_spec n : pos (succ_pos n) = succ n.
Lemma pos_pred_succ n : Pos.pred_N (succ_pos n) = n.
Lemma succ_pos_pred p : succ (Pos.pred_N p) = pos p.
(** Properties of successor and predecessor *)
Theorem pred_succ n : pred (succ n) = n.
Theorem pred_sub n : pred n = sub n 1.
Theorem succ_0_discr n : succ n <> 0.
(** Specification of addition *)
Theorem add_0_l n : 0 + n = n.
Theorem add_succ_l n m : succ n + m = succ (n + m).
(** Specification of subtraction. *)
Theorem sub_0_r n : n - 0 = n.
Theorem sub_succ_r n m : n - succ m = pred (n - m).
(** Specification of multiplication *)
Theorem mul_0_l n : 0 * n = 0.
Theorem mul_succ_l n m : (succ n) * m = n * m + m.
(** Specification of boolean comparisons. *)
Lemma eqb_eq n m : eqb n m = true <-> n=m.
Lemma ltb_lt n m : (n <? m) = true <-> n < m.
Lemma leb_le n m : (n <=? m) = true <-> n <= m.
(** Basic properties of comparison *)
Theorem compare_eq_iff n m : (n ?= m) = Eq <-> n = m.
Theorem compare_lt_iff n m : (n ?= m) = Lt <-> n < m.
Theorem compare_le_iff n m : (n ?= m) <> Gt <-> n <= m.
Theorem compare_antisym n m : (m ?= n) = CompOpp (n ?= m).
Include BoolOrderFacts.