Description
Reflecting on @Taneb 's PR #1969 , and wanting to add the definition of Irreducible
to Data.Nat.Primality
, with
IrreducibleAt : ℕ → Pred ℕ _
IrreducibleAt n m = m ∣ n → m ≡ 1 ⊎ m ≡ n
Irreducible : ℕ → Set
Irreducible n = ∀[ IrreducibleAt n ]
I found myself wanting to redefine Composite
and Prime
to eliminate the special cases for 0
and 1
which otherwise pollute the definitions and properties given there.
This leads to the following definitions [REVISED in PR #2181 but not updated here]:
[DELETED: please see #2181 for heavily revised/redacted versions]
with this last pattern synonym essentially permitting proofs formerly involving with a constructor Prime
to access the second functional component without difficulty, and moreover to enforce that the argument to Prime
must be of the form suc (suc _)
, and thus eliminate some now-redundant pattern matching against patterns of that form.prime
introducing witnesses to Prime p
imposing that p
must be NonTrivial
ie > 1
(and much else besides ;-))
I have a revised version of Data.Nat.Primality
based on these re-definitions, towards a breaking PR. So I'm cheekily tagging this as v2.0
in order to try to sneak it into the upcoming release.