|
| 1 | +""" |
| 2 | +In this file we give the "proof" that the monoid defined by the presentation |
| 3 | +not_renner_type_B_monoid(5, 1) is not isomorphic to the monoid defined by |
| 4 | +renner_type_B_monoid(5, 1). |
| 5 | +""" |
| 6 | + |
| 7 | +from libsemigroups_pybind11 import Sims2, Presentation, WordGraph |
| 8 | +from libsemigroups_pybind11 import word_graph |
| 9 | +from libsemigroups_pybind11.presentation import examples |
| 10 | + |
| 11 | + |
| 12 | +def check_incompat(wg: WordGraph, p: Presentation) -> bool: |
| 13 | + for i in range(0, len(p.rules), 2): |
| 14 | + if not word_graph.is_compatible(wg, 0, 4096, p.rules[i], p.rules[i + 1]): |
| 15 | + return True |
| 16 | + return False |
| 17 | + |
| 18 | + |
| 19 | +def witness(wg: WordGraph, p: Presentation) -> tuple[list[int], list[int]]: |
| 20 | + for i in range(0, len(p.rules), 2): |
| 21 | + if not word_graph.is_compatible(wg, 0, 1, p.rules[i], p.rules[i + 1]): |
| 22 | + return (p.rules[i], p.rules[i + 1]) |
| 23 | + |
| 24 | + |
| 25 | +p = examples.not_renner_type_B_monoid(5, 1) |
| 26 | +q = examples.renner_type_B_monoid(5, 1) |
| 27 | + |
| 28 | +# We iterate 2-sided congruences of the monoid defined by "p" with the aim of |
| 29 | +# finding one which is not compatible with the relations in "q" |
| 30 | +twosided_congs = Sims2(p) |
| 31 | +wg = twosided_congs.find_if(4096, lambda wg: check_incompat(wg, q)) |
| 32 | +word_graph.number_of_nodes_reachable_from(wg, 0) # 2177 |
| 33 | +wg.induced_subgraph(0, 2177) |
| 34 | +witness(wg, q) # ([5, 0, 1, 2, 3, 4, 0, 1, 2, 3, 0, 1, 2, 0, 1, 0, 5], [10]) |
| 35 | +# meaning that the paths with source 0 labelled by these two words should lead to the same |
| 36 | +# node but do not. |
| 37 | +word_graph.follow_path(wg, 0, [5, 0, 1, 2, 3, 4, 0, 1, 2, 3, 0, 1, 2, 0, 1, 0, 5]) # 6 |
| 38 | +word_graph.follow_path(wg, 0, [10]) # 7 |
0 commit comments