Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

SageMath does not yet support general extensions of p-adics yet unfortunately, it's something that we're actively working on, e.g., at https://trac.sagemath.org/ticket/28466. If you want to get involved a bit, please join us at https://sagemath.zulipchat.com/#narrow/stream/271072-padics.

There's a package that builds on SageMath to provide some Henselizations here that might work for such problems since it can compute in towers of fields and provides valuations. I am not sure how well that package currently works, but please let us know in the above zulip chat if you find it useful or have suggestions. Anyway, the following works on this binder with this package installed…

from henselization import *

K = QQ.henselization(3)
R.<x> = K[]
F.<ξ> = K.extension(x^4 + x^3 + x^2 + x + 1)
# Extension defined by ξ^4 + ξ^3 + ξ^2 + ξ + 1 of Henselization of Rational Field with respect to 3-adic valuation

R.<x> = F[]
f = x^4 - 3*x^2 + 18
LF.<α> = F.extension(f.factor()[0][0])
# Extension defined by α^2 + O(x^(3/4))*α + 3*ξ^3 + 3*ξ^2 + O(x^(3/4)) of Extension defined by ξ^4 + ξ^3 + ξ^2 + ξ + 1 of Henselization of Rational Field with respect to 3-adic valuation

R.<x> = LF[]
# We need to pass to approximations so we can perform arithmetic.
# Unfortunately, we cannot say ξ = ξ.approximation(20) directly. :(
ξ = -(x^4 + x^3 + x^2 + x + 1).factor()[0][0][0].approximation(20)
α = -(x^4 - 3*x^2 + 18).factor()[0][0][0].approximation(20)
basis = [ξ^i*α^j for i in range(4) for j in range(2)]

R.<x> = LF[]
# Note that if you change the first 0 to a 1, you get a different result.
sqrt27 = -((x^2 + 2/7).factor()[0][0][0].approximation(20))

# Write φ in terms of the basis given by ξ and α.
φα = (2*α^2 - 3)* sqrt27 / α
φξ = ξ^3
image = [φξ^i*φα^j for i in range(4) for j in range(2)]

# We write sqrt(3) in terms of that basis
sqrt3 = -(x^2 - 3).factor()[0][0][0].approximation(20)
A = matrix([b._vector_(base=K) for b in basis])
coefficients = A.transpose().solve_right(sqrt3._vector_(base=K))

# Map sqrt(3) through φ
φsqrt3 = sum([b * c for (b, c) in zip(image, coefficients)])
(φsqrt3 - sqrt3).valuation() # big number

# We write sqrt(-3) in terms of that basis
sqrt_3 = -(x^2 + 3).factor()[0][0][0].approximation(20)
A = matrix([b._vector_(base=K) for b in basis])
coefficients = A.transpose().solve_right(sqrt3._vector_(base=K))

φsqrt_3 = sum([b * c for (b, c) in zip(image, coefficients)])
(φsqrt_3 - sqrt_3).valuation() # small number

So, the answer is $\sqrt{3}$ since $\varphi\sqrt{3} - \sqrt{3}$ has "infinite" valuation but $\varphi\sqrt{3} - \sqrt{3}$ has valuation 1/2 or so. However, this depends on the choice of $\sqrt{-2}{7}$. Choosing the other root, gives $\sqrt{-3}$.

SageMath does not yet support general extensions of p-adics yet unfortunately, it's something that we're actively working on, e.g., at https://trac.sagemath.org/ticket/28466. If you want to get involved a bit, please join us at https://sagemath.zulipchat.com/#narrow/stream/271072-padics.

There's a package that builds on SageMath to provide some Henselizations here that might work for such problems since it can compute in towers of fields and provides valuations. I am not sure how well that package currently works, but please let us know in the above zulip chat if you find it useful or have suggestions. Anyway, the following works on this binder with this package installed…

from henselization import *

K = QQ.henselization(3)
R.<x> = K[]
F.<ξ> = K.extension(x^4 + x^3 + x^2 + x + 1)
# Extension defined by ξ^4 + ξ^3 + ξ^2 + ξ + 1 of Henselization of Rational Field with respect to 3-adic valuation

R.<x> = F[]
f = x^4 - 3*x^2 + 18
LF.<α> = F.extension(f.factor()[0][0])
# Extension defined by α^2 + O(x^(3/4))*α + 3*ξ^3 + 3*ξ^2 + O(x^(3/4)) of Extension defined by ξ^4 + ξ^3 + ξ^2 + ξ + 1 of Henselization of Rational Field with respect to 3-adic valuation

R.<x> = LF[]
# We need to pass to approximations so we can perform arithmetic.
# Unfortunately, we cannot say ξ = ξ.approximation(20) directly. :(
ξ = -(x^4 + x^3 + x^2 + x + 1).factor()[0][0][0].approximation(20)
α = -(x^4 - 3*x^2 + 18).factor()[0][0][0].approximation(20)
basis = [ξ^i*α^j for i in range(4) for j in range(2)]

R.<x> = LF[]
# Note that if you change the first 0 to a 1, you get a different result.
sqrt27 = -((x^2 + 2/7).factor()[0][0][0].approximation(20))

# Write φ in terms of the basis given by ξ and α.
φα = (2*α^2 - 3)* sqrt27 / α
φξ = ξ^3
image = [φξ^i*φα^j for i in range(4) for j in range(2)]

# We write sqrt(3) in terms of that basis
sqrt3 = -(x^2 - 3).factor()[0][0][0].approximation(20)
A = matrix([b._vector_(base=K) for b in basis])
coefficients = A.transpose().solve_right(sqrt3._vector_(base=K))

# Map sqrt(3) through φ
φsqrt3 = sum([b * c for (b, c) in zip(image, coefficients)])
(φsqrt3 - sqrt3).valuation() # big number

# We write sqrt(-3) in terms of that basis
sqrt_3 = -(x^2 + 3).factor()[0][0][0].approximation(20)
A = matrix([b._vector_(base=K) for b in basis])
coefficients = A.transpose().solve_right(sqrt3._vector_(base=K))

φsqrt_3 = sum([b * c for (b, c) in zip(image, coefficients)])
(φsqrt_3 - sqrt_3).valuation() # small number

So, the answer is $\sqrt{3}$ since $\varphi\sqrt{3} $\varphi(\sqrt{3}) - \sqrt{3}$ has "infinite" valuation but $\varphi\sqrt{3} $\varphi(\sqrt{3}) - \sqrt{3}$ has valuation 1/2 or so. However, this depends on the choice of $\sqrt{-2}{7}$. $\sqrt{\frac{-2}{7}}$. Choosing the other root, gives $\sqrt{-3}$.

SageMath does not yet support general extensions of p-adics yet unfortunately, it's something that we're actively working on, e.g., at https://trac.sagemath.org/ticket/28466. If you want to get involved a bit, please join us at https://sagemath.zulipchat.com/#narrow/stream/271072-padics.

There's a package that builds on SageMath to provide some Henselizations here that might work for such problems since it can compute in towers of fields and provides valuations. I am not sure how well that package currently works, but please let us know in the above zulip chat if you find it useful or have suggestions. Anyway, the following works on this binder with this package installed…

from henselization import *

K = QQ.henselization(3)
R.<x> = K[]
F.<ξ> = K.extension(x^4 + x^3 + x^2 + x + 1)
# Extension defined by ξ^4 + ξ^3 + ξ^2 + ξ + 1 of Henselization of Rational Field with respect to 3-adic valuation

R.<x> = F[]
f = x^4 - 3*x^2 + 18
LF.<α> = F.extension(f.factor()[0][0])
# Extension defined by α^2 + O(x^(3/4))*α + 3*ξ^3 + 3*ξ^2 + O(x^(3/4)) of Extension defined by ξ^4 + ξ^3 + ξ^2 + ξ + 1 of Henselization of Rational Field with respect to 3-adic valuation

R.<x> = LF[]
# We need to pass to approximations so we can perform arithmetic.
# Unfortunately, we cannot say ξ = ξ.approximation(20) directly. :(
ξ = -(x^4 + x^3 + x^2 + x + 1).factor()[0][0][0].approximation(20)
α = -(x^4 - 3*x^2 + 18).factor()[0][0][0].approximation(20)
basis = [ξ^i*α^j for i in range(4) for j in range(2)]

R.<x> = LF[]
# Note that if you change the first 0 to a 1, you get a different result.
sqrt27 = -((x^2 + 2/7).factor()[0][0][0].approximation(20))

# Write φ in terms of the basis given by ξ and α.
φα = (2*α^2 - 3)* sqrt27 / α
φξ = ξ^3
image = [φξ^i*φα^j for i in range(4) for j in range(2)]

# We write sqrt(3) in terms of that basis
sqrt3 = -(x^2 - 3).factor()[0][0][0].approximation(20)
A = matrix([b._vector_(base=K) for b in basis])
coefficients = A.transpose().solve_right(sqrt3._vector_(base=K))

# Map sqrt(3) through φ
φsqrt3 = sum([b * c for (b, c) in zip(image, coefficients)])
(φsqrt3 - sqrt3).valuation() # big number

# We write sqrt(-3) in terms of that basis
sqrt_3 = -(x^2 + 3).factor()[0][0][0].approximation(20)
A = matrix([b._vector_(base=K) for b in basis])
coefficients = A.transpose().solve_right(sqrt3._vector_(base=K))

φsqrt_3 = sum([b * c for (b, c) in zip(image, coefficients)])
(φsqrt_3 - sqrt_3).valuation() # small number

So, the answer is $\sqrt{3}$ since $\varphi(\sqrt{3}) - \sqrt{3}$ has "infinite" valuation but $\varphi(\sqrt{3}) - \sqrt{3}$ $\varphi(\sqrt{-3}) - \sqrt{-3}$ has valuation 1/2 or so. However, this depends on the choice of $\sqrt{\frac{-2}{7}}$. Choosing the other root, gives $\sqrt{-3}$.