Skip to content

Comments

[ refactor ] make Relation.Binary.Morphism.Definitions obsolete#2922

Open
jamesmckinna wants to merge 2 commits intoagda:masterfrom
jamesmckinna:issue2875ptI
Open

[ refactor ] make Relation.Binary.Morphism.Definitions obsolete#2922
jamesmckinna wants to merge 2 commits intoagda:masterfrom
jamesmckinna:issue2875ptI

Conversation

@jamesmckinna
Copy link
Collaborator

@jamesmckinna jamesmckinna commented Jan 24, 2026

This tackles the first part of #2875 , retaining the module solely for compatibility per #1206 / #1213 as requested by @pnlph , so no actual deprecation at this stage.

Knock-on consequences include:

  • hopefully simplifying the dependency graph wrt imports of Function.Definitions vs. alternatives
  • replacing the definition Homomorphic₂ throughout by Function.Definitions.Congruent (but the name is still exported as public by the obsolete stub; and hence also exported by Relation.Binary.Morphism, but this could be removed/deprecated?)
  • etc.

TL;DR: the 'cause' of the problem is yet again [ DRY ] with some basic concepts duplicated across the Function/Relation/Algebra hierarchies as various specialisations (or not even that) of 'common' (very) general abstractions (eg 'monotonicity'/'congruence'/'respects') which different authors have, at different times, identified as Core to one or other hierarchy... cf. #2917

open import Relation.Binary.Core using (_Preserves_⟶_)
open import Relation.Binary.Bundles using (Setoid; Preorder; Poset)
open import Relation.Binary.Consequences using (mono⇒cong)
open import Relation.Binary.Definitions using (Monotonic₁)
Copy link
Collaborator Author

@jamesmckinna jamesmckinna Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB, this too could be replaced by

Suggested change
open import Relation.Binary.Definitions using (Monotonic₁)
open import Function.Definitions using (Congruent)

But at the cost of straying outside the Relation.* hierarchy...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since morphisms tend to be functions, using Function.Definitions where does not seem out of place.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although here, as the definition is being used in a context where the monotonicity of the function is being appealed to, I think is makes slightly more sense (cognitive load? 'documentation'?) to prefer Monotonic₁ in this instance?

@jamesmckinna jamesmckinna requested review from JacquesCarette, MatthewDaggitt and gallais and removed request for JacquesCarette January 28, 2026 15:12
open import Data.Product.Base using (_,_)
open import Function.Definitions using (Injective; Surjective; Bijective)
open import Function.Definitions
using (Congruent; Injective; Surjective; Bijective)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively,

Suggested change
using (Congruent; Injective; Surjective; Bijective)
using (Injective; Surjective; Bijective)
renaming (Congruent to Homomorphic₂)

Copy link
Collaborator

@JacquesCarette JacquesCarette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting as comment, since I don't want to block merge on just this.

open import Relation.Binary.Core using (_Preserves_⟶_)
open import Relation.Binary.Bundles using (Setoid; Preorder; Poset)
open import Relation.Binary.Consequences using (mono⇒cong)
open import Relation.Binary.Definitions using (Monotonic₁)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since morphisms tend to be functions, using Function.Definitions where does not seem out of place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants