Skip to content

Commit fafc400

Browse files
committed
add: Relation.Binary.Morphism.Construct.On
1 parent 38f22ec commit fafc400

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ New modules
105105
Data.List.NonEmpty.Membership.Setoid
106106
```
107107

108+
* `Relation.Binary.Morphism.Construct.On`: given a relation `_∼_` on `B`,
109+
and a function `f : A → B`, lift to various `IsRelHomomorphism`s between
110+
`_∼_ on f` and `_∼_`.
111+
108112
Additions to existing modules
109113
-----------------------------
110114

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
------------------------------------------------------------------------
2+
-- The Agda standard library
3+
--
4+
-- Construct IsRelHomomorphisms from a relation and a function
5+
------------------------------------------------------------------------
6+
7+
{-# OPTIONS --cubical-compatible --safe #-}
8+
9+
open import Relation.Binary.Core using (Rel)
10+
11+
module Relation.Binary.Morphism.Construct.On
12+
{a b ℓ} {A : Set a} {B : Set b} (_∼_ : Rel B ℓ) (f : A B)
13+
where
14+
15+
open import Function.Base using (id; _on_)
16+
open import Relation.Binary.Morphism.Structures
17+
using (IsRelHomomorphism; IsRelMonomorphism)
18+
19+
------------------------------------------------------------------------
20+
-- Definition
21+
22+
_≈_ : Rel A _
23+
_≈_ = _∼_ on f
24+
25+
isRelHomomorphism : IsRelHomomorphism _≈_ _∼_ f
26+
isRelHomomorphism = record { cong = id }
27+
28+
isRelMonomorphism : IsRelMonomorphism _≈_ _∼_ f
29+
isRelMonomorphism = record
30+
{ isHomomorphism = isRelHomomorphism
31+
; injective = id
32+
}
33+
34+
module ι = IsRelMonomorphism isRelMonomorphism
35+

0 commit comments

Comments
 (0)