(** Maximum and minimum : definitions and specifications *)

Notation max := Nat.max (only parsing).Notation min := Nat.min (only parsing).

(* Specifications: *)
Lemma max_l n m : m <= n -> Nat.max n m = n.
Lemma max_r n m : n <= m -> Nat.max n m = m.
Lemma min_l n m : n <= m -> Nat.min n m = n.
Lemma min_r n m : m <= n -> Nat.min n m = m.
Lemma nat_rect_succ_r {A} (f: A -> A) (x:A) n : nat_rect (fun _ => A) x (fun _ => f) (S n) = nat_rect (fun _ => A) (f x) (fun _ => f) n.
Theorem nat_rect_plus : forall (n m:nat) {A} (f:A -> A) (x:A), nat_rect (fun _ => A) x (fun _ => f) (n + m) = nat_rect (fun _ => A) (nat_rect (fun _ => A) x (fun _ => f) m) (fun _ => f) n.