Substitution changes the multiplicative unit, F(1), in F = FreeGroup(2) to the integer, 1. The following code demonstrates the problem:
--------------------------------------------- F = FreeGroup(2) F.inject_variables() u = F(1) w = u.subs({x0:x1}) print 'u.parent() = ', u.parent() print 'w.parent() = ', w.parent() ----------------------------------------------- Both u and w print as '1', but the parent of u is 'Free Group on generators {x0, x1}', and the parent of w is 'Integer Ring'. Consequently, u*x0 == x0 works fine as expected, but w*x0 == x0 results in: TypeError: unsupported operand parent(s) for *: 'Integer Ring' and 'Free Group on generators {x0, x1}' I am running Sage version 8.1 (sage-8.1-OSX_10.12.6-x86_64) on a MacBook Pro, with OS X, version 10.13.3. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.