Skip to content
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

Create Adjunctions.agda #326

Draft
wants to merge 46 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
1806521
Create Adjunctions.agda
Nov 30, 2021
c6f1d21
whoops, file was in the wrong place
Nov 30, 2021
4f12528
stub one thing at a time...
Nov 30, 2021
5973e7f
little progress
Nov 30, 2021
f755c48
Finish Split category definition
iwilare Dec 1, 2021
5700870
def of kleisli-object
Dec 1, 2021
fa0b87c
revert to 1.7
Dec 2, 2021
f1bc8e7
progress
Dec 2, 2021
a0b6dba
proof of Kl-initial
Dec 2, 2021
59d6ef6
cose
Dec 2, 2021
b9f877c
Clean modules and definitions
iwilare Dec 2, 2021
f6168a8
lazily think about it
Dec 9, 2021
fd94bd7
revert agda-lib to 1.7
Dec 9, 2021
38c00aa
a blind, automatic commit
Jan 14, 2022
44603fc
Add μ-eq, move to Adjunction.Properties, fill some definitions
iwilare May 29, 2022
1166118
Refactor with simpler names
iwilare Jul 23, 2022
f1ad63f
Simplify homomorphism, refactor into lemma on adjunction
iwilare Aug 6, 2022
0439ad0
Complete homomorphism for bang
iwilare Aug 18, 2022
f876929
Progress on initiality of Kleisli
iwilare Aug 19, 2022
a23a132
WIP
iwilare Jan 2, 2023
f731926
gnagna
Jan 3, 2023
30aad51
WIP with μ-comp
iwilare Jan 3, 2023
4b25a8b
Minima
iwilare Jan 9, 2023
ac22091
aloora
Jan 9, 2023
d9f6b10
pulizia
Jan 9, 2023
260272d
underscore
Jan 9, 2023
0c9a245
ostia
Jan 9, 2023
f13489a
nomi di mucomp
Jan 9, 2023
399992c
un mucomp fatto
Jan 9, 2023
6926096
underscores
Jan 9, 2023
c25e87b
qualcosa fatto
Jan 9, 2023
baec081
removed ids
Jan 9, 2023
4543667
swoosh
Jan 9, 2023
b4972e3
simplify mucomp ids
Jan 10, 2023
3902c5b
smol steps
Jan 10, 2023
42cebd6
mucomp fatto
Jan 10, 2023
09b1dda
typechecka fin qui
Jan 10, 2023
3c1a416
KL-initial
Jan 10, 2023
72e3bea
remove push of pippo
Jan 10, 2023
a576da1
just a comp from the end
Jan 10, 2023
d2cf221
Minima
iwilare Jan 10, 2023
27dd32d
smol homomorphism
Jan 11, 2023
7712bb5
Style fixes
iwilare Jan 11, 2023
20c26f8
Make terms explicit
iwilare Jan 11, 2023
e963814
Revert Categories.Tactic.Category
iwilare Jan 11, 2023
3cee6a1
Small progress on mu-comp
iwilare Jan 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agda-categories.agda-lib
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: agda-categories
depend: standard-library-1.7
depend: standard-library-1.7.1
include: src/
176 changes: 176 additions & 0 deletions src/Categories/Adjoint/Construction/Adjunctions.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
{-# OPTIONS --without-K --allow-unsolved-metas #-}

open import Level
open import Categories.Category.Core using (Category)
open import Categories.Category
open import Categories.Monad

module Categories.Adjoint.Construction.Adjunctions {o ℓ e} {C : Category o ℓ e} (M : Monad C) where

private
module C = Category C
module M = Monad M
open C

open import Categories.Adjoint
open import Categories.Functor
open import Categories.Morphism hiding (_≅_)
open import Categories.Functor.Properties
open import Categories.NaturalTransformation.Core
open import Categories.NaturalTransformation.NaturalIsomorphism
open import Categories.NaturalTransformation.Equivalence renaming (_≃_ to _≅_)
open import Categories.Morphism.Reasoning as MR
open import Categories.Tactic.Category

-- the category of adjunctions splitting a given monad
record SplitObj : Set (suc o ⊔ suc ℓ ⊔ suc e) where
constructor splitobj
field
D : Category o ℓ e
F : Functor C D
G : Functor D C
adj : F ⊣ G
GF≃M : G ∘F F ≃ M.F

module D = Category D
module F = Functor F
module G = Functor G
module adj = Adjoint adj
module GF≃M = NaturalIsomorphism GF≃M

field
η-eq : ∀ {A} → GF≃M.⇐.η _ ∘ M.η.η A ≈ adj.unit.η _
μ-eq : ∀ {A} → GF≃M.⇐.η _ ∘ M.μ.η A ≈ G.₁ (adj.counit.η (F.₀ A)) ∘ GF≃M.⇐.η _ ∘ M.F.F₁ (GF≃M.⇐.η A)

{-
η-eq:
adj.unit.η A
A ------------------+
M.η.η A | |
v v
MA --------------> GFA
GF≃M.⇐.η A

μ-eq:
GF≃M.⇐.η G.F₁ (F.F₁ (GF≃M.⇐.η))
---------------------> GFMA -------------------->
MMA ---------------------> MGFA --------------------> GFGFA
| M.F.F₁ (GF≃M.⇐.η A) GF≃M.⇐.η |
| |
| M.μ A | G.₁ (adj.counit.η (F.₀ A))
v v
MA -------------------------------------------------> GFA
GF≃M.⇐.η A
-}

record Split⇒ (X Y : SplitObj) : Set (suc o ⊔ suc ℓ ⊔ suc e) where
constructor split⇒
private
module X = SplitObj X
module Y = SplitObj Y

field
H : Functor X.D Y.D
Γ : H ∘F X.F ≃ Y.F

module Γ = NaturalIsomorphism Γ
module H = Functor H

field
μ-comp : ∀ {x : Obj} →
Y.GF≃M.⇐.η x ≈ Y.G.F₁ (Γ.⇒.η x)
∘ ((Y.G.F₁ (Functor.F₁ H (X.adj.counit.η (X.F.F₀ x))))
∘ Y.G.F₁ (Γ.⇐.η (X.G.F₀ (X.F.F₀ x)))
∘ Y.adj.unit.η (X.G.F₀ (X.F.F₀ x)))
∘ X.GF≃M.⇐.η x

Split : Category _ _ _
Split = record
{ Obj = SplitObj
; _⇒_ = Split⇒
; _≈_ = λ U V → Split⇒.H U ≃ Split⇒.H V
; id = split-id
; _∘_ = comp
; assoc = λ { {f = f} {g = g} {h = h} → associator (Split⇒.H f) (Split⇒.H g) (Split⇒.H h) }
; sym-assoc = λ { {f = f} {g = g} {h = h} → sym-associator (Split⇒.H f) (Split⇒.H g) (Split⇒.H h) }
; identityˡ = unitorˡ
; identityʳ = unitorʳ
; identity² = unitor²
; equiv = record { refl = refl ; sym = sym ; trans = trans }
; ∘-resp-≈ = _ⓘₕ_
}
where
open NaturalTransformation
split-id : {A : SplitObj} → Split⇒ A A
split-id {A} = record
{ H = Categories.Functor.id
; Γ = unitorˡ
; μ-comp = λ { {x} →
Equiv.sym(begin _ ≈⟨ elimˡ C (Functor.identity A.G) ⟩
_ ≈⟨ (refl⟩∘⟨ elimˡ C (Functor.identity A.G)) ⟩∘⟨refl ⟩
_ ≈⟨ elimˡ C A.adj.zag ⟩
_ ∎)}
} where module A = SplitObj A
open C
open C.HomReasoning
comp : {A B X : SplitObj} → Split⇒ B X → Split⇒ A B → Split⇒ A X
comp {A = A} {B = B} {X = X} (split⇒ Hᵤ Γᵤ Aμ-comp) (split⇒ Hᵥ Γᵥ Bμ-comp) = record
{ H = Hᵤ ∘F Hᵥ
; Γ = Γᵤ ⓘᵥ (Hᵤ ⓘˡ Γᵥ) ⓘᵥ associator (SplitObj.F A) Hᵥ Hᵤ
; μ-comp = λ { {x} →
Equiv.sym (begin {! !} ≈⟨ (X.G.F-resp-≈ (X.D.HomReasoning.refl⟩∘⟨ X.D.identityʳ) ⟩∘⟨refl) ⟩
{! !} ≈⟨ (refl⟩∘⟨ ((refl⟩∘⟨ (X.G.F-resp-≈ (X.D.identityˡ X.D.HomReasoning.⟩∘⟨refl) ⟩∘⟨refl)) ⟩∘⟨refl)) ⟩
{! !} ≈⟨ pushˡ C X.G.homomorphism ⟩
{! !} ≈⟨ (refl⟩∘⟨ refl⟩∘⟨ assoc) ⟩
{! !} ≈⟨ (refl⟩∘⟨ refl⟩∘⟨ (refl⟩∘⟨ ((X.G.homomorphism ⟩∘⟨refl) ⟩∘⟨refl))) ⟩
{! !} ≈⟨ (refl⟩∘⟨ refl⟩∘⟨ refl⟩∘⟨ (assoc ○ assoc)) ⟩
{! !} ≈⟨ (refl⟩∘⟨ refl⟩∘⟨ refl⟩∘⟨ refl⟩∘⟨ refl⟩∘⟨ X.adj.unit.commute _) ⟩
{! !} ≈⟨ (refl⟩∘⟨ refl⟩∘⟨ refl⟩∘⟨ (refl⟩∘⟨ extendʳ C (Equiv.sym X.G.homomorphism ○ X.G.F-resp-≈ (Γᵤ.⇐.commute _) ○ X.G.homomorphism))) ⟩
{! !} ≈⟨ (refl⟩∘⟨ refl⟩∘⟨ refl⟩∘⟨ (extendʳ C (Equiv.sym (Functor.homomorphism (X.G ∘F Hᵤ)) ○ Functor.F-resp-≈ ((X.G ∘F Hᵤ)) (Γᵥ.⇐.commute _) ○ Functor.homomorphism ((X.G ∘F Hᵤ))))) ⟩
{! !} ≈⟨ {! !} ⟩
{! !} ≈⟨ {! !} ⟩
{! !} ≈⟨ {! !} ⟩

{! !} ≈⟨ (refl⟩∘⟨ refl⟩∘⟨ Equiv.sym Bμ-comp) ⟩
{! !} ≈⟨ Equiv.sym Aμ-comp ⟩
{! !} ∎) }
{-
Equiv.sym X.G.homomorphism ○ X.G.F-resp-≈ (Γᵤ.⇐.commute _) ○ X.G.homomorphism
-}


{-
Have

X.G.F₁ (Γᵤ.⇒.η x) ∘
X.G.F₁ (Hᵤ.F₁ (Γᵥ.⇒.η x)) ∘
X.G.F₁ (Hᵤ.F₁ (Hᵥ.F₁ (A.adj.counit.η (A.F.F₀ x)))) ∘
(X.G.F₁
(Hᵤ.F₁ (Γᵥ.⇐.η (A.G.F₀ (A.F.F₀ x))) X.D.∘
Γᵤ.⇐.η (A.G.F₀ (A.F.F₀ x)))
∘ X.adj.unit.η (A.G.F₀ (A.F.F₀ x)))
∘ A.GF≃M.⇐.η x

Goal

X.G.F₁ (Γᵤ.⇒.η x) ∘
(X.G.F₁ (Hᵤ.F₁ (B.adj.counit.η (B.F.F₀ x))) ∘
X.G.F₁ (Γᵤ.⇐.η (B.G.F₀ (B.F.F₀ x))) ∘
X.adj.unit.η (B.G.F₀ (B.F.F₀ x)))
B.G.F₁ (Γᵥ.⇒.η x) ∘
(B.G.F₁ (Hᵥ.F₁ (A.adj.counit.η (A.F.F₀ x))) ∘
B.G.F₁ (Γᵥ.⇐.η (A.G.F₀ (A.F.F₀ x))) ∘
B.adj.unit.η (A.G.F₀ (A.F.F₀ x)))
∘ A.GF≃M.⇐.η x
-}
} where
module A = SplitObj A
module B = SplitObj B
module X = SplitObj X
open C
open C.HomReasoning
module Hᵤ = Functor Hᵤ
module Hᵥ = Functor Hᵥ
module Γᵤ = NaturalIsomorphism Γᵤ
module Γᵥ = NaturalIsomorphism Γᵥ
Loading