-
Notifications
You must be signed in to change notification settings - Fork 85
introduce total categories #535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f96567c
introduce total categories
4e554c4c 2b18eff
address review comments
4e554c4c c4d60b7
small fixes
4e554c4c d2228a4
fixup
4e554c4c e0e329f
address review comments
4e554c4c 2ee1ec0
chore: address amy comments
4e554c4c 2251074
chore: style
4e554c4c 3694303
chore: more style
plt-amy ef368fe
fixup
plt-amy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,44 @@ | ||
| <!-- | ||
| ```agda | ||
| open import Cat.Diagram.Limit.Initial | ||
| open import Cat.Diagram.Colimit.Base | ||
| open import Cat.Diagram.Limit.Base | ||
| open import Cat.Diagram.Terminal | ||
| open import Cat.Diagram.Duals | ||
| open import Cat.Morphism | ||
| open import Cat.Prelude | ||
|
|
||
| import Cat.Reasoning as Cat | ||
|
|
||
| open make-is-colimit | ||
| open Terminal | ||
| ``` | ||
| --> | ||
|
|
||
| ```agda | ||
| module Cat.Diagram.Colimit.Terminal {o ℓ} {C : Precategory o ℓ} where | ||
| ``` | ||
|
|
||
| # Terminal objects as colimits | ||
|
|
||
| This module provides a characterisation of [[terminal objects]] as | ||
| [[*colimits*]] rather than as [[limits]]. Namely, while an terminal | ||
| object is the limit of the empty diagram, it is the *co*limit of the | ||
| identity functor, considered as a diagram. | ||
|
|
||
| Proving this consists of reversing the arrows in the proof that | ||
| [[initial objects are limits]]. | ||
|
|
||
| ```agda | ||
| Id-colimit→Terminal : Colimit (Id {C = C}) → Terminal C | ||
| Id-colimit→Terminal L = Coinitial→terminal | ||
| $ Id-limit→Initial | ||
| $ natural-iso→limit (path→iso Id^op≡Id) | ||
| $ Colimit→Co-limit L | ||
|
|
||
| Terminal→Id-colimit : Terminal C → Colimit (Id {C = C}) | ||
| Terminal→Id-colimit terminal = Co-limit→Colimit | ||
| $ natural-iso→limit (path→iso (sym Id^op≡Id)) | ||
| $ Initial→Id-limit | ||
| $ Terminal→Coinitial terminal | ||
| ``` |
This file contains hidden or 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 hidden or 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 hidden or 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,108 @@ | ||
| <!-- | ||
| ```agda | ||
| open import Cat.Diagram.Product.Indexed | ||
| open import Cat.Diagram.Product.Power | ||
| open import Cat.Functor.Properties | ||
| open import Cat.Functor.Hom | ||
| open import Cat.Prelude | ||
|
|
||
| import Cat.Reasoning | ||
| import Cat.Morphism | ||
| ``` | ||
| --> | ||
|
|
||
| ```agda | ||
| module Cat.Diagram.Coseparator {o ℓ} (C : Precategory o ℓ) where | ||
| ``` | ||
|
|
||
| <!-- | ||
| ```agda | ||
| open Cat.Reasoning C | ||
| open _=>_ | ||
| ``` | ||
| --> | ||
| # Coseparating objects {defines="coseparating-object cogenerating-object coseparator"} | ||
|
|
||
|
|
||
| A coseparating (or cogenerating) object is formally the dual of a | ||
| [[separator]]. | ||
|
|
||
|
|
||
| ```agda | ||
| is-coseparator : Ob → Type _ | ||
| is-coseparator c = | ||
| ∀ {x y} {f g : Hom x y} | ||
| → (∀ (m : Hom y c) → m ∘ f ≡ m ∘ g) | ||
| → f ≡ g | ||
| ``` | ||
|
|
||
| Equivalently, an object $S$ is a coseparator if the hom functor $\cC(-,S)$ | ||
| is [[faithful]]. | ||
|
|
||
| ```agda | ||
| coseparator→faithful : ∀ {s} → is-coseparator s → is-faithful (よ₀ C s) | ||
| coseparator→faithful cos p = cos (happly p) | ||
|
|
||
| faithful→coseparator : ∀ {s} → is-faithful (よ₀ C s) → is-coseparator s | ||
| faithful→coseparator faithful p = faithful (ext p) | ||
| ``` | ||
|
|
||
| # Coseparating families {defines="coseparating-family"} | ||
|
|
||
| Likewise, a coseparating family is dual to a [[separating family]]. | ||
|
|
||
| ```agda | ||
| is-coseparating-family : ∀ {ℓi} {Idx : Type ℓi} → (Idx → Ob) → Type _ | ||
| is-coseparating-family s = | ||
| ∀ {x y} {f g : Hom x y} | ||
| → (∀ {i} (mᵢ : Hom y (s i)) → mᵢ ∘ f ≡ mᵢ ∘ g ) | ||
| → f ≡ g | ||
| ``` | ||
|
|
||
| ## Coseparators and powers | ||
|
|
||
| Equivalently to approximating objects with [[separators and copowers]], we | ||
| may approximate them with coseparators and powers. | ||
|
|
||
| ```agda | ||
| module _ (powers : (I : Set ℓ) → has-products-indexed-by C ∣ I ∣) where | ||
| open Powers powers | ||
|
|
||
| coseparator→mono | ||
| : ∀ {s x} → is-coseparator s → is-monic (⋔!.tuple (Hom x s) s λ f → f) | ||
| coseparator→mono {s} {x} cosep f g p = cosep λ m → | ||
| m ∘ f ≡⟨ pushl (sym $ ⋔!.commute _ _) ⟩ | ||
| ⋔!.π _ _ m ∘ (⋔!.tuple _ _ λ f → f) ∘ f ≡⟨ refl⟩∘⟨ p ⟩ | ||
| ⋔!.π _ _ m ∘ (⋔!.tuple _ _ λ f → f) ∘ g ≡⟨ pulll $ ⋔!.commute _ _ ⟩ | ||
| m ∘ g ∎ | ||
|
|
||
| mono→coseparator | ||
| : ∀ {s} → (∀ {x} → is-monic (⋔!.tuple (Hom x s) s λ f → f)) → is-coseparator s | ||
| mono→coseparator monic {f = f} {g = g} p = monic f g $ ⋔!.unique₂ _ _ λ m → | ||
| assoc _ _ _ ∙ p _ ∙ sym (assoc _ _ _) | ||
|
|
||
| coseparating-family→mono | ||
| : ∀ (Idx : Set ℓ) (sᵢ : ∣ Idx ∣ → Ob) | ||
| → is-coseparating-family sᵢ | ||
| → ∀ {x} → is-monic (∏!.tuple (Σ[ i ∈ ∣ Idx ∣ ] Hom x (sᵢ i)) (sᵢ ⊙ fst) snd ) | ||
| coseparating-family→mono Idx sᵢ cosep f g p = cosep λ {i} mᵢ → | ||
| mᵢ ∘ f ≡⟨ pushl (sym $ ∏!.commute _ _) ⟩ | ||
| ∏!.π _ _ (i , mᵢ) ∘ (∏!.tuple _ _ snd) ∘ f ≡⟨ refl⟩∘⟨ p ⟩ | ||
| ∏!.π _ _ (i , mᵢ) ∘ (∏!.tuple _ _ snd) ∘ g ≡⟨ pulll $ ∏!.commute _ _ ⟩ | ||
| mᵢ ∘ g ∎ | ||
|
|
||
| coseparating-family→make-mono | ||
| : ∀ (Idx : Set ℓ) (sᵢ : ∣ Idx ∣ → Ob) | ||
| → is-coseparating-family sᵢ | ||
| → ∀ {x} → x ↪ ∏!.ΠF (Σ[ i ∈ ∣ Idx ∣ ] Hom x (sᵢ i)) (sᵢ ⊙ fst) | ||
| coseparating-family→make-mono Idx sᵢ cosep = make-mono _ $ | ||
| coseparating-family→mono Idx sᵢ cosep | ||
|
|
||
| mono→coseparating-family | ||
| : ∀ (Idx : Set ℓ) | ||
| → (sᵢ : ∣ Idx ∣ → Ob) | ||
| → (∀ {x} → is-monic (∏!.tuple (Σ[ i ∈ ∣ Idx ∣ ] Hom x (sᵢ i)) (sᵢ ⊙ fst) snd)) | ||
| → is-coseparating-family sᵢ | ||
| mono→coseparating-family Idx sᵢ monic {f = f} {g = g} p = monic f g $ | ||
| ∏!.unique₂ _ _ λ (i , mᵢ) → assoc _ _ _ ∙ p _ ∙ sym (assoc _ _ _) | ||
| ``` | ||
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.