FollowedBy

Contents

FollowedBy#

class discopy.feedback.FollowedBy(arg, is_dagger=False, time_step=0)[source]#

Bases: Box

The isomorphism between x.head @ x.tail.delay() and x.

In the category of streams, this is just the identity.

Example

>>> from discopy import stream
>>> x = Ty(Ob('x', is_constant=False))
>>> FollowedBy(x).draw(path="docs/_static/feedback/followed-by.png")
../_images/followed-by.png
>>> F = Functor({x: stream.Ty.sequence('x')}, cod=stream.Category())
>>> X, Xh, Xtd = map(F, (x, x.head, x.tail.delay()))
>>> for xh, xtd in [(Xh.now, Xtd.now),
...                 (Xh.later.now, Xtd.later.now),
...                 (Xh.later.later.now, Xtd.later.later.now)]:
...     print(f"({xh}, {xtd})")
(x0, Ty())
(Ty(), x1)
(Ty(), x2)
>>> eq_up_to_F = lambda f, g: F(f).unroll(2).now == F(g).unroll(2).now
>>> assert eq_up_to_F(FollowedBy(x), Id(x))
Parameters:

arg (Ty) –