Skip to content

Commit f12ca70

Browse files
Removed module parameters from Function (#977)
1 parent 18908bf commit f12ca70

File tree

3 files changed

+16
-27
lines changed

3 files changed

+16
-27
lines changed

src/Function.agda

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,9 @@
66

77
{-# OPTIONS --without-K --safe #-}
88

9-
-- Note that it is not necessary to provide the equality relations. If
10-
-- they are not provided then it is necessary to provide them directly
11-
-- when using the contents of `Function.Definitions` and
12-
-- `Function.Structures`.
13-
14-
open import Relation.Binary using (Rel)
15-
16-
module Function
17-
{a b ℓ₁ ℓ₂} {A : Set a} {B : Set b}
18-
(_≈₁_ : Rel A ℓ₁) -- Equality over the domain
19-
(_≈₂_ : Rel B ℓ₂) -- Equality over the codomain
20-
where
9+
module Function where
2110

2211
open import Function.Core public
23-
open import Function.Definitions _≈₁_ _≈₂_ public
24-
open import Function.Structures _≈₁_ _≈₂_ public
12+
open import Function.Definitions public
13+
open import Function.Structures public
2514
open import Function.Bundles public

src/Function/Construct/Composition.agda

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,28 +82,28 @@ module _ {≈₁ : Rel A ℓ₁} {≈₂ : Rel B ℓ₂} {≈₃ : Rel C ℓ₃}
8282
{ cong = G.cong ∘ F.cong
8383
; isEquivalence₁ = F.isEquivalence₁
8484
; isEquivalence₂ = G.isEquivalence₂
85-
} where module F = IsCongruent _ _ f-cong; module G = IsCongruent _ _ g-cong
85+
} where module F = IsCongruent f-cong; module G = IsCongruent g-cong
8686

8787
isInjection : IsInjection ≈₁ ≈₂ f IsInjection ≈₂ ≈₃ g
8888
IsInjection ≈₁ ≈₃ (g ∘ f)
8989
isInjection f-inj g-inj = record
9090
{ isCongruent = isCongruent F.isCongruent G.isCongruent
9191
; injective = injective ≈₁ ≈₂ ≈₃ F.injective G.injective
92-
} where module F = IsInjection _ _ f-inj; module G = IsInjection _ _ g-inj
92+
} where module F = IsInjection f-inj; module G = IsInjection g-inj
9393

9494
isSurjection : IsSurjection ≈₁ ≈₂ f IsSurjection ≈₂ ≈₃ g
9595
IsSurjection ≈₁ ≈₃ (g ∘ f)
9696
isSurjection f-surj g-surj = record
9797
{ isCongruent = isCongruent F.isCongruent G.isCongruent
9898
; surjective = surjective ≈₁ ≈₂ ≈₃ G.Eq₂.trans G.cong F.surjective G.surjective
99-
} where module F = IsSurjection _ _ f-surj; module G = IsSurjection _ _ g-surj
99+
} where module F = IsSurjection f-surj; module G = IsSurjection g-surj
100100

101101
isBijection : IsBijection ≈₁ ≈₂ f IsBijection ≈₂ ≈₃ g
102102
IsBijection ≈₁ ≈₃ (g ∘ f)
103103
isBijection f-bij g-bij = record
104104
{ isInjection = isInjection F.isInjection G.isInjection
105105
; surjective = surjective ≈₁ ≈₂ ≈₃ G.Eq₂.trans G.cong F.surjective G.surjective
106-
} where module F = IsBijection _ _ f-bij; module G = IsBijection _ _ g-bij
106+
} where module F = IsBijection f-bij; module G = IsBijection g-bij
107107

108108
module _ {≈₁ : Rel A ℓ₁} {≈₂ : Rel B ℓ₂} {≈₃ : Rel C ℓ₃}
109109
{f : A B} {g : B C} {f⁻¹ : B A} {g⁻¹ : C B}
@@ -115,22 +115,22 @@ module _ {≈₁ : Rel A ℓ₁} {≈₂ : Rel B ℓ₂} {≈₃ : Rel C ℓ₃}
115115
{ isCongruent = isCongruent F.isCongruent G.isCongruent
116116
; cong₂ = congruent ≈₃ ≈₂ ≈₁ G.cong₂ F.cong₂
117117
; inverseˡ = inverseˡ ≈₁ ≈₂ ≈₃ f _ G.Eq₂.trans G.cong₁ F.inverseˡ G.inverseˡ
118-
} where module F = IsLeftInverse _ _ f-invˡ; module G = IsLeftInverse _ _ g-invˡ
118+
} where module F = IsLeftInverse f-invˡ; module G = IsLeftInverse g-invˡ
119119

120120
isRightInverse : IsRightInverse ≈₁ ≈₂ f f⁻¹ IsRightInverse ≈₂ ≈₃ g g⁻¹
121121
IsRightInverse ≈₁ ≈₃ (g ∘ f) (f⁻¹ ∘ g⁻¹)
122122
isRightInverse f-invʳ g-invʳ = record
123123
{ isCongruent = isCongruent F.isCongruent G.isCongruent
124124
; cong₂ = congruent ≈₃ ≈₂ ≈₁ G.cong₂ F.cong₂
125125
; inverseʳ = inverseʳ ≈₁ ≈₂ ≈₃ _ g⁻¹ F.Eq₁.trans F.cong₂ F.inverseʳ G.inverseʳ
126-
} where module F = IsRightInverse _ _ f-invʳ; module G = IsRightInverse _ _ g-invʳ
126+
} where module F = IsRightInverse f-invʳ; module G = IsRightInverse g-invʳ
127127

128128
isInverse : IsInverse ≈₁ ≈₂ f f⁻¹ IsInverse ≈₂ ≈₃ g g⁻¹
129129
IsInverse ≈₁ ≈₃ (g ∘ f) (f⁻¹ ∘ g⁻¹)
130130
isInverse f-inv g-inv = record
131131
{ isLeftInverse = isLeftInverse F.isLeftInverse G.isLeftInverse
132132
; inverseʳ = inverseʳ ≈₁ ≈₂ ≈₃ _ g⁻¹ F.Eq₁.trans F.cong₂ F.inverseʳ G.inverseʳ
133-
} where module F = IsInverse _ _ f-inv; module G = IsInverse _ _ g-inv
133+
} where module F = IsInverse f-inv; module G = IsInverse g-inv
134134

135135
------------------------------------------------------------------------
136136
-- Setoid bundles

src/Function/Construct/Identity.agda

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
module Function.Construct.Identity where
1010

1111
open import Data.Product using (_,_)
12-
import Function
12+
open import Function using (id)
13+
open import Function.Bundles
14+
import Function.Definitions as Definitions
15+
import Function.Structures as Structures
1316
open import Level
1417
open import Relation.Binary
1518
open import Relation.Binary.PropositionalEquality using (_≡_; setoid)
@@ -24,7 +27,7 @@ private
2427

2528
module _ (_≈_ : Rel A ℓ) where
2629

27-
open Function _≈_ _≈_
30+
open Definitions _≈_ _≈_
2831

2932
injective : Injective id
3033
injective = id
@@ -49,7 +52,7 @@ module _ (_≈_ : Rel A ℓ) where
4952

5053
module _ {_≈_ : Rel A ℓ} (isEq : IsEquivalence _≈_) where
5154

52-
open Function _≈_ _≈_
55+
open Structures _≈_ _≈_
5356
open IsEquivalence isEq
5457

5558
isCongruent : IsCongruent id
@@ -103,7 +106,6 @@ module _ {_≈_ : Rel A ℓ} (isEq : IsEquivalence _≈_) where
103106
module _ (S : Setoid a ℓ) where
104107

105108
open Setoid S
106-
open Function _≈_ _≈_
107109

108110
injection : Injection S S
109111
injection = record
@@ -166,8 +168,6 @@ module _ (S : Setoid a ℓ) where
166168

167169
module _ (A : Set a) where
168170

169-
open Function {A = A} {A} _≡_ _≡_
170-
171171
id-↣ : A ↣ A
172172
id-↣ = injection (setoid A)
173173

0 commit comments

Comments
 (0)