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 Bool ZMulOrder NZParity.
Some more properties of even and odd.
Module Type ZParityProp (Import Z : ZAxiomsSig')
                        (Import ZP : ZMulOrderProp Z).

Include NZParityProp Z Z ZP.


forall n : t, odd (P n) = even n

forall n : t, odd (P n) = even n
n:t

odd (P n) = even n
n:t

odd (P n) = even (S (P n))
n:t

even (S (P n)) = odd (P n)
apply even_succ. Qed.

forall n : t, even (P n) = odd n

forall n : t, even (P n) = odd n
n:t

even (P n) = odd n
n:t

even (P n) = odd (S (P n))
n:t

odd (S (P n)) = even (P n)
apply odd_succ. Qed.

forall n : t, even (- n) = even n

forall n : t, even (- n) = even n

forall n : t, Even n -> Even (- n)
H:forall n : t, Even n -> Even (- n)
forall n : t, even (- n) = even n
n, m:t
H:n == 2 * m

Even (- n)
H:forall n : t, Even n -> Even (- n)
forall n : t, even (- n) = even n
n, m:t
H:n == 2 * m

- n == 2 * - m
H:forall n : t, Even n -> Even (- n)
forall n : t, even (- n) = even n
n, m:t
H:n == 2 * m

- n == - (2 * m)
H:forall n : t, Even n -> Even (- n)
forall n : t, even (- n) = even n
H:forall n : t, Even n -> Even (- n)

forall n : t, even (- n) = even n
H:forall n0 : t, Even n0 -> Even (- n0)
n:t

even (- n) = even n
H:forall n0 : t, Even n0 -> Even (- n0)
n:t

Even (- n) <-> Even n
H:forall n0 : t, Even n0 -> Even (- n0)
n:t

Even (- n) -> Even n
H:forall n0 : t, Even n0 -> Even (- n0)
n:t
Even n -> Even (- n)
H:forall n0 : t, Even n0 -> Even (- n0)
n:t

Even (- n) -> Even (- - n)
H:forall n0 : t, Even n0 -> Even (- n0)
n:t
Even n -> Even (- n)
H:forall n0 : t, Even n0 -> Even (- n0)
n:t

Even n -> Even (- n)
apply H. Qed.

forall n : t, odd (- n) = odd n

forall n : t, odd (- n) = odd n
n:t

odd (- n) = odd n
n:t

negb (even (- n)) = negb (even n)
now rewrite even_opp. Qed.

forall n m : t, even (n - m) = Bool.eqb (even n) (even m)

forall n m : t, even (n - m) = Bool.eqb (even n) (even m)
n, m:t

even (n - m) = Bool.eqb (even n) (even m)
now rewrite <- add_opp_r, even_add, even_opp. Qed.

forall n m : t, odd (n - m) = xorb (odd n) (odd m)

forall n m : t, odd (n - m) = xorb (odd n) (odd m)
n, m:t

odd (n - m) = xorb (odd n) (odd m)
now rewrite <- add_opp_r, odd_add, odd_opp. Qed. End ZParityProp.