{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Tropicalization of a p-adic surface\n", "\n", "Inspired by https://github.com/emresertoz/pAdicCubicSurface\n", "\n", "Author: Michael Joswig" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "$\\require{action}$" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ " ----- ----- ----- - ----- \n", "| | | | | | | | | | \n", "| | | | | | | | \n", "| | ----- | | | |----- \n", "| | | | |-----| | | \n", "| | | | | | | | | | \n", " ----- ----- ----- - - - - \n", "\n", "...combining (and extending) GAP, Hecke, Nemo, Polymake and Singular\n", "Version\u001b[32m 0.3.0 \u001b[39m... \n", " ... which comes with absolutely no warranty whatsoever\n", "Type: '?Oscar' for more information\n", "(c) 2019-2020 by The Oscar Development Team\n" ] } ], "source": [ "using Oscar" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We start out with basic arithmetic in a p-adic field; this comes from FLINT." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "a = 2*5^1 + 4*5^2 + 1*5^3 + O(5^4)\n", "valuation(a) = 1\n" ] } ], "source": [ "p=5\n", "Qp = PadicField(p, 30)\n", "\n", "a = 2*p + 4*p^2 + 1*p^3 + O(Qp, p^4);\n", "\n", "@show a\n", "@show valuation(a);" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The polynomials come from AbstractAlgebra.jl." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "R, (w,x,y,z) = PolynomialRing(Qp, [\"w\",\"x\",\"y\",\"z\"])\n", "\n", "f = 3125*w^3 + 25*w^2*x + 25*w^2*y + 5*w^2*z + 25*w*x^2 + w*x*y + w*x*z + 25*w*y^2 + w*y*z + 5*w*z^2 + 3125*x^3 + 5*x^2*y + 25*x^2*z + 5*x*y^2 + x*y*z + 25*x*z^2 + 3125*y^3 + 25*y^2*z + 25*y*z^2 + 3125*z^3;" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we can translate this into a function which employs polymake. Note that the classical p-adic valuation naturally forces $\\min$ as the tropical addition." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "tropical_hypersurface (generic function with 1 method)" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "function tropical_hypersurface(f)\n", " C = map(c->Int(valuation(c)), coeffs(f))\n", " E = transpose(hcat(collect(Nemo.exponent_vectors(f))...))\n", " return Polymake.@pm tropical.Hypersurface{Min}(COEFFICIENTS=C, MONOMIALS=E)\n", "end" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Indeed, the resulting tropical hypersurface is cubic." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "H.DEGREE = 3\n" ] } ], "source": [ "H = tropical_hypersurface(f)\n", "\n", "@show H.DEGREE;" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The notebook supports interactive visualization, e.g., via threejs. The corresponding command would be\n", "\n", "* Polymake.visual(H)\n", "\n", "Obviously, this does not go well with noninteractive versions of this notebook. Hence, as a proof of concept, we rely in 2D SVG output here; note that this is too simplistic to give an adequate view." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", "\tunnamed\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "Polymake.display_svg(H)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "polymake's bundled extension a-tint provides a function for finding lines on a tropical cubic surface. In contrast to the classical setting there may be infinite families." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "L.N_ISOLATED = 16\n", "L.N_FAMILIES = 43\n" ] } ], "source": [ "L = Polymake.tropical.lines_in_cubic(H.POLYNOMIAL);\n", "\n", "@show L.N_ISOLATED\n", "@show L.N_FAMILIES;" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Julia 1.4.0", "language": "julia", "name": "julia-1.4" }, "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", "version": "1.4.0" } }, "nbformat": 4, "nbformat_minor": 2 }