{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
module OAlg.Adjunction.Definition
(
Adjunction(..), unitr, unitl, adjl, adjr
, adjHomMlt, adjHomDst
, adjHomDisj
, adjMapCnt
, coAdjunctionOp
, prpAdjunction, prpAdjunctionRight, prpAdjunctionLeft
) where
import OAlg.Prelude
import OAlg.Structure.Oriented
import OAlg.Structure.Multiplicative
import OAlg.Structure.Distributive
import OAlg.Hom
data Adjunction h d c where
Adjunction
:: h c d
-> h d c
-> (Point c -> c)
-> (Point d -> d)
-> Adjunction h d c
unitr :: Adjunction h d c -> Point c -> c
unitr :: forall (h :: * -> * -> *) d c. Adjunction h d c -> Point c -> c
unitr (Adjunction h c d
_ h d c
_ Point c -> c
u Point d -> d
_) = Point c -> c
u
unitl :: Adjunction h d c -> Point d -> d
unitl :: forall (h :: * -> * -> *) d c. Adjunction h d c -> Point d -> d
unitl (Adjunction h c d
_ h d c
_ Point c -> c
_ Point d -> d
v) = Point d -> d
v
adjr :: Hom Mlt h => Adjunction h d c -> Point c -> d -> c
adjr :: forall (h :: * -> * -> *) d c.
Hom Mlt h =>
Adjunction h d c -> Point c -> d -> c
adjr adj :: Adjunction h d c
adj@(Adjunction h c d
_ h d c
r Point c -> c
_ Point d -> d
_) = Adjunction h d c -> Struct Mlt c -> Point c -> d -> c
forall (h :: * -> * -> *) d c.
Hom Mlt h =>
Adjunction h d c -> Struct Mlt c -> Point c -> d -> c
adjrStruct Adjunction h d c
adj (Struct (ObjectClass h) c -> Struct Mlt c
forall x. Struct (ObjectClass h) x -> Struct Mlt x
forall s t x. Transformable s t => Struct s x -> Struct t x
tau (h d c -> Struct (ObjectClass h) c
forall x y. h x y -> Struct (ObjectClass h) y
forall (m :: * -> * -> *) x y.
Morphism m =>
m x y -> Struct (ObjectClass m) y
range h d c
r)) where
adjrStruct :: Hom Mlt h
=> Adjunction h d c -> Struct Mlt c -> Point c -> d -> c
adjrStruct :: forall (h :: * -> * -> *) d c.
Hom Mlt h =>
Adjunction h d c -> Struct Mlt c -> Point c -> d -> c
adjrStruct (Adjunction h c d
_ h d c
r Point c -> c
u Point d -> d
_) Struct Mlt c
Struct Point c
x d
f = h d c -> d -> c
forall (h :: * -> * -> *) x y. Applicative h => h x y -> x -> y
amap h d c
r d
f c -> c -> c
forall c. Multiplicative c => c -> c -> c
* Point c -> c
u Point c
x
adjl :: Hom Mlt h => Adjunction h d c -> Point d -> c -> d
adjl :: forall (h :: * -> * -> *) d c.
Hom Mlt h =>
Adjunction h d c -> Point d -> c -> d
adjl adj :: Adjunction h d c
adj@(Adjunction h c d
l h d c
_ Point c -> c
_ Point d -> d
_) = Adjunction h d c -> Struct Mlt d -> Point d -> c -> d
forall (h :: * -> * -> *) d c.
Hom Mlt h =>
Adjunction h d c -> Struct Mlt d -> Point d -> c -> d
adjlStruct Adjunction h d c
adj (Struct (ObjectClass h) d -> Struct Mlt d
forall x. Struct (ObjectClass h) x -> Struct Mlt x
forall s t x. Transformable s t => Struct s x -> Struct t x
tau (h c d -> Struct (ObjectClass h) d
forall x y. h x y -> Struct (ObjectClass h) y
forall (m :: * -> * -> *) x y.
Morphism m =>
m x y -> Struct (ObjectClass m) y
range h c d
l)) where
adjlStruct :: Hom Mlt h
=> Adjunction h d c -> Struct Mlt d -> Point d -> c -> d
adjlStruct :: forall (h :: * -> * -> *) d c.
Hom Mlt h =>
Adjunction h d c -> Struct Mlt d -> Point d -> c -> d
adjlStruct (Adjunction h c d
l h d c
_ Point c -> c
_ Point d -> d
v) Struct Mlt d
Struct Point d
y c
f = Point d -> d
v Point d
y d -> d -> d
forall c. Multiplicative c => c -> c -> c
* h c d -> c -> d
forall (h :: * -> * -> *) x y. Applicative h => h x y -> x -> y
amap h c d
l c
f
adjHomMlt :: Hom Mlt h => Adjunction h d c -> Homomorphous Mlt d c
adjHomMlt :: forall (h :: * -> * -> *) d c.
Hom Mlt h =>
Adjunction h d c -> Homomorphous Mlt d c
adjHomMlt (Adjunction h c d
_ h d c
r Point c -> c
_ Point d -> d
_) = Homomorphous (ObjectClass h) d c -> Homomorphous Mlt d c
forall s t x y.
Transformable s t =>
Homomorphous s x y -> Homomorphous t x y
tauHom (h d c -> Homomorphous (ObjectClass h) d c
forall x y. h x y -> Homomorphous (ObjectClass h) x y
forall (m :: * -> * -> *) x y.
Morphism m =>
m x y -> Homomorphous (ObjectClass m) x y
homomorphous h d c
r)
adjHomDst :: HomDistributive h => Adjunction h d c -> Homomorphous Dst d c
adjHomDst :: forall (h :: * -> * -> *) d c.
HomDistributive h =>
Adjunction h d c -> Homomorphous Dst d c
adjHomDst (Adjunction h c d
_ h d c
r Point c -> c
_ Point d -> d
_) = Homomorphous (ObjectClass h) d c -> Homomorphous Dst d c
forall s t x y.
Transformable s t =>
Homomorphous s x y -> Homomorphous t x y
tauHom (h d c -> Homomorphous (ObjectClass h) d c
forall x y. h x y -> Homomorphous (ObjectClass h) x y
forall (m :: * -> * -> *) x y.
Morphism m =>
m x y -> Homomorphous (ObjectClass m) x y
homomorphous h d c
r)
adjHomDisj ::
( HomMultiplicative h
, Transformable (ObjectClass h) s
)
=> Adjunction h x y -> Adjunction (Variant2 Covariant (HomDisj s o h)) x y
adjHomDisj :: forall (h :: * -> * -> *) s x y (o :: * -> *).
(HomMultiplicative h, Transformable (ObjectClass h) s) =>
Adjunction h x y
-> Adjunction (Variant2 'Covariant (HomDisj s o h)) x y
adjHomDisj (Adjunction h y x
l h x y
r Point y -> y
u Point x -> x
v) = Variant2 'Covariant (HomDisj s o h) y x
-> Variant2 'Covariant (HomDisj s o h) x y
-> (Point y -> y)
-> (Point x -> x)
-> Adjunction (Variant2 'Covariant (HomDisj s o h)) x y
forall (h :: * -> * -> *) c d.
h c d
-> h d c -> (Point c -> c) -> (Point d -> d) -> Adjunction h d c
Adjunction (h y x -> Variant2 'Covariant (HomDisj s o h) y x
forall (h :: * -> * -> *) s x y (o :: * -> *).
(Morphism h, Transformable (ObjectClass h) s) =>
h x y -> Variant2 'Covariant (HomDisj s o h) x y
homDisj h y x
l) (h x y -> Variant2 'Covariant (HomDisj s o h) x y
forall (h :: * -> * -> *) s x y (o :: * -> *).
(Morphism h, Transformable (ObjectClass h) s) =>
h x y -> Variant2 'Covariant (HomDisj s o h) x y
homDisj h x y
r) Point y -> y
u Point x -> x
v
adjMapCnt :: FunctorialOriented h
=> Variant2 Contravariant (Inv2 h) x x'
-> Variant2 Contravariant (Inv2 h) y y'
-> Adjunction (Variant2 Covariant h) x y -> Adjunction (Variant2 Covariant h) y' x'
adjMapCnt :: forall (h :: * -> * -> *) x x' y y'.
FunctorialOriented h =>
Variant2 'Contravariant (Inv2 h) x x'
-> Variant2 'Contravariant (Inv2 h) y y'
-> Adjunction (Variant2 'Covariant h) x y
-> Adjunction (Variant2 'Covariant h) y' x'
adjMapCnt (Contravariant2 (Inv2 h x x'
tx h x' x
fx)) (Contravariant2 (Inv2 h y y'
ty h y' y
fy))
(Adjunction (Covariant2 h y x
l) (Covariant2 h x y
r) Point y -> y
u Point x -> x
v) = Variant2 'Covariant h x' y'
-> Variant2 'Covariant h y' x'
-> (Point x' -> x')
-> (Point y' -> y')
-> Adjunction (Variant2 'Covariant h) y' x'
forall (h :: * -> * -> *) c d.
h c d
-> h d c -> (Point c -> c) -> (Point d -> d) -> Adjunction h d c
Adjunction Variant2 'Covariant h x' y'
l' Variant2 'Covariant h y' x'
r' Point x' -> x'
u' Point y' -> y'
v' where
l' :: Variant2 'Covariant h x' y'
l' = h x' y' -> Variant2 'Covariant h x' y'
forall {k} {k1} (h :: k -> k1 -> *) (x :: k) (y :: k1).
h x y -> Variant2 'Covariant h x y
Covariant2 (h y y'
ty h y y' -> h x' y -> h x' y'
forall y z x. h y z -> h x y -> h x z
forall (c :: * -> * -> *) y z x.
Category c =>
c y z -> c x y -> c x z
. h x y
r h x y -> h x' x -> h x' y
forall y z x. h y z -> h x y -> h x z
forall (c :: * -> * -> *) y z x.
Category c =>
c y z -> c x y -> c x z
. h x' x
fx)
r' :: Variant2 'Covariant h y' x'
r' = h y' x' -> Variant2 'Covariant h y' x'
forall {k} {k1} (h :: k -> k1 -> *) (x :: k) (y :: k1).
h x y -> Variant2 'Covariant h x y
Covariant2 (h x x'
tx h x x' -> h y' x -> h y' x'
forall y z x. h y z -> h x y -> h x z
forall (c :: * -> * -> *) y z x.
Category c =>
c y z -> c x y -> c x z
. h y x
l h y x -> h y' y -> h y' x
forall y z x. h y z -> h x y -> h x z
forall (c :: * -> * -> *) y z x.
Category c =>
c y z -> c x y -> c x z
. h y' y
fy)
u' :: Point x' -> x'
u' = h x x' -> x -> x'
forall (h :: * -> * -> *) x y. Functorial h => h x y -> x -> y
amapf h x x'
tx (x -> x') -> (Point x' -> x) -> Point x' -> x'
forall y z x. (y -> z) -> (x -> y) -> x -> z
forall (c :: * -> * -> *) y z x.
Category c =>
c y z -> c x y -> c x z
. Point x -> x
v (Point x -> x) -> (Point x' -> Point x) -> Point x' -> x
forall y z x. (y -> z) -> (x -> y) -> x -> z
forall (c :: * -> * -> *) y z x.
Category c =>
c y z -> c x y -> c x z
. h x' x -> Point x' -> Point x
forall (h :: * -> * -> *) x y.
FunctorialPoint h =>
h x y -> Point x -> Point y
pmapf h x' x
fx
v' :: Point y' -> y'
v' = h y y' -> y -> y'
forall (h :: * -> * -> *) x y. Functorial h => h x y -> x -> y
amapf h y y'
ty (y -> y') -> (Point y' -> y) -> Point y' -> y'
forall y z x. (y -> z) -> (x -> y) -> x -> z
forall (c :: * -> * -> *) y z x.
Category c =>
c y z -> c x y -> c x z
. Point y -> y
u (Point y -> y) -> (Point y' -> Point y) -> Point y' -> y
forall y z x. (y -> z) -> (x -> y) -> x -> z
forall (c :: * -> * -> *) y z x.
Category c =>
c y z -> c x y -> c x z
. h y' y -> Point y' -> Point y
forall (h :: * -> * -> *) x y.
FunctorialPoint h =>
h x y -> Point x -> Point y
pmapf h y' y
fy
coAdjunctionStruct ::
( HomMultiplicative h
, Transformable (ObjectClass h) s
, TransformableGRefl o s
, DualisableMultiplicative s o
)
=> Homomorphous s x y
-> Adjunction h x y -> Adjunction (Variant2 Covariant (HomDisj s o h)) (o y) (o x)
coAdjunctionStruct :: forall (h :: * -> * -> *) s (o :: * -> *) x y.
(HomMultiplicative h, Transformable (ObjectClass h) s,
TransformableGRefl o s, DualisableMultiplicative s o) =>
Homomorphous s x y
-> Adjunction h x y
-> Adjunction (Variant2 'Covariant (HomDisj s o h)) (o y) (o x)
coAdjunctionStruct (Struct s x
sx:>:Struct s y
sy) Adjunction h x y
adj = Variant2 'Contravariant (Inv2 (HomDisj s o h)) x (o x)
-> Variant2 'Contravariant (Inv2 (HomDisj s o h)) y (o y)
-> Adjunction (Variant2 'Covariant (HomDisj s o h)) x y
-> Adjunction (Variant2 'Covariant (HomDisj s o h)) (o y) (o x)
forall (h :: * -> * -> *) x x' y y'.
FunctorialOriented h =>
Variant2 'Contravariant (Inv2 h) x x'
-> Variant2 'Contravariant (Inv2 h) y y'
-> Adjunction (Variant2 'Covariant h) x y
-> Adjunction (Variant2 'Covariant h) y' x'
adjMapCnt (Struct s x
-> Variant2 'Contravariant (Inv2 (HomDisj s o h)) x (o x)
forall (h :: * -> * -> *) (o :: * -> *) s x.
(Morphism h, TransformableGRefl o s) =>
Struct s x -> Variant2 'Contravariant (IsoHomDisj s o h) x (o x)
isoHomDisj Struct s x
sx) (Struct s y
-> Variant2 'Contravariant (Inv2 (HomDisj s o h)) y (o y)
forall (h :: * -> * -> *) (o :: * -> *) s x.
(Morphism h, TransformableGRefl o s) =>
Struct s x -> Variant2 'Contravariant (IsoHomDisj s o h) x (o x)
isoHomDisj Struct s y
sy) (Adjunction h x y
-> Adjunction (Variant2 'Covariant (HomDisj s o h)) x y
forall (h :: * -> * -> *) s x y (o :: * -> *).
(HomMultiplicative h, Transformable (ObjectClass h) s) =>
Adjunction h x y
-> Adjunction (Variant2 'Covariant (HomDisj s o h)) x y
adjHomDisj Adjunction h x y
adj)
coAdjunctionOp :: HomMultiplicative h
=> Adjunction h x y -> Adjunction (Variant2 Covariant (HomDisj Mlt Op h)) (Op y) (Op x)
coAdjunctionOp :: forall (h :: * -> * -> *) x y.
HomMultiplicative h =>
Adjunction h x y
-> Adjunction
(Variant2 'Covariant (HomDisj Mlt Op h)) (Op y) (Op x)
coAdjunctionOp Adjunction h x y
a = Homomorphous Mlt x y
-> Adjunction h x y
-> Adjunction
(Variant2 'Covariant (HomDisj Mlt Op h)) (Op y) (Op x)
forall (h :: * -> * -> *) s (o :: * -> *) x y.
(HomMultiplicative h, Transformable (ObjectClass h) s,
TransformableGRefl o s, DualisableMultiplicative s o) =>
Homomorphous s x y
-> Adjunction h x y
-> Adjunction (Variant2 'Covariant (HomDisj s o h)) (o y) (o x)
coAdjunctionStruct (Adjunction h x y -> Homomorphous Mlt x y
forall (h :: * -> * -> *) d c.
Hom Mlt h =>
Adjunction h d c -> Homomorphous Mlt d c
adjHomMlt Adjunction h x y
a) Adjunction h x y
a
relAdjunctionRightUnitHom :: (Hom Mlt h, Show2 h)
=> Homomorphous Mlt d c -> Adjunction h d c -> Point c -> Statement
relAdjunctionRightUnitHom :: forall (h :: * -> * -> *) d c.
(Hom Mlt h, Show2 h) =>
Homomorphous Mlt d c -> Adjunction h d c -> Point c -> Statement
relAdjunctionRightUnitHom (Struct Mlt d
Struct :>: Struct Mlt c
Struct) (Adjunction h c d
l h d c
r Point c -> c
u Point d -> d
v) Point c
x
= [Statement] -> Statement
And [ (c, d) -> Statement
forall a. Validable a => a -> Statement
valid (c
ux,d
vlx)
, String -> Label
Label String
"1.1" Label -> Statement -> Statement
:<=>: (c -> Orientation (Point c)
forall q. Oriented q => q -> Orientation (Point q)
orientation c
ux Orientation (Point c) -> Orientation (Point c) -> Bool
forall a. Eq a => a -> a -> Bool
== Point c
x Point c -> Point c -> Orientation (Point c)
forall p. p -> p -> Orientation p
:> h d c -> Point d -> Point c
forall (h :: * -> * -> *) x y.
ApplicativePoint h =>
h x y -> Point x -> Point y
pmap h d c
r (h c d -> Point c -> Point d
forall (h :: * -> * -> *) x y.
ApplicativePoint h =>
h x y -> Point x -> Point y
pmap h c d
l Point c
x))
Bool -> Message -> Statement
:?> [Parameter] -> Message
Params [String
"x"String -> String -> Parameter
:=Point c -> String
forall a. Show a => a -> String
show Point c
x,String
"u x"String -> String -> Parameter
:=c -> String
forall a. Show a => a -> String
show c
ux,String
"l"String -> String -> Parameter
:=h c d -> String
forall a b. h a b -> String
forall (h :: * -> * -> *) a b. Show2 h => h a b -> String
show2 h c d
l,String
"r"String -> String -> Parameter
:=h d c -> String
forall a b. h a b -> String
forall (h :: * -> * -> *) a b. Show2 h => h a b -> String
show2 h d c
r]
, String -> Label
Label String
"3.1" Label -> Statement -> Statement
:<=>: (Point d -> d
forall c. Multiplicative c => Point c -> c
one Point d
lx d -> d -> Bool
forall a. Eq a => a -> a -> Bool
== d
vlx d -> d -> d
forall c. Multiplicative c => c -> c -> c
* h c d -> c -> d
forall (h :: * -> * -> *) x y. Applicative h => h x y -> x -> y
amap h c d
l c
ux)
Bool -> Message -> Statement
:?> [Parameter] -> Message
Params [String
"x"String -> String -> Parameter
:=Point c -> String
forall a. Show a => a -> String
show Point c
x,String
"pmap l x"String -> String -> Parameter
:= Point d -> String
forall a. Show a => a -> String
show Point d
lx,String
"l"String -> String -> Parameter
:=h c d -> String
forall a b. h a b -> String
forall (h :: * -> * -> *) a b. Show2 h => h a b -> String
show2 h c d
l,String
"r"String -> String -> Parameter
:=h d c -> String
forall a b. h a b -> String
forall (h :: * -> * -> *) a b. Show2 h => h a b -> String
show2 h d c
r]
]
where ux :: c
ux = Point c -> c
u Point c
x
vlx :: d
vlx = Point d -> d
v Point d
lx
lx :: Point d
lx = h c d -> Point c -> Point d
forall (h :: * -> * -> *) x y.
ApplicativePoint h =>
h x y -> Point x -> Point y
pmap h c d
l Point c
x
relAdjunctionRightNaturalHom :: (Hom Mlt h, Show2 h)
=> Homomorphous Mlt d c -> Adjunction h d c -> c -> Statement
relAdjunctionRightNaturalHom :: forall (h :: * -> * -> *) d c.
(Hom Mlt h, Show2 h) =>
Homomorphous Mlt d c -> Adjunction h d c -> c -> Statement
relAdjunctionRightNaturalHom (Struct Mlt d
Struct :>: Struct Mlt c
Struct) (Adjunction h c d
l h d c
r Point c -> c
u Point d -> d
_) c
f
= String -> Label
Label String
"1.2" Label -> Statement -> Statement
:<=>: (Point c -> c
u (c -> Point c
forall q. Oriented q => q -> Point q
end c
f) c -> c -> c
forall c. Multiplicative c => c -> c -> c
* c
f c -> c -> Bool
forall a. Eq a => a -> a -> Bool
== h d c -> d -> c
forall (h :: * -> * -> *) x y. Applicative h => h x y -> x -> y
amap h d c
r (h c d -> c -> d
forall (h :: * -> * -> *) x y. Applicative h => h x y -> x -> y
amap h c d
l c
f) c -> c -> c
forall c. Multiplicative c => c -> c -> c
* Point c -> c
u (c -> Point c
forall q. Oriented q => q -> Point q
start c
f))
Bool -> Message -> Statement
:?> [Parameter] -> Message
Params [String
"f"String -> String -> Parameter
:=c -> String
forall a. Show a => a -> String
show c
f,String
"l"String -> String -> Parameter
:=h c d -> String
forall a b. h a b -> String
forall (h :: * -> * -> *) a b. Show2 h => h a b -> String
show2 h c d
l,String
"r"String -> String -> Parameter
:=h d c -> String
forall a b. h a b -> String
forall (h :: * -> * -> *) a b. Show2 h => h a b -> String
show2 h d c
r]
prpAdjunctionRight :: (Hom Mlt h, Show2 h) => Adjunction h d c -> Point c -> c -> Statement
prpAdjunctionRight :: forall (h :: * -> * -> *) d c.
(Hom Mlt h, Show2 h) =>
Adjunction h d c -> Point c -> c -> Statement
prpAdjunctionRight adj :: Adjunction h d c
adj@(Adjunction h c d
_ h d c
r Point c -> c
_ Point d -> d
_) Point c
x c
f = String -> Label
Prp String
"AdjunctionRight" Label -> Statement -> Statement
:<=>:
[Statement] -> Statement
And [ Homomorphous Mlt d c -> Adjunction h d c -> Point c -> Statement
forall (h :: * -> * -> *) d c.
(Hom Mlt h, Show2 h) =>
Homomorphous Mlt d c -> Adjunction h d c -> Point c -> Statement
relAdjunctionRightUnitHom Homomorphous Mlt d c
s Adjunction h d c
adj Point c
x
, Homomorphous Mlt d c -> Adjunction h d c -> c -> Statement
forall (h :: * -> * -> *) d c.
(Hom Mlt h, Show2 h) =>
Homomorphous Mlt d c -> Adjunction h d c -> c -> Statement
relAdjunctionRightNaturalHom Homomorphous Mlt d c
s Adjunction h d c
adj c
f
]
where s :: Homomorphous Mlt d c
s = Homomorphous (ObjectClass h) d c -> Homomorphous Mlt d c
forall s t x y.
Transformable s t =>
Homomorphous s x y -> Homomorphous t x y
tauHom (h d c -> Homomorphous (ObjectClass h) d c
forall x y. h x y -> Homomorphous (ObjectClass h) x y
forall (m :: * -> * -> *) x y.
Morphism m =>
m x y -> Homomorphous (ObjectClass m) x y
homomorphous h d c
r)
prpAdjunctionLeft :: (Hom Mlt h, Show2 h) => Adjunction h d c -> Point d -> d -> Statement
prpAdjunctionLeft :: forall (h :: * -> * -> *) d c.
(Hom Mlt h, Show2 h) =>
Adjunction h d c -> Point d -> d -> Statement
prpAdjunctionLeft Adjunction h d c
adj Point d
y d
g = String -> Label
Prp String
"AdjucntionLeft" Label -> Statement -> Statement
:<=>:
Adjunction (Variant2 'Covariant (HomDisj Mlt Op h)) (Op c) (Op d)
-> Point (Op d) -> Op d -> Statement
forall (h :: * -> * -> *) d c.
(Hom Mlt h, Show2 h) =>
Adjunction h d c -> Point c -> c -> Statement
prpAdjunctionRight (Adjunction h d c
-> Adjunction
(Variant2 'Covariant (HomDisj Mlt Op h)) (Op c) (Op d)
forall (h :: * -> * -> *) x y.
HomMultiplicative h =>
Adjunction h x y
-> Adjunction
(Variant2 'Covariant (HomDisj Mlt Op h)) (Op y) (Op x)
coAdjunctionOp Adjunction h d c
adj) Point d
Point (Op d)
y (d -> Op d
forall x. x -> Op x
Op d
g)
prpAdjunction
:: (Hom Mlt h, Entity2 h)
=> Adjunction h d c
-> X (Point d) -> X d
-> X (Point c) -> X c
-> Statement
prpAdjunction :: forall (h :: * -> * -> *) d c.
(Hom Mlt h, Entity2 h) =>
Adjunction h d c
-> X (Point d) -> X d -> X (Point c) -> X c -> Statement
prpAdjunction adj :: Adjunction h d c
adj@(Adjunction h c d
l h d c
r Point c -> c
_ Point d -> d
_) X (Point d)
xpd X d
xd X (Point c)
xpc X c
xc = String -> Label
Prp String
"Adjunction" Label -> Statement -> Statement
:<=>:
[Statement] -> Statement
And [ h c d -> Statement
forall x y. h x y -> Statement
forall (h :: * -> * -> *) x y. Validable2 h => h x y -> Statement
valid2 h c d
l
, h d c -> Statement
forall x y. h x y -> Statement
forall (h :: * -> * -> *) x y. Validable2 h => h x y -> Statement
valid2 h d c
r
, X (Point c, c) -> ((Point c, c) -> Statement) -> Statement
forall x. X x -> (x -> Statement) -> Statement
Forall (X (Point c) -> X c -> X (Point c, c)
forall a b. X a -> X b -> X (a, b)
xTupple2 X (Point c)
xpc X c
xc) ((Point c -> c -> Statement) -> (Point c, c) -> Statement
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry (Adjunction h d c -> Point c -> c -> Statement
forall (h :: * -> * -> *) d c.
(Hom Mlt h, Show2 h) =>
Adjunction h d c -> Point c -> c -> Statement
prpAdjunctionRight Adjunction h d c
adj))
, X (Point d, d) -> ((Point d, d) -> Statement) -> Statement
forall x. X x -> (x -> Statement) -> Statement
Forall (X (Point d) -> X d -> X (Point d, d)
forall a b. X a -> X b -> X (a, b)
xTupple2 X (Point d)
xpd X d
xd) ((Point d -> d -> Statement) -> (Point d, d) -> Statement
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry (Adjunction h d c -> Point d -> d -> Statement
forall (h :: * -> * -> *) d c.
(Hom Mlt h, Show2 h) =>
Adjunction h d c -> Point d -> d -> Statement
prpAdjunctionLeft Adjunction h d c
adj))
]
instance ( HomMultiplicative h, Entity2 h
, XStandardPoint d, XStandard d, XStandardPoint c, XStandard c
)
=> Validable (Adjunction h d c) where
valid :: Adjunction h d c -> Statement
valid Adjunction h d c
adj = String -> Label
Label String
"Mlt" Label -> Statement -> Statement
:<=>:
Adjunction h d c
-> X (Point d) -> X d -> X (Point c) -> X c -> Statement
forall (h :: * -> * -> *) d c.
(Hom Mlt h, Entity2 h) =>
Adjunction h d c
-> X (Point d) -> X d -> X (Point c) -> X c -> Statement
prpAdjunction Adjunction h d c
adj X (Point d)
forall x. XStandard x => X x
xStandard X d
forall x. XStandard x => X x
xStandard X (Point c)
forall x. XStandard x => X x
xStandard X c
forall x. XStandard x => X x
xStandard