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 == 0

forall n : t, n * 0 == 0
nzinduct n; intros; now nzsimpl. Qed.

forall n m : t, n * S m == n * m + n

forall n m : t, n * S m == n * m + n
m:t

0 * S m == 0 * m + 0
m:t
forall n : t, n * S m == n * m + n <-> S n * S m == S n * m + S n
m:t

0 * S m == 0 * m + 0
now nzsimpl.
m:t

forall n : t, n * S m == n * m + n <-> S n * S m == S n * m + S n
m, n:t

n * S m == n * m + n <-> S n * S m == S n * m + S n
m, n:t

n * S m == n * m + n <-> S (n * S m + m) == S (n * m + m + n)
m, n:t

n * S m == n * m + n <-> n * S m + m == n * m + n + m
now rewrite add_cancel_r. Qed. Hint Rewrite mul_0_r mul_succ_r : nz.

forall n m : t, n * m == m * n

forall n m : t, n * m == m * n
m:t

0 * m == m * 0
m:t
forall n : t, n * m == m * n <-> S n * m == m * S n
m:t

0 * m == m * 0
now nzsimpl.
m:t

forall n : t, n * m == m * n <-> S n * m == m * S n
m, n:t

n * m == m * n <-> S n * m == m * S n
m, n:t

n * m == m * n <-> n * m + m == m * n + m
now rewrite add_cancel_r. Qed.

forall n m p : t, (n + m) * p == n * p + m * p

forall n m p : t, (n + m) * p == n * p + m * p
m, p:t

(0 + m) * p == 0 * p + m * p
m, p:t
forall n : t, (n + m) * p == n * p + m * p <-> (S n + m) * p == S n * p + m * p
m, p:t

(0 + m) * p == 0 * p + m * p
now nzsimpl.
m, p:t

forall n : t, (n + m) * p == n * p + m * p <-> (S n + m) * p == S n * p + m * p
m, p, n:t

(n + m) * p == n * p + m * p <-> (S n + m) * p == S n * p + m * p
m, p, n:t

(n + m) * p == n * p + m * p <-> (n + m) * p + p == n * p + p + m * p
m, p, n:t

(n + m) * p == n * p + m * p <-> (n + m) * p + p == n * p + m * p + p
now rewrite add_cancel_r. Qed.

forall n m p : t, n * (m + p) == n * m + n * p

forall n m p : t, n * (m + p) == n * m + n * p
n, m, p:t

n * (m + p) == n * m + n * p
n, m, p:t

(m + p) * n == m * n + p * n
apply mul_add_distr_r. Qed.

forall n m p : t, n * (m * p) == n * m * p

forall n m p : t, n * (m * p) == n * m * p
m, p:t

0 * (m * p) == 0 * m * p
m, p:t
forall n : t, n * (m * p) == n * m * p <-> S n * (m * p) == S n * m * p
m, p:t

0 * (m * p) == 0 * m * p
now nzsimpl.
m, p:t

forall n : t, n * (m * p) == n * m * p <-> S n * (m * p) == S n * m * p
m, p, n:t

n * (m * p) == n * m * p <-> S n * (m * p) == S n * m * p
m, p, n:t

n * (m * p) == n * m * p <-> n * (m * p) + m * p == (n * m + m) * p
m, p, n:t

n * (m * p) == n * m * p <-> n * (m * p) + m * p == n * m * p + m * p
now rewrite add_cancel_r. Qed.

forall n : t, 1 * n == n

forall n : t, 1 * n == n
n:t

1 * n == n
now nzsimpl'. Qed.

forall n : t, n * 1 == n

forall n : t, n * 1 == n
n:t

n * 1 == n
now nzsimpl'. Qed. Hint Rewrite mul_1_l mul_1_r : nz.

forall n m p : t, n * m * p == n * p * m

forall n m p : t, n * m * p == n * p * m
n, m, p:t

n * m * p == n * p * m
now rewrite <- 2 mul_assoc, (mul_comm m). Qed.

forall 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)
n, m, p, q:t

n * m * (p * q) == n * p * (m * q)
now rewrite 2 mul_assoc, (mul_shuffle0 n). Qed.

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:t

n * m * (p * q) == n * q * (m * p)
n, m, p, q:t

n * m * (q * p) == n * q * (m * p)
apply mul_shuffle1. Qed.

forall n m p : t, n * (m * p) == m * (n * p)

forall n m p : t, n * (m * p) == m * (n * p)
n, m, p:t

n * (m * p) == m * (n * p)
now rewrite mul_assoc, (mul_comm n), mul_assoc. Qed. End NZMulProp.