proposition: Lemma inj_mod x y : 0 ≤ x → 0 ≤ y → Z.to_nat (x `mod` y) = (Z.to_nat x `mod` Z.to_nat y)%nat.
proof: Proof. intros. destruct (decide (y = Z.of_nat 0%nat)); [by subst; destruct x|]. pose proof (Z.mod_pos x y). apply (base.inj Z.of_nat). by rewrite Nat2Z.inj_mod, !Z2Nat.id by lia. Qed.
imports: Coq(QArith Qcanon) stdpp(well_founded) stdpp(options)