pushout#

class discopy.hypergraph.pushout(left, right, left_boundary, right_boundary)[source]#

Bases:

Computes the pushout of two finite mappings using connected components.

Parameters:
  • left (int) – Size of the left set.

  • right (int) – Size of the right set.

  • left_boundary (List[int]) – Mapping from boundary to left.

  • right_boundary (List[int]) – Mapping from boundary to right.

Returns:

left_pushout, right_pushout – Injections from left and right to their pushout.

Return type:

Mapping[int, int]

Examples

>>> assert pushout(2, 3, [1], [0]) == ({0: 0, 1: 1}, {0: 1, 1: 2, 2: 3})