Ltac solve_max :=
 match goal with |- context [max ?n ?m] =>
  destruct (max_spec n m); intuition; order
 end.

(* Specifications: *)
Lemma le_max_l n m : n <= max n m.
Lemma le_max_r n m : m <= max n m.
Lemma max_l_iff n m : max n m == n <-> m <= n.
Lemma max_r_iff n m : max n m == m <-> n <= m.
Lemma max_le n m p : p <= max n m -> p <= n \/ p <= m.
Lemma max_le_iff n m p : p <= max n m <-> p <= n \/ p <= m.
Lemma max_lt_iff n m p : p < max n m <-> p < n \/ p < m.
Lemma max_lub_l n m p : max n m <= p -> n <= p.
Lemma max_lub_r n m p : max n m <= p -> m <= p.
Lemma max_lub n m p : n <= p -> m <= p -> max n m <= p.
Lemma max_lub_iff n m p : max n m <= p <-> n <= p /\ m <= p.
Lemma max_lub_lt n m p : n < p -> m < p -> max n m < p.
Lemma max_lub_lt_iff n m p : max n m < p <-> n < p /\ m < p.
Lemma max_le_compat_l n m p : n <= m -> max p n <= max p m.
Lemma max_le_compat_r n m p : n <= m -> max n p <= max m p.
Lemma max_le_compat n m p q : n <= m -> p <= q -> max n p <= max m q.
Lemma min_spec n m : (n < m /\ min n m == n) \/ (m <= n /\ min n m == m).
Lemma min_spec_le n m : (n <= m /\ min n m == n) \/ (m <= n /\ min n m == m).