Compare commits
7
Commits
c040ccadcd
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1edc14d2bd | ||
|
|
fc605de0a6 | ||
|
|
3e2ea54030 | ||
|
|
d2557b6967 | ||
|
|
19d2e98ef0 | ||
|
|
a0a743ac71 | ||
|
|
19141b121b |
@@ -0,0 +1,2 @@
|
||||
*.agdai
|
||||
*~
|
||||
@@ -4,12 +4,19 @@ module Categories.Category.Instance.Thinnings where
|
||||
|
||||
open import Categories.Category.Core
|
||||
open import Categories.Category.Helper
|
||||
open import Data.List.Base using (List)
|
||||
open import Categories.Object.Initial
|
||||
open import Data.List.Base using (List; [])
|
||||
open import Level using (Level)
|
||||
open import Relation.Binary.PropositionalEquality
|
||||
|
||||
open import Thinning
|
||||
open import Thinning.Properties
|
||||
|
||||
private
|
||||
variable
|
||||
a : Level
|
||||
A : Set a
|
||||
|
||||
Thinnings : ∀ {a} (A : Set a) → Category a a a
|
||||
Thinnings A = categoryHelper record
|
||||
{ Obj = List A
|
||||
@@ -23,3 +30,9 @@ Thinnings A = categoryHelper record
|
||||
; equiv = isEquivalence
|
||||
; ∘-resp-≈ = cong₂ _∘_
|
||||
}
|
||||
|
||||
[]-isInitial : IsInitial (Thinnings A) []
|
||||
[]-isInitial = record { !-unique = ¡-unique }
|
||||
|
||||
initial : Initial (Thinnings A)
|
||||
initial = record { ⊥-is-initial = []-isInitial }
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
{-# OPTIONS --safe --without-K #-}
|
||||
|
||||
module Categories.Category.Instance.Thinnings.Properties where
|
||||
|
||||
open import Categories.Category.Instance.Thinnings
|
||||
open import Categories.Category.Slice
|
||||
open import Data.List.Base
|
||||
open import Level
|
||||
open import Relation.Binary.PropositionalEquality
|
||||
|
||||
open import Thinning.Triangle
|
||||
|
||||
private
|
||||
variable
|
||||
a : Level
|
||||
A : Set a
|
||||
zs : List A
|
||||
|
||||
module _ where
|
||||
|
||||
open SliceObj
|
||||
open Slice⇒
|
||||
|
||||
-- Morphisms between two objects in a slice category over thinnings are unique!
|
||||
-- We prove this using triangles.
|
||||
Slice⇒-unique : ∀ {θ φ : SliceObj (Thinnings A) zs} (f g : Slice⇒ (Thinnings A) θ φ) → h f ≡ h g
|
||||
Slice⇒-unique {zs = zs} {θ = θ} {φ = φ} (slicearr {h = hf} ▲) (slicearr {h = hg} △) = triangleUnique ▴ ▵
|
||||
where
|
||||
▴ : Triangle _ (arr φ) hf (arr θ)
|
||||
▴ = subst (Triangle _ _ _) ▲ (arr φ ⊚ hf)
|
||||
|
||||
▵ : Triangle _ (arr φ) hg (arr θ)
|
||||
▵ = subst (Triangle _ _ _) △ (arr φ ⊚ hg)
|
||||
@@ -45,3 +45,9 @@ end ∘ end = end
|
||||
include α ∘ include β = include (α ∘ β)
|
||||
include α ∘ exclude β = exclude (α ∘ β)
|
||||
exclude α ∘ β = exclude (α ∘ β)
|
||||
|
||||
-- There is always a Thinning from the empty list to any list. Here we exclude
|
||||
-- at every step.
|
||||
¡ : Thinning A [] xs
|
||||
¡ {xs = []} = end
|
||||
¡ {xs = x ∷ xs} = exclude ¡
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
module Thinning.Properties where
|
||||
|
||||
open import Data.List.Base using (List)
|
||||
open import Data.List.Base using (List; [])
|
||||
open import Level using (Level)
|
||||
open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong)
|
||||
|
||||
@@ -48,3 +48,8 @@ assoc (exclude θ) (include φ) (include ψ) = cong exclude (assoc θ φ ψ)
|
||||
assoc (exclude θ) (include φ) (exclude ψ) = cong exclude (assoc (exclude θ) (include φ) ψ)
|
||||
assoc (exclude θ) (exclude φ) (include ψ) = cong exclude (assoc (exclude θ) φ ψ)
|
||||
assoc (exclude θ) (exclude φ) (exclude ψ) = cong exclude (assoc (exclude θ) (exclude φ) ψ)
|
||||
|
||||
-- ¡ is the only Thinning from []
|
||||
¡-unique : (θ : Thinning A [] xs) → ¡ ≡ θ
|
||||
¡-unique end = refl
|
||||
¡-unique (exclude θ) = cong exclude (¡-unique θ)
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
{-# OPTIONS --safe --without-K #-}
|
||||
|
||||
module Thinning.Triangle where
|
||||
|
||||
open import Level
|
||||
open import Data.List.Base
|
||||
open import Relation.Binary.PropositionalEquality
|
||||
|
||||
open import Thinning
|
||||
|
||||
private
|
||||
variable
|
||||
a : Level
|
||||
A : Set a
|
||||
x : A
|
||||
xs ys zs : List A
|
||||
θ φ φ′ ψ : Thinning A xs ys
|
||||
|
||||
-- Thinning triangles
|
||||
------------------------------------------------------------------------
|
||||
|
||||
-- These are a sort of inductive view of "φ ∘ θ ≡ ψ" that's much easier to work
|
||||
-- with than a more direct definition. This helps a lot when working with slice
|
||||
-- categories!
|
||||
|
||||
-- I choose the order of arguments to match composition order. The names are by
|
||||
-- the second argument, with "occlude" as another word that rhymes. Any aptitude
|
||||
-- is purely accidental.
|
||||
|
||||
data Triangle (A : Set a) : Thinning A ys zs → Thinning A xs ys → Thinning A xs zs → Set a where
|
||||
end : Triangle A end end end
|
||||
include : Triangle A θ φ ψ → Triangle A (include {x = x} θ) (include φ) (include ψ)
|
||||
occlude : Triangle A θ φ ψ → Triangle A (exclude {x = x} θ) φ (exclude ψ)
|
||||
exclude : Triangle A θ φ ψ → Triangle A (include {x = x} θ) (exclude φ) (exclude ψ)
|
||||
|
||||
-- We can construct a triangle by composition
|
||||
_⊚_ : (θ : Thinning A ys zs) (φ : Thinning A xs ys) → Triangle A θ φ (θ ∘ φ)
|
||||
end ⊚ end = end
|
||||
include θ ⊚ include φ = include (θ ⊚ φ)
|
||||
include θ ⊚ exclude φ = exclude (θ ⊚ φ)
|
||||
exclude θ ⊚ φ = occlude (θ ⊚ φ)
|
||||
|
||||
-- We can deconstruct a triangle into a proof of equality to the composition
|
||||
untriangle : Triangle A θ φ ψ → θ ∘ φ ≡ ψ
|
||||
untriangle end = refl
|
||||
untriangle (include ▴) = cong include (untriangle ▴)
|
||||
untriangle (occlude ▴) = cong exclude (untriangle ▴)
|
||||
untriangle (exclude ▴) = cong exclude (untriangle ▴)
|
||||
|
||||
-- If we have two triangles with common edges, the third edge must also be equal
|
||||
triangleUnique : Triangle A θ φ ψ → Triangle A θ φ′ ψ → φ ≡ φ′
|
||||
triangleUnique end end = refl
|
||||
triangleUnique (include ▴) (include ▵) = cong include (triangleUnique ▴ ▵)
|
||||
triangleUnique (occlude ▴) (occlude ▵) = triangleUnique ▴ ▵
|
||||
triangleUnique (exclude ▴) (exclude ▵) = cong exclude (triangleUnique ▴ ▵)
|
||||
Reference in New Issue
Block a user