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) *) (************************************************************************) (* Evgeny Makarov, INRIA, 2007 *) (************************************************************************) Require Import NZAxioms NZBase NZAdd. Module Type NZMulProp (Import NZ : NZAxiomsSig')(Import NZBase : NZBaseProp NZ). Include NZAddProp NZ NZBase.forall n : t, n * 0 == 0nzinduct n; intros; now nzsimpl. Qed.forall n : t, n * 0 == 0forall n m : t, n * S m == n * m + nforall n m : t, n * S m == n * m + nm:t0 * S m == 0 * m + 0m:tforall n : t, n * S m == n * m + n <-> S n * S m == S n * m + S nnow nzsimpl.m:t0 * S m == 0 * m + 0m:tforall n : t, n * S m == n * m + n <-> S n * S m == S n * m + S nm, n:tn * S m == n * m + n <-> S n * S m == S n * m + S nm, n:tn * S m == n * m + n <-> S (n * S m + m) == S (n * m + m + n)now rewrite add_cancel_r. Qed. Hint Rewrite mul_0_r mul_succ_r : nz.m, n:tn * S m == n * m + n <-> n * S m + m == n * m + n + mforall n m : t, n * m == m * nforall n m : t, n * m == m * nm:t0 * m == m * 0m:tforall n : t, n * m == m * n <-> S n * m == m * S nnow nzsimpl.m:t0 * m == m * 0m:tforall n : t, n * m == m * n <-> S n * m == m * S nm, n:tn * m == m * n <-> S n * m == m * S nnow rewrite add_cancel_r. Qed.m, n:tn * m == m * n <-> n * m + m == m * n + mforall n m p : t, (n + m) * p == n * p + m * pforall n m p : t, (n + m) * p == n * p + m * pm, p:t(0 + m) * p == 0 * p + m * pm, p:tforall n : t, (n + m) * p == n * p + m * p <-> (S n + m) * p == S n * p + m * pnow nzsimpl.m, p:t(0 + m) * p == 0 * p + m * pm, p:tforall n : t, (n + m) * p == n * p + m * p <-> (S n + m) * p == S n * p + m * pm, p, n:t(n + m) * p == n * p + m * p <-> (S n + m) * p == S n * p + m * pm, p, n:t(n + m) * p == n * p + m * p <-> (n + m) * p + p == n * p + p + m * pnow rewrite add_cancel_r. Qed.m, p, n:t(n + m) * p == n * p + m * p <-> (n + m) * p + p == n * p + m * p + pforall n m p : t, n * (m + p) == n * m + n * pforall n m p : t, n * (m + p) == n * m + n * pn, m, p:tn * (m + p) == n * m + n * papply mul_add_distr_r. Qed.n, m, p:t(m + p) * n == m * n + p * nforall n m p : t, n * (m * p) == n * m * pforall n m p : t, n * (m * p) == n * m * pm, p:t0 * (m * p) == 0 * m * pm, p:tforall n : t, n * (m * p) == n * m * p <-> S n * (m * p) == S n * m * pnow nzsimpl.m, p:t0 * (m * p) == 0 * m * pm, p:tforall n : t, n * (m * p) == n * m * p <-> S n * (m * p) == S n * m * pm, p, n:tn * (m * p) == n * m * p <-> S n * (m * p) == S n * m * pm, p, n:tn * (m * p) == n * m * p <-> n * (m * p) + m * p == (n * m + m) * pnow rewrite add_cancel_r. Qed.m, p, n:tn * (m * p) == n * m * p <-> n * (m * p) + m * p == n * m * p + m * pforall n : t, 1 * n == nforall n : t, 1 * n == nnow nzsimpl'. Qed.n:t1 * n == nforall n : t, n * 1 == nforall n : t, n * 1 == nnow nzsimpl'. Qed. Hint Rewrite mul_1_l mul_1_r : nz.n:tn * 1 == nforall n m p : t, n * m * p == n * p * mforall n m p : t, n * m * p == n * p * mnow rewrite <- 2 mul_assoc, (mul_comm m). Qed.n, m, p:tn * m * p == n * p * mforall n m p q : t, n * m * (p * q) == n * p * (m * q)forall n m p q : t, n * m * (p * q) == n * p * (m * q)now rewrite 2 mul_assoc, (mul_shuffle0 n). Qed.n, m, p, q:tn * m * (p * q) == n * p * (m * q)forall n m p q : t, n * m * (p * q) == n * q * (m * p)forall n m p q : t, n * m * (p * q) == n * q * (m * p)n, m, p, q:tn * m * (p * q) == n * q * (m * p)apply mul_shuffle1. Qed.n, m, p, q:tn * m * (q * p) == n * q * (m * p)forall n m p : t, n * (m * p) == m * (n * p)forall n m p : t, n * (m * p) == m * (n * p)now rewrite mul_assoc, (mul_comm n), mul_assoc. Qed. End NZMulProp.n, m, p:tn * (m * p) == m * (n * p)