Skip to content

Commit b8ce24b

Browse files
authored
[ add ] Relation.Binary.Morphism.Construct.On (#2872)
* add: `Relation.Binary.Morphism.Construct.On` * fix: top-level descriptive comment * fix: remove `module ι`, and better description in `CHANGELOG`
1 parent 4b50bf3 commit b8ce24b

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-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`, construct the canonical `IsRelMonomorphism`
110+
between `_∼_ on f` and `_∼_`, witnessed by `f` itself.
111+
108112
Additions to existing modules
109113
-----------------------------
110114

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
------------------------------------------------------------------------
2+
-- The Agda standard library
3+
--
4+
-- Construct monomorphism from a relation and a function via `_on_`
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+
}

0 commit comments

Comments
 (0)