view comparison-em.agda @ 122:f8fbd5ecec97

no yellow on em-category
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 02 Aug 2013 08:21:32 +0900 (2013-08-01)
parents 324511654f23
children 44c58c27d12d
line wrap: on
line source
-- -- -- -- -- -- -- -- 
--  Comparison Functor of  Eilenberg-Moore  Category
--  defines U^K and F^K as a resolution of Monad
--  checks Adjointness
-- 
--   Shinji KONO <kono@ie.u-ryukyu.ac.jp>
-- -- -- -- -- -- -- -- 

open import Category -- https://github.com/konn/category-agda                                                                                     
open import Level
--open import Category.HomReasoning                                                                                                               
open import HomReasoning
open import cat-utility
open import Category.Cat
open import Relation.Binary.Core

module comparison-em 
      { c₁ c₂ ℓ : Level} { A : Category c₁ c₂ ℓ }
                 { T : Functor A A }
                 { η : NTrans A A identityFunctor T }
                 { μ : NTrans A A (T ○ T) T }
                 { M' : Monad A T η μ }
      {c₁' c₂' ℓ' : Level} ( B : Category c₁' c₂' ℓ' ) 
      { U^K : Functor B A } { F^K : Functor A B }
      { η^K : NTrans A A identityFunctor ( U^K ○ F^K ) }
      { ε^K : NTrans B B ( F^K ○ U^K ) identityFunctor } 
      { μ^K : NTrans A A (( U^K ○ F^K ) ○ ( U^K ○ F^K )) ( U^K ○ F^K ) }
      ( Adj^K : Adjunction A B U^K F^K η^K ε^K )
      ( RK : MResolution A B T U^K F^K {η^K} {ε^K} {μ^K} Adj^K )
where

open import adj-monad

T^K = U^K ○ F^K

M : Monad A (U^K ○ F^K ) η^K μ^K 
M =  Adj2Monad A B {U^K} {F^K} {η^K} {ε^K} Adj^K

open import em-category {c₁} {c₂} {ℓ} {A} { U^K ○ F^K } { η^K } { μ^K } { M } 

open Functor
open NTrans
open Adjunction
open MResolution
open Eilenberg-Moore-Hom

emkobj : Obj B -> EMObj
emkobj b = record { 
     a = FObj U^K b ; phi = A [ FMap U^K o TMap ε^K b ] ; isAlgebra = record { identity = identity1; eval = eval1 }
  } where
      identity1 : ?
      identity1 = ?
      eval1 : ?
      eval1 = ?

emkmap : {a b : Obj B} (f : Hom B a b) -> EMHom (emkobj a) (emkobj b)
emkmap {a} {b} f = record { EMap = FMap U^K f ; homomorphism = homomorphism1 
  } where
      homomorphism1 : ?
      homomorphism1 = ?

K^T : Functor B Eilenberg-MooreCategory 
K^T = record {
          FObj = emkobj
        ; FMap = emkmap
        ; isFunctor = record
        {      ≈-cong   = ≈-cong
             ; identity = identity
             ; distr    = distr1
        }
     }  where
         identity : {a : Obj A} →  B [ emkmap (EM-id {a}) ≈ id1 B (FObj F^K a) ]
         identity {a} = let open ≈-Reasoning (B) in
           begin
               emkmap (EM-id {a})
           ≈⟨ ? ⟩
              id1 B (FObj F^K a)

         ≈-cong : {a b : Obj A} -> {f g : EMHom a b} → A [ EMap f ≈ EMap g ] → B [ emkmap f ≈ emkmap g ]
         ≈-cong {a} {b} {f} {g} f≈g = let open ≈-Reasoning (B) in
           begin
               emkmap f
           ≈⟨ ? ⟩
               emkmap g

         distr1 :  {a b c : Obj A} {f : EMHom a b} {g : EMHom b c} → B [ emkmap (g ∙ f) ≈ (B [ emkmap g o emkmap f ] )]
         distr1 {a} {b} {c} {f} {g} = let open ≈-Reasoning (B) in
           begin
              emkmap (g ∙ f)
           ≈⟨ ? ⟩
              emkmap g o emkmap f