-
Notifications
You must be signed in to change notification settings - Fork 259
Description
lib-2.1-rc1 has general definitions for Irreducible, Prime for Magma, CancellativeCommutativeSemiring,
and also some proofs for them (see Algebra/Definitions/ and certain other places).
And ℕ, ℤ do have their instances *-magma, cancellativeCommutativeSemiring.
So, it has sense for ℕ and ℤ to import the general definitions of Irreducible, Prime as specialization
(by substituting the module parameters) and to use them instead of declaring ad-hoc definitions by new. For example, the parts of Nat.Primality.Prime can be derived from the general definition of Prime.
If the ad-hoc local definitions occur useful, it would have sense to rename them and to hide them under private.
The matter is that the general definitions and many their related properties work not only for ℕ, but also for ℤ and for polynomials over ℤ and for many other domains.
For example, I use Nat.Factorization.factorise , but I need to convert the parts of PrimeFactorisation to general ones,
say, to convert factorsPrime from the ad-hoc definition Prime to general Prime, and so on.
Such renaming and conversion complicates the code.