Skip to content

Commit 7a8d3cf

Browse files
committed
add: functoriality proofs
1 parent d02a8cf commit 7a8d3cf

File tree

3 files changed

+34
-14
lines changed

3 files changed

+34
-14
lines changed

CHANGELOG.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,13 @@ Additions to existing modules
229229

230230
* In `Relation.Unary.Properties`
231231
```agda
232-
⟨_⟩⊢ˡ : (f : A → B) → ⟨ f ⟩⊢ P ⊆ Q → P ⊆ f ⊢ Q
233-
⟨_⟩⊢ʳ : (f : A → B) → P ⊆ f ⊢ Q → ⟨ f ⟩⊢ P ⊆ Q
234-
[_]⊢ˡ : (f : A → B) → Q ⊆ [ f ]⊢ P → f ⊢ Q ⊆ P
235-
[_]⊢ʳ : (f : A → B) → f ⊢ Q ⊆ P → Q ⊆ [ f ]⊢ P
232+
_map-⊢_ : P ⊆ Q → f ⊢ P ⊆ f ⊢ Q
233+
map-⟨_⟩⊢_ : P ⊆ Q → ⟨ f ⟩⊢ P ⊆ ⟨ f ⟩⊢ Q
234+
map-[_]⊢_ : P ⊆ Q → [ f ]⊢ P ⊆ [ f ]⊢ Q
235+
⟨_⟩⊢⁻_ : ⟨ f ⟩⊢ P ⊆ Q → P ⊆ f ⊢ Q
236+
⟨_⟩⊢⁺_ : P ⊆ f ⊢ Q → ⟨ f ⟩⊢ P ⊆ Q
237+
[_]⊢⁻_ : Q ⊆ [ f ]⊢ P → f ⊢ Q ⊆ P
238+
[_]⊢⁺_ : f ⊢ Q ⊆ P → Q ⊆ [ f ]⊢ P
236239
```
237240

238241
* In `System.Random`:

src/Relation/Unary.agda

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,10 @@ f ⊢ P = λ x → P (f x)
273273

274274
-- Change-of-base has left- and right- adjoints (Lawvere).
275275
-- We borrow the 'diamond'/'box' notation from modal logic, cf.
276-
-- `Relation.Unary.Closure.Base`
276+
-- `Relation.Unary.Closure.Base`, rather than Lawvere's ∃f, ∀f.
277+
-- In some settings, the left adjoint is called 'image' or 'pushforward',
278+
-- but the right adjoint doesn't seem to have a non-symbolic name.
279+
277280
⟨_⟩⊢_ : (A B) Pred A ℓ Pred B _
278281
⟨ f ⟩⊢ P = λ y λ x f x ≡ y × P x
279282

src/Relation/Unary/Properties.agda

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,21 +221,35 @@ U-Universal = λ _ → _
221221
⊥⇒¬≬ P⊥Q = P⊥Q ∘ Product.proj₂
222222

223223
------------------------------------------------------------------------
224-
-- Adjoint properties for change-of-base
224+
-- Properties of adjoints to update: functoriality and adjointness
225+
226+
module _ {P : Pred B ℓ₁} {Q : Pred B ℓ₂} where
227+
228+
_map-⊢_ : (f : A B) P ⊆ Q f ⊢ P ⊆ f ⊢ Q
229+
f map-⊢ P⊆Q = P⊆Q
230+
231+
module _ {P : Pred A ℓ₁} {Q : Pred A ℓ₂} (f : A B) where
232+
233+
map-⟨_⟩⊢_ : P ⊆ Q ⟨ f ⟩⊢ P ⊆ ⟨ f ⟩⊢ Q
234+
map-⟨_⟩⊢_ P⊆Q (_ , refl , Px) = (_ , refl , P⊆Q Px)
235+
236+
map-[_]⊢_ : P ⊆ Q [ f ]⊢ P ⊆ [ f ]⊢ Q
237+
map-[_]⊢_ P⊆Q Px refl = P⊆Q (Px refl)
225238

226239
module _ {P : Pred A ℓ₁} {Q : Pred B ℓ₂} (f : A B) where
227240

228-
⟨_⟩⊢ˡ : ⟨ f ⟩⊢ P ⊆ Q P ⊆ f ⊢ Q
229-
⟨_⟩⊢ˡ ⟨f⟩⊢P⊆Q Px = ⟨f⟩⊢P⊆Q (_ , refl , Px)
241+
⟨_⟩⊢⁻_ : ⟨ f ⟩⊢ P ⊆ Q P ⊆ f ⊢ Q
242+
⟨_⟩⊢⁻_ ⟨f⟩⊢P⊆Q Px = ⟨f⟩⊢P⊆Q (_ , refl , Px)
243+
244+
⟨_⟩⊢⁺_ : P ⊆ f ⊢ Q ⟨ f ⟩⊢ P ⊆ Q
245+
⟨_⟩⊢⁺_ P⊆f⊢Q (_ , refl , Px) = P⊆f⊢Q Px
230246

231-
⟨_⟩⊢ʳ : Pf ⊢ Q ⟨ f ⟩⊢ PQ
232-
⟨_⟩⊢ʳ P⊆f⊢Q (x , refl , Px) = P⊆f⊢Q Px
247+
[_]⊢⁻_ : Q[ f ]⊢ P f ⊢ QP
248+
[_]⊢⁻_ Q⊆[f]⊢P Qfx = Q⊆[f]⊢P Qfx refl
233249

234-
[_]⊢ˡ : Q ⊆ [ f ]⊢ P f ⊢ Q ⊆ P
235-
[_]⊢ˡ Q⊆[f]⊢P Qfx = Q⊆[f]⊢P Qfx refl
250+
[_]⊢⁺_ : f ⊢ Q ⊆ P Q ⊆ [ f ]⊢ P
251+
[_]⊢⁺_ f⊢Q⊆P Qfx refl = f⊢Q⊆P Qfx
236252

237-
[_]⊢ʳ : f ⊢ Q ⊆ P Q ⊆ [ f ]⊢ P
238-
[_]⊢ʳ f⊢Q⊆P Qfx refl = f⊢Q⊆P Qfx
239253

240254
------------------------------------------------------------------------
241255
-- Decidability properties

0 commit comments

Comments
 (0)