# Ticket #9054: trac_9054_codomain.patch

File trac_9054_codomain.patch, 1.8 KB (added by saraedum, 10 years ago)

set the correct codomain for function fields

• ## sage/rings/function_field/function_field.py

```exporting patch:
# HG changeset patch
# User Julian Rüth <julian.rueth@gmail.com>
# Date 1311351537 -7200
# Node ID 6be45617d3fd77916a605eb8c28966f5b47fe201
# Parent  58c4d3f474221e7cdd8c5eab1d2fda05febcbdcf
Trac 9054: correct codomain of morphisms

diff -r 58c4d3f47422 -r 6be45617d3fd sage/rings/function_field/function_field.py```
 a 4*w + t + 1 sage: f(x*y + x/(x^2+1)) (4*t + 4)*w + (t + 1)/(t^2 + 2*t + 2) We make another extension of a rational function field:: sage: R3. = FunctionField(QQ); S3. = R3[] sage: L3. = R3.extension(yy^2 - xx^3 - 1) This is the function field L with the generators exchanged. We define a morphism to L:: sage: g = L3.hom([x,y]); g Morphism of function fields defined by xx |--> x, yy |--> y """ if not isinstance(im_gens, (list,tuple)): im_gens = [im_gens] if len(im_gens) == 0: raise ValueError, "no images specified" if len(im_gens) > 1: base_morphism = self.base_field().hom(im_gens[1:], base_morphism) return maps.FunctionFieldMorphism(self.Hom(im_gens[0].parent()), im_gens[0], base_morphism) # the codomain of this morphism is the field containing all the im_gens codomain = im_gens[0].parent(); if base_morphism is not None: if base_morphism.codomain().has_coerce_map_from(codomain): codomain = base_morphism.codomain(); return maps.FunctionFieldMorphism(self.Hom(codomain), im_gens[0], base_morphism) class FunctionField_polymod(FunctionField): """