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 A B C : π.Ob X Y Z : π.Ob a b c : π.Hom A B f g h : π.Hom X Y
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 π.β Ξ· _ naturall p = sym (is-natural _ _ _) Β·Β· p Β·Β· is-natural _ _ _ naturalr : G.β a π.β Ξ· _ β‘ G.β b π.β Ξ· _ β Ξ· _ π.β F.β a β‘ Ξ· _ π.β F.β b naturalr p = is-natural _ _ _ Β·Β· p Β·Β· sym (is-natural _ _ _)
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 viewr p = naturalr (ap (π._β Ξ· _) p) viewl : F.β a β‘ F.β b β G.β a π.β Ξ· _ β‘ G.β b π.β Ξ· _ viewl p = naturall (ap (Ξ· _ π.β_) p)
Commuting
Ξ·
through
compositesπ
pulll : (p : Ξ· _ π.β f β‘ g) β Ξ· _ π.β F.β a π.β f β‘ G.β a π.β g pulll p = π.pulll (is-natural _ _ _) β π.pullr p pullr : (p : f π.β Ξ· _ β‘ g) β (f π.β G.β a) π.β Ξ· _ β‘ g π.β F.β a pullr p = π.pullr (sym (is-natural _ _ _)) β π.pulll p
popl : (p : Ξ· _ π.β F.β b β‘ f) β Ξ· _ π.β F.β (a π.β b) β‘ G.β a π.β f popl p = F.popl (is-natural _ _ _) β π.pullr p popr : (p : G.β a π.β Ξ· _ β‘ f) β G.β (a π.β b) π.β Ξ· _ β‘ f π.β F.β b popr p = G.popr (sym (is-natural _ _ _)) β π.pulll p
shiftl : (p : F.β a π.β f β‘ g) β G.β a π.β Ξ· _ π.β f β‘ Ξ· _ π.β g shiftl p = π.pulll (sym (is-natural _ _ _)) β π.pullr p shiftr : (p : f π.β G.β a β‘ g) β (f π.β Ξ· _) π.β F.β a β‘ g π.β Ξ· _ shiftr p = π.pullr (is-natural _ _ _) β π.pulll p
Cancellationsπ
cancell : (p : Ξ· _ π.β f β‘ π.id) β Ξ· _ π.β F.β a π.β f β‘ G.β a cancell p = π.pulll (is-natural _ _ _) β π.cancelr p cancelr : (p : f π.β Ξ· _ β‘ π.id) β (f π.β G.β a) π.β Ξ· _ β‘ F.β a cancelr p = π.pullr (sym (is-natural _ _ _)) β π.cancell p