#11239: Incorrect coercion of polynomials over finite fields
-------------------------------------+-------------------------------------
       Reporter:  johanbosman        |        Owner:  robertwb
           Type:  defect             |       Status:  needs_info
       Priority:  major              |    Milestone:  sage-6.1
      Component:  coercion           |   Resolution:
       Keywords:  finite fields,     |    Merged in:
  polynomials, coercion, sd53        |    Reviewers:  Jean-Pierre Flori
        Authors:  Peter Bruin        |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  236effb6198c6192dce0cedc0e53423c68743e3e
  u/jpflori/ticket/11239             |     Stopgaps:
   Dependencies:  #8335              |
-------------------------------------+-------------------------------------

Comment (by pbruin):

 Here is the way in which I think this bug should be solved conceptually.
 It is motivated by the fact that if ''A'' is a commutative ring, the
 object ''A''[''x''] in the category of ''A''-algebras represents the
 forgetful functor to the category of sets.
 - Implement a class `PolynomialRingMorphism` modelling ring homomorphisms
 ''f'': ''A''[''x''] -> ''C'', where ''A'' and ''C'' are commutative rings.
 Note that ''C'' is not required to be a polynomial ring.  Such ring
 homomorphisms correspond bijectively to pairs (''g'', ''c''), where ''g'':
 ''A'' -> ''C'' is a ring homomorphism and ''c'' is an element of ''C'',
 where the bijection is given by ''g'' = ''f''|,,A,, and ''c'' =
 ''f''(''x''); cf. the above motivation.
 - Have optimised code for the following special case: ''C'' = ''B''[''y'']
 where ''B'' is an ''A''-algebra (or: has a coercion map from ''A''), ''g''
 is the composition of the obvious maps ''A'' -> ''B'' -> ''C'', and ''c''
 = ''y''. In this case, ''f'' is the map ''A''[''x''] -> ''C''[''y''] that
 we will declare as the coercion map.  Given an element ''p'' of
 ''A''[''x''], the `PolynomialRingMorphism` in this special case should
 just take the list of coefficients of ''p'', map them to ''B'' and hence
 construct the desired element ''f''(''p'') of ''B''[''y''].
 - If ''C'' = ''B''[''y''], where ''B'' has a coercion map from ''A'', let
 `C._coerce_map_from_(A['x'])` return the `PolynomialRingMorphism` for the
 above special case.
 - A general `PolynomialRingMorphism` could be implemented either in terms
 of this special case or independently from it.  The first approach would
 work as follows: given a general ''f'': ''A''[''x''] -> ''C'' as in the
 first point, represented by a pair (''g'', ''c''), applying ''f'' to a
 polynomial ''p'' in ''A''[''x''] can be implemented by first mapping ''p''
 to ''C''[''y''] (applying ''g'' to the coefficients as in the special
 case) and then substituting ''c'' for ''y''.
 This is probably not very difficult to implement.  This ticket could
 function as a temporary solution for the bug it fixes, until we have the
 real solution.

--
Ticket URL: <http://trac.sagemath.org/ticket/11239#comment:30>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to