| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Relationships between properties of functions where the equality |
| 5 |
-- over both the domain and codomain is assumed to be _≡_ |
| 6 |
------------------------------------------------------------------------ |
| 7 |
|
| 8 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 9 |
|
| 10 |
module Function.Consequences.Propositional |
| 11 |
{a b} {A : Set a} {B : Set b} |
| 12 |
where |
| 13 |
|
| 14 |
open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; cong) |
| 15 |
open import Relation.Binary.PropositionalEquality.Properties |
| 16 |
using (setoid) |
| 17 |
open import Function.Definitions |
| 18 |
using (StrictlySurjective; StrictlyInverseˡ; StrictlyInverseʳ; Inverseˡ |
| 19 |
; Inverseʳ; Surjective) |
| 20 |
open import Relation.Nullary.Negation.Core using (contraposition) |
| 21 |
|
| 22 |
import Function.Consequences.Setoid (setoid A) (setoid B) as Setoid |
| 23 |
|
| 24 |
------------------------------------------------------------------------ |
| 25 |
-- Re-export setoid properties |
| 26 |
|
| 27 |
open Setoid public |
| 28 |
hiding |
| 29 |
( strictlySurjective⇒surjective |
| 30 |
; strictlyInverseˡ⇒inverseˡ |
| 31 |
; strictlyInverseʳ⇒inverseʳ |
| 32 |
) |
| 33 |
|
| 34 |
------------------------------------------------------------------------ |
| 35 |
-- Properties that rely on congruence |
| 36 |
|
| 37 |
private |
| 38 |
variable |
| 39 |
f : A → B |
| 40 |
f⁻¹ : B → A |
| 41 |
|
| 42 |
strictlySurjective⇒surjective : StrictlySurjective _≡_ f → |
| 43 |
Surjective _≡_ _≡_ f |
| 44 |
strictlySurjective⇒surjective = |
| 45 |
Setoid.strictlySurjective⇒surjective (cong _) |
| 46 |
|
| 47 |
strictlyInverseˡ⇒inverseˡ : ∀ f → StrictlyInverseˡ _≡_ f f⁻¹ → |
| 48 |
Inverseˡ _≡_ _≡_ f f⁻¹ |
| 49 |
strictlyInverseˡ⇒inverseˡ f = |
| 50 |
Setoid.strictlyInverseˡ⇒inverseˡ (cong _) |
| 51 |
|
| 52 |
strictlyInverseʳ⇒inverseʳ : ∀ f → StrictlyInverseʳ _≡_ f f⁻¹ → |
| 53 |
Inverseʳ _≡_ _≡_ f f⁻¹ |
| 54 |
strictlyInverseʳ⇒inverseʳ f = |
| 55 |
Setoid.strictlyInverseʳ⇒inverseʳ (cong _) |