Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ Minor improvements
an alias, and should be backwards compatible, but does improve the behaviour
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...


* The type of `Relation.Nullary.Negation.Core.contradiction-irr` has been further
weakened so that the negated hypothesis `¬ A` is marked as irrelevant. This is
safe to do, in view of `Relation.Nullary.Recomputable.Properties.¬-recompute`.
Expand Down
2 changes: 0 additions & 2 deletions src/Algebra/Morphism/Bundles.agda
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ open import Algebra.Bundles.Raw using
; RawRingWithoutOne; RawRing)
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!?


private
variable
Expand Down
43 changes: 23 additions & 20 deletions src/Algebra/Morphism/Construct/Initial.agda
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ module Algebra.Morphism.Construct.Initial {c ℓ : Level} where
open import Algebra.Bundles.Raw using (RawMagma)
open import Algebra.Morphism.Structures
using (IsMagmaHomomorphism; IsMagmaMonomorphism)
open import Function.Definitions using (Injective)
import Relation.Binary.Morphism.Definitions as Rel
open import Function.Definitions using (Congruent; Injective)
open import Relation.Binary.Core using (Rel)

open import Algebra.Construct.Initial {c} {ℓ}
Expand All @@ -27,7 +26,7 @@ private
variable
a m ℓm : Level
A : Set a
≈ : Rel A ℓm


------------------------------------------------------------------------
-- The unique morphism
Expand All @@ -38,25 +37,29 @@ zero ()
------------------------------------------------------------------------
-- Basic properties

cong : (≈ : Rel A ℓm) → Rel.Homomorphic₂ ℤero.Carrier A ℤero._≈_ ≈ zero
cong _ {x = ()}
module _ (≈ : Rel A ℓm) where

cong : Congruent ℤero._≈_ ≈ zero
cong {x = ()}

injective : (≈ : Rel A ℓm) → Injective ℤero._≈_ ≈ zero
injective _ {x = ()}
injective : Injective ℤero._≈_ ≈ zero
injective {x = ()}

------------------------------------------------------------------------
-- Morphism structures

isMagmaHomomorphism : (M : RawMagma m ℓm) →
IsMagmaHomomorphism rawMagma M zero
isMagmaHomomorphism M = record
{ isRelHomomorphism = record { cong = cong (RawMagma._≈_ M) }
; homo = λ()
}

isMagmaMonomorphism : (M : RawMagma m ℓm) →
IsMagmaMonomorphism rawMagma M zero
isMagmaMonomorphism M = record
{ isMagmaHomomorphism = isMagmaHomomorphism M
; injective = injective (RawMagma._≈_ M)
}
module _ (M : RawMagma m ℓm) where

open RawMagma M using (_≈_)

isMagmaHomomorphism : IsMagmaHomomorphism rawMagma M zero
isMagmaHomomorphism = record
{ isRelHomomorphism = record { cong = cong _≈_ }
; homo = λ()
}

isMagmaMonomorphism : IsMagmaMonomorphism rawMagma M zero
isMagmaMonomorphism = record
{ isMagmaHomomorphism = isMagmaHomomorphism
; injective = injective _≈_
}
2 changes: 0 additions & 2 deletions src/Algebra/Morphism/Construct/Terminal.agda
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ open import Algebra.Morphism.Structures
; IsRingHomomorphism)
open import Data.Product.Base using (_,_)
open import Function.Definitions using (StrictlySurjective)
import Relation.Binary.Morphism.Definitions as Rel
open import Relation.Binary.Morphism.Structures using (IsRelHomomorphism)

open import Algebra.Construct.Terminal {c} {ℓ}

Expand Down
1 change: 0 additions & 1 deletion src/Algebra/Morphism/Structures.agda
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ open import Algebra.Bundles
import Algebra.Morphism.Definitions as MorphismDefinitions
open import Level using (Level; _⊔_)
open import Function.Definitions using (Injective; Surjective)
open import Relation.Binary.Core using (Rel)
open import Relation.Binary.Morphism.Structures
using (IsRelHomomorphism; IsRelMonomorphism; IsRelIsomorphism)

Expand Down
7 changes: 4 additions & 3 deletions src/Relation/Binary/Morphism/Bundles.agda
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@
module Relation.Binary.Morphism.Bundles where

open import Level using (Level; _⊔_)
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₁)
open import Relation.Binary.Morphism.Structures
using (IsRelHomomorphism; IsRelMonomorphism; IsRelIsomorphism
; IsOrderHomomorphism; IsOrderMonomorphism; IsOrderIsomorphism)
open import Relation.Binary.Consequences using (mono⇒cong)

private
variable
ℓ₁ ℓ₂ ℓ₃ ℓ₄ ℓ₅ ℓ₆ : Level


------------------------------------------------------------------------
-- Setoids
------------------------------------------------------------------------
Expand Down Expand Up @@ -96,7 +97,7 @@ module _ (P : Poset ℓ₁ ℓ₂ ℓ₃) (Q : Poset ℓ₄ ℓ₅ ℓ₆) where

-- Smart constructor that automatically constructs the congruence
-- proof from the monotonicity proof
mkPosetHomo : ∀ f → f Preserves P._≤_ Q._≤_ → PosetHomomorphism
mkPosetHomo : ∀ f → Monotonic₁ P._≤_ Q._≤_ f → PosetHomomorphism
mkPosetHomo f mono = record
{ ⟦_⟧ = f
; isOrderHomomorphism = record
Expand Down
15 changes: 4 additions & 11 deletions src/Relation/Binary/Morphism/Definitions.agda
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
------------------------------------------------------------------------
-- The Agda standard library
--
-- Basic definitions for morphisms between algebraic structures
-- Issue #2875: this is a stub module, retained solely for compatibility
------------------------------------------------------------------------

{-# OPTIONS --cubical-compatible --safe #-}

open import Relation.Binary.Core

module Relation.Binary.Morphism.Definitions
{a} (A : Set a) -- The domain of the morphism
{b} (B : Set b) -- The codomain of the morphism
where

open import Level using (Level)

private
variable
ℓ₁ ℓ₂ : Level

------------------------------------------------------------------------
-- Morphism definition in Function.Core

Expand All @@ -28,5 +20,6 @@ open import Function.Core public
------------------------------------------------------------------------
-- Basic definitions

Homomorphic₂ : Rel A ℓ₁ → Rel B ℓ₂ → (A → B) → Set _
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

17 changes: 8 additions & 9 deletions src/Relation/Binary/Morphism/Structures.agda
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
------------------------------------------------------------------------
-- The Agda standard library
--
-- Order morphisms
-- Relational morphisms, incl. in particular, order morphisms
------------------------------------------------------------------------

{-# OPTIONS --cubical-compatible --safe #-}

open import Relation.Binary.Core using (Rel)

module Relation.Binary.Morphism.Structures
{a b} {A : Set a} {B : Set b}
where

open import Data.Product.Base using (_,_)
open import Function.Definitions using (Injective; Surjective; Bijective)
open import Function.Definitions
using (Congruent; Injective; Surjective; Bijective)
open import Level using (Level; _⊔_)

open import Relation.Binary.Morphism.Definitions A B
open import Relation.Binary.Core using (Rel)

private
variable
ℓ₁ ℓ₂ ℓ₃ ℓ₄ : Level


------------------------------------------------------------------------
-- Relations
------------------------------------------------------------------------

record IsRelHomomorphism (_∼₁_ : Rel A ℓ₁) (_∼₂_ : Rel B ℓ₂)
(⟦_⟧ : A → B) : Set (a ⊔ ℓ₁ ⊔ ℓ₂) where
field
cong : Homomorphic₂ _∼₁_ _∼₂_ ⟦_⟧
cong : Congruent _∼₁_ _∼₂_ ⟦_⟧


record IsRelMonomorphism (_∼₁_ : Rel A ℓ₁) (_∼₂_ : Rel B ℓ₂)
Expand Down Expand Up @@ -62,8 +61,8 @@ record IsOrderHomomorphism (_≈₁_ : Rel A ℓ₁) (_≈₂_ : Rel B ℓ₂)
(⟦_⟧ : A → B) : Set (a ⊔ ℓ₁ ⊔ ℓ₂ ⊔ ℓ₃ ⊔ ℓ₄)
where
field
cong : Homomorphic₂ _≈₁_ _≈₂_ ⟦_⟧
mono : Homomorphic₂ _≲₁_ _≲₂_ ⟦_⟧
cong : Congruent _≈₁_ _≈₂_ ⟦_⟧
mono : Congruent _≲₁_ _≲₂_ ⟦_⟧

module Eq where
isRelHomomorphism : IsRelHomomorphism _≈₁_ _≈₂_ ⟦_⟧
Expand Down