agda / agda-stdlib

The Agda standard library

Home Page:https://wiki.portal.chalmers.se/agda/Libraries/StandardLibrary

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

suggestion for divisibility `_∣ʳ_ ` in `lib-2.0`

mechvel opened this issue · comments

May be lib-2.0 could return to the definition of general divisibility _∣_ to its definition in lib-1.7.3 ?

I could not ask this in time, when testing the candidate release, because it seems, this release did not contain this change for divisibility.
My impresssion is that

_∣ʳ_ : Rel A (a ⊔ ℓ)
x ∣ʳ y = ∃ λ q → (q ∙ x) ≈ y

is better than

record _∣ʳ_ (x y : record _∣ʳ_ (x y : A) : Set (a ⊔ ℓ) where
  constructor _,_
  field
    quotient : A
    equality : quotient ∙ x ≈ y

due to the following reasons.

  1. The source mathematical definition for divisibility is
    "x divides y iff there exists q such that q ∙ x ≈ y".
    This is exactly formalized in Agda in lib-1.7.3 via exists, as above.
    This agrees better with intuition.

  2. (minor one) When using _∣_, the variant in lib-2.0 requires two relations to import instead of one, and also to declare open for the record of _∣ʳ_.

And anyway, please, do not change the definition of !

Related: #1572
See also #2216 for the reason behind the change.

Personally, I would like the divisibility definition in ...RawMagma as it is in lib-1.7.3
(and my project has a great number of this divisibility usage).
Оn the other hand, the project needs to rely on the most fresh official Agda and most fresh official standard library, and I already can operate with the new definition also without any essential loss.
The matter is that now we have a fork. I need to accomplish a certain project, and need to know:
what definition is taken by the standard library designers as the most stable.
Please, advise.

Sorry for the late reply. @gallais has linked to the reasoning behind the change. We won't be changing it back, as none of those reasons have changed.