The Mathematica Journal p-adic Arithmetic

Similar documents
The p-adic numbers. Given a prime p, we define a valuation on the rationals by

Chapter 8. P-adic numbers. 8.1 Absolute values

NOTES ON DIOPHANTINE APPROXIMATION

MA257: INTRODUCTION TO NUMBER THEORY LECTURE NOTES

1 Adeles over Q. 1.1 Absolute values

Zair Ibragimov CSUF. Talk at Fullerton College July 14, Geometry of p-adic numbers. Zair Ibragimov CSUF. Valuations on Rational Numbers

The p-adic Numbers. Akhil Mathew

The p-adic Numbers. Akhil Mathew. 4 May Math 155, Professor Alan Candiotti

Euclidean Models of the p-adic Integers

8 Complete fields and valuation rings

February 1, 2005 INTRODUCTION TO p-adic NUMBERS. 1. p-adic Expansions

x = π m (a 0 + a 1 π + a 2 π ) where a i R, a 0 = 0, m Z.

Part III. x 2 + y 2 n mod m

arxiv: v1 [math.mg] 5 Nov 2007

p-adic Continued Fractions

Metric Spaces Math 413 Honors Project

Problem Set 2: Solutions Math 201A: Fall 2016

ZEROES OF INTEGER LINEAR RECURRENCES. 1. Introduction. 4 ( )( 2 1) n

Introduction to Arithmetic Geometry Fall 2013 Lecture #5 09/19/2013

Valuations. 6.1 Definitions. Chapter 6

Generalization of Hensel lemma: nding of roots of p-adic Lipschitz functions

= 1 2x. x 2 a ) 0 (mod p n ), (x 2 + 2a + a2. x a ) 2

The Fixed String of Elementary Cellular Automata

Algebraic Number Theory Notes: Local Fields

a = a i 2 i a = All such series are automatically convergent with respect to the standard norm, but note that this representation is not unique: i<0

Local Fields. Chapter Absolute Values and Discrete Valuations Definitions and Comments

Some Background Material

Metric Spaces Math 413 Honors Project

Completion Date: Monday February 11, 2008

Material covered: Class numbers of quadratic fields, Valuations, Completions of fields.

p-adic Analysis Compared to Real Lecture 1

René Schoof s Algorithm for Determining the Order of the Group of Points on an Elliptic Curve over a Finite Field

CONGRUENCES FOR BERNOULLI - LUCAS SUMS

Number Theory, Algebra and Analysis. William Yslas Vélez Department of Mathematics University of Arizona

THE P-ADIC NUMBERS AND FINITE FIELD EXTENSIONS OF Q p

0.1 Valuations on a number field

We are going to discuss what it means for a sequence to converge in three stages: First, we define what it means for a sequence to converge to zero

Absolute Values and Completions

A brief introduction to p-adic numbers

P-adic Functions - Part 1

Nature is an infinite sphere of which the center is everywhere and the circumference nowhere. Blaise Pascal

Profinite Groups. Hendrik Lenstra. 1. Introduction

ABSOLUTE VALUES AND VALUATIONS

Contents Ordered Fields... 2 Ordered sets and fields... 2 Construction of the Reals 1: Dedekind Cuts... 2 Metric Spaces... 3

P -adic root separation for quadratic and cubic polynomials

Do we need Number Theory? Václav Snášel

LOCAL FIELDS AND p-adic GROUPS. In these notes, we follow [N, Chapter II] most, but we also use parts of [FT, L, RV, S].

Nonarchimedean Cantor set and string

The Completion of a Metric Space

Some topics in analysis related to Banach algebras, 2

p-adic Analysis in Arithmetic Geometry

CLASS NOTES FOR APRIL 14, 2000

Solutions, Project on p-adic Numbers, Real Analysis I, Fall, 2010.

Chapter 1 The Real Numbers

Fourth Week: Lectures 10-12

Solvability of Cubic Equations over 3 (Kebolehselesaian Persamaan Kubik ke atas 3

#A5 INTEGERS 18A (2018) EXPLICIT EXAMPLES OF p-adic NUMBERS WITH PRESCRIBED IRRATIONALITY EXPONENT

then it is called a non-archimedean absolute value. If condition (1.1.2) fails for some x, y F, then is called an archimedean absolute value.

QUOTIENTS OF FIBONACCI NUMBERS

1 Take-home exam and final exam study guide

Places of Number Fields and Function Fields MATH 681, Spring 2018

arxiv:math/ v1 [math.ho] 2 Feb 2005

Mid Term-1 : Practice problems

Math Subject GRE Questions

Sequences. Chapter 3. n + 1 3n + 2 sin n n. 3. lim (ln(n + 1) ln n) 1. lim. 2. lim. 4. lim (1 + n)1/n. Answers: 1. 1/3; 2. 0; 3. 0; 4. 1.

(1) Consider the space S consisting of all continuous real-valued functions on the closed interval [0, 1]. For f, g S, define

That is, there is an element

MAT 570 REAL ANALYSIS LECTURE NOTES. Contents. 1. Sets Functions Countability Axiom of choice Equivalence relations 9

CHAPTER 6. Limits of Functions. 1. Basic Definitions

WEIERSTRASS THEOREMS AND RINGS OF HOLOMORPHIC FUNCTIONS

Modular Counting of Rational Points over Finite Fields

Automorphisms of varieties and critical density. Jason Bell (U. Michigan)

1 Topology Definition of a topology Basis (Base) of a topology The subspace topology & the product topology on X Y 3

2 Metric Spaces Definitions Exotic Examples... 3

Tewodros Amdeberhan, Dante Manna and Victor H. Moll Department of Mathematics, Tulane University New Orleans, LA 70118

OSTROWSKI S THEOREM FOR Q(i)

Finite-dimensional spaces. C n is the space of n-tuples x = (x 1,..., x n ) of complex numbers. It is a Hilbert space with the inner product

Advanced Calculus: MATH 410 Real Numbers Professor David Levermore 5 December 2010

NATIONAL BOARD FOR HIGHER MATHEMATICS. Research Scholarships Screening Test. Saturday, January 20, Time Allowed: 150 Minutes Maximum Marks: 40

MATH 117 LECTURE NOTES

Math 117: Topology of the Real Numbers

MATH 23b, SPRING 2005 THEORETICAL LINEAR ALGEBRA AND MULTIVARIABLE CALCULUS Midterm (part 1) Solutions March 21, 2005

Statistical Properties of the Arithmetic Correlation of Sequences. Mark Goresky School of Mathematics Institute for Advanced Study

An introduction to some aspects of functional analysis

7 Lecture 7: Rational domains, Tate rings and analytic points

Metric Spaces and Topology

8 - Series Solutions of Differential Equations

SOLUTION TO RUBEL S QUESTION ABOUT DIFFERENTIALLY ALGEBRAIC DEPENDENCE ON INITIAL VALUES GUY KATRIEL PREPRINT NO /4

Dividing Polynomials: Remainder and Factor Theorems

Solutions to Practice Final

arxiv: v1 [math.nt] 8 Jan 2014

Logical Connectives and Quantifiers

DIFFERENTIABILITY IN LOCAL FIELDS

GENERAL QUARTIC-CUBIC-QUADRATIC FUNCTIONAL EQUATION IN NON-ARCHIMEDEAN NORMED SPACES

A p-adic Euclidean Algorithm

COMPLETELY INVARIANT JULIA SETS OF POLYNOMIAL SEMIGROUPS

Liapunov Stability and the ring of P-adic integers

Introductory Analysis I Fall 2014 Homework #9 Due: Wednesday, November 19

Department of Mathematics, University of California, Berkeley. GRADUATE PRELIMINARY EXAMINATION, Part A Fall Semester 2016

Analysis Comprehensive Exam Questions Fall F(x) = 1 x. f(t)dt. t 1 2. tf 2 (t)dt. and g(t, x) = 2 t. 2 t

Transcription:

The Mathematica Journal p-adic Arithmetic Stany De Smedt The p-adic numbers were introduced by K. Hensel in 1908 in his book Theorie der algebraïschen Zahlen, Leipzig, 1908. In this article we present a package that does p-adic calculations using Mathematica. It allows addition, subtraction, multiplication, and division of p-adic numbers written in Hensel expansion. Functions, such as sqrt, log, exp, sin, cos, sinh, and cosh, are defined using their power series expansion. We also calculate the coefficients of a continuous function with respect to the Mahler and Vanderput bases, and implement the p-adic Newton method. Introduction Let p be a prime number, fixed once and for all. If x is any rational number other than 0, we can write x in the form x = p n ÅÅÅÅ a, where a, b œ are relatively prime b to p and n œ. We now define» x» p = p -n and» 0» p = 0, and ord p HxL = n and ord p H0L = +. They satisfy the following properties. 1.» x» p 0,» x» p = 0 if and only if x = 0. 2.» x + y» p max 8» x» p,» y» p < (the strong triangle inequality) with» x + y» p = max 8» x» p,» y» p < if» x» p» y» p (the isosceles triangle principle). 3.» x. y» p =» x» p.» y» p. With ord p instead of».» p, we get for 2 and 3: ord p Hx + yl min 8ord p HxL, ord p HyL< ord p Hx. yl = ord p HxL + ord p HyL».» p is called the p-adic valuation; ord p H.L is called the p-adic order. Ostrowski proved that each nontrivial valuation on the field of rational numbers is equivalent either to the absolute value function or to some p-adic valuation. Recall that two valuations».» 1 and».» 2 are equivalent if there exists a positive constant c such that».» 2 =».» 1 c. For a proof of this theorem, see [1]. The completion of the field of rational numbers with respect to the p-adic valuation».» p is called the field of p-adic numbers and will be denoted p. The set p = 9x œ p x p 1= is the ring of p-adic integers.

350 Stany De Smedt It can be easily proved that each p-adic number x can be written in the form x = a n p n, n=- f where each a n is one of the elements 0, 1,..., p - 1, and f œ. This is called the Hensel representation of the p-adic numbers. Sometimes one uses, analogous to the ordinary decimal notation for real numbers, the notation a - f... a -3 a -2 a -1 a 0, a 1 a 2... a n-1 a n... It is this representation, preceded with < p > to denote the p-adic, that we will use in our package. With this representation, one obtains for x œ p : and ord p HxL = l o + if a i = 0 for all i, m n o min 8s» a x 0< otherwise,» x» p = p -ord p HxL. The set of values of».» p is 80< 8p n» n œ <, and 8p n» n œ < = 9 x p x œ p \ 80<= is called the valuation group of p. Every x œ p can be written as x = an p n with a n œ 80, 1,, p - 1<. The n=0 elements with a n = 0 for sufficiently large n can be identified with the nonnegative integers. Thus Õ p and p also contains as a subset. For example, -1 = Hp - 1L + Hp - 1L p + Hp - 1L p 2 +. Note also that every nonzero element x of p can be written as p n y, where n œ and y œ p with» y» p = 1. And just as with decimal fractions, a p-adic number x = ai p i is rational if and only if the sequence of the digits a i is i=n periodic from some index i on. Due to the strong triangle inequality, we may use the following property, which is much easier than in the Archimedean case: i=1 a i converges if and only if lim iø a i = 0. In general we say that a sequence a 1,, a n, in p converges to a if and only if lim» a n - a» p = 0 and we will write this as lim a n = a. nø nø For p and p we have the following topological properties, which we only present here for completeness. 1. p is compact: each covering by means of open sets has a finite subcovering.

p-adic Arithmetic 351 2. p is complete: every Cauchy sequence converges. 3. is dense in p : each element of p is the limit of elements of. 4. p is locally compact: each point has a compact neighborhood. 5. is dense in p. 6. p is complete and separable: it has a countable dense subset. 7. p is zero-dimensional: every neighborhood of a point contains an open and closed subset. 8. p is totally disconnected: the only subsets that are connected as a metric space are the empty set and the singletons. We now survey the different parts that are treated in this package. For more information on p-adic calculus, see [1] or [2]. p-adic Order and Valuation This is the implementation of the previously defined functions ord p and».» p. PadicOrder[s,p] returns the number of times that p divides s, roughly speaking. PadicValue@s, pd = 1 ê p PadicOrder@s,pD In[1]:= Get@"PadicArithmetic.m"D; In[2]:= PadicOrder[3/16,2] Out[2]= -4 In[3]:= Out[3]= PadicValue@144, 3D 1 ÄÄÄÄÄÄ 9 Conversion to p-adics Next we calculate the Hensel expansion of a p-adic number to a given precision. One may think of PadicN[n,p,k] as being a bit like N[n,k]. The internal representation is given as PadicRational[m,n,e,p]. PadicN[n,p] gives an eight-digit p-adic number; PadicN[n,p,k] gives k digits. The numbers to the right of the radix point represent the positive H > 0L powers, and the numbers to the left represent the negative H 0L powers. The implementation to print these expansions is made in the third section of the package entitled Printing of p-adics where we use PadicDigits[m,n,e,p] as an auxiliary function to aid formatting.

352 Stany De Smedt In[4]:= PadicN@102356, 3, 12D Out[4]= <3> 2. 2 2 1 0 1 2 1 0 2 1 0 In[5]:= PadicN@1 ê 6, 2, 10D Out[5]= <2> 1 1. 0 1 0 1 0 1 0 1 In[6]:= PadicN@17 ê 1024, 2D Out[6]= H<2>1. 0 0 0 1 0 0 0 L 1 ÄÄÄÄÄÄÄÄÄÄÄÄÄ 2 10 In[7]:= PadicN@125048, 20, 6D Out[7]= <20> 8. 12 12 15 0 0 Basic p-adic Arithmetic Addition and multiplication of p-adic numbers are defined in several cases whether or not both numbers are given in Hensel expansion. Note that addition and multiplication in p can be defined by a n p n + b n p n = n=n n=m i j a n p y i n z j kn=n { kn=m n=min 8N,M< b n p y n z = { in-m n=n +M Ha n + b n L p n, y j a i b n-i z pn. k i=n { The left-hand expansions are Hensel expansions, but the right-hand ones, in general, are not. Also p-adic exponentiation is implemented for the case of integer powers. We then define the p-adic version of some classical functions, such as log, exp, sin, cos, sinh, and cosh. This is done with the help of their power series expansions, which are completely analogous to the real case except that their regions of convergence might differ [1]. We have also defined square roots. The existence of square roots of a number x in p depends on the following theorems. Let p 2. A p-adic number x = ai p i H0 a i p - 1, a 0 0L is a square if and i=0 only if a 0 is a square residue mod p. Let p = 2. A 2-adic number x,» x» 2 = 1 is a square if and only if x ª 1 Hmod 8L. Finally, we implement the p-adic Gamma function. In[8]:= PadicN@10, 3, 5D Out[8]= <3> 1. 0 1 0 0

p-adic Arithmetic 353 In[9]:= PadicN@20, 3, 8D Out[9]= <3> 2. 0 2 0 0 0 0 0 In[10]:= % + %% Out[10]= <3> 0. 1 0 1 0 0 In[11]:= PadicN@15, 5D + 17 Out[11]= <5> 2. 1 1 0 0 0 0 0 0 In[12]:= PadicN@15, 5D * 17 Out[12]= <5> 0. 1 0 2 0 0 0 0 0 In[13]:= PadicN@9, 2, 10D 2 Out[13]= <2> 0. 1 0 0 1 0 0 0 0 0 0 In[14]:= PadicN@4, 3, 4D Out[14]= <3> 1. 1 0 0 In[15]:= Exp@%D Exp::overflow : Number not in the region of convergence In[16]:= Log@%%D Out[16]= <3> 0. 1 2 1 2 2 In[17]:= PadicN@15, 3, 4D Out[17]= <3> 0. 2 1 0 0 In[18]:= Exp@%D Out[18]= <3> 1. 2 1 0 1 In[19]:= PadicN@-1, 3, 4D Out[19]= <3> 2. 2 2 2 In[20]:= Sqrt@%D Sqrt::nonexistence : Square root does not exist In[21]:= PadicN@31, 5, 10D Out[21]= <5> 1. 1 1 0 0 0 0 0 0 0 In[22]:= Sqrt@%D Out[22]= <5> 1. 3 3 2 2 0 4 1 4 2 1 In[23]:= PadicGamma@15, 3D Out[23]= -44844800

354 Stany De Smedt In[24]:= Out[24]= PadicGamma@-2, 3D 1 ÄÄÄÄÄÄ 2 Booleans and Selectors on p-adic Rationals Here we implement whether or not a given number is a p-adic number. The second example selects the different parts of a p-adic number. Next we implement the conversion of a p-adic number to a rational number. We also define the function SqrtQ[x,p] to test whether the square roots of x exist in p or not. In[25]:= PadicN@12, 3, 5D ê PadicN@4, 3, 3D Out[25]= <3> 0. 1 0 0 In[26]:= PadicToRational@%D Out[26]= 3 In[27]:= PadicExponent@%%D Out[27]= 1 In[28]:= Out[28]= SqrtQ@-1, 3D False Function Expansion For the space CI p Ø p M of all continuous functions from p to p (we can simply transfer the definitions from classical analysis to non-archimedean analysis by adapting the valuations), there exist two well-known bases. On the one hand, we have the Mahler basis, consisting of the polynomials I n x M, n œ. On the other hand, there is the Vanderput basis, consisting of locally constant functions e n HxL, where e 0 HxL = 1 and for n 0, e n is the characteristic function of the open ball with center n and radius ÅÅÅÅ 1 n. Each continuous function f : p Ø p can then be written as f HxL = a n I n x M with a n = H-1L n- j J n j N f H jl, n=0 n j=0 f HxL = a n e n HxL with a 0 = f H0L and a n = f HnL - f Hn - L for n 0. n=0 Here n - is defined as follows. For every n œ 0, there exists a p-adic expansion n = a 0 + a 1 p + + a N p N with a N 0. Then n - = a 0 + a 1 p + + a N -1 p N -1.

p-adic Arithmetic 355 In this section of the package we implement these expansions as Mahler[f,x,n] and Vanderput[f,x,n,p], which calculate the first n + 1 coefficients of the function f HxL according to the respective basis. Note that the Vanderput expansion depends on p, while the Mahler expansion does not. In[29]:= Mahler@x 3 + x + 1, x, 5D 0 : 1 1 : 2 2 : 6 3 : 6 4 : 0 5 : 0 In[30]:= Vanderput@x 3 + x + 1, x, 5, 3D 0 : 1 1 : 2 2 : 10 3 : 30 4 : 66 5 : 120

356 Stany De Smedt In[31]:= Vanderput@x 3 + x + 1, x, 5, 5D 0 : 1 1 : 2 2 : 10 3 : 30 4 : 68 5 : 130 VolkenbornIntegral This is the p-adic equivalent of the classical integral. The Volkenbornintegral is defined as or equivalently p n -1 f HxL dx = lim p -n f HkL nø p k=0 H-1L n f HxL dx = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ p n + 1 Ûn f H0L. n=0 Here Û is the forward difference quotient: Û f HxL = f Hx + 1L - f HxL and Û n f HxL = ÛHÛ n-1 f HxLL. We used this last expression for our implementation. p-adic Newton Method Here we implement the well-known Newton method to solve an algebraic equation f HxL = 0. The algorithm is the same as in the classical case, that is, we use the iterations x n+1 = x n - f Hx n L ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ f Hx n L. The main problem is to find an appropriate starting value since convergence might be rather slow. We tried to solve this based on the following theorem. Let FHxL be a polynomial with p-adic integer coefficients and let there exist g œ p, such that FHgL ª 0 Hmod pl and F HgL T 0 Hmod pl. Then there exists a œ p, such that FHaL = 0 and a ª g Hmod pl.

p-adic Arithmetic 357 Here is an example. In[32]:= PadicNewton@x^ 2-1, x, 2, 0.0001, 3D Out[32]= <3> 2. 2 2 2 2 2 2 2 2 References [1] W. Schikhof, Ultrametric Calculus: An Introduction to p-adic Analysis, New York: Cambridge University Press, 1984. [2] N. Koblitz, p-adic Numbers, p-adic Analysis, and Zeta-Functions, London: Springer-Verlag, 1977. [3] S. Wolfram, The Mathematica Book, 5th ed., Champaign: Wolfram Media, Inc., 2003. Additional Material PadicArithmetic.m Available at www.mathematica-journal.com. Stany De Smedt KBC Bank & Verzekeringen Havenlaan 12,1080 Brussels, Belgium