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

Consistently add the equality after `resp` in proof names.

mechvel opened this issue · comments

In lib-2.0, Algebra.Properties.Magma.Divisibility
introduces the names
∣-respʳ and ∣∣-respʳ-≈.
I suggest to declare ∣∣-respʳ-≈ as obfuscated and to introduce ∣∣-respʳ instead.
And to treat ∣∣-respˡ, ∣∣-resp-≈ similarly.
The reasons are as follows.

  1. A uniform denotation style is desirable.
  2. It is clear for Magma that "_∣_ respects" is about the equality of _≈_ as default
    (for _≡_, one can use subst or to introduce ∣-resp-≡).
    And if one needs ∣-resp with respect to some other relation foo, then it can be
    introduced ∣-resp-foo.

Thanks for the suggestion, but looking at the search results, it's clear with the one exception in Relation.Binary.Properties, the convention in the library is to have the equality afterwards.

Keeping this issue open to fix the proofs at:

≉-respˡ : _≉_ Respectsˡ _≈_
≉-respˡ x≈x′ x≉y = x≉y ∘ trans x≈x′
≉-respʳ : _≉_ Respectsʳ _≈_
≉-respʳ y≈y′ x≉y x≈y′ = x≉y $ trans x≈y′ (sym y≈y′)
≉-resp₂ : _≉_ Respects₂ _≈_
≉-resp₂ = ≉-respʳ , ≉-respˡ

For the three exceptions noted, I'd be prepared to leave them as is, precisely because _≉_ presupposes the equality relation as part of its definition, so in that sense these properties are not 'uniform' with the style of ad hoc provable 'respects' properties, but true by virtue of the definitions.

On that basis, I'd perhaps prefer to leave them as distinct?