Debian Codegraph @

src/Function/Indexed/Relation/Binary/Equality.agda

raw
1 ------------------------------------------------------------------------
2 -- The Agda standard library
3 --
4 -- Function setoids and related constructions
5 ------------------------------------------------------------------------
6
7 {-# OPTIONS --cubical-compatible --safe #-}
8
9 module Function.Indexed.Relation.Binary.Equality where
10
11 open import Relation.Binary.Bundles using (Setoid)
12 open import Relation.Binary.Indexed.Heterogeneous using (IndexedSetoid)
13
14 -- A variant of setoid which uses the propositional equality setoid
15 -- for the domain, and a more convenient definition of _≈_.
16
17 ≡-setoid : ∀ {f t₁ t₂} (From : Set f) → IndexedSetoid From t₁ t₂ → Setoid _ _
18 ≡-setoid From To = record
19 { Carrier = (x : From) → Carrier x
20 ; _≈_ = λ f g → ∀ x → f x ≈ g x
21 ; isEquivalence = record
22 { refl = λ {f} x → refl
23 ; sym = λ f∼g x → sym (f∼g x)
24 ; trans = λ f∼g g∼h x → trans (f∼g x) (g∼h x)
25 }
26 } where open IndexedSetoid To
27