(* Max and min. *)
Definition minn m n := if m < n then m else n.

(* Specifications: *)
Lemma max0n : left_id 0 maxn.  Proof. by case. Qed.
Lemma maxn0 : right_id 0 maxn. Proof. by []. Qed.
Lemma maxnC : commutative maxn.
Lemma leq_maxl m n : m <= maxn m n. Proof. by rewrite leq_max leqnn. Qed.
Lemma leq_maxr m n : n <= maxn m n. Proof. by rewrite maxnC leq_maxl. Qed.
Lemma gtn_max m n1 n2 : (m > maxn n1 n2) = (m > n1) && (m > n2).
Lemma minnA : associative minn.
Lemma minn_idPr {m n} : reflect (minn m n = n) (m >= n).
Lemma gtn_min m n1 n2 : (m > minn n1 n2) = (m > n1) || (m > n2).
Lemma maxn_minr : right_distributive maxn minn.
Lemma minn_maxr : right_distributive minn maxn.
Definition ex_minn := s2val find_ex_minn.