Debian Codegraph @

src/Relation/Binary/Construct/Constant.agda

raw
1 ------------------------------------------------------------------------
2 -- The Agda standard library
3 --
4 -- The binary relation defined by a constant
5 ------------------------------------------------------------------------
6
7 {-# OPTIONS --cubical-compatible --safe #-}
8
9 module Relation.Binary.Construct.Constant where
10
11 open import Level using (Level)
12 open import Relation.Binary.Bundles using (Setoid)
13 open import Relation.Binary.Structures using (IsEquivalence)
14 open import Relation.Binary.Definitions using (Reflexive; Symmetric; Transitive)
15
16 private
17 variable
18 a b c : Level
19 A : Set a
20 B : Set b
21
22 ------------------------------------------------------------------------
23 -- Re-export definition
24
25 open import Relation.Binary.Construct.Constant.Core public
26
27 ------------------------------------------------------------------------
28 -- Properties
29
30 module _ {a c} (A : Set a) {C : Set c} where
31
32 refl : C → Reflexive {A = A} (Const C)
33 refl c = c
34
35 sym : Symmetric {A = A} (Const C)
36 sym c = c
37
38 trans : Transitive {A = A} (Const C)
39 trans c d = c
40
41 isEquivalence : C → IsEquivalence {A = A} (Const C)
42 isEquivalence c = record
43 { refl = λ {x} → refl c {x}
44 ; sym = λ {x} {y} → sym {x} {y}
45 ; trans = λ {x} {y} {z} → trans {x} {y} {z}
46 }
47
48 setoid : C → Setoid a c
49 setoid x = record { isEquivalence = isEquivalence x }