Ltac solve_min :=
 match goal with |- context [min ?n ?m] =>
  destruct (min_spec n m); intuition; order
 end.

(* Specifications: *)
Lemma le_min_r n m : min n m <= m.
Lemma le_min_l n m : min n m <= n.
Lemma min_l_iff n m : min n m == n <-> n <= m.
Lemma min_r_iff n m : min n m == m <-> m <= n.
Lemma min_le n m p : min n m <= p -> n <= p \/ m <= p.
Lemma min_le_iff n m p : min n m <= p <-> n <= p \/ m <= p.
Lemma min_lt_iff n m p : min n m < p <-> n < p \/ m < p.
Lemma min_glb_l n m p : p <= min n m -> p <= n.
Lemma min_glb_r n m p : p <= min n m -> p <= m.
Lemma min_glb n m p : p <= n -> p <= m -> p <= min n m.
Lemma min_glb_iff n m p : p <= min n m <-> p <= n /\ p <= m.
Lemma min_glb_lt n m p : p < n -> p < m -> p < min n m.
Lemma min_glb_lt_iff n m p : p < min n m <-> p < n /\ p < m.
Lemma min_le_compat_l n m p : n <= m -> min p n <= min p m.
Lemma min_le_compat_r n m p : n <= m -> min n p <= min m p.
Lemma min_le_compat n m p q : n <= m -> p <= q -> min n p <= min m q.
Lemma min_max_absorption n m : max n (min n m) == n.
Lemma max_min_absorption n m : min n (max n m) == n.
Lemma max_min_distr n m p : max n (min m p) == min (max n m) (max n p).
Lemma min_max_distr n m p : min n (max m p) == max (min n m) (min n p).
Lemma max_min_modular n m p : max n (min m (max n p)) == min (max n m) (max n p).
Lemma min_max_modular n m p : min n (max m (min n p)) == max (min n m) (min n p).
Lemma max_min_disassoc n m p : min n (max m p) <= max (min n m) p.
Lemma max_min_antimono f : Proper (eq==>eq) f -> Proper (le==>flip le) f -> forall x y, max (f x) (f y) == f (min x y).
Lemma min_max_antimono f : Proper (eq==>eq) f -> Proper (le==>flip le) f -> forall x y, min (f x) (f y) == f (max x y).
Lemma max_case_strong n m (P:t -> Type) : (forall x y, x==y -> P x -> P y) -> (m<=n -> P n) -> (n<=m -> P m) -> P (max n m).
Lemma max_case n m (P:t -> Type) : (forall x y, x == y -> P x -> P y) -> P n -> P m -> P (max n m).
Lemma max_dec n m : {max n m == n} + {max n m == m}.
Lemma min_case_strong n m (P:O.t -> Type) : (forall x y, x == y -> P x -> P y) -> (n<=m -> P n) -> (m<=n -> P m) -> P (min n m).
Lemma min_case n m (P:O.t -> Type) : (forall x y, x == y -> P x -> P y) -> P n -> P m -> P (min n m).
Lemma min_dec n m : {min n m == n} + {min n m == m}.