Magma - Coercing a Function Field element to a Rational Function Here's an example of what I'm trying to do:
I have an elliptic curve $E : y^2 = x^3+x$ over the field $F= GF(43)$. I want to be able to go back and forth between $F(E)$ and $F(x,y)$ in MAGMA.
This is because I have rational functions, $p(x,y)/q(x,y)$, but I want to be able to write the high powers of $y$ as linear functions in $y$ with coefficients in $x$ using the equation for $E$. So, I coerce an expression into the function field of $E$. I have a very messy and ad hoc way of doing it but I'd like to know the "proper way". Here's an example
> F:=GF(43);
> R<X>:=PolynomialRing(F);
> E:=EllipticCurve([F!1,F!0]);
> E1,p:=IsogenyFromKernel(E,X);
> S<z,w>:= Parent(IsogenyMapOmega(p));
> omega:=IsogenyMapOmega(p);
> phi:=Evaluate(IsogenyMapPhi(p),z);
> psi := Evaluate(IsogenyMapPsi(p),z);
> SS<a,b>:=FieldOfFractions(S);
> KE<x,y>:=FunctionField(E);
> omega^2/psi;
(a^4*b^2 + 41*a^2*b^2 + b^2)/a

I want to take the $b^2$ and substitute $a^3+a$. So I try
> KE!omega^2/psi
but MAGMA says its an illegal coercion.
I also want to be able to do substitutions on these expressions, so I need to coerce back to $F(x,y)$, but MAGMA says such a coercion is illegal
 A: You can just define a homomorphism $\varphi: F(u,v) \to F(E)$.
k := GF(43);
F<u,v> := RationalFunctionField(k,2);
E := EllipticCurve([k | 1,0]);
kE<x,y> := FunctionField(E);
phi := hom< F -> kE | [x,y] >;
f := (u^4*v^2 + 41*u^2*v^2 + v^2)/u;
phi(f);

This returns x^6 + 42*x^4 + 42*x^2 + 1.
You can define a lifting map in the other direction that will be a right inverse, but, as you point out in the comments, will not be a homomorphism:
g := phi(f);
phi_inv := hom< kE -> F | [u,v]>; 
phi_inv(g);

This returns u^2 + 40*u*v^2 + v^4 + 1.
Here's a hacky way to get the rational function back represented in the same way as it was in the function field of $E$.
cs, mons := CoefficientsAndMonomials(g); 
&+[Evaluate(cs[i],u)*phi_inv(mons[i]) : i in [1..#cs]];

With $f = v^{43}$ and $g = \varphi(f)$ as in your example, this returns
u^63*v + 21*u^61*v + 38*u^59*v + 40*u^57*v + 8*u^55*v + 10*u^53*v + 41*u^51*v + 8*u^49*v + 14*u^47*v + 25*u^45*v + 30*u^43*v + 30*u^41*v + 25*u^39*v + 14*u^37*v + 8*u^35*v + 41*u^33*v + 10*u^31*v + 8*u^29*v + 40*u^27*v + 38*u^25*v + 21*u^23*v + u^21*v

