def ModInverse.not_coprime
import bend-collections-laws-math@1.0.0.0/spec/math/natural.bend as Naturalimport Base
import bend-collections-laws-math@1.0.0.0/src/math/natural.bend as M
265# PDF 8.7: no inverse exactly when a and m share a factor g >= 2
266def ModInverse.not_coprime(+a: Nat, +mp: Nat, +h: {M.mod_inverse(a, 1n+mp) == Fail{M.NotInvertible{}} : Result<&2, &2, M.MathError, Nat>}) -> Type:
267 Sigma<&1, &1, Nat, g => {Nat.is_le(2n, g) == True{} : Bool} & (dvd(g, a) & dvd(g, 1n+mp))>