proposition: Lemma mod_factor a b c: b <> 0 -> c <> 0 -> (a mod (b * c)) mod b = a mod b.
proof: Proof. intros. pose proof (Nat.mod_mul_r a _ _ H H0). rewrite H1. rewrite Nat.add_mod_idemp_l by auto. rewrite Nat.add_mod by auto. assert (sth: b * ((a/b) mod c) = (a/b) mod c * b) by (apply Nat.mul_comm). rewrite sth. rewrite Nat.mod_mul by auto. rewrite Nat.add_0_r. rewrite Nat.mod_mod by auto. auto. 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