proposition: Lemma Nminus_mod_idemp_r: forall a b n : N, (n <> 0)%N -> (b <= a)%N -> ((a - b mod n) mod n)%N = ((a - b) mod n)%N.
proof: Proof. intros. apply N2Z.inj. rewrite? N2Z.inj_mod by assumption. pose proof (N.mod_le b n H). rewrite N2Z.inj_sub by (eapply N.le_trans; eassumption). rewrite N2Z.inj_sub by assumption. rewrite? N2Z.inj_mod by assumption. apply Zdiv.Zminus_mod_idemp_r. Qed.
imports: Coq.Classes.Morphisms Coq.Classes.Morphisms_Prop Coq.Classes.Equivalence Coq.Arith.PeanoNat Coq.ZArith.BinInt  Coq.Arith.Arith Coq.NArith.NArith Coq.Bool.Bool Coq.ZArith.ZArith Coq.Logic.Eqdep_dec Coq.Logic.EqdepFacts Coq.Program.Tactics Coq.Program.Equality Coq.setoid_ring.Ring Coq.setoid_ring.Ring_polynom bbv.Nomega bbv.ZLib bbv.NatLib bbv.NLib bbv.N_Z_nat_conversions bbv.DepEq bbv.DepEqNat bbv.ReservedNotations Coq.micromega.Lia