A formalization of the concept of a perfectoid space in the Lean formal proof verification system.
By Kevin Buzzard, Johan Commelin, and Patrick Massot.
See the project website.
Perfectoid spaces in the Lean formal theorem prover.
Home Page: https://leanprover-community.github.io/lean-perfectoid-spaces/
License: Apache License 2.0
A formalization of the concept of a perfectoid space in the Lean formal proof verification system.
By Kevin Buzzard, Johan Commelin, and Patrick Massot.
See the project website.
Theorem: to give a term of type perfectoid space X
is to give a perfectoid space (in the sense used in the mathematical literature).
Proof: Looking at the definition of perfectoid space in our repository, and comparing it with the definition in the literature, one sees that there are two instances where we do not follow the definition in the literature, but instead do something equivalent. Here is the justification that what we do is equivalent.
Traditionally in the literature the topology on Spa(A) is defined to be the one generated by basic open sets, but in our repository we used the one generated by rational open sets. A reference in the informal literature for the fact that these topologies coincide is Theorem 3.5(ii) of "Continuous Valuations", by R. Huber (Math Z 212, 455--477, 1993).
Once this theorem is formalised in Lean, we can change our definition of the topology to be the one generated by the basic opens and thus conform more closely to the literature.
A reference for the definition of the presheaf on Spa(A) in the informal literature is the definition just after the end of the proof of Lemma 1.5 in "A generalization of formal schemes and rigid analytic varieties", by R. Huber (Math Z 217, 513--551, 1994). The reason we do not use this definition is that we have not yet formalised the proof of Lemma 1.5(i) of Loc Cit, a geometric universal property of rational open subsets. As a consequence we cannot define all of the morphisms between rings involved in Huber's projective limit. Instead we use a trick. If U and V are rational subsets of Spa(A) and V is a subset of U, then we can define restriction maps from O_X(U) and O_X(V) to an auxiliary ring R, and use these two maps instead of the map O_X(U)->O_X(V) in our projective limit. R is constructed using the proof that the intersection of two rational opens is a rational open, applied to U intersect V. Because U intersect V equals V, R is isomorphic to O_X(V), but a formal proof of this needs a formal proof of Lemma 1.5(i), which we have not yet completed.
We summarise the situation as follows. Two theorems in the informal literature imply that our definition of perfectoid space is the same as the definition in the informal literature. However we have not yet formalised the proofs of these theorems in Lean.
For those more familiar with Wedhorn's "Adic Spaces" notes (never published, but extremely helpful), the two results we have not formalised are Theorem 7.35(2) and Proposition 8.2(1). To give some idea of what is involved here, 8.2(1) relies on 7.18, whose proof involves setting up some of the theory of primary and secondary specialisations of valuations, and Theorem 7.35(2) relies on the theory of the sets Spv(A,I) and the subgroup c\Gamma_v of the value group. All of this is possible in Lean, it simply takes time.
Following the cut-n-paste installation instructions on master
gives a repo which does not complile. We have not updated mathlib for a while, and Patrick and I have between us managed to create two non-rfl instances of a class.
/home/buzzard/lean-projects/lean-perfectoid-spaces/src/r_o_d_completion.lean:43:2: error: synthesized type class instance is not definitionally equal to expression inferred by typing rules, synthesized
domain.to_ring (ring_completion (valuation_field (out (v.val))))
inferred
comm_ring.to_ring (ring_completion (valuation_field (out (v.val))))
This needs more than I thought. To construct the sections we need an API for complete rings as discussed in #24 . This is enough to construct the sections. But to define the restriction morphisms we need a bunch of general topological ring theory.
To construct the restriction morphisms we need at least (1) of Proposition 8.2 which needs the more geometric universal property Lemma 8.1, which need the usual universal property of completions and Prop 7.52 (and hence 7.18 whose proof is not in Wedhorn but is in Huber's "continuous valuations" (but doesn't look too bad), and the hard part of 7.49 too, which needs some of 7.44). Everything needs ideals everywhere. But nothing needs modules.
The code should somehow be documented. My dream for this would be that the low-level files (like valuation.basic
) just get big comment blocks at the top explaining the API of the file, and the higher level files get LaTeX code which could be read using Patrick's formatter. I am a bit unclear about what exactly we can do here, but ultimately now we have the code I think that we should be thinking about trying to make what we have more accessible to mathematicians.
I have always claimed that we need that the integral closure of a subring is a subring. The use case is: when constructing the sheaf "O-plus" on Spa A
. But actually there is a second construction using valuations (see (8.13.1) in Wedhorn, p78) and if we use this construction and do not prove Proposition 8.15 of Wedhorn then we might be able to cut a corner. I am not advocating cutting corners.
The main issue involved is showing that addition and multiplcation of integral elements is integral. One proof of this involves reducing to the Noetherian case and then using the Hilbert Basis theorem. Given that we now have Noetherian rings -- why not?
Discussions on github about Hilbert basis:
Main hold-ups: (1) module refactoring (2) Kevin busy (3) Kevin not entirely convinced integral closure is necessary [although Kenny also wants it for algebraic closure]
We have made a lot of recent progress on the valuation API; I've worked on this for a couple of days but now need to get back to other things, so here's a quick summary of where we are.
Given a valuation v : R -> Gamma union {0}, let canonical_ordered_group v
. The valuation canonical_valuation v
. The lemma canonical_valuation.map
says that the canonical valuation composed with the natural map canonical_ordered_group.toΓ v
from canonical_ordered_group v
to Gamma recovers v
. I am not wedded to these names by the way! It's just how I was thinking of them.
Here are the things still to be done for the valuation API to be complete:
I proved that canonical_ordered_group.toΓ v
is a group hom, but we need to show it preserves <=.
Prove that the inequality corresponding to canonical_valuation v
is the inequality corresponding to valuation v
, i.e. prove that v is equivalent to canonical_valuation v
. I think that this trivially follows from 1 and canonical_valuation.map
.
Make a quotient API for Spv. Define lift by evaluating on the canonical valuation. Prove the computation rule from the fact that v is equivalent to its canonical valuation.
We need to understand exactly how much of Wedhorn 1.27 we now need. Our goal here is to prove that continuity is constant across equivalence classes. My proposed new definition of the value group is just canonical_ordered_group v
-- it is isomorphic to the value group. The proof that equivalent (in our sense) valuations have isomorphic value groups now becomes the statement that equivalent valuations have the same K and the same
All this is easily within sight now, as far as I can see.
It might be easiest to just comment out all the minimal_valuation stuff right now because we should never have to use it -- the canonical valuation replaces this stuff; the canonical valuation has all the properties that the minimal valuation had, and more.
Other than the empty space we currently have no examples of perfectoid spaces. The most natural class of examples would be to prove that if K is a perfectoid field then Spa(K) is a perfectoid space, and then to give examples of perfectoid fields. I guess the natural example is the completion of an algebraic closure of the p-adic numbers.
Route to examples of perfectoid spaces (needs fleshing out):
We have already built perfectoid rings, so building perfectoid spaces is the same as building adic spaces, which is hence the main work in this issue.
An adic space is just a pre-adic space plus an extra axiom (the structure presheaf is a sheaf) so the main work is to build a structure in Lean corresponding to a pre-adic space.
For this we first need the objects of the category Wedhorn calls V^pre on p76. These objects do not seem hard to define.
The main work is the assumption that the space is locally affinoid; so we need the notion of an isomorphism in V^pre (which should not be hard; is it less hard than defining general morphisms in that category?), the fact that an open subset of a space in V^pre gets an induced structure of an object in V^pre, and we need that Spa A
is in V^pre, so we certainly need the structure presheaf on Spa A
(#25) and we also need Wedhorn 8.6 to "do it properly" but in theory I could imagine circumventing this (and it doesn't look too hard).
lean-perfectoid-spaces/src/adic_space.lean
Line 433 in 9384997
We currently take the full subcategory, but we should of course require local ring morphisms on the stalks. We don't need this instance, so we might as well just remove it.
We need completions to define the sections of the presheaf on Spa(A).
To define the presheaf on a rational open in Spa(A) via the formula in Wedhorn (8.2.1) (p75) we need to create the ring A<T/s>, which is a completion -- see p74, six lines down. To extend the presheaf to an arbitrary open we need that projective limits exist in the category of complete topological commutative rings, although Reid and possibly also Mario suggested that we might want to show that complete comm rings are a reflective category of all comm rings because this provides stronger results which we might well need. We need the universal property of completions stated at the beginning of section 8.1 (to define the restriction morphisms).
Somewhere I did colimits of commutative rings. Limits should be easier. We also need limits and colimits of commutative topological rings. Finally we need to use Patrick's work showing complete rings are a reflective subcategory to deduce that limits of complete topological rings exist and are complete (you know what I mean by this)
The main problems left have been broken down into smaller issues (2 to 5).
A perfectoid_space
is an adic_space
with some properties, and the main work involved in formalising the definition of a perfectoid space will be formalising adic spaces. Indeed, modulo adic spaces, the definition of a perfectoid space is basically already in the repository, modulo some basic definitions in the theory of topological rings (bounded subset, power-bounded elements) which we'll have to do for adic spaces anyway. One could imagine a basic topological_ring.lean
file containing definitions like this, and it would probably not be a hard job to reduce the definition of perfectoid space to the definition of adic space.
My proposal for formalizing adic_space
, the definition of an adic space, is Torsten Wedhorn's notes. The definition of an adic space is on page 80 of these notes. Note the warning at the beginning, but note also that I have read the definition given in these notes in full and I believe it's fine. In fact, formalizing the definition of an adic space might in some sense be a way of verifying that the notes are fine.
Let me give more details of what needs to be done. Page numbers are all for Wedhorn's notes.
An adic space (definition 8.21, p80) is something which is covered by affinoid adic spaces, so one needs to define affinoid adic spaces. Indeed, given the definition of an affinoid adic space it should be relatively easy to formalise the definition of adic space.
An affinoid adic space (definition 8.20, p80) -- this is where the meat is. One attaches an affinoid preadic space to a Huber pair (the old name for a Huber pair is an "affinoid ring"); an affinoid preadic space is a topological space with a presheaf of topological rings and some extra structure, and an affinoid preadic space is an affinoid adic space if this presheaf is a sheaf. I define presheaves and sheaves in my schemes repository but I am older and wiser now, and have a clearer idea about how this should be done. I only needed presheaves of rings, not topological rings, but this should be a relatively straightforward extension. One could imagine developing a general theory of presheaves (of types and of topological rings) and of sheaves, however I am unclear about whether one should embark upon presheaves taking values in an arbitrary category at this point, because there is still not much category theory in mathlib (although this will soon change). This theory is just a general part of the geometer's toolkit and is independent of the theory of adic spaces.
A Huber pair (called "affinoid ring" in Wedhorn) is defined in definition 7.14(2), page 60. It is a pair consisting of a Huber ring (called "f-adic ring" in Wedhorn, and I won't be the only person pleased to see the back of this notation) and a "ring of integral elements" (definition 7.14(1)). These definitions will be a good test of Lean's type class system and I hoping that they will be relatively straightforward to implement but they involve working with topological rings. In fact it would not be unreasonable to target Huber rings and Huber pairs fairly early on in the formalization process -- we will be working a lot with topological rings and this will just involve formalising some basic definitions in the theory like the topology generated by an ideal of a commutative ring, the notion of a bounded subset of a topological ring and so on.
The main work involved in formalising adic spaces is the Spa
function, which is definition 7.23 on p62. This function eats a Huber pair and spits out an object of the category called
Valuations have basically already been done (by Kenny Lau) and are in the repo, in src/valuations.lean
at the time of writing, although this might change. One needs to define the topology on the appropriate space of valuations (and prove that it is a topology). The main work here is defining the topology on an auxiliary object
I envisage the hardest part of the formalisation as being the definition of the presheaf on Spa(A). To define it on rational subsets (definition 7.29, p62) one needs a theory of localization (which we have) and a theory of completion (which we don't have). Once we have these, the definition is equation 8.21 on p75. In addition to this, one needs to extend the presheaf to all open subsets, which is a projective limit procedure described just after. Now checking the presheaf axioms will be some work, but it hopefully won't be too hard.
Currently perfectoid ring extends Tate ring. This is cluttering the properties in perfectoid ring. I think we should remove the extension, and prove an instance from perfectoid ring to Tate ring.
I believe one should PR the content of this repo into mathlib bit by bit to preserve this repo. Afterall, a Chinese proverb says that "anything not PR'ed into mathlib is lost in time".
I imagine this will start with src/for_mathlib
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.