Local ring elements are implemented using a balanced mod representation. This allows small negative elements x to be represented as x rather than pk - x where k is a p-adic precision.
To simplify the creation of elements in a local ring, various coercions are provided. The most obvious is to regard the integer ring or rational field as embedded in the p-adic ring or field. But there is a range of coercions available, including that of elements from the residue class field.
To create an element of a local field not lying in the local ring, constructors are provided that create an element coercible into the ring, and which increase or decrease this element's valuation in the field.
Given a local ring or field L, create the additive identity of L. Note that if L is an unbounded precision ring, this will only be the zero element to the default precision of the ring, and hence only an approximation to the additive identity of L. The valuation and hence the absolute precision of the zero of a field is infinite.
Given a local ring or field L, create the multiplicative identity of L. Note that if L is an unbounded precision structure, this will only be the one element to the default precision of the ring, and hence only an approximation to the multiplicative identity of L.
Given a local ring or field L, return a random element of L, which must be a quotient ring or bounded precision ring. The element will have the default precision of the ring.
Return an element of the local ring or field L.
Coerce the object u into the local ring or field L. The resulting element will have as much precision as possible. The element u is allowed to be one of the following:
- (i)
- An integer.
- (ii)
- An element of Z / pmZ; (where m is a precision).
- (iii)
- An element of the residue class field of L.
- (iv)
- An element of a local ring or field with something in common with L.
- (v)
- A rational number. If L is a ring then u must not have valuation in the denominator.
- (vi)
- An element of a valuation ring over the rationals with the same prime as L.
- (vii)
- A sequence s. In this case, the sequence s is coerced to a sequence t over the base ring or field of L. This sequence is coerced to ∑i=1#t t[i] L.1i - 1.
Create an element of the local ring or field L by coercing u into L and returning with it precision r.
Create an element of the local ring or field L by coercing u into L, multiplying by the v-th power of the uniformizing element and returning it with precision r.
For an element x of a local ring or field L of valuation v, create an element of valuation v and relative precision 0. For rings this is the zero element in the quotient L / πv L.
Given a local ring or field L, return the uniformizing element of L to the default precision of L.
> Zp := pAdicRing(5, 20); > I<a> := UnramifiedExtension(Zp, 3); > R<x> := PolynomialRing(I); > L<b> := ext<I | x^3 + 5*a*x^2 + 5>; > K<pi> := ext<BaseField(FieldOfFractions(L)) | x^2 + 5>; > K; Totally ramified extension defined by the polynomial x^2 + 5 over Unramified extension defined by the polynomial x^3 + 3*x + 3 over 5-adic field mod 5^20 > elt<K | 64>; 64 + O(pi^40) > P := PrimeField(K); > elt<K | 2, 3/4, 6>; pi^2*7 + O(pi^6) > 4*$1; pi^2*3 + O(pi^6) > K!3/5; pi^-2*3 + O(pi^38) > O(K!40^200); O(pi^400) > Precision($1); 0 > O(K!0); O(pi^40) > O(K!1); O(1) > R<x> := PolynomialRing(Integers()); > K<pi> := ext<pAdicField(5, 100) | x^2 + 5>; > elt<K | 64>; 64 + O(pi^200) > Precision($1); 200 > K!3/10; -pi^-2*3944304526105059027058642826413931148366032175545115023851394653320311 + O(pi^198)
> P := pAdicRing(5); > R := ext<P | 2>; > P`DefaultPrecision; 20 > R`DefaultPrecision := 40; > x := Random(R); > x; -1579801843431963201369145587*R.1 - 680575730458975039033394769 + O(5^40) > s := [-680575730458975039033394769, -1579801843431963201369145587]; > R!s; -13585890629962*R.1 + 47482939261481 + O(5^20) > P`DefaultPrecision := 40; > R!s; -1579801843431963201369145587*R.1 - 680575730458975039033394769 + O(5^40)
As can be seen from the above, it is the default precision of the base ring, not the ring itself, which determines the precision of elements created by sequences.
Given an element x of a degree n extension K of L, these functions return a sequence s of elements of L such that x = ∑i=1n s[i] K.1i - 1.
Equivalent to, but more efficient than, Coefficients(x)[i].
> p := 3; > L<a> := UnramifiedExtension(pAdicRing(p), 4 : Cyclotomic); > R<x> := PolynomialRing(L); > g := x^2 + (a+a^-2)*x + (a^-1+a^3+1); > g; (1 + O(3^20))*x^2 + (-151999392*a^3 - 428033534*a^2 + 1509587217*a - 64512399 + O(3^20))*x + 2*a^3 + 307453058*a^2 - 1732356354*a - 151999391 + O(3^20) > a2 := a^(p^2); > g2 := R ! [ &+[Eltseq(c)[i]*a2^(i-1) : i in [1..4]] : c in Eltseq(g) ];Here Eltseq is being used to replace occurrences of a in the element by a2.
> h := g * g2; > h; (1 + O(3^20))*x^4 + (774759822*a^3 - 1559939781*a^2 + 644136111*a + 143311364 + O(3^20))*x^3 + (73899384*a^3 - 333497478*a^2 + 1655979363*a + 158024680 + O(3^20))*x^2 + (989668189*a^3 - 661853000*a^2 - 1685887308*a + 122035547 + O(3^20))*x - 1630826887*a^3 - 328410694*a^2 - 175290219*a + 1601599448 + O(3^20)The polynomial g2 is the image of g under the automorphism induced by the square of the Frobenius automorphism. The product h = g g2 has coefficients in the unramified extension of degree 2, which is the fixed field under the square of the Frobenius and is generated by a10. Next, we determine a representation for the polynomial h with coefficients lying in this unramified extension of degree 2.
> K<b> := UnramifiedExtension(pAdicRing(p), 2 : Cyclotomic); > S<y> := PolynomialRing(K); > M := RMatrixSpace(PrimeRing(L), 2, 4) ! 0; > V := RSpace(PrimeRing(L), 4); > M[1] := V ! Eltseq(a^0); > M[2] := V ! Eltseq(a^10); > sol := [ Solution(M, V ! Eltseq(c)) : c in Eltseq(h) ]; > h2 := S ! [ K ! Eltseq(s) : s in sol ]; > h2; (1 + O(3^20))*y^4 + (-1237301755*b + 505889265 + O(3^20))*y^3 + (-542504216*b + 1258167831 + O(3^20))*y^2 + (-280210015*b - 1205051127 + O(3^20))*y + 1213139407*b + 1602993886 + O(3^20)