-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #347 from agda/BaseChange
Cleaning up Slice Functor and surrounding infrastructure
- Loading branch information
Showing
5 changed files
with
117 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{-# OPTIONS --without-K --safe #-} | ||
|
||
open import Categories.Category using (Category) | ||
|
||
module Categories.Adjoint.Instance.BaseChange {o ℓ e} (C : Category o ℓ e) where | ||
|
||
open import Categories.Adjoint using (_⊣_) | ||
open import Categories.Adjoint.Compose using (_∘⊣_) | ||
open import Categories.Adjoint.Instance.Slice using (Forgetful⊣Free) | ||
open import Categories.Category.Slice C using (Slice) | ||
open import Categories.Category.Slice.Properties C using (pullback⇒product; slice-slice≃slice) | ||
open import Categories.Category.Equivalence.Properties using (module C≅D) | ||
open import Categories.Diagram.Pullback C using (Pullback) | ||
open import Categories.Functor.Slice.BaseChange C using (BaseChange!; BaseChange*) | ||
|
||
open Category C | ||
|
||
module _ {A B : Obj} (f : B ⇒ A) (pullback : ∀ {C} {h : C ⇒ A} → Pullback f h) where | ||
|
||
!⊣* : BaseChange! f ⊣ BaseChange* f pullback | ||
!⊣* = C≅D.L⊣R (slice-slice≃slice f) ∘⊣ Forgetful⊣Free (Slice A) (pullback⇒product pullback) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{-# OPTIONS --safe --without-K #-} | ||
|
||
open import Categories.Category using (Category) | ||
|
||
module Categories.Adjoint.Instance.Slice {o ℓ e} (C : Category o ℓ e) where | ||
|
||
open import Categories.Adjoint using (_⊣_) | ||
open import Categories.Category.Slice C using (SliceObj; Slice⇒; slicearr) | ||
open import Categories.Functor.Slice C using (Forgetful; Free) | ||
open import Categories.NaturalTransformation using (ntHelper) | ||
open import Categories.Object.Product C | ||
|
||
open Category C | ||
open HomReasoning | ||
|
||
open SliceObj | ||
open Slice⇒ | ||
|
||
module _ {A : Obj} (product : ∀ {X} → Product A X) where | ||
|
||
private | ||
module product {X} = Product (product {X}) | ||
open product | ||
|
||
Forgetful⊣Free : Forgetful ⊣ Free product | ||
Forgetful⊣Free = record | ||
{ unit = ntHelper record | ||
{ η = λ _ → slicearr project₁ | ||
; commute = λ {X} {Y} f → begin | ||
⟨ arr Y , id ⟩ ∘ h f ≈⟨ ∘-distribʳ-⟨⟩ ⟩ | ||
⟨ arr Y ∘ h f , id ∘ h f ⟩ ≈⟨ ⟨⟩-cong₂ (△ f) identityˡ ⟩ | ||
⟨ arr X , h f ⟩ ≈˘⟨ ⟨⟩-cong₂ identityˡ identityʳ ⟩ | ||
⟨ id ∘ arr X , h f ∘ id ⟩ ≈˘⟨ [ product ⇒ product ]×∘⟨⟩ ⟩ | ||
[ product ⇒ product ] id × h f ∘ ⟨ arr X , id ⟩ ∎ | ||
} | ||
; counit = ntHelper record | ||
{ η = λ _ → π₂ | ||
; commute = λ _ → project₂ | ||
} | ||
; zig = project₂ | ||
; zag = begin | ||
[ product ⇒ product ]id× π₂ ∘ ⟨ π₁ , id ⟩ ≈⟨ [ product ⇒ product ]×∘⟨⟩ ⟩ | ||
⟨ id ∘ π₁ , π₂ ∘ id ⟩ ≈⟨ ⟨⟩-cong₂ identityˡ identityʳ ⟩ | ||
⟨ π₁ , π₂ ⟩ ≈⟨ η ⟩ | ||
id ∎ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{-# OPTIONS --without-K --safe #-} | ||
|
||
open import Categories.Category using (Category) | ||
|
||
module Categories.Functor.Slice.BaseChange {o ℓ e} (C : Category o ℓ e) where | ||
|
||
open import Categories.Category.Slice C using (Slice) | ||
open import Categories.Category.Slice.Properties C using (pullback⇒product; slice-slice⇒slice; slice⇒slice-slice) | ||
open import Categories.Functor using (Functor; _∘F_) | ||
open import Categories.Functor.Slice using (Forgetful; Free) | ||
open import Categories.Diagram.Pullback C using (Pullback) | ||
|
||
open Category C | ||
|
||
module _ {A B : Obj} (f : B ⇒ A) where | ||
|
||
-- Any morphism induces a functor between slices. | ||
BaseChange! : Functor (Slice B) (Slice A) | ||
BaseChange! = Forgetful (Slice A) ∘F slice⇒slice-slice f | ||
|
||
-- Any morphism which admits pullbacks induces a functor the other way between slices. | ||
-- This is adjoint to BaseChange!: see Categories.Adjoint.Instance.BaseChange. | ||
BaseChange* : (∀ {C} {h : C ⇒ A} → Pullback f h) → Functor (Slice A) (Slice B) | ||
BaseChange* pullback = slice-slice⇒slice f ∘F Free (Slice A) (pullback⇒product pullback) |