Skip to content

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

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

[ refactor ] make Relation.Binary.Morphism.Definitions obsolete#2922
jamesmckinna wants to merge 5 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

@jamesmckinna jamesmckinna requested review from JacquesCarette, MatthewDaggitt and gallais and removed request for JacquesCarette January 28, 2026 15:12
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.

@jamesmckinna jamesmckinna added this to the v2.4 milestone Feb 25, 2026
Homomorphic₂ _∼₁_ _∼₂_ ⟦_⟧ = ∀ {x y} → x ∼₁ y → ⟦ x ⟧ ∼₂ ⟦ y ⟧
open import Function.Definitions public
using ()
renaming (Congruent to Homomorphic₂)
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this is a stub module, should we be deprecating Homomorphic₂? Otherwise, where is it going to live?

Copy link
Collaborator Author

@jamesmckinna jamesmckinna Mar 3, 2026

Choose a reason for hiding this comment

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

My only reason for not deprecating, is that there seemed to be a request from @pnlph a number of years ago, to retain this name for client compatibility (and hence the public re-export from this module, where it originated). If there is no longer any such demand, then I'd be more radical wrt the surgery being carried out here, and mark the whole module as DEPRECATED...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

UPDATED: I've deprecated the lemmas, but not the module, and we'll do that in v3.0

open import Algebra.Morphism.Structures
open import Level using (Level; suc; _⊔_)
--open import Relation.Binary.Morphism using (IsRelHomomorphism)
--open import Relation.Binary.Morphism.Bundles using (SetoidHomomorphism)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Delete?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Blast, I thought that I had caught these two.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wait, won't this PR do the deletion when merged?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

And yes, they are commented out (never mind unused) on master, so should be deleted!?

of the termination checker for some `Vector`-defined operations.

* `Relation.Binary.Morphism.Definitions` is no longer imported by any module,
but retained as a stub for compatibility with external users.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should it be deprecated then?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, see my comment on the module. I'd be happy to, if we no longer have external clients requesting this.

But now I think about it, let's just deprecate anyway?

Copy link
Collaborator Author

@jamesmckinna jamesmckinna Mar 4, 2026

Choose a reason for hiding this comment

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

I tried a middle course, deprecating the two names, but not the whole module, but now, against expectations, a warning is raised whenever Function.Definitions.Congruent is used... ???

UPDATED: seemingly fixed now, but let's see what make test does remotely...

@jamesmckinna
Copy link
Collaborator Author

jamesmckinna commented Mar 4, 2026

Is this an Agda bug now? Or simply that I don't understand the semantics of WARNING_ON_USE?

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.

3 participants