Skip to content

Commit fbc5c50

Browse files
committed
refactor: deprecate injective⇒to⁻-cong
1 parent 7fcbcb0 commit fbc5c50

File tree

1 file changed

+15
-23
lines changed

1 file changed

+15
-23
lines changed

src/Function/Properties/Surjection.agda

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ module Function.Properties.Surjection where
1010

1111
open import Function.Base using (_∘_; _$_)
1212
open import Function.Definitions using (Surjective; Injective; Congruent)
13-
open import Function.Bundles using (Func; Surjection; _↠_; _⟶_; _↪_; mk↪;
14-
_⇔_; mk⇔)
13+
open import Function.Bundles
14+
using (Func; Surjection; _↠_; _⟶_; _↪_; mk↪; _⇔_; mk⇔)
1515
import Function.Construct.Identity as Identity
16+
import Function.Construct.Symmetry as Symmetry
1617
import Function.Construct.Composition as Compose
1718
open import Level using (Level)
18-
open import Data.Product.Base using (proj₁; proj₂)
19+
open import Data.Product.Base using (_,_; proj₁; proj₂)
1920
import Relation.Binary.PropositionalEquality.Core as ≡
2021
open import Relation.Binary.Definitions using (Reflexive; Trans)
2122
open import Relation.Binary.Bundles using (Setoid)
@@ -31,8 +32,8 @@ private
3132
-- Constructors
3233

3334
mkSurjection : (f : Func S T) (open Func f)
34-
Surjective Eq₁._≈_ Eq₂._≈_ to
35-
Surjection S T
35+
Surjective Eq₁._≈_ Eq₂._≈_ to
36+
Surjection S T
3637
mkSurjection f surjective = record
3738
{ Func f
3839
; surjective = surjective
@@ -63,22 +64,6 @@ trans : Trans (Surjection {a} {ℓ₁} {b} {ℓ₂})
6364
(Surjection {a} {ℓ₁} {c} {ℓ₃})
6465
trans = Compose.surjection
6566

66-
------------------------------------------------------------------------
67-
-- Other
68-
69-
injective⇒section-cong : (surj : Surjection S T)
70-
(open Surjection surj)
71-
Injective Eq₁._≈_ Eq₂._≈_ to
72-
Congruent Eq₂._≈_ Eq₁._≈_ section
73-
injective⇒section-cong {T = T} surj injective {x} {y} x≈y = injective $ begin
74-
to (section x) ≈⟨ section-strictInverseˡ x ⟩
75-
x ≈⟨ x≈y ⟩
76-
y ≈⟨ section-strictInverseˡ y ⟨
77-
to (section y) ∎
78-
where
79-
open ≈-Reasoning T
80-
open Surjection surj
81-
8267

8368
------------------------------------------------------------------------
8469
-- DEPRECATED NAMES
@@ -88,8 +73,15 @@ injective⇒section-cong {T = T} surj injective {x} {y} x≈y = injective $ begi
8873

8974
-- Version 2.3
9075

91-
injective⇒to⁻-cong = injective⇒section-cong
76+
module _ (surjection : Surjection S T) where
77+
78+
open Surjection surjection
79+
80+
injective⇒to⁻-cong : Injective Eq₁._≈_ Eq₂._≈_ to
81+
Congruent Eq₂._≈_ Eq₁._≈_ section
82+
injective⇒to⁻-cong injective =
83+
Symmetry.section-cong (injective , surjective) Eq₁.refl Eq₂.sym Eq₂.trans
9284
{-# WARNING_ON_USAGE injective⇒to⁻-cong
9385
"Warning: injective⇒to⁻-cong was deprecated in v2.3.
94-
Please use injective⇒section-cong instead. "
86+
Please use Symmetry.section-cong instead. "
9587
#-}

0 commit comments

Comments
 (0)