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. Module Type NZAddProp (Import NZ : NZAxiomsSig')(Import NZBase : NZBaseProp NZ). Hint Rewrite pred_succ add_0_l add_succ_l mul_0_l mul_succ_l sub_0_r sub_succ_r : nz. Hint Rewrite one_succ two_succ : nz'. Ltac nzsimpl := autorewrite with nz. Ltac nzsimpl' := autorewrite with nz nz'.forall n : t, n + 0 == nforall n : t, n + 0 == n0 + 0 == 0forall n : t, n + 0 == n <-> S n + 0 == S nnow nzsimpl.0 + 0 == 0forall n : t, n + 0 == n <-> S n + 0 == S nn:tn + 0 == n <-> S n + 0 == S nnow rewrite succ_inj_wd. Qed.n:tn + 0 == n <-> S (n + 0) == S nforall n m : t, n + S m == S (n + m)forall n m : t, n + S m == S (n + m)m:t0 + S m == S (0 + m)m:tforall n : t, n + S m == S (n + m) <-> S n + S m == S (S n + m)now nzsimpl.m:t0 + S m == S (0 + m)m:tforall n : t, n + S m == S (n + m) <-> S n + S m == S (S n + m)m, n:tn + S m == S (n + m) <-> S n + S m == S (S n + m)now rewrite succ_inj_wd. Qed.m, n:tn + S m == S (n + m) <-> S (n + S m) == S (S (n + m))forall n m : t, S n + m == n + S mforall n m : t, S n + m == n + S mnow rewrite add_succ_r, add_succ_l. Qed. Hint Rewrite add_0_r add_succ_r : nz.n, m:tS n + m == n + S 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 succ_inj_wd. Qed.m, n:tn + m == m + n <-> S (n + m) == S (m + n)forall n : t, 1 + n == S nintro n; now nzsimpl'. Qed.forall n : t, 1 + n == S nforall n : t, n + 1 == S nintro n; now nzsimpl'. Qed. Hint Rewrite add_1_l add_1_r : nz.forall n : t, n + 1 == S 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 + pnow rewrite succ_inj_wd. Qed.m, p, n:tn + (m + p) == n + m + p <-> S (n + (m + p)) == S (n + m + p)forall n m p : t, p + n == p + m <-> n == mforall n m p : t, p + n == p + m <-> n == mn, m:t0 + n == 0 + m <-> n == mn, m:tforall n0 : t, (n0 + n == n0 + m <-> n == m) <-> (S n0 + n == S n0 + m <-> n == m)now nzsimpl.n, m:t0 + n == 0 + m <-> n == mn, m:tforall n0 : t, (n0 + n == n0 + m <-> n == m) <-> (S n0 + n == S n0 + m <-> n == m)n, m, p:t(p + n == p + m <-> n == m) <-> (S p + n == S p + m <-> n == m)now rewrite succ_inj_wd. Qed.n, m, p:t(p + n == p + m <-> n == m) <-> (S (p + n) == S (p + m) <-> n == m)forall n m p : t, n + p == m + p <-> n == mforall n m p : t, n + p == m + p <-> n == mn, m, p:tn + p == m + p <-> n == mapply add_cancel_l. Qed.n, m, p:tp + n == p + m <-> n == mforall n m p : t, n + m + p == n + p + mforall n m p : t, n + m + p == n + p + mn, m, p:tn + m + p == n + p + mapply add_comm. Qed.n, m, p:tm + p == 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)n, m, p, q:tn + m + (p + q) == n + p + (m + q)apply add_shuffle0. Qed.n, m, p, q:tn + m + p == n + p + mforall 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 add_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 add_comm, <- add_assoc, (add_comm p). Qed.n, m, p:tn + (m + p) == m + (n + p)forall n : t, n - 1 == P nintro n; now nzsimpl'. Qed. Hint Rewrite sub_1_r : nz. End NZAddProp.forall n : t, n - 1 == P n