Library Stdlib.Numbers.Natural.Abstract.NParity


From Stdlib Require Import Bool NSub NZParity.

Some additional properties of even, odd.

Module NParityProp (Import N : NAxiomsSig')(Import NP : NSubPropT N).

Include NZParityProp N N NP.

Lemma odd_pred n : n~=0 -> odd (P n) = even n.

Lemma even_pred n : n~=0 -> even (P n) = odd n.

Lemma even_sub n m : m<=n -> even (n-m) = Bool.eqb (even n) (even m).

Lemma odd_sub n m : m<=n -> odd (n-m) = xorb (odd n) (odd m).

End NParityProp.

Module Type NParityPropT (Import N : NAxiomsSig')(Import NP : NSubPropT N).
Include NParityProp N NP.
End NParityPropT.