module Cat.Natural.Reasoning
{o β o' β'}
{π : Precategory o β} {π : Precategory o' β'}
{F G : Functor π π}
(Ξ± : F => G)
where
private
module π = Cat.Reasoning π
module π = Cat.Reasoning π
module F = Cat.Functor.Reasoning F
module G = Cat.Functor.Reasoning G
open _=>_ Ξ± public
private variable
: π.Ob
A B C : π.Ob
X Y Z : π.Hom A B
a b c : π.Hom X Y f g h
Reasoning combinators for natural transformationsπ
Lensesπ
Our first set of reasoning combinators let you re-arrange goals by
conjugating with naturality. The mnemonic here is that naturall
lets you move the natural
transformation left.
naturall: Ξ· _ π.β F.β a β‘ Ξ· _ π.β F.β b
β G.β a π.β Ξ· _ β‘ G.β b π.β Ξ· _
= sym (is-natural _ _ _) Β·Β· p Β·Β· is-natural _ _ _
naturall p
naturalr: G.β a π.β Ξ· _ β‘ G.β b π.β Ξ· _
β Ξ· _ π.β F.β a β‘ Ξ· _ π.β F.β b
= is-natural _ _ _ Β·Β· p Β·Β· sym (is-natural _ _ _) naturalr p
We also provide a pair of combinators that simultaneously apply naturality and focus on a subexpression.
viewr: G.β a β‘ G.β b
β Ξ· _ π.β F.β a β‘ Ξ· _ π.β F.β b
= naturalr (ap (π._β Ξ· _) p)
viewr p
viewl: F.β a β‘ F.β b
β G.β a π.β Ξ· _ β‘ G.β b π.β Ξ· _
= naturall (ap (Ξ· _ π.β_) p) viewl p
Commuting
Ξ·
through
compositesπ
pulll: (p : Ξ· _ π.β f β‘ g)
β Ξ· _ π.β F.β a π.β f β‘ G.β a π.β g
= π.pulll (is-natural _ _ _) β π.pullr p
pulll p
pullr: (p : f π.β Ξ· _ β‘ g)
β (f π.β G.β a) π.β Ξ· _ β‘ g π.β F.β a
= π.pullr (sym (is-natural _ _ _)) β π.pulll p pullr p
popl: (p : Ξ· _ π.β F.β b β‘ f)
β Ξ· _ π.β F.β (a π.β b) β‘ G.β a π.β f
= F.popl (is-natural _ _ _) β π.pullr p
popl p
popr: (p : G.β a π.β Ξ· _ β‘ f)
β G.β (a π.β b) π.β Ξ· _ β‘ f π.β F.β b
= G.popr (sym (is-natural _ _ _)) β π.pulll p popr p
shiftl: (p : F.β a π.β f β‘ g)
β G.β a π.β Ξ· _ π.β f β‘ Ξ· _ π.β g
= π.pulll (sym (is-natural _ _ _)) β π.pullr p
shiftl p
shiftr: (p : f π.β G.β a β‘ g)
β (f π.β Ξ· _) π.β F.β a β‘ g π.β Ξ· _
= π.pullr (is-natural _ _ _) β π.pulll p shiftr p
Cancellationsπ
cancell: (p : Ξ· _ π.β f β‘ π.id)
β Ξ· _ π.β F.β a π.β f β‘ G.β a
= π.pulll (is-natural _ _ _) β π.cancelr p
cancell p
cancelr: (p : f π.β Ξ· _ β‘ π.id)
β (f π.β G.β a) π.β Ξ· _ β‘ F.β a
= π.pullr (sym (is-natural _ _ _)) β π.cancell p cancelr p