ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 28 Jul 2020 20:53:29 +0200Difference(s) between `fraction(Integers(p))` and`fraction(GF(p))` (with `p` prime) ?https://ask.sagemath.org/question/52728/differences-between-fractionintegersp-andfractiongfp-with-p-prime/ (Mis-)inspired by [this question](https://ask.sagemath.org/question/52656/reduction-to-a-rational-expression/) . Let `F` b some (not uninteresting) rational fraction:
sage: F=tan(2*arctan(x)+3*arctan(y)).trig_expand().trig_expand() ; F
((y^3 - 3*y)/(3*y^2 - 1) - 2*x/(x^2 - 1))/(2*(y^3 - 3*y)*x/((x^2 - 1)*(3*y^2 - 1)) + 1)
Question : when working in the (fraction field of) congruence rings, when is this fraction a polynomial ? This question has a trivial answer : when its denominator has a multiplicative inverse.
However :
sage: F.fraction(Integers(2))
(x^2*y^3 + x^2*y + y^3 + y)/(x^2*y^2 + x^2 + y^2 + 1)
Here, `Sage` does *not* simplify its results, notwithstanding the fact that it "knows" that such simplifications are possible) :
sage: F.fraction(GF(2)).parent().is_integral_domain()
True
In consequence :
sage: F.fraction(Integers(2)).denominator().is_unit()
False
However, if we work with the *finite field* of size 2 (which *is* the same ring...) :
sage: F.fraction(GF(2))
y
sage: F.fraction(GF(2)).denominator()
1
The [documentation](https://doc.sagemath.org/html/en/reference/categories/sage/categories/integral_domains.html) is not especially enlightening. I still do not see why there should be any difference between `GF(2)` and `Integers(2)`
Could some kind soul point me to the direction and magnitude of my (ignorance|stupidity) ?Emmanuel CharpentierTue, 28 Jul 2020 20:53:29 +0200https://ask.sagemath.org/question/52728/