|
7 | 7 |
|
8 | 8 | {-# OPTIONS --cubical-compatible --safe #-}
|
9 | 9 |
|
10 |
| -module Function.Consequences.Propositional where |
| 10 | +module Function.Consequences.Propositional |
| 11 | + {a b} {A : Set a} {B : Set b} |
| 12 | + where |
11 | 13 |
|
| 14 | +open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; cong) |
| 15 | +open import Relation.Binary.PropositionalEquality.Properties |
| 16 | + using (setoid) |
12 | 17 | open import Function.Definitions
|
13 |
| -open import Level |
14 | 18 | open import Relation.Nullary.Negation.Core using (contraposition)
|
15 |
| -open import Relation.Binary.PropositionalEquality.Core |
16 |
| - using (_≡_; _≢_; refl; sym; trans; cong) |
17 | 19 |
|
18 |
| -import Function.Consequences as C |
19 |
| - |
20 |
| -private |
21 |
| - variable |
22 |
| - a b ℓ₁ ℓ₂ : Level |
23 |
| - A B : Set a |
24 |
| - f f⁻¹ : A → B |
25 |
| - |
26 |
| ------------------------------------------------------------------------- |
27 |
| --- Injective |
28 |
| - |
29 |
| -contraInjective : Injective _≡_ _≡_ f → |
30 |
| - ∀ {x y} → x ≢ y → f x ≢ f y |
31 |
| -contraInjective inj p = contraposition inj p |
32 |
| - |
33 |
| ------------------------------------------------------------------------- |
34 |
| --- Inverseˡ |
35 |
| - |
36 |
| -inverseˡ⇒surjective : Inverseˡ _≡_ _≡_ f f⁻¹ → Surjective _≡_ _≡_ f |
37 |
| -inverseˡ⇒surjective = C.inverseˡ⇒surjective _≡_ |
38 |
| - |
39 |
| ------------------------------------------------------------------------- |
40 |
| --- Inverseʳ |
41 |
| - |
42 |
| -inverseʳ⇒injective : ∀ f → |
43 |
| - Inverseʳ _≡_ _≡_ f f⁻¹ → |
44 |
| - Injective _≡_ _≡_ f |
45 |
| -inverseʳ⇒injective f = C.inverseʳ⇒injective _≡_ f refl sym trans |
| 20 | +import Function.Consequences.Setoid (setoid A) (setoid B) as Setoid |
46 | 21 |
|
47 | 22 | ------------------------------------------------------------------------
|
48 |
| --- Inverseᵇ |
| 23 | +-- Re-export setoid properties |
49 | 24 |
|
50 |
| -inverseᵇ⇒bijective : Inverseᵇ _≡_ _≡_ f f⁻¹ → Bijective _≡_ _≡_ f |
51 |
| -inverseᵇ⇒bijective = C.inverseᵇ⇒bijective _≡_ refl sym trans |
| 25 | +open Setoid public |
| 26 | + hiding |
| 27 | + ( strictlySurjective⇒surjective |
| 28 | + ; strictlyInverseˡ⇒inverseˡ |
| 29 | + ; strictlyInverseʳ⇒inverseʳ |
| 30 | + ) |
52 | 31 |
|
53 | 32 | ------------------------------------------------------------------------
|
54 |
| --- StrictlySurjective |
| 33 | +-- Properties that rely on congruence |
55 | 34 |
|
56 |
| -surjective⇒strictlySurjective : Surjective _≡_ _≡_ f → |
57 |
| - StrictlySurjective _≡_ f |
58 |
| -surjective⇒strictlySurjective = |
59 |
| - C.surjective⇒strictlySurjective _≡_ refl |
| 35 | +private |
| 36 | + variable |
| 37 | + f : A → B |
| 38 | + f⁻¹ : B → A |
60 | 39 |
|
61 | 40 | strictlySurjective⇒surjective : StrictlySurjective _≡_ f →
|
62 | 41 | Surjective _≡_ _≡_ f
|
63 | 42 | strictlySurjective⇒surjective =
|
64 |
| - C.strictlySurjective⇒surjective trans (cong _) |
65 |
| - |
66 |
| ------------------------------------------------------------------------- |
67 |
| --- StrictlyInverseˡ |
68 |
| - |
69 |
| -inverseˡ⇒strictlyInverseˡ : Inverseˡ _≡_ _≡_ f f⁻¹ → |
70 |
| - StrictlyInverseˡ _≡_ f f⁻¹ |
71 |
| -inverseˡ⇒strictlyInverseˡ = |
72 |
| - C.inverseˡ⇒strictlyInverseˡ _≡_ _≡_ refl |
| 43 | + Setoid.strictlySurjective⇒surjective (cong _) |
73 | 44 |
|
74 |
| -strictlyInverseˡ⇒inverseˡ : ∀ f → |
75 |
| - StrictlyInverseˡ _≡_ f f⁻¹ → |
| 45 | +strictlyInverseˡ⇒inverseˡ : ∀ f → StrictlyInverseˡ _≡_ f f⁻¹ → |
76 | 46 | Inverseˡ _≡_ _≡_ f f⁻¹
|
77 | 47 | strictlyInverseˡ⇒inverseˡ f =
|
78 |
| - C.strictlyInverseˡ⇒inverseˡ trans (cong f) |
79 |
| - |
80 |
| ------------------------------------------------------------------------- |
81 |
| --- StrictlyInverseʳ |
82 |
| - |
83 |
| -inverseʳ⇒strictlyInverseʳ : Inverseʳ _≡_ _≡_ f f⁻¹ → |
84 |
| - StrictlyInverseʳ _≡_ f f⁻¹ |
85 |
| -inverseʳ⇒strictlyInverseʳ = C.inverseʳ⇒strictlyInverseʳ _≡_ _≡_ refl |
| 48 | + Setoid.strictlyInverseˡ⇒inverseˡ (cong _) |
86 | 49 |
|
87 |
| -strictlyInverseʳ⇒inverseʳ : ∀ f → |
88 |
| - StrictlyInverseʳ _≡_ f f⁻¹ → |
| 50 | +strictlyInverseʳ⇒inverseʳ : ∀ f → StrictlyInverseʳ _≡_ f f⁻¹ → |
89 | 51 | Inverseʳ _≡_ _≡_ f f⁻¹
|
90 |
| -strictlyInverseʳ⇒inverseʳ {f⁻¹ = f⁻¹} _ = |
91 |
| - C.strictlyInverseʳ⇒inverseʳ trans (cong f⁻¹) |
| 52 | +strictlyInverseʳ⇒inverseʳ f = |
| 53 | + Setoid.strictlyInverseʳ⇒inverseʳ (cong _) |
0 commit comments