Skip to content

Commit f981711

Browse files
committed
refactor: Luke, use the force!
1 parent 325c66f commit f981711

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/Function/Construct/Symmetry.agda

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ open import Level using (Level)
2222
open import Relation.Binary.Core using (Rel)
2323
open import Relation.Binary.Definitions using (Reflexive; Symmetric; Transitive)
2424
open import Relation.Binary.Bundles using (Setoid)
25-
open import Relation.Binary.PropositionalEquality.Core using (_≡_; cong)
25+
open import Relation.Binary.PropositionalEquality.Core using (_≡_)
2626
open import Relation.Binary.PropositionalEquality.Properties using (setoid)
2727

2828
private
@@ -47,8 +47,8 @@ module _ (≈₁ : Rel A ℓ₁) (≈₂ : Rel B ℓ₂) {f : A → B} {f⁻¹ :
4747
------------------------------------------------------------------------
4848
-- Structures
4949

50-
module _ {≈₁ : Rel A ℓ₁} {≈₂ : Rel B ℓ₂}
51-
{f : A B} (isBij : IsBijection ≈₁ ≈₂ f)
50+
module _ {≈₁ : Rel A ℓ₁} {≈₂ : Rel B ℓ₂} {f : A B}
51+
(isBij : IsBijection ≈₁ ≈₂ f)
5252
where
5353

5454
private module B = IsBijection isBij
@@ -105,11 +105,9 @@ module _ {R : Setoid a ℓ₁} {S : Setoid b ℓ₂} (bij : Bijection R S) where
105105
-- We can always flip a bijection WITHOUT knowing if the witness produced
106106
-- by the surjection proof respects the equality on the codomain.
107107
bijectionWithoutCongruence : Bijection S R
108-
bijectionWithoutCongruence = record
109-
{ to = B.section
110-
; cong = S.cong B.injective B.Eq₁.refl B.Eq₂.sym B.Eq₂.trans
111-
; bijective = S.bijective B.injective B.Eq₁.refl B.Eq₂.sym B.Eq₂.trans
112-
} where module B = Bijection bij ; module S = Section (Setoid._≈_ S) B.surjective
108+
bijectionWithoutCongruence = record {
109+
IsBijection (isBijectionWithoutCongruence B.isBijection)
110+
} where module B = Bijection bij
113111

114112
module _ {R : Setoid a ℓ₁} {S : Setoid b ℓ₂} where
115113

@@ -223,7 +221,7 @@ module _ {≈₁ : Rel A ℓ₁} {≈₂ : Rel B ℓ₂} {f : A → B}
223221

224222
bijective : Symmetric ≈₂ Transitive ≈₂
225223
Congruent ≈₁ ≈₂ f Bijective ≈₂ ≈₁ S.section
226-
bijective sym trans _ = S.injective refl sym trans , surjective trans
224+
bijective sym trans cong = injective sym trans cong , surjective trans
227225
{-# WARNING_ON_USAGE injective
228226
"Warning: injective was deprecated in v2.3.
229227
Please use Function.Consequences.Section.injective instead, with a sharper type."
@@ -237,8 +235,8 @@ Please use Function.Consequences.Section.surjective instead."
237235
Please use Function.Consequences.Section.bijective instead, with a sharper type."
238236
#-}
239237

240-
module _ {≈₁ : Rel A ℓ₁} {≈₂ : Rel B ℓ₂}
241-
{f : A B} (isBij : IsBijection ≈₁ ≈₂ f)
238+
module _ {≈₁ : Rel A ℓ₁} {≈₂ : Rel B ℓ₂} {f : A B}
239+
(isBij : IsBijection ≈₁ ≈₂ f)
242240
where
243241
private module B = IsBijection isBij
244242
isBijection : Congruent ≈₂ ≈₁ B.section IsBijection ≈₂ ≈₁ B.section

0 commit comments

Comments
 (0)