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 nforall n : t, odd (P n) = even nn:todd (P n) = even nn:todd (P n) = even (S (P n))apply even_succ. Qed.n:teven (S (P n)) = odd (P n)forall n : t, even (P n) = odd nforall n : t, even (P n) = odd nn:teven (P n) = odd nn:teven (P n) = odd (S (P n))apply odd_succ. Qed.n:todd (S (P n)) = even (P n)forall n : t, even (- n) = even nforall n : t, even (- n) = even nforall n : t, Even n -> Even (- n)H:forall n : t, Even n -> Even (- n)forall n : t, even (- n) = even nn, m:tH:n == 2 * mEven (- n)H:forall n : t, Even n -> Even (- n)forall n : t, even (- n) = even nn, m:tH:n == 2 * m- n == 2 * - mH:forall n : t, Even n -> Even (- n)forall n : t, even (- n) = even nn, m:tH:n == 2 * m- n == - (2 * m)H:forall n : t, Even n -> Even (- n)forall n : t, even (- n) = even nH:forall n : t, Even n -> Even (- n)forall n : t, even (- n) = even nH:forall n0 : t, Even n0 -> Even (- n0)n:teven (- n) = even nH:forall n0 : t, Even n0 -> Even (- n0)n:tEven (- n) <-> Even nH:forall n0 : t, Even n0 -> Even (- n0)n:tEven (- n) -> Even nH:forall n0 : t, Even n0 -> Even (- n0)n:tEven n -> Even (- n)H:forall n0 : t, Even n0 -> Even (- n0)n:tEven (- n) -> Even (- - n)H:forall n0 : t, Even n0 -> Even (- n0)n:tEven n -> Even (- n)apply H. Qed.H:forall n0 : t, Even n0 -> Even (- n0)n:tEven n -> Even (- n)forall n : t, odd (- n) = odd nforall n : t, odd (- n) = odd nn:todd (- n) = odd nnow rewrite even_opp. Qed.n:tnegb (even (- n)) = negb (even n)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)now rewrite <- add_opp_r, even_add, even_opp. Qed.n, m:teven (n - m) = Bool.eqb (even n) (even m)forall n m : t, odd (n - m) = xorb (odd n) (odd m)forall n m : t, odd (n - m) = xorb (odd n) (odd m)now rewrite <- add_opp_r, odd_add, odd_opp. Qed. End ZParityProp.n, m:todd (n - m) = xorb (odd n) (odd m)