Zulip Chat Archive
Stream: mathlib4
Topic: Real Closed Fields Project
Artie Khovanov (Jun 26 2025 at 01:16):
I'm formalising some real algebra in Mathlib :slight_smile:
https://artie2000.github.io/real_closed_field/
I've got a blueprint, which should make it relatively easy to contribute if you are interested!
I've already formalised some material on orderings of rings and fields.
I think a good target is the characterisation of real closed fields (Theorem 40 / RCF_tfae).
I have some material beyond this (Sturm's theorem, real closures, Artin-Schreier theorem) but I haven't fully worked out a path to formalising it.
Eventually I want to prove the Tarski-Seidenberg principle, but that's quite far away and I'm not really sure how equipped Lean is to handle the computational aspects of the theory.
I'm doing this in my spare time, so progress will be slow, but any contributions are very welcome! The ultimate goal is to upstream everything to Mathlib.
Kenny Lau (Jun 26 2025 at 02:09):
wow that's quite quick!
Violeta Hernández (Aug 21 2025 at 22:27):
Hi! I'm interested in this. I kind of need this in order to show surreals are real closed.
Artie Khovanov (Aug 22 2025 at 00:07):
@Violeta Hernández what results do you need? See the blueprint for what I have planned
Violeta Hernández (Aug 22 2025 at 00:08):
I need the result that for a real-closed field and a divisible group, the field of Hahn series is also real-closed
Violeta Hernández (Aug 22 2025 at 00:15):
I'm not really sure if this is more of a Hahn series result or a real-closed field result
Violeta Hernández (Aug 22 2025 at 00:15):
Found this on ncatlab
image.png
Artie Khovanov (Aug 22 2025 at 00:18):
Yep OK so the only bit of real closed field theory you need there is that index 2 in algebraic closure implies real closed (so, Theorem 50 in the current version of my blueprint)
Artie Khovanov (Aug 22 2025 at 00:19):
The rest is Hahn series stuff eg k[t^G][i]=k[i][t^G]
Artie Khovanov (Aug 22 2025 at 00:22):
At the moment that result (Theorem 50) is a while away, at least the way I want to prove it, due to missing API around quadratic extensions (see Lemma 3)
But any contributions in this direction would of course be very welcome :)
Violeta Hernández (Aug 22 2025 at 00:23):
How do you even write down K[i] in Mathlib?
Artie Khovanov (Aug 22 2025 at 00:24):
AdjoinRoot K (X^2 + 1)
Artie Khovanov (Aug 22 2025 at 00:25):
And, if you already have your field, use IsAdjoinRoot
Violeta Hernández (Aug 22 2025 at 00:28):
Thanks!
Violeta Hernández (Aug 22 2025 at 00:28):
I'll read about this. Hope I'm not jumping into something far beyond my depth...
Artie Khovanov (Aug 22 2025 at 00:31):
Nothing in the blueprint is really beyond the level of a first course in number fields, if you take the ordering stuff as given
And much of the proofs is just polynomial manipulation
I'm still getting to grips with this part of the library though; it feels like there's definitely missing API
Violeta Hernández (Aug 22 2025 at 00:32):
Polynomials in Mathlib my beloathed
Artie Khovanov (Aug 22 2025 at 00:32):
There isn't even a normal form for them
Weiyi Wang (Aug 31 2025 at 01:01):
I reminded myself about this project as I stumbled upon some theory mentioning real-closeness. Specifically this lemma: a Gamma-valued, real-closed or algebraically closed field F has a section (a group homomorphism Gamma->F that's right inverse of the valuation. I wonder if it is in the scope of the project, or when the definition of real closed field will be ready in mathlib to express this.
Aaron Liu (Aug 31 2025 at 01:02):
for any Gamma?
Aaron Liu (Aug 31 2025 at 01:03):
or does the valuation have to be surjective
Aaron Liu (Aug 31 2025 at 01:04):
wait what do you mean the field has a section, and where did the valuation come from
Weiyi Wang (Aug 31 2025 at 01:08):
For any valuation. Gamma just refers to the value group (so surjectivity implied). "Section" is just name given to the homomorphism in the article I am reading
Artie Khovanov (Aug 31 2025 at 01:11):
I have "real closed field" stated but I haven't proved much about them yet
the API around finite extensions of fields needs work
Weiyi Wang (Aug 31 2025 at 01:23):
:smile: Would be nice to see it in mathlib even with just simple definition and lemmas. I think the actual lemma I need is "you can take n-th root in real closed fields"
Artie Khovanov (Aug 31 2025 at 01:25):
Well, you can't take nth roots, necessarily. You can take them when n is odd, or when n is even and your element is non-negative. Stuff about real closed fields is generally proved from the algebraically closed field version using the characterisation of real closed fields as non-algebraically-closed fields whose extension by is algebraically closed.
Weiyi Wang (Aug 31 2025 at 01:28):
sorry I should clarify I meant taking n-th root of a positive number
Artie Khovanov (Aug 31 2025 at 01:29):
Here is the definition I have right now:
/- An ordered field is real closed if every nonegative element is a square and
every odd-degree polynomial has a root. -/
class IsRealClosed (R : Type*) [Field R] [LinearOrder R] : Prop extends IsStrictOrderedRing R where
isSquare_of_nonneg {x : R} (hx : 0 ≤ x) : IsSquare x
exists_isRoot_of_odd_natDegree {f : R[X]} (hf : Odd f.natDegree) : ∃ x, f.IsRoot x
I don't have much else (you can check out the project blueprint to see current scope and progress)
Violeta Hernández (Aug 31 2025 at 06:08):
I'd love to see the definition in Mathlib too. That way I can add the relevant proof_wanted for my project!
Filippo A. E. Nuccio (Aug 31 2025 at 11:07):
I think @Florent Schaffhauser had somethink on this.
Artie Khovanov (Aug 31 2025 at 13:13):
Yes, this project comes as a result of his work on real algebra.
Last updated: Dec 20 2025 at 21:32 UTC