@@ -29,7 +29,7 @@ module _ ℓ where
29
29
open import Categories.Category.Instance.Properties.Setoids.Exact
30
30
open import Categories.Object.InternalRelation using (Relation)
31
31
32
- -- Presentation axiom, aka CoSHEP (http ://nlab-pages.s3.us-east-2.amazonaws.com /nlab/show/presentation+axiom)
32
+ -- Presentation axiom, aka CoSHEP (https ://ncatlab.org /nlab/show/presentation+axiom)
33
33
record CoSHEP (A : Setoid ℓ ℓ) : Set (Level.suc ℓ) where
34
34
field
35
35
{P} : Setoid ℓ ℓ
@@ -60,6 +60,10 @@ module _ ℓ where
60
60
entire {A} R = ∀ (x : ∣ A ∣) → Σ[ e ∈ ∣ dom ∣ ] [ A ][ p₁ ⟨$⟩ e ≈ x ]
61
61
where open Relation R
62
62
63
+ functional : {A B : Setoid ℓ ℓ} → (R : Relation S A B) → Set ℓ
64
+ functional {A}{B} R = ∀ (e₁ e₂ : ∣ dom ∣) → [ A ][ p₁ ⟨$⟩ e₁ ≈ p₁ ⟨$⟩ e₂ ] → [ B ][ p₂ ⟨$⟩ e₁ ≈ p₂ ⟨$⟩ e₂ ]
65
+ where open Relation R
66
+
63
67
ℕ-Setoid : Setoid ℓ ℓ
64
68
ℕ-Setoid = record { Carrier = Lift _ ℕ ; _≈_ = P._≡_ ; isEquivalence = record { refl = P.refl ; sym = P.sym ; trans = P.trans } }
65
69
@@ -94,3 +98,32 @@ module _ ℓ where
94
98
; cong = λ {n}{m} eq → let x , _ = surj n; y , _ = surj m in P.subst (λ m → [ A ][ proj₁ (surj n) ≈ proj₁ (surj m) ]) eq (refl A)
95
99
}
96
100
, λ {n}{m} n≡m → let _ , eq = surj n in P.trans eq n≡m
101
+
102
+ -- principle of unique choice for setoids
103
+ -- https://ncatlab.org/nlab/show/principle+of+unique+choice
104
+ record UniqueChoice {A B : Setoid ℓ ℓ} (R : Relation S A B) (ent : entire R) (frel : functional R) : Set ℓ where
105
+ open Relation R
106
+
107
+ field
108
+ fun : A ⇒ B
109
+ isfun : ∀ (e : ∣ dom ∣) → [ B ][ fun ⟨$⟩ (p₁ ⟨$⟩ e) ≈ p₂ ⟨$⟩ e ]
110
+
111
+ Setoid-UniqueChoice : {A B : Setoid ℓ ℓ} (R : Relation S A B) (ent : entire R) (frel : functional R) → UniqueChoice R ent frel
112
+ _⟨$⟩_ (UniqueChoice.fun (Setoid-UniqueChoice R ent frel)) x = p₂ ⟨$⟩ proj₁ (ent x)
113
+ where open Relation R
114
+
115
+ cong (UniqueChoice.fun (Setoid-UniqueChoice {A} {B} R ent frel)) {n} {m} n≈m =
116
+ let (en , p₁en≈n) = ent n
117
+ (em , p₁em≈m) = ent m in frel en em
118
+ (begin
119
+ p₁ ⟨$⟩ en ≈⟨ p₁en≈n ⟩
120
+ n ≈⟨ n≈m ⟩
121
+ m ≈˘⟨ p₁em≈m ⟩
122
+ p₁ ⟨$⟩ em
123
+ ∎)
124
+ where
125
+ open Relation R
126
+ open SR A
127
+
128
+ UniqueChoice.isfun (Setoid-UniqueChoice R ent frel) e = let (e' , p₁e'≈p₁e) = ent (p₁ ⟨$⟩ e) in frel e' e p₁e'≈p₁e
129
+ where open Relation R
0 commit comments