Built with Alectryon, running Coq+SerAPI v8.10.0+0.7.0. Coq sources are in this panel; goals and messages will appear in the other. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus.
(************************************************************************) (* * The Coq Proof Assistant / The Coq Development Team *) (* v * INRIA, CNRS and contributors - Copyright 1999-2018 *) (* <O___,, * (see CREDITS file for the list of authors) *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (* * (see LICENSE file for the text of the license) *) (************************************************************************) Require Import ZAxioms ZMulOrder GenericMinMax.
Module Type ZMaxMinProp (Import Z : ZAxiomsMiniSig'). Include ZMulOrderProp Z.
The following results are concrete instances of max_monotone
and similar lemmas.
Succ
forall n m : t, S (max n m) == max (S n) (S m)forall n m : t, S (max n m) == max (S n) (S m)destruct (le_ge_cases n m); [rewrite 2 max_r | rewrite 2 max_l]; now rewrite <- ?succ_le_mono. Qed.n, m:tS (max n m) == max (S n) (S m)forall n m : t, S (min n m) == min (S n) (S m)forall n m : t, S (min n m) == min (S n) (S m)destruct (le_ge_cases n m); [rewrite 2 min_l | rewrite 2 min_r]; now rewrite <- ?succ_le_mono. Qed.n, m:tS (min n m) == min (S n) (S m)
Pred
forall n m : t, P (max n m) == max (P n) (P m)forall n m : t, P (max n m) == max (P n) (P m)destruct (le_ge_cases n m); [rewrite 2 max_r | rewrite 2 max_l]; now rewrite <- ?pred_le_mono. Qed.n, m:tP (max n m) == max (P n) (P m)forall n m : t, P (min n m) == min (P n) (P m)forall n m : t, P (min n m) == min (P n) (P m)destruct (le_ge_cases n m); [rewrite 2 min_l | rewrite 2 min_r]; now rewrite <- ?pred_le_mono. Qed.n, m:tP (min n m) == min (P n) (P m)
Add
forall n m p : t, max (p + n) (p + m) == p + max n mforall n m p : t, max (p + n) (p + m) == p + max n mdestruct (le_ge_cases n m); [rewrite 2 max_r | rewrite 2 max_l]; now rewrite <- ?add_le_mono_l. Qed.n, m, p:tmax (p + n) (p + m) == p + max n mforall n m p : t, max (n + p) (m + p) == max n m + pforall n m p : t, max (n + p) (m + p) == max n m + pdestruct (le_ge_cases n m); [rewrite 2 max_r | rewrite 2 max_l]; now rewrite <- ?add_le_mono_r. Qed.n, m, p:tmax (n + p) (m + p) == max n m + pforall n m p : t, min (p + n) (p + m) == p + min n mforall n m p : t, min (p + n) (p + m) == p + min n mdestruct (le_ge_cases n m); [rewrite 2 min_l | rewrite 2 min_r]; now rewrite <- ?add_le_mono_l. Qed.n, m, p:tmin (p + n) (p + m) == p + min n mforall n m p : t, min (n + p) (m + p) == min n m + pforall n m p : t, min (n + p) (m + p) == min n m + pdestruct (le_ge_cases n m); [rewrite 2 min_l | rewrite 2 min_r]; now rewrite <- ?add_le_mono_r. Qed.n, m, p:tmin (n + p) (m + p) == min n m + p
Opp
forall n m : t, - max n m == min (- n) (- m)forall n m : t, - max n m == min (- n) (- m)n, m:t- max n m == min (- n) (- m)n, m:tH:n <= m- max n m == min (- n) (- m)n, m:tH:m <= n- max n m == min (- n) (- m)n, m:tH:n <= m- m == min (- n) (- m)n, m:tH:m <= n- max n m == min (- n) (- m)n, m:tH:n <= mmin (- n) (- m) == - mn, m:tH:m <= n- max n m == min (- n) (- m)n, m:tH:n <= m- m <= - nn, m:tH:m <= n- max n m == min (- n) (- m)n, m:tH:m <= n- max n m == min (- n) (- m)n, m:tH:m <= n- n == min (- n) (- m)n, m:tH:m <= nmin (- n) (- m) == - nnow rewrite <- opp_le_mono. Qed.n, m:tH:m <= n- n <= - mforall n m : t, - min n m == max (- n) (- m)forall n m : t, - min n m == max (- n) (- m)n, m:t- min n m == max (- n) (- m)n, m:tH:n <= m- min n m == max (- n) (- m)n, m:tH:m <= n- min n m == max (- n) (- m)n, m:tH:n <= m- n == max (- n) (- m)n, m:tH:m <= n- min n m == max (- n) (- m)n, m:tH:n <= mmax (- n) (- m) == - nn, m:tH:m <= n- min n m == max (- n) (- m)n, m:tH:n <= m- m <= - nn, m:tH:m <= n- min n m == max (- n) (- m)n, m:tH:m <= n- min n m == max (- n) (- m)n, m:tH:m <= n- m == max (- n) (- m)n, m:tH:m <= nmax (- n) (- m) == - mnow rewrite <- opp_le_mono. Qed.n, m:tH:m <= n- n <= - m
Sub
forall n m p : t, max (p - n) (p - m) == p - min n mforall n m p : t, max (p - n) (p - m) == p - min n mn, m, p:tmax (p - n) (p - m) == p - min n mn, m, p:tH:n <= mmax (p - n) (p - m) == p - min n mn, m, p:tH:m <= nmax (p - n) (p - m) == p - min n mn, m, p:tH:n <= mmax (p - n) (p - m) == p - nn, m, p:tH:m <= nmax (p - n) (p - m) == p - min n mn, m, p:tH:n <= mp - m <= p - nn, m, p:tH:m <= nmax (p - n) (p - m) == p - min n mn, m, p:tH:m <= nmax (p - n) (p - m) == p - min n mn, m, p:tH:m <= nmax (p - n) (p - m) == p - mnow rewrite <- sub_le_mono_l. Qed.n, m, p:tH:m <= np - n <= p - mforall n m p : t, max (n - p) (m - p) == max n m - pforall n m p : t, max (n - p) (m - p) == max n m - pdestruct (le_ge_cases n m); [rewrite 2 max_r | rewrite 2 max_l]; try order; now apply sub_le_mono_r. Qed.n, m, p:tmax (n - p) (m - p) == max n m - pforall n m p : t, min (p - n) (p - m) == p - max n mforall n m p : t, min (p - n) (p - m) == p - max n mn, m, p:tmin (p - n) (p - m) == p - max n mn, m, p:tH:n <= mmin (p - n) (p - m) == p - max n mn, m, p:tH:m <= nmin (p - n) (p - m) == p - max n mn, m, p:tH:n <= mmin (p - n) (p - m) == p - mn, m, p:tH:m <= nmin (p - n) (p - m) == p - max n mn, m, p:tH:n <= mp - m <= p - nn, m, p:tH:m <= nmin (p - n) (p - m) == p - max n mn, m, p:tH:m <= nmin (p - n) (p - m) == p - max n mn, m, p:tH:m <= nmin (p - n) (p - m) == p - nnow rewrite <- sub_le_mono_l. Qed.n, m, p:tH:m <= np - n <= p - mforall n m p : t, min (n - p) (m - p) == min n m - pforall n m p : t, min (n - p) (m - p) == min n m - pdestruct (le_ge_cases n m); [rewrite 2 min_l | rewrite 2 min_r]; try order; now apply sub_le_mono_r. Qed.n, m, p:tmin (n - p) (m - p) == min n m - p
Mul
forall n m p : t, 0 <= p -> max (p * n) (p * m) == p * max n mforall n m p : t, 0 <= p -> max (p * n) (p * m) == p * max n mdestruct (le_ge_cases n m); [rewrite 2 max_r | rewrite 2 max_l]; try order; now apply mul_le_mono_nonneg_l. Qed.n, m, p:tH:0 <= pmax (p * n) (p * m) == p * max n mforall n m p : t, 0 <= p -> max (n * p) (m * p) == max n m * pforall n m p : t, 0 <= p -> max (n * p) (m * p) == max n m * pdestruct (le_ge_cases n m); [rewrite 2 max_r | rewrite 2 max_l]; try order; now apply mul_le_mono_nonneg_r. Qed.n, m, p:tH:0 <= pmax (n * p) (m * p) == max n m * pforall n m p : t, 0 <= p -> min (p * n) (p * m) == p * min n mforall n m p : t, 0 <= p -> min (p * n) (p * m) == p * min n mdestruct (le_ge_cases n m); [rewrite 2 min_l | rewrite 2 min_r]; try order; now apply mul_le_mono_nonneg_l. Qed.n, m, p:tH:0 <= pmin (p * n) (p * m) == p * min n mforall n m p : t, 0 <= p -> min (n * p) (m * p) == min n m * pforall n m p : t, 0 <= p -> min (n * p) (m * p) == min n m * pdestruct (le_ge_cases n m); [rewrite 2 min_l | rewrite 2 min_r]; try order; now apply mul_le_mono_nonneg_r. Qed.n, m, p:tH:0 <= pmin (n * p) (m * p) == min n m * pforall n m p : t, p <= 0 -> max (p * n) (p * m) == p * min n mforall n m p : t, p <= 0 -> max (p * n) (p * m) == p * min n mn, m, p:tH:p <= 0max (p * n) (p * m) == p * min n mn, m, p:tH:p <= 0H0:n <= mmax (p * n) (p * m) == p * min n mn, m, p:tH:p <= 0H0:m <= nmax (p * n) (p * m) == p * min n mn, m, p:tH:p <= 0H0:n <= mmax (p * n) (p * m) == p * nn, m, p:tH:p <= 0H0:m <= nmax (p * n) (p * m) == p * min n mn, m, p:tH:p <= 0H0:n <= mp * n == p * nn, m, p:tH:p <= 0H0:n <= mp * m <= p * nn, m, p:tH:p <= 0H0:m <= nmax (p * n) (p * m) == p * min n mn, m, p:tH:p <= 0H0:n <= mp * m <= p * nn, m, p:tH:p <= 0H0:m <= nmax (p * n) (p * m) == p * min n mn, m, p:tH:p <= 0H0:m <= nmax (p * n) (p * m) == p * min n mn, m, p:tH:p <= 0H0:m <= nmax (p * n) (p * m) == p * mn, m, p:tH:p <= 0H0:m <= np * m == p * mn, m, p:tH:p <= 0H0:m <= np * n <= p * mnow apply mul_le_mono_nonpos_l. Qed.n, m, p:tH:p <= 0H0:m <= np * n <= p * mforall n m p : t, p <= 0 -> max (n * p) (m * p) == min n m * pforall n m p : t, p <= 0 -> max (n * p) (m * p) == min n m * pn, m, p:tH:p <= 0max (n * p) (m * p) == min n m * pn, m, p:tH:p <= 0H0:n <= mmax (n * p) (m * p) == min n m * pn, m, p:tH:p <= 0H0:m <= nmax (n * p) (m * p) == min n m * pn, m, p:tH:p <= 0H0:n <= mmax (n * p) (m * p) == n * pn, m, p:tH:p <= 0H0:m <= nmax (n * p) (m * p) == min n m * pn, m, p:tH:p <= 0H0:n <= mn * p == n * pn, m, p:tH:p <= 0H0:n <= mm * p <= n * pn, m, p:tH:p <= 0H0:m <= nmax (n * p) (m * p) == min n m * pn, m, p:tH:p <= 0H0:n <= mm * p <= n * pn, m, p:tH:p <= 0H0:m <= nmax (n * p) (m * p) == min n m * pn, m, p:tH:p <= 0H0:m <= nmax (n * p) (m * p) == min n m * pn, m, p:tH:p <= 0H0:m <= nmax (n * p) (m * p) == m * pn, m, p:tH:p <= 0H0:m <= nm * p == m * pn, m, p:tH:p <= 0H0:m <= nn * p <= m * pnow apply mul_le_mono_nonpos_r. Qed.n, m, p:tH:p <= 0H0:m <= nn * p <= m * pforall n m p : t, p <= 0 -> min (p * n) (p * m) == p * max n mforall n m p : t, p <= 0 -> min (p * n) (p * m) == p * max n mn, m, p:tH:p <= 0min (p * n) (p * m) == p * max n mn, m, p:tH:p <= 0H0:n <= mmin (p * n) (p * m) == p * max n mn, m, p:tH:p <= 0H0:m <= nmin (p * n) (p * m) == p * max n mn, m, p:tH:p <= 0H0:n <= mmin (p * n) (p * m) == p * mn, m, p:tH:p <= 0H0:m <= nmin (p * n) (p * m) == p * max n mn, m, p:tH:p <= 0H0:n <= mp * m == p * mn, m, p:tH:p <= 0H0:n <= mp * m <= p * nn, m, p:tH:p <= 0H0:m <= nmin (p * n) (p * m) == p * max n mn, m, p:tH:p <= 0H0:n <= mp * m <= p * nn, m, p:tH:p <= 0H0:m <= nmin (p * n) (p * m) == p * max n mn, m, p:tH:p <= 0H0:m <= nmin (p * n) (p * m) == p * max n mn, m, p:tH:p <= 0H0:m <= nmin (p * n) (p * m) == p * nn, m, p:tH:p <= 0H0:m <= np * n == p * nn, m, p:tH:p <= 0H0:m <= np * n <= p * mnow apply mul_le_mono_nonpos_l. Qed.n, m, p:tH:p <= 0H0:m <= np * n <= p * mforall n m p : t, p <= 0 -> min (n * p) (m * p) == max n m * pforall n m p : t, p <= 0 -> min (n * p) (m * p) == max n m * pn, m, p:tH:p <= 0min (n * p) (m * p) == max n m * pn, m, p:tH:p <= 0H0:n <= mmin (n * p) (m * p) == max n m * pn, m, p:tH:p <= 0H0:m <= nmin (n * p) (m * p) == max n m * pn, m, p:tH:p <= 0H0:n <= mmin (n * p) (m * p) == m * pn, m, p:tH:p <= 0H0:m <= nmin (n * p) (m * p) == max n m * pn, m, p:tH:p <= 0H0:n <= mm * p == m * pn, m, p:tH:p <= 0H0:n <= mm * p <= n * pn, m, p:tH:p <= 0H0:m <= nmin (n * p) (m * p) == max n m * pn, m, p:tH:p <= 0H0:n <= mm * p <= n * pn, m, p:tH:p <= 0H0:m <= nmin (n * p) (m * p) == max n m * pn, m, p:tH:p <= 0H0:m <= nmin (n * p) (m * p) == max n m * pn, m, p:tH:p <= 0H0:m <= nmin (n * p) (m * p) == n * pn, m, p:tH:p <= 0H0:m <= nn * p == n * pn, m, p:tH:p <= 0H0:m <= nn * p <= m * pnow apply mul_le_mono_nonpos_r. Qed. End ZMaxMinProp.n, m, p:tH:p <= 0H0:m <= nn * p <= m * p