Zulip Chat Archive

Stream: maths

Topic: Cyclotomic fields


Riccardo Brasca (Oct 23 2021 at 09:41):

@Eric Rodriguez If you want refactor the definition of cyclotomic polynomials pleas go ahead.
But the current API should suffice to prove that the splitting field of cyclotomic n Z is the same as the splitting field of X^n-1. We know that the roots if cyclotomic n Z (in C) are the primitive roots of unity.

Riccardo Brasca (Oct 23 2021 at 09:44):

Are you planning to do some Galois theory after that?

Eric Rodriguez (Oct 23 2021 at 09:46):

Yes, that's the plan. I was hoping to get some more general results (I think they're equal if X^n-1 is separable in R) but I'm not averse to the specialised results if that's what's easiest, too

Riccardo Brasca (Oct 23 2021 at 09:48):

Oh yes, I mean in characteristic 0.

Riccardo Brasca (Oct 23 2021 at 09:51):

In any case we know that cyclotomic n Z is irreducible and we know its roots, so mathematically there is not a lot to do, but of course in Lean the story is different. But I think that if there is something missing is rather about splitting fields in general than about cyclotomic polynomials. (Of course there a lot of missing results about cyclotomic polynomial, but for Galois theory what we have should suffice).

Riccardo Brasca (Oct 23 2021 at 09:55):

I am asking because I think that a very very interesting middle sized project is Fermat Last Theorem for regular primes. I don't know if someone else is working on it, but if this is not the case I would like to think about it.

Antoine Chambert-Loir (Oct 23 2021 at 15:34):

Could one define the cyclotomic polynomials as the unique sequence $(\Phi_n)$ of monic polynomials with integer coefficients characterized by the formula $T^n-1=\prod_{d\mid n} \Phi_d$ holds?

Kevin Buzzard (Oct 23 2021 at 15:35):

you'd have to simultaneously make the definition and the proof that polynomials exist which satisfy the property, but this can be done

Kevin Buzzard (Oct 23 2021 at 15:36):

Alternatively you could define them to be "Phi(n) is T^n-1/prod_{d|n, d<n}Phi(d) if this is a polynomial, and 37 otherwise" and then prove later on that none of them are 37

Riccardo Brasca (Oct 23 2021 at 15:37):

This is essentially what Johan was proposing. But let me stress that we already have a definition, and a pretty good API (up to irreducibility). I maybe chose the wrong definition at the beginning, going through the complex numbers, but before thinking about alternative definitions we should ask ourselves if it is worth the effort of reproving all the results.

Kevin Buzzard (Oct 23 2021 at 15:37):

actually I think Phi(0) might be 37

Riccardo Brasca (Oct 23 2021 at 15:38):

We already add this discussion one year ago :). Currently cyclotomic 0 R = 1.

Kevin Buzzard (Oct 23 2021 at 15:38):

but it doesn't have degree phi(0)=2 ;-)

Riccardo Brasca (Oct 23 2021 at 15:40):

docs#polynomial.degree_cyclotomic says it's true for all n, so I think 0.totient = 0.

Yaël Dillies (Oct 23 2021 at 15:41):

That makes sense from my point of view, as no element strictly smaller than 0 is coprime with 0.

Riccardo Brasca (Oct 23 2021 at 15:41):

BTW, what I was proposing to get rid of the use of complex numbers in much simpler than redoing everything: it suffices to have a char 0 field with all the primitive roots of unity (like Q bar). I should check, but maybe we can even use a different field for every n, and then the splitting field of X^n-1 would be enough.

Riccardo Brasca (Oct 23 2021 at 15:44):

Of course this not for any mathematical reasons, it is just to avoid having import analysis.complex.roots_of_unity at the beginning of a morally "algebraic" file.

Kevin Buzzard (Oct 23 2021 at 16:42):

So we're saying there are three approaches. There's a totally "hands-on" approach where you define Phi_n recursively in Z[X]\Z[X], there's an approach via Galois theory where you work in the splitting field of Xn1X^n-1 (so it imports a whole bunch of algebra files) and there's an approach via using the complex numbers (where you import some analysis files). The "hands-on" approach will need very few imports but you might have to work hard and I guess it's not clear whether there's any point in doing so just to shorten the import tree -- you would be making mathlib more incomprehensible. The approach via splitting fields -- you won't have to import the complex numbers and a proof that they're algebraically closed (actually no, you only need a basic theory of roots of unity which is much easier), but you will have to import quite a bit of field theory.

Riccardo Brasca (Oct 26 2021 at 08:54):

For those that are not following the flt-regular stream: we are discussing about the definition of cyclotomic extensions/fields. We want a super general definition, even if of course we are going to work in a much more specific case. Does anyone have in mind something called "cyclotomic extension" that is not captured by the following?

import field_theory.splitting_field
import data.pnat.basic

class is_cyclotomic_extension (K L : Type*) [field K] [field L] [algebra K L] (S : set pnat) :=
(splits (a : pnat) (ha : a  S) : polynomial.splits (algebra_map K L) (polynomial.X^(a : ) - 1))
(adjoint_roots : algebra.adjoin K { b : L |  a : pnat, a  S  b^(a : ) = 1 } = ) -- or some other equivalent condition

Filippo A. E. Nuccio (Oct 26 2021 at 09:05):

Do you really want to restrict to field K and field L? It might be useful to say that Z[ζn]\mathbb{Z}[\zeta_n] is a cyclotomic extension.

Riccardo Brasca (Oct 26 2021 at 09:34):

docs#polynomial.splits is for fields. But don't worry, we have docs#integral_closure.is_integral_closure for that.

Riccardo Brasca (Oct 26 2021 at 09:35):

So the idea is to have cyclotomic extensions of fields and their ring of integers (of course with the lemma that says it's enough add a primitive root of unity).

Filippo A. E. Nuccio (Oct 26 2021 at 09:37):

Yes, I know the integral_closure business; but I am wondering if it is reasonable to impose that a "cyclotomic algebra tower" be only defined for fields.

Filippo A. E. Nuccio (Oct 26 2021 at 09:39):

(deleted)

Riccardo Brasca (Oct 26 2021 at 09:40):

Well, to be honest I am not even sure what that notation means. In real math, when we write Z[α]\mathbb{Z}[\alpha] we often mean the ring of integers of Q(α)\mathbb{Q}(\alpha).

Riccardo Brasca (Oct 26 2021 at 09:40):

We rarely speak about the subalgebra generated by α\alpha, unless it is already integrally closed

Filippo A. E. Nuccio (Oct 26 2021 at 09:41):

No, I am not so sure; Z[5]\mathbb{Z}[\sqrt{5}] is a very honest order in Q(5)\mathbb{Q}(\sqrt{5})

Riccardo Brasca (Oct 26 2021 at 09:42):

OK, probably I rarely use that :innocent:

Riccardo Brasca (Oct 26 2021 at 09:42):

But what definition do you propose? We cannot say that a polynomial is split over a ring

Filippo A. E. Nuccio (Oct 26 2021 at 09:43):

I think it would be a problem to only have full rings of integers; for instance, if one day we develop global CFT, it would be important to develop general orders.

Riccardo Brasca (Oct 26 2021 at 09:43):

Wait, maybe the condition splits is useless

Filippo A. E. Nuccio (Oct 26 2021 at 09:44):

We can say it splits over a domain, where there are at most as many roots as the degree?

Riccardo Brasca (Oct 26 2021 at 09:44):

I mean that I don't want to do the refactor

Filippo A. E. Nuccio (Oct 26 2021 at 09:44):

I understand, and it makes sense.

Filippo A. E. Nuccio (Oct 26 2021 at 09:45):

But indeed, do you need the splitting condition? For instance, we define ring of integers for every field (including positive char!, or the reals) as the integral closure of Z\mathbb{Z}. It might be disgusting, but you do not need any finiteness condition on it.

Filippo A. E. Nuccio (Oct 26 2021 at 09:48):

Can't you define a Prop called contains_nth_root_of_one by saying that Φn\Phi_n has at least one root, and then define that an algebra tower A/BA/B is cyclotomic if the Prop is satisfied?

Riccardo Brasca (Oct 26 2021 at 09:56):

Is it OK in characteristic pp for Φp\Phi_p?

Riccardo Brasca (Oct 26 2021 at 09:57):

Yes, it seems it is

Riccardo Brasca (Oct 26 2021 at 10:00):

class is_cyclotomic_extension (K L : Type*) [comm_ring K] [ring L] [algebra K L] (S : set pnat) :=
(ex_root (a : pnat) (ha : a  S) :  r : L, polynomial.aeval r (polynomial.cyclotomic a K) = 0)
(adjoint_roots : algebra.adjoin K { b : L |  a : pnat, a  S  b^(a : ) = 1 } = )

Riccardo Brasca (Oct 26 2021 at 10:02):

Do we say that Fp\mathbb{F}_p is the pp-th cyclotomic extension of Fp\mathbb{F}_p?

Eric Rodriguez (Oct 26 2021 at 10:09):

Riccardo Brasca said:

Do we say that Fp\mathbb{F}_p is the pp-th cyclotomic extension of Fp\mathbb{F}_p?

Yes, I think this is what was suggested earlier

Filippo A. E. Nuccio (Oct 26 2021 at 10:09):

Why not? I think it is better to add a lemma saying that "nothing happens" rather than adding a constraint.

Riccardo Brasca (Oct 26 2021 at 10:11):

Ah, I am stupid, this is always the extension generated by the primitive pp-th roots of unity (there are no primitive pp-th roots of unity in Fp\mathbb{F}_p, so that's OK)

Filippo A. E. Nuccio (Oct 26 2021 at 13:10):

Well, I wanted to add a :+1: but certainly don't want to agree on your "I am stupid"... :wink:

Filippo A. E. Nuccio (Oct 26 2021 at 13:12):

What I like of the above definition is that it also allows for infinite cyclotomic extensions, because you do not require that S is a finset. Indeed, when we will do Iwasawa theory, it will be important to have the cyclotomic Zp\mathbb{Z}_p-extension at our disposal.

Filippo A. E. Nuccio (Oct 27 2021 at 09:48):

By the way, I have been thinking about the (S : set pnat) business. I am wondering if it would not be more appropriate to let S be a sub-lattice of pnat (or of nat) when the (positive) naturals are ordered by division. This would allow to use Galois connections to state the theorem that the nn-th cyclotomic field is contained in the mm-th whenever nmn\mid m. Otherwise, the result becomes a bit painful to state (divisibility is always defined in nat but "often" means nothing) and more painful to prove: whereas Galois connections are really natural and cute (@Patrick Massot and @Yaël Dillies , dont' you agree ? :wink: )

Yaël Dillies (Oct 27 2021 at 10:03):

They really are cute! But how do you state that S is a sublattice?

Yaël Dillies (Oct 27 2021 at 10:06):

Unless I misunderstood, does that mean we should define a type synonym for any type where division makes sense?

Yaël Dillies (Oct 27 2021 at 10:07):

Then S : set (div_order nat) or S : set (div_order pnat) would be more appropriate.

Yaël Dillies (Oct 27 2021 at 10:23):

However we'll need to quotient by the units to even get a partial order...

Filippo A. E. Nuccio (Oct 27 2021 at 10:25):

You are right. What I had in mind is that it is useful to be sure that S is itself a (div)-lattice. So, for instance, rather than considering the singleton a : set nat one should consider the lattice of all divisors of a. They give rise to the same cyclotomic extension, but with the Galois connection bonus.

Filippo A. E. Nuccio (Oct 27 2021 at 10:25):

And as long as nat is concerned, there are not so many units...

Filippo A. E. Nuccio (Oct 27 2021 at 10:28):

At any rate, it is vital to wait for @Riccardo Brasca 's opinion on all this, since he is the one defining cyclotomic extensions.

Kevin Buzzard (Oct 27 2021 at 10:32):

I don't immediately see how to use Galois connections because we don't have a type of all cyclotomic fields

Filippo A. E. Nuccio (Oct 27 2021 at 10:34):

Not yet, but this was Riccardo's project, to define them. And my point was whether it is better to attach a cyclotomic field to a subset of nat or to some sort of division-lattice in it, so that we can later state the existence of a Galois connection.

Kevin Buzzard (Oct 27 2021 at 10:47):

If we defined a choice of Q\overline{\mathbb{Q}} (e.g. the subfield of C\mathbb{C}) then we could define cyclotomic fields as subfields of this, and also define Gal(Q/Q)Gal(\overline{\mathbb{Q}}/\mathbb{Q}).

Kevin Buzzard (Oct 27 2021 at 10:48):

After all, we defined C\mathbb{C} and that has automorphisms

Filippo A. E. Nuccio (Oct 27 2021 at 10:49):

My experience with Dededind domains would rather suggest to keep everything moving, so defining a predicate is_cyclotomic_extension L K to say that L is obtained by adjoining the root of a cyclotomic polynomial to K whatever K is.

Johan Commelin (Oct 27 2021 at 10:54):

I agree that it's not clear that Galois connections can be used here. Basically, we would need to define

def lattice_of_cyclotomic_fields := _

But I don't think it will be very nice to work with terms of that type.

Filippo A. E. Nuccio (Oct 27 2021 at 10:59):

Hmm...I see what you mean, but coming from the Iwasawa-theoretic perspective, this would seem quite reasonable to me. The way Iwasawa theory attaches gadgets (class groups, ell. curves or cohomology thereof) to "layers" in cyclotomic extensions seems to be described pretty well as a Galois connection

lattice_of_cyclotomic_fields -> bleah

I might not see some hidden problem, though.

Johan Commelin (Oct 27 2021 at 11:00):

In Iwasawa theory, is this an honest lattice, or is it a category (with Galois groups as automorphism groups for the object = cyclotomic fields).

Johan Commelin (Oct 27 2021 at 11:01):

Because maybe we should use (adjoint) functors instead of Galois connections.

Filippo A. E. Nuccio (Oct 27 2021 at 11:05):

I would really think that it is a honest lattice; but may be I should better understand when is it better to speak in terms of lattices and when in terms of categories. In #docs.galois_connection I read "A Galois connection is a pair of functions l and u satisfying l a ≤ b ↔ a ≤ u b. They are special cases of adjoint functors in category theory, but do not depend on the category theory library in mathlib." and I have the feeling that the whole machinery of category theory would not be very useful in practice for Iwasawa theory.

Johan Commelin (Oct 27 2021 at 11:08):

So all fields are embedded in a fixed algebraic closure? And you don't consider different embeddings?

Filippo A. E. Nuccio (Oct 27 2021 at 11:08):

Indeed, it never happened to me to consider different embeddings while doing Iwasawa theory...

Kevin Buzzard (Oct 27 2021 at 11:12):

Cyclotomic extensions are abelian extensions, so the subtle problem of whether a number field should be regarded as coming with a fixed embedding into the complexes is reduced to the simpler problem of understanding their Galois groups

Kevin Buzzard (Oct 27 2021 at 11:13):

Filippo might never have changed his embedding into the complexes but will have considered the Galois group of a cyclotomic field over Q

Filippo A. E. Nuccio (Oct 27 2021 at 12:33):

Sure I did! At any rate, I would be happy in general to get a clearer picture on when are Galois connections/insertions the best choice as opposed to categorical adjunctions.

Adam Topaz (Oct 27 2021 at 12:54):

In the other stream I originally had in mind to use truncation_sets for S (which might additionally be closed under lcm). What do you think about that idea?

Adam Topaz (Oct 27 2021 at 12:55):

Another issue in positive characteristic is that you can add as many powers of p as you like without changing the property

Filippo A. E. Nuccio (Oct 27 2021 at 12:57):

Do you mean truncated sets?

Filippo A. E. Nuccio (Oct 27 2021 at 12:57):

Concerning positive char, I agree that nothing happens, but what is the problem in the definition?

Adam Topaz (Oct 27 2021 at 12:58):

Oh I mean truncation sets in the sense of, e.g., http://math.uchicago.edu/~drinfeld/Seminar-2019/Witt_vectors/Hesselholt%20on%20Witt%20vectors.pdf

Filippo A. E. Nuccio (Oct 27 2021 at 13:00):

Oh, great. I was not aware of this notion. Sure, it makes sense and really goes in the direction I had in mind.

Filippo A. E. Nuccio (Oct 27 2021 at 13:02):

I confess I still somewhat feel that setting up Galois would make Iwasawa-theory life easy: for instance, you could say that the assignment nCnn \mapsto \mathcal{C}_n is a Galois connection where Cn\mathcal{C}_n is a group (e.g. the class group) attached to the field of degree pnp^n in a cyclotomic tower.

Filippo A. E. Nuccio (Oct 27 2021 at 13:02):

A part from this, I think it would be important to allow for infinite truncation sets.

Adam Topaz (Oct 27 2021 at 13:03):

For sure. I don't want any finiteness restriction on S

Adam Topaz (Oct 27 2021 at 13:07):

There should be something like a Galois connection btw. Maybe just an adjunction between the lattice of truncation sets and the category of cyclotomic extensions (which is not a lattice since there are automorphisms).

Filippo A. E. Nuccio (Oct 27 2021 at 13:09):

Ah, I see the business with lattices and categories, now: thanks!

Adam Topaz (Oct 27 2021 at 13:09):

You probably can use the category of all algebras over the base field. The functor in one direction takes a set S and gives the cyclotomic extension associated to it, and in the other direction you take an algebra and send it to the set S of all n such that X^n-1 splits in the algebra.

Filippo A. E. Nuccio (Oct 27 2021 at 13:10):

Truncation sets might indeed be the right context!

Filippo A. E. Nuccio (Oct 27 2021 at 13:10):

Yes, it seems to make sense.

Filippo A. E. Nuccio (Oct 27 2021 at 13:11):

The only problem is that "the cyclotomic extensions associated to it" does not quite exist, right? One needs to pick up an alg closed field - or something like that.

Filippo A. E. Nuccio (Oct 27 2021 at 13:12):

I would rather consider the category of all KK-subalgebras in a KK-algebra LL, and let LL vary.

Riccardo Brasca (Oct 27 2021 at 13:13):

I am not ignoring your messages, and your help is really appreciated. I will read everything after having fixed a problem with the current def

Adam Topaz (Oct 27 2021 at 13:16):

@Filippo A. E. Nuccio you are right, to define the functor from S to algebras, it might be easier to choose an algebraic closure and work inside there.

Kevin Buzzard (Oct 27 2021 at 13:39):

Filippo A. E. Nuccio said:

Ah, I see the business with lattices and categories, now: thanks!

Categories in Lean have two universes associated with them -- the universe where the objects live and the universe where the morphisms live. If you imagine a category where morphisms live in Prop then you get exactly a preorder :-)

Filippo A. E. Nuccio (Oct 27 2021 at 14:15):

Kevin Buzzard said:

Filippo A. E. Nuccio said:

Ah, I see the business with lattices and categories, now: thanks!

Categories in Lean have two universes associated with them -- the universe where the objects live and the universe where the morphisms live. If you imagine a category where morphisms live in Prop then you get exactly a preorder :-)

Oh, this is very nice a description indeed! Thanks.

Kevin Buzzard (Oct 27 2021 at 14:19):

and then all the adjoint functor stuff just precisely translates into Galois connections in this special case.

Kevin Buzzard (Oct 27 2021 at 14:20):

Unfortunately my memory was that Scott once tried to let categories have Props as morphisms but things didn't work out for some reason, so he changed them all back to types.

Filippo A. E. Nuccio (Oct 27 2021 at 14:21):

Ah, I see. But as long as preorders exist, we can call these special categories that way...

Kevin Buzzard (Oct 27 2021 at 14:22):

For some reason, quiver is allowed to have Hom sets in Prop, but not category_struct (see the "v+1" in that definition)

Kevin Buzzard (Oct 27 2021 at 14:23):

However it's still a cool mental model to have :-)

Riccardo Brasca (Oct 27 2021 at 14:42):

Late to the party, but currently we have a characteristic predicate

universes u v

variables (S : set +) (A : Type u) (B : Type v) [comm_ring A] [comm_ring B] [algebra A B]

class is_cyclotomic_extension :=
( ex_root (a : +) (ha : a  S) :  r : B, aeval r (cyclotomic a A) = 0 )
( adjoint_roots :  x, x  adjoin A { b : B |  a : +, a  S  b ^ (a : ) = 1 } )

Riccardo Brasca (Oct 27 2021 at 14:43):

And a "model"

@[derive [field, algebra K]]
def cyclotomic_field : Type w := (cyclotomic n K).splitting_field

lemma is_cyclotomic_extension : is_cyclotomic_extension {n} K (cyclotomic_field n K) := sorry

defined over a field K for S a singleton.

Adam Topaz (Oct 27 2021 at 14:58):

Just playing around with this idea @Filippo A. E. Nuccio:

I wanted to prove the adjunction as well, but I have to go teach :expressionless:

Filippo A. E. Nuccio (Oct 27 2021 at 14:59):

Very nice!

Riccardo Brasca (Oct 27 2021 at 15:15):

I guess we can have some interplay with a more down to Earth interpretation, right? Like group and Group and so on.

Riccardo Brasca (Oct 27 2021 at 15:17):

I agree that such an abstract approach can be useful sometimes, but what will happen when we have to prove that (1-z)^p =... or a similar very very concrete result? Of course it will be provable, at end the objects are the same, but I am afraid it will be annoying.

Riccardo Brasca (Oct 28 2021 at 08:39):

It seems that it's enough to prove something like is_cyclotomic_extension S K (to_algebra S) to make the link between the categorical def and the "concrete" one.

Antoine Chambert-Loir (Oct 28 2021 at 09:35):

Riccardo Brasca said:

Well, to be honest I am not even sure what that notation means. In real math, when we write Z[α]\mathbb{Z}[\alpha] we often mean the ring of integers of Q(α)\mathbb{Q}(\alpha).

To be honest, I've never seen any use of this convention, and I would not recommend it.

Antoine Chambert-Loir (Oct 28 2021 at 09:41):

Riccardo Brasca said:

But what definition do you propose? We cannot say that a polynomial is split over a ring

If the polynomial is monic, it may sense to say that it factors as a product of monic terms of degree 1 .

Moreover, the book Modern Computer Algebra by von zur Gathen and Gerhard, ISBN: 0-521-82646-2, defines the splitting algebra $S$ of a monic degree $n$ polynomial $P\in R[T]$ as the algebra generated by $n$ indeterminates $a_1,\dots,a_n$ quotiented by the relations that say that $P=(T-a_1)\dots (T-a_n)$. This algebra is free of rank $n!$ over $R$, it has an action of the symmetric group $\mathfrak S_n$. If $R$ is a field, then this algebra is artinian, the symmetric group acts transitively on the set of maximal ideals, the residue fields are splitting extensions of $P$., and the fixator of any maximal ideal in $\mathfrak S_n$ is “the” Galois group of $P$.

Riccardo Brasca (Oct 28 2021 at 09:53):

It surely makes sense mathematically. I meant it's not in mathlib, and I prefer not spending two months in writing 100 stupid lemmas about a new notion if it's possible

Yaël Dillies (Oct 28 2021 at 09:54):

Well, isn't that the point of those big projects? :stuck_out_tongue:

Antoine Chambert-Loir (Oct 28 2021 at 10:20):

Riccardo Brasca said:

It surely makes sense mathematically. I meant it's not in mathlib, and I prefer not spending two months in writing 100 stupid lemmas about a new notion if it's possible

I don't know whether it is useful to include it in mathlib, and I don't claim somebody should.
I just claim this is a meaningful mathematical notion, and having it in mind may be useful to think about the topic.

Riccardo Brasca (Oct 28 2021 at 10:37):

Sure, I completely agree!

Eric Wieser (Oct 28 2021 at 23:52):

Am I correct in reading the above as a proposed more general definition of docs#polynomial.splitting_field? Or is it a separate concept?

Adam Topaz (Oct 29 2021 at 01:38):

@Eric Wieser Antoine's suggestion won't quite generalize the splitting field, but it's related. If you apply that construction in the case where the base is a field, and mod out by some maximal ideal, you would indeed get "the" splitting field (rather, "a" splitting field).

Adam Topaz (Oct 29 2021 at 01:50):

One point where I think this construction could be very useful is in generalizing docs#polynomial.splits

Adam Topaz (Oct 29 2021 at 01:52):

I.e. we could say that a polynomial f : R[X] splits w.r.t ι:RS\iota : R \to S if ι\iota factors through the algebra in question.

Antoine Chambert-Loir (Oct 29 2021 at 09:36):

Eric Wieser said:

Am I correct in reading the above as a proposed more general definition of docs#polynomial.splitting_field? Or is it a separate concept?

It is a separate, but related, concept. If you apply the “splitting algebra” to a separable polynomial over a field, you get a separable algebra which is a product of fields, all isomorphic to the splitting field extension. If the polynomial is not separable, the algebra you get may not be a field, it may have nilpotent elements. (Already for $P=T^2$, what you get is $k[a,b]/(a+b,ab)=k[a]/(a^2)$.)

Riccardo Brasca (Dec 23 2021 at 22:03):

After some weeks working on the flt-regular project, we realized that the definition of is_cyclotomic_extension we are using is maybe too general. The definition is basically "generated by the roots of the n-th cyclotomic polynomial". You can have a look at #10849 or at the full project if you are curious.

The problem is that, for example, the 55 cyclotomic extension of F5\mathbb{F}_5 is trivial, and in practice it is not true that we have n-th primitive roots of unity in a n-th cyclotomic extension. The math is clear (I even have a Lean proof the following): if L/KL/K is a nn-th cyclotomic extension and n0n \neq 0 in KK then everything is OK, but if KK is of characteristic p>0p > 0 and n=psmn = p^s m with pp and mm coprime, then we only have mm-th primitive roots of unity in LL.

My question is what can we do in Lean? Having hn : (↑n : _) ≠ 0 is getting annoying, and in practice, for flt-regular, we are only interested in the char_zero case. Of course char_p cyclotomic extensions are interesting, but maybe not the pp-th cyclotomic extension of Fp\mathbb{F}_p. I am thinking about adding to the definition of is_cyclotomic_extension the condition that (↑n : _) ≠ 0. What do you think?

Riccardo Brasca (Dec 23 2021 at 22:06):

I don't see a way of using efficiently TC resolution here, but it's maybe my fault.

Eric Rodriguez (Dec 23 2021 at 22:13):

(related discussion here)

Riccardo Brasca (Dec 23 2021 at 22:29):

To give a more explicit example, consider the following: let B be an A-algbra with [is_cyclotomic_extension n A B] for a given n. Let foo be the theorem that says that, if [is_domain B] and (↑n : B) ≠ 0 then there is a primitive n-th root of unity in B. We want also a bar theorem that, if [is_domain B] [char_zero B] gives the same result as foo, without having to prove (↑n : B) ≠ 0 manually.

Riccardo Brasca (Dec 23 2021 at 22:30):

Of course we can just prove both foo and bar, but we would like to avoid to duplicate all the theorems with (↑n : B) ≠ 0.

Adam Topaz (Dec 23 2021 at 22:30):

Maybe the definition of "primitive root of unity" should be changed?

Adam Topaz (Dec 23 2021 at 22:31):

What definition is currently being used?

Riccardo Brasca (Dec 23 2021 at 22:31):

The definition looks perfectly fine to me, it's just that there are no 55-th primitive roots of unity if a field of chracteristic 55.

Riccardo Brasca (Dec 23 2021 at 22:32):

The multiplicative order of a primitive n-th root of unity is n.

Riccardo Brasca (Dec 23 2021 at 22:32):

I mean, this is essentially the definition.

Adam Topaz (Dec 23 2021 at 22:32):

Well, I would argue that 11 is a primitive 5th root of unity in a field of characteristic 55 :)

Adam Topaz (Dec 23 2021 at 22:33):

But that doesn't satisfy docs#is_primitive_root.

Riccardo Brasca (Dec 23 2021 at 22:34):

1 ^ 1 = 1 but 5 ∣ 1 is false.

Adam Topaz (Dec 23 2021 at 22:35):

yeah, of course, so one could change the second condition in that def

Eric Rodriguez (Dec 23 2021 at 22:35):

are you then saying a primitive root should by definition be a root of the nth cyclotomic poly?

Adam Topaz (Dec 23 2021 at 22:35):

I guess so, yeah.

Riccardo Brasca (Dec 23 2021 at 22:36):

But cyclotomic polynomials are defined using primitive roots...

Riccardo Brasca (Dec 23 2021 at 22:36):

I know they can be defined directly, but I don't think we want to do such a refactor

Riccardo Brasca (Dec 23 2021 at 22:41):

@Eric Rodriguez what do you think about having results with(↑n : _) ≠ 0 as an explicit assumption (so no fact) and duplicate them in the char_zero case? Maybe at the end of the day the duplicated code is not that much...

Riccardo Brasca (Dec 23 2021 at 22:41):

For flt-regular we will very quickly specialize to Q, so it doesn't really matter

Eric Rodriguez (Dec 23 2021 at 22:45):

I still think it may be helpful to have the ne-zero classes that I outlined in the linked thread; TC can then deal with everything (hopefully) - there should only be this new class, and no_smul_zero_divisors involved. That also seems like a decent solution, though; who deals with charp and char zero at the same time without getting headaches ;b

Yaël Dillies (Dec 23 2021 at 22:47):

Sounds easy enough that abbreviating the appropriate fact and maybe writing some quick API (to avoid always going down to fact.out) should do the job.

Eric Rodriguez (Dec 23 2021 at 22:48):

we can't have (global) fact instances, Yael

Eric Rodriguez (Dec 23 2021 at 22:50):

at least, we shouldn't because it slows down TC; but a couple of cases seem to have done it regardless

Yaël Dillies (Dec 23 2021 at 22:50):

Then don't make it an abbreviation but instead a proper class.

Riccardo Brasca (Dec 23 2021 at 22:54):

Do you mean something like

class test (R : Type*) [semiring R] (n : ) : Prop :=
(out : ((n : R)  0))

?

Eric Rodriguez (Dec 23 2021 at 22:59):

I had N+ in mind, but I think this is better because we can just provide an easy-to-use instance for N+

Riccardo Brasca (Dec 23 2021 at 22:59):

class test (R : Type*) [semiring R] (n : ) : Prop :=
(out : ((n : R)  0))

instance foo (R : Type*) [semiring R] [char_zero R] (n : +) : test R n :=
nat.cast_ne_zero.2 n.pos.ne'

seems to work

Riccardo Brasca (Dec 23 2021 at 23:01):

If there are no TC resolution problems I propose this way

Eric Rodriguez (Dec 23 2021 at 23:04):

any idea where in mathlib this could be placed?

Yaël Dillies (Dec 23 2021 at 23:05):

Close to docs#char_zero?

Yaël Dillies (Dec 23 2021 at 23:05):

Actually, this is a very sense-making typeclass that can probably be used in many places where we had previously used char_zero.

Yaël Dillies (Dec 23 2021 at 23:06):

Typically for docs#nat.asc_factorial, docs#pochhammer...

Yaël Dillies (Dec 23 2021 at 23:06):

char_not_dvd_class?

Kevin Buzzard (Dec 23 2021 at 23:11):

I have never heard of the phrase "cyclotomic extension" being used to describe anything other than extensions of number fields and p-adic fields BTW

Yaël Dillies (Dec 23 2021 at 23:17):

To be honest, I have been looking for that typeclass quite a few times already and wondered why we weren't needing it. I guess we actually do!

Kevin Buzzard (Dec 23 2021 at 23:25):

This "n!=0 in the ground field" thing comes up a lot in representation theory of finite groups too (you often average some construction in the field over the elements of the group)

Riccardo Brasca (Dec 23 2021 at 23:41):

Time to sleep for me, but it seems we all agree about this new typeclass :)
@Kevin Buzzard I agree about "cyclotomic extension" being used only in characteristic zero, but the mathlib mafia forced us to write the most general definition...

Alex J. Best (Dec 23 2021 at 23:51):

I'm slightly conflicted about this all now, on the one hand its always nice to get results for free, and it would occasionally be helpful perhaps to reduce cyclotomic rings modulo primes and still have some results.
Buut I really feel like all these weird facts floating around causes unnecessary difficultly / complication for flt-regular at this point.
That said it certainly seems a characteristic not n typeclass is useful, certainly the char_not 2 version will be!

Adam Topaz (Dec 23 2021 at 23:57):

I think the correct class should be defined around is_unit n. That's a condition that pops up a lot in practice.. much more than the condition that n is nonzero

Eric Rodriguez (Dec 24 2021 at 00:13):

Isn't that just invertible? This wouldn't work for our use case, as we lifted a couple results through the fraction field, and so we require n ≠ 0 for things in an arbitrary integral domain

Kevin Buzzard (Dec 24 2021 at 00:21):

For rep theory of finite groups invertible is exactly what you need -- it's not just that the order is nonzero but that you can divide by it.

Eric Rodriguez (Dec 24 2021 at 04:45):

I began work on the foo typeclass in branch#foo_typeclass... name suggestions, lemma suggestions, and commits not only welcome, but much encouraged ;D

Eric Rodriguez (Dec 24 2021 at 04:46):

the file is currently src/algebra/foo.lean

Riccardo Brasca (Dec 24 2021 at 08:44):

Eric Rodriguez said:

I began work on the foo typeclass in branch#foo_typeclass... name suggestions, lemma suggestions, and commits not only welcome, but much encouraged ;D

Can you open a WIP PR so we can comment there?

Riccardo Brasca (Dec 24 2021 at 09:16):

Concerning n ≠ 0 or invertible, if someone really need invertiblethey can create another class bar, and we can provide an insance of bar having foo and field. I can be wrong, but I have the impression that, when invertible is needed people are working over a field, so this would be enough.

Damiano Testa (Dec 24 2021 at 09:22):

I agree that most of the times, the ground ring is a field. However, I have sometimes used rings such as Z[12]\mathbb{Z}[\frac{1}{2}] to explicitly assume that 2 was invertible, but still work over a Dedekind domain.

Damiano Testa (Dec 24 2021 at 09:23):

The solution of using two typeclasses, one where it is enough to assume that n is non-zero and one where you explicitly invert it, seems good to me, though.

Damiano Testa (Dec 24 2021 at 09:29):

In the specific context of modular curves of given level NN, it is quite common to work over Z[1N]\mathbb{Z}[\frac{1}{N}]. I find that this is a situation where the two points of view mentioned above (cyclotomic-like stuff and modular/non-modular representation theory) come together.

Damiano Testa (Dec 24 2021 at 09:29):

Having said that, it is probably reasonable to not develop the whole theory in this generality right now!

Riccardo Brasca (Dec 24 2021 at 09:40):

Indeed we morally already have the class with NN invertible: it is the same as Z[1/N]\mathbb{Z}[1/N]-algebras.

Riccardo Brasca (Dec 24 2021 at 09:40):

But I don't know if this can help

Johan Commelin (Dec 24 2021 at 10:07):

@Riccardo Brasca It wasn't clear to me from your message above whether you know this, but docs#invertible already exists. So we don't need "another class bar".

Johan Commelin (Dec 24 2021 at 10:08):

But maybe you meant something else with that bar?

Riccardo Brasca (Dec 24 2021 at 10:09):

We need (n : R) ≠ 0), that is not the same since we also want to work integrally, but this probably gives a good API to generalize, thanks!!

Johan Commelin (Dec 24 2021 at 10:21):

Right, but that's already your foo class, right? So I didn't understand what you wanted from the bar class.

Riccardo Brasca (Dec 24 2021 at 10:22):

Yes yes, I was talking about bar without knowing docs#invertible exists

Johan Commelin (Dec 24 2021 at 10:24):

Ok, gotcha.

Riccardo Brasca (Dec 24 2021 at 13:44):

Having

instance ne.fact_coe (K R : Type*) (n : +) [field K] [ring R] [nontrivial R] [algebra K R]
  [hK : fact (((n : ) : K)  0)] : fact (((n : ) : R)  0) :=
by simpa using (function.injective.ne (algebra_map K R).injective hK.out)⟩

instance ne.fact_char_zero (K : Type*) (n : +) [field K] [char_zero K] :
  fact (((n : ) : K)  0) := nat.cast_ne_zero.mpr n.pos.ne'

here makes the linter unhappy

/- The `fails_quickly` linter reports: -/
/- TYPE CLASS SEARCHES TIMED OUT.
The following instances are part of a loop, or an excessively long search.
It is common that the loop occurs in a different class than the one flagged below,
but usually an instance that is part of the loop is also flagged.

I tried to debug the error but I don't see where I am creating a loop. Any idea?

Yaël Dillies (Dec 24 2021 at 13:44):

Might be fails_quickly having too low of a time-out

Riccardo Brasca (Dec 24 2021 at 13:46):

The linter suggest what to do, here, but for all the flagged instance I just get a timeout, no errors.

Riccardo Brasca (Dec 24 2021 at 13:52):

I just realized I have no idea how to run the linter locally...is it a scropt somewhere?

Riccardo Brasca (Dec 24 2021 at 13:52):

I know about #lint at the ed of a file, I am talking about the global linter

Riccardo Brasca (Dec 24 2021 at 13:54):

Ah, it's probably lean --run scripts/lint_project.lean or something similar

Eric Rodriguez (Dec 24 2021 at 13:56):

#11033 is the PR; my first run failed pretty badly, I'm going to try take more of a look today

Eric Rodriguez (Dec 24 2021 at 13:56):

Also, what does it mean by "R is a metavariable"? I thought I was being clever with my char-zero typeclass

Yaël Dillies (Dec 24 2021 at 14:02):

It means it can't be inferred from context usually. Try using out_param and summoning @Anne Baanen

Riccardo Brasca (Dec 24 2021 at 14:06):

Looking at docs#invertible, it seems that they decided to not have any global instance. Everything is a def, and instances can be activated when needed.

Anne Baanen (Dec 24 2021 at 14:09):

Yaël Dillies said:

It means it can't be inferred from context usually. Try using out_param and summoning Anne Baanen

Indeed. The rule is that any parameter to the instance must be an [instance parameter] itself, be inferrable from the goal (i.e. appear after the :), or an out_param.

Anne Baanen (Dec 24 2021 at 14:12):

However, in this case you can't make S an out_param to foo because it is not uniquely determined by the other parameters to foo.

Anne Baanen (Dec 24 2021 at 14:16):

Does the argument order matter? I would prefer foo n R, but not sure what TC prefers.

Since n depends on R, the parameters have to stay in that order according to type theory. Although I guess you could use notation `foo` n R := foo_class R n.

My suggestion would be to define class foo {R : Type*} [has_zero R] (n : R) := (out : n ≠ 0) instead, because then you can write foo (n : R).

Riccardo Brasca (Dec 24 2021 at 14:47):

I tested in flt-regular the strategy of having lemmas instead of instances, and using local attribute [instance] when needed. It seems to work well.

Eric Rodriguez (Dec 24 2021 at 14:48):

If that's what invertible does, as well, then that seems very reasonable.

Antoine Chambert-Loir (Dec 24 2021 at 17:03):

Riccardo Brasca said:

After some weeks working on the flt-regular project, we realized that the definition of is_cyclotomic_extension we are using is maybe too general. The definition is basically "generated by the roots of the n-th cyclotomic polynomial". You can have a look at #10849 or at the full project if you are curious.

Sorry to come after the battle, but why such a definition?

Compare with the definition of a solvable-by-radicals extension: you ask that it is generated (inductively) by elements $a$ some positive power of which belong to the base field. Here, I'd say a cyclotomic extension is generated by elements some (strictly positive) power of which is 1. Cyclotomic of cyclotomic is cyclotomic (so I did not define the stuff inductively).

It's easy to refine the definition to ask that the exponents belong to a given subset of $\mathbf N$.

If the base is a field and the extension is finitely generated, you can prove that it is generated by a single root of unity (which is primitive of some order).

If the base is an integrally closed domain, you can prove that its integral closure in a cyclotomic extension of the fraction field is a cyclotomic extension. This amounts to the property that the ring of integers of $\mathbf Q(\zeta_n)$ is $\mathbf Z[\zeta_n]$ (and some limit arguments in the general case).

Eric Rodriguez (Dec 24 2021 at 19:13):

Antoine Chambert-Loir said:

Riccardo Brasca said:

After some weeks working on the flt-regular project, we realized that the definition of is_cyclotomic_extension we are using is maybe too general. The definition is basically "generated by the roots of the n-th cyclotomic polynomial". You can have a look at #10849 or at the full project if you are curious.

Sorry to come after the battle, but why such a definition?

Compare with the definition of a solvable-by-radicals extension: you ask that it is generated (inductively) by elements aa some positive power of which belong to the base field. Here, I'd say a cyclotomic extension is generated by elements some (strictly positive) power of which is 1. Cyclotomic of cyclotomic is cyclotomic (so I did not define the stuff inductively).

It's easy to refine the definition to ask that the exponents belong to a given subset of N\mathbf N.

If the base is a field and the extension is finitely generated, you can prove that it is generated by a single root of unity (which is primitive of some order).

If the base is an integrally closed domain, you can prove that its integral closure in a cyclotomic extension of the fraction field is a cyclotomic extension. This amounts to the property that the ring of integers of Q(ζn)\mathbf Q(\zeta_n) is Z[ζn]\mathbf Z[\zeta_n] (and some limit arguments in the general case).

sorry just copying this to make it easier to read. Zulip needs double $s for LaTeX, for some reason

Eric Rodriguez (Dec 24 2021 at 19:23):

I'm confused how you'd want to state this that's fundamentally different to our definition; our definition is a) we have all nth roots for n in S : set pnat, and b) algebra.adjoin K {these nth roots} = \top.

Johan Commelin (Dec 24 2021 at 20:27):

I think Antoine wants to avoid mentioning n in the type. @Antoine Chambert-Loir do I understand that correctly?
You want something like

def is_cyclotomic (A B : Type*) [comm_ring A] [comm_ring B] [algebra A B] : Prop :=
 s : set B,
  (subalgebra.span A s = ) 
  ( b  s,  n > 0, b ^ n = 1)

Will Sawin (Dec 24 2021 at 21:35):

This definition would be different in that it would allow for cyclotomic extensions of infinite degree.

Adam Topaz (Dec 24 2021 at 21:43):

The definition proposed in #10849 allows for infinite extensions as well.

Adam Topaz (Dec 24 2021 at 21:55):

But to build on Johan's def above, you can just say that the algebra is generated by the set of roots of unity contained in the algebra. No set needed.

Antoine Chambert-Loir (Dec 24 2021 at 22:00):

Exactly. And probably something like is_elementarily_cyclotomic where the set s is replaced by a single element b: B.

Adam Topaz (Dec 24 2021 at 22:04):

One argument to have a set as a parameter is to obtain some sort of adjunction between the lattice of subsets of Nat and the lattice of cyclotomic extensions. But it seems this just complicates things for the FLT project.

Kevin Buzzard (Dec 24 2021 at 22:06):

You have to be careful here because cyclotomic extensions are only unique up to non-unique isomorphism, so it's not clear to me that they even form a partial order -- there is some automorphism group complicating the picture in my head, at least

Adam Topaz (Dec 24 2021 at 22:06):

My second lattice should have been category, sorry :grinning_face_with_smiling_eyes:

Eric Rodriguez (Dec 24 2021 at 22:07):

There's no real complication for the FLT - if we wanted just to prove FLT, we could specialise every result to Q and all of our issues vanish. But we are trying to prove every result at a reasonable level of generality

Kevin Buzzard (Dec 24 2021 at 22:08):

If we're going for is_cyclotomic_extension, meaning \exists S : set nat, is_S_cyclotomic as a predicate on K-fields or whatever then yeah this looks to me like a category

Adam Topaz (Dec 24 2021 at 22:11):

You don't even need to restrict the category of algebras. Given a set S, associate the distinguished cyclotomic extension associated to S, constructed in some way. Given an algebra B, construct the set of all n such that the nth cyclotomic poly splits on B. These should be adjoint functors, I think.

Antoine Chambert-Loir (Dec 24 2021 at 22:35):

Is it so clear that there is such a “distinguished” cyclotomic extension associated to a set S ? I am not sure. Even if S = {n}, the only canonical stuff would be $R[T]/(T^n-1)$, but you could also consider $R[T]/(\Phi_n)$, or $R[T]/(P)$, for some factor of $T^n-1$, even not necessarily irreducible. If you fix a universal algebra in which everything is supposed to live (an algebraic closure), then OK.

Adam Topaz (Dec 24 2021 at 22:47):

You're right, "distinguished" was not the right word. One just has to come up with some construction (e.g. work inside a chosen algebraically closed extension)

Kevin Buzzard (Dec 24 2021 at 22:48):

This is all exactly the same as localisation. There's no distinguished localization R S but there is is_localization R S A if A is an R-algebra.

Kevin Buzzard (Dec 24 2021 at 22:48):

similarly for algebraic_closure and is_algebraic_closure

Kevin Buzzard (Dec 24 2021 at 22:49):

(the latter apparently doesn't exist)

Adam Topaz (Dec 24 2021 at 22:49):

I think it does? docs#is_algebraic_closure

Yaël Dillies (Dec 24 2021 at 22:50):

docs#is_alg_closure

Kevin Buzzard (Dec 24 2021 at 22:50):

If you fixed an algebraic closure and let all your fields be subfields of that, it would be analogous to the trick they use in the odd order Coq proof where all their groups are subgroups of a big group, i.e. all terms not types

Kevin Buzzard (Dec 24 2021 at 22:53):

So there is a relative theory one can define (cyclotomic S : subalgebra K L) and an absolute theory defined with models (cyclotomic' S K : Type) and also an absolute theory defined by the universal property (is_cyclotomic S K E with [algebra K E])

Riccardo Brasca (Dec 25 2021 at 00:09):

Thanks for all the comments.
To be honest I don't think it is worth to fundamentally change the current definition unless it's clear that things will really improve. Our current definition seems to work pretty well, for example we have a sorry free computation of the discriminant in of a p-th cyclotomic extension of the rationals. The only problem so far is that we have this annoying assumption ((n : ℕ) : _) ≠ 0 lying around. It is just an annoyance, the proofs work. I proposed to change the definition just to include this condition, but the new idea using a class seems very promising.

Riccardo Brasca (Dec 25 2021 at 00:13):

Just a couple of comments:

  • is_cyclotomic_extension is definitely needed, cyclotomic_extension is not enough (we have both, and all the theorems use is_cyclotomic_extension).
  • I have the impression that forgetting the n (or S) complicates things a little, if we want to say that the discriminant of what we currently call is_cyclotomic_extension p Q L is p^... we have to say something about, for example, the degree of a cyclotomic extension of Q and it seems unnatural.

Riccardo Brasca (Dec 25 2021 at 00:23):

At the end of the day what we want is that our definition (assuming it is the obvious one for Q and for finite fields in the separable case) is flexible enough to allow us to do some serious math, and the only way to find out is to test it. The computation of the discriminant is currently very similar to the pen and paper proof (except for some combinatoric nightmares unrelated to cyclotomic extensions) and I take this as a very good sign.

Riccardo Brasca (Dec 25 2021 at 00:23):

Having said this, merry Christmas to everybody !

Johan Commelin (Dec 25 2021 at 05:35):

I think that one of the benefits of the ∃ s, ... predicate is that the type becomes simpler. So Lean cannot get confused about different n or s working for the same field extension, because all this data is now hidden in a Prop.
But like Riccardo says, this comes at a cost: you now have to work harder to get access to that data.


Last updated: Dec 20 2023 at 11:08 UTC