Formalizing the Ring of Witt Vectors
Total Page:16
File Type:pdf, Size:1020Kb
Formalizing the Ring of Witt Vectors Johan Commelin Robert Y. Lewis [email protected] [email protected] Albert–Ludwigs-Universität Freiburg Vrije Universiteit Amsterdam Freiburg, Germany Amsterdam, The Netherlands Abstract 1 Introduction The ring of Witt vectors W' over a base ring ' is an impor- Formalizing a full undergraduate mathematics curriculum tant tool in algebraic number theory and lies at the founda- has long been a goal of the proof assistant community [31]. tions of modern ?-adic Hodge theory. W' has the interesting This horizon is arguably now in sight: most topics in the property that it constructs a ring of characteristic 0 out of a standard curriculum can be found in at least one major proof ring of characteristic ? ¡ 1, and it can be used more specif- assistant library. As researchers, though, we cannot simply ically to construct from a finite field containing Z/?Z the take this as a win. With undergraduate mathematics done corresponding unramified field extension of the ?-adic num- we must turn to new challenges. bers Q? (which is unique up to isomorphism). Formalizations of modern research mathematics are laud- We formalize the notion of a Witt vector in the Lean proof able, but remain rare for good reason. Such projects tend to assistant, along with the corresponding ring operations and take massive efforts [10, 13], to formalize only part of the other algebraic structure. We prove in Lean that, for prime ?, main result [28], or to target theorems that are exceptionally the ring of Witt vectors over Z/?Z is isomorphic to the ring well-suited for mechanization [7]. of ?-adic integers Z? . In the process we develop idioms to This scarcity of results is hardly surprising. Mastery of un- cleanly handle calculations of identities between operations dergraduate topics is necessary to do research mathematics, on the ring of Witt vectors. These calculations are intractable but far from sufficient: Buzzard, Commelin, and Massot [3] with a naive approach, and require a proof technique that is note the depth of theory that is needed even to define the usually skimmed over in the informal literature. Our proofs structures studied in many subfields. We may be nearing the resemble the informal arguments while being fully rigorous. first horizon of undergraduate mathematics, but the seabe- tween us and the second horizon—graduate mathematics—is CCS Concepts: • Theory of computation ! Type the- vast, little explored, and filled with adventures. ory; • Mathematics of computing ! Mathematical anal- As a new expedition into this sea, we have constructed ysis; • Security and privacy ! Logic and verification. the ring of ?-adic Witt vectors and related operations in the Lean proof assistant and verified some of their fundamental Keywords: formal math, ring theory, number theory, Lean, properties. Specifically, we define the Teichmüller lift and proof assistant the Frobenius and Verschiebung operators, and show that the ring of Witt vectors over Z/?Z, the integers modulo ACM Reference Format: ?, is isomorphic to the ?-adic integers. To our knowledge, Johan Commelin and Robert Y. Lewis. 2021. Formalizing the Ring of these topics have never before been formalized in a proof Witt Vectors. In Proceedings of the 10th ACM SIGPLAN International assistant. Our development pushes forward the front line of Conference on Certified Programs and Proofs (CPP ’21), January 18– formalizations in ring theory. 19, 2021, Virtual, Denmark. ACM, New York, NY, USA, 14 pages. Our project resulted in substantial additions to the ring https://doi.org/10.1145/3437992.3439919 theory and multivariate polynomial sections of Lean’s math- ematical library mathlib [21]. Building on Lewis’ develop- ment of the analytic properties of the ?-adic numbers Q? and Permission to make digital or hard copies of all or part of this work for ?-adic integers Z? [17], we have established more of their personal or classroom use is granted without fee provided that copies algebraic properties: we show that Z? is a discrete valuation are not made or distributed for profit or commercial advantage and that ring and is the projective limit of the rings Z/?=Z of integers copies bear this notice and the full citation on the first page. Copyrights ?= for components of this work owned by others than the author(s) must modulo . Our project also served to stress test Lean 3’s be honored. Abstracting with credit is permitted. To copy otherwise, or type class inference mechanism in an algebraic context. republish, to post on servers or to redistribute to lists, requires prior specific The early theory of Witt vectors was developed in the permission and/or a fee. Request permissions from [email protected]. 1930s [25, 32]. They form a fundamental tool in algebraic CPP ’21, January 18–19, 2021, Virtual, Denmark number theory and lie at the foundations of modern ?-adic © 2021 Copyright held by the owner/author(s). Publication rights licensed Hodge theory. For example, they provide an elegant way to ACM. Z ACM ISBN 978-1-4503-8299-1/21/01...$15.00 to construct unramified ? -algebras with prescribed finite https://doi.org/10.1145/3437992.3439919 residue fields of characteristic ?. The ring of Witt vectors also CPP ’21, January 18–19, 2021, Virtual, Denmark Johan Commelin and Robert Y. Lewis appears in the definitions of Fontaine’s period ring 퐵 [9], 1 1 1 1 1 1 1 1 2 1 2 1 2 1 1 1 1 1 1 1 1 dR ... ... ... an important component in the classification of ?-adic Galois 44444444 31313132 31313132 ... representations. Indeed, all the ingredients for the definition ¸ 1 × 3 ¸ 44444444 0 1 ... 31313131 of 퐵dR have now been formalized in Lean. Witt vectors have a reputation among mathematicians of being forbidding and impenetrable. Presentations often skip Figure 1. If we represent Z? as left-infinite streams of digits, ? the details of technical proofs and lengthy calculations; these we can perform addition and multiplication in base by ... can become nightmarish unless approached very carefully. carrying remainders to the left. 5-adically, 444444 ¸ 1 = 0 ... One would reasonably expect a formalization to be even more and 313132 × 3 = 1. nightmarish, but we have found idioms in our development that often lead to short, clean proofs and calculations, clearer We can alternatively give an algebraic characterization than their traditional counterparts. In many cases, we have of the ?-adics. From this perspective, we take Z? to be the been able to reduce goals to universal calculations in the = projective limit of Z/? Z in the category of rings and Q? to language of rings (Section 4.4), which can be discharged be the field of fractions of Z? . by very simple tactics (Section 5.3). We believe that these Either perspective allows us to see I 2 Z? as an infinite statements and proofs are mathematically legible. We were Í1 I ?: I I ? : sum :=0 : where : 2 Z, 0 ≤ : < for each . (While not able to erase the details in every case, though. Our proofs this sum may diverge in the standard absolute value, it al- that certain polynomials are integral are long, slow, and ways converges in the ?-adic norm.) This is particularly clear unreadable, just as they are on paper. from the algebraic perspective, as the =th partial sum cor- Our formalization is integrated into mathlib. We provide responds to an approximation to I in Z/?=Z. One can thus up-to-date information and links to the source code on the picture a ?-adic integer as a left-infinite base-? expansion of project website: digits (Fig.1). https://leanprover-community.github.io/witt-vectors The ?-adic numbers are fundamental to many areas of number theory. Among many other applications, they appear 2 Preliminaries in the studies of Diophantine equations [16] and rational The formalized contributions described in this paper can be points on algebraic varieties [22], and lie at the core of the roughly split into three parts: Hasse principle in Diophantine geometry [2]. ? 1. We expand the algebraic theory of the ring of -adic 2.2 The Ring of ?-Typical Witt Vectors integers Z (Section3). ? ? ' 2. We define the notion of a Witt vector over an arbitrary Fix a prime number and a commutative ring . The under- ? ' ring ' (Section4) and construct a ring structure on the lying set of the ring of -typical Witt vectors W is the set of ' ? set of Witt vectors itself, additionally defining some functions N ! . (Note that the prime number is usually ' fundamental operations on this ring (Section5). suppressed in the notation W .) One usually pictures a Witt G 3. We show that the ring of Witt vectors over Z/?Z is vector as a left-infinite sequence of coefficients: isomorphic to Z? (Section6). ¹...,G8,...,G2,G1,G0º,G8 2 '. Parts1 and2 are independent of each other; part3 bridges A very illustrative example to keep in mind is W¹Z/?Zº, in the first two. which the coefficients G8 are integers modulo ?. Readers may To give the reader a high-level overview of the mathemat- recognize the similarity to Z? , and we will eventually show ical content of our formalization, we sketch here the route that they are isomorphic as rings, although this isomorphism that we will follow. Since there is extensive introductory is not the map that preserves the sequence of coefficients. ? literature on the -adic numbers we focus on the latter parts. We will now describe some properties of W'. Our main reference for part1 is Gouvêa [ 11], although much First, W' is a commutative ring of characteristic 0, even if is folklore. Parts2 and3 primarily follow Hazewinkel [14]. ' has characteristic ? ¡ 1. For Witt vectors G = ¹...,G1,G0º and ~ = ¹. ,~ ,~ º in W', the addition and multiplication 2.1 Q and Z 1 0 ? ? are defined as follows: The analytic perspective on the ?-adic numbers Q? defines G ¸ ~ = ¹...,(8 ¹G,~º,...,(1 ¹G,~º,(0 ¹G,~ºº them analogously to the real numbers R.