Zulip Chat Archive
Stream: LFTCM 2024
Topic: Project idea: GL_n(F_q)
Chris Birkbeck (Mar 25 2024 at 10:06):
The idea is to find the size of , which is
Chris Birkbeck (Mar 25 2024 at 10:08):
If you would like to just copy-paste a start of this, you can make a new file (ask me if you need help with this) and then paste in:
import Mathlib.FieldTheory.Finite.GaloisField
import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup
open Matrix BigOperators
variable (p n m : ℕ) [Fact (Nat.Prime p)]
noncomputable instance fintype : Fintype (GL (Fin n) (GaloisField p m)) := by
exact Fintype.ofFinite (GL (Fin n) (GaloisField p m))
lemma card : Fintype.card (GL (Fin n) (GaloisField p m)) =
∏ i : (Fin n), (p ^ (n * m) - p ^ (n * i)) := by sorry
local notation "𝔽" => (GaloisField p m)
variable (v : Fin n → 𝔽)
#check Submodule.span 𝔽 ({v} : Set (Fin n → 𝔽))
--Basis.invertibleToMatrix might be useful to turn it into a question about bases.
Peiran Wu (Mar 25 2024 at 10:32):
Here is a proof I have in mind; no idea how doable it is.
- Define a (non-canonical) bijection between the invertible matrices and the bases, thereby reducing the problem to counting the number of bases.
- Define, given a non-zero vector v in V, a bijection between the bases of V starting with v and the bases of V / <v>.
- Prove the result by induction on the dimension.
Chris Birkbeck (Mar 25 2024 at 10:35):
Ok so 1. is definitely doable. This is all in Basis.invertibleToMatrix
. But we can talk more about this to do the precise statement. 2. sounds like a good idea, but maybe we need to think about the best way to state it. And then yes 3 should be easy.
Peiran Wu (Mar 25 2024 at 10:43):
As an alternative to 1., GL acts regularly on the set of all bases and docs#MulAction.orbitEquivQuotientStabilizer gives us the bijection. This will probably boil down to the same arguments, so is not a priority.
Edgar Costa (Mar 25 2024 at 10:51):
It would be nice if we could also make the argument work for , but that is not a priority
Chris Birkbeck (Mar 25 2024 at 10:52):
So I've made a repo for this: Hopefully following these instructions should let you download it:
git clone https://github.com/CBirkbeck/GLn_F_q
cd GLn_F_q
lake exe cache get
lake build
Chris Birkbeck (Mar 25 2024 at 10:52):
Peiran Wu said:
As an alternative to 1., GL acts regularly on the set of all bases and docs#MulAction.orbitEquivQuotientStabilizer gives us the bijection. This will probably boil down to the same arguments, so is not a priority.
Oh nice that could be useful. Its always good to have multiple options and see which is best for mathlib
Chris Birkbeck (Mar 25 2024 at 10:53):
Edgar Costa said:
It would be nice if we could also make the argument work for , but that is not a priority
Yes I agree this would be really nice! If there is a proof that isnt much harder then we could definitely think about this.
Chris Birkbeck (Mar 25 2024 at 11:13):
I propose we meet up after Amelia's talk this afternoon and we can chat about how to approach this!
Peiran Wu (Mar 25 2024 at 11:16):
The git repo has not been set-up correctly (.gitignore
is old probably from prior to v4.3.0 and the inner modules are not imported into the main file so lake build
doesn't do much). I've fixed this locally and can push the fix to a branch
Peiran Wu (Mar 25 2024 at 11:16):
Chris Birkbeck said:
I propose we meet up after Amelia's talk this afternoon and we can chat about how to approach this!
I'm up for this!
Chris Birkbeck (Mar 25 2024 at 11:17):
Peiran Wu said:
The git repo has not been set-up correctly (
.gitignore
is old probably from prior to v4.3.0 and the inner modules are not imported into the main file solake build
doesn't do much). I've fixed this locally and can push the fix to a branch
Oh thank you! yes push the fix and I'll merge it
Peiran Wu (Mar 25 2024 at 11:18):
OK, just need push access. My GitHub handle is wupr
:)
InnaCap (Mar 25 2024 at 15:11):
Hi Guys, could I join you?
InnaCap (Mar 25 2024 at 15:11):
The only problem is I know nothing.
Chris Birkbeck (Mar 25 2024 at 15:12):
Yes! thats perfectly fine. We can talk about this after Amelia's talk :)
InnaCap (Mar 25 2024 at 15:13):
Great! Thank you very much. Where will I find you?
Chris Birkbeck (Mar 25 2024 at 15:14):
How about we meet up near the piano at the front on the room (by the boards), we can then maybe go find some room in the library/elsewhere
Alessandro Iraci (Mar 25 2024 at 15:16):
Suggestion: prove instead that the number of maximal rank matrices with entries in is , it should be a lot easier to do by induction.
InnaCap (Mar 25 2024 at 15:32):
Sorry, where is the piano?
Chris Birkbeck (Mar 25 2024 at 15:33):
Oh I just mean the covered up one at the front of the lecture theatre (although I'm not there yet, just snacking at the moment)
Peiran Wu (Mar 25 2024 at 16:13):
Orbit-stabilizer theorem: docs#MulAction.orbitEquivQuotientStabilizer
Peiran Wu (Mar 25 2024 at 16:47):
Alessandro Iraci said:
Suggestion: prove instead that the number of maximal rank matrices with entries in is , it should be a lot easier to do by induction.
One way to phrase this could be the following?
abbrev q := p ^ m
variable (v : Fin n → 𝔽)
lemma step2 (k : ℕ) (hk : k ≤ n) :
Nat.card { s : Fin k → (Fin n → 𝔽) // LinearIndependent 𝔽 s } = ∏ i : Fin k, ((p ^ m) ^ n - (p ^ m) ^ i.val) :=
sorry
Thomas Lanard (Mar 25 2024 at 16:58):
Some results about linear independent vectors
#check LinearIndependent
#check LinearIndependent.comp
#check linearIndependent_unique_iff
#check linearIndependent_fin_cons
#check linearIndependent_fin_snoc
Thomas Lanard (Mar 25 2024 at 19:56):
For the initialization
induction k
· simp [LinearIndependent]
Antoine Chambert-Loir (Mar 25 2024 at 21:26):
It may be easier to talk about finite families of vectors (Fin m -> V) which are linearly independent. If m < n, any such family can be extended to a family (Fin (m+1) -> V) in exactly … ways, by choosing a vector which is not in the span.
Peiran Wu (Mar 25 2024 at 21:28):
I have just finished Step 2 (still a lot of tidying-up to do). The code is now on branch wupr
of the project repo.
Peiran Wu (Mar 25 2024 at 21:28):
Antoine Chambert-Loir said:
It may be easier to talk about finite families of vectors (Fin m -> V) which are linearly independent. If m < n, any such family can be extended to a family (Fin (m+1) -> V) in exactly … ways, by choosing a vector which is not in the span.
Yes, that's exactly what I have done.
Johan Commelin (Mar 26 2024 at 08:31):
@InnaCap and I made some progress on Step 1 yesterday. We can push this to the repo.
Peiran Wu (Mar 26 2024 at 14:40):
I've merged my branch into main
since everyone seems to be working there.
Thomas Lanard (Mar 27 2024 at 21:33):
I have finished step 1 and made the connection with step 2 to have a complete proof of the cardinal of GLn(Fq). However, I do not have the authorization to push to the repo.
Chris Birkbeck (Mar 27 2024 at 21:39):
Oh send me your GitHub username and I'll add you
Chris Birkbeck (Mar 27 2024 at 21:39):
Also, that's great!!
Chris Birkbeck (Mar 27 2024 at 21:53):
Sorry I didn't actually read what you said, so the project is done! thats amazing!
Chris Birkbeck (Mar 27 2024 at 21:54):
or at least done until the people come back :P
Thomas Lanard (Mar 27 2024 at 21:54):
:)
Kevin Buzzard (Mar 27 2024 at 23:14):
How about the size of O_n(q)?
Chris Birkbeck (Mar 27 2024 at 23:19):
Hmm I don't remember what the proofs are in that case. I'll have to look.
Antoine Chambert-Loir (Mar 27 2024 at 23:49):
It's much more complicated, (un)fortunately and the answer has arithmetic content.
The only example I know by heart is for n = 2 : if -1 is a square in Fq, then it's q - 1, otherwise it's q + 1.
To do the proof for a general quadratic form, I'd take an orthogonal basis, and map the first vector to a vector of same value, hence I need to know the cardinality of the sphere, and I'd go on by induction. Fortunately, Witt tells you that orthogonals of two lines generated by vectors of same value are isomorphic.
Thomas Lanard (Mar 29 2024 at 15:53):
I pushed in the repo the proof of the cardinal of .
It just remains to prove that and do some cleaning. (I will do it later)
I will also try to finish the cardinal of using the chinese remainder theorem.
Chris Birkbeck (Mar 29 2024 at 15:54):
Ah fantastic! its been a good train ride I see :)
Riccardo Brasca (Mar 29 2024 at 15:58):
Do we have that GL
of isomorphic rings are isomorphic?
Chris Birkbeck (Mar 29 2024 at 16:00):
maybe not explicitly, but surely we have enough to do this.
Johan Commelin (Mar 29 2024 at 16:00):
It the proof is about , and gives the result in terms of card K
, then we don't need such a result.
Chris Birkbeck (Mar 29 2024 at 16:03):
Aha yes good point! Thats another good reason to not use GaloisField
and instead use a "general" finite field :)
Thomas Lanard (Mar 29 2024 at 16:03):
Given a morphisme of commutative rings I defined in the file a morphism of group for GL. I don’t think it is too difficult to prove that this is a isomorphism.
Chris Birkbeck (Mar 29 2024 at 16:03):
Riccardo Brasca said:
Do we have that
GL
of isomorphic rings are isomorphic?
But if we dont have this, we should definitely add it, even if we dont need it here.
Thomas Lanard (Mar 29 2024 at 16:05):
If we want to use the chinese remainder theorem to get we need it I think.
Riccardo Brasca (Mar 29 2024 at 16:15):
Yes, I was thinking about the chinese remainder theorem.
Riccardo Brasca (Mar 29 2024 at 16:16):
If you need to add it, consider adding that GL preserve injectivity first.
Riccardo Brasca (Mar 29 2024 at 16:17):
Does anyone know a reasonable criterion to get surjectivity?
Johan Commelin (Mar 29 2024 at 16:18):
To preserve isoms, you only need functoriality
Riccardo Brasca (Mar 29 2024 at 16:21):
Sure, but since injectivity is clearly preserved we can also add it.
Riccardo Brasca (Mar 29 2024 at 16:21):
I was just curious about surjectivity (that is not preserved in general)
Thomas Lanard (Mar 29 2024 at 16:22):
Riccardo Brasca said:
Does anyone know a reasonable criterion to get surjectivity?
morphism surjective + x is a unit if f(x) is a unit?
Johan Commelin (Mar 29 2024 at 16:23):
Fun fact: such f
are called local ring homs in Lean
Riccardo Brasca (Mar 29 2024 at 16:25):
ah sure, preserving units is also a necessary condition.
Johan Commelin (Mar 29 2024 at 16:29):
Except when n = 0 :stuck_out_tongue_wink:
Chris Birkbeck (Mar 29 2024 at 16:34):
Chris Birkbeck said:
Aha yes good point! Thats another good reason to not use
GaloisField
and instead use a "general" finite field :)
Ok this is done!
Kevin Buzzard (Mar 29 2024 at 23:33):
For SL_n it's much more subtle -- for example SL_n(Z) surjects into SL_n(Z/NZ) but this is not immediately obvious as far as i know
Antoine Chambert-Loir (Mar 31 2024 at 13:23):
Riccardo Brasca said:
Does anyone know a reasonable criterion to get surjectivity?
It's a good question. For GL, little hope, unless you have surjectivity on units of the rings, but for SL, you get it by adapting the proof that SL(n, Z) is generated by elementary matrices (1s one diagonal, 0 elsewhere except for one 1).
Thomas Lanard (Apr 09 2024 at 13:21):
I have an issue finishing the proof of the cardinal of . So I want to rewrite N into its decomposition into prime numbers (in order to apply the Chinese Remainder Theorem). However, I have an error that I don’t understand. I think it has something to do with the instance of Fintype. Here are two attempts with a stupid example :
import Mathlib
open BigOperators
variable (N : ℕ) [NeZero N]
instance : Fintype (ZMod (N)) := ZMod.fintype N
noncomputable instance : Fintype (GL (Fin n) (ZMod (N))) := Fintype.ofFinite (GL (Fin n) (ZMod N))
lemma card_GL_ZMod : Fintype.card (GL (Fin n) (ZMod (N))) = 1 := by
have h : N ≠ 0 := Ne.symm (NeZero.ne' N)
rw [←(Nat.factorization_prod_pow_eq_self h)]
--tactic 'rewrite' failed, motive is not type correct
Here the rewrite does not work (tactic 'rewrite' failed, motive is not type correct).
Second attempt :
import Mathlib
open BigOperators
variable (N : ℕ) (h : N ≠ 0)
noncomputable instance : NeZero N := by exact { out := h }
instance : Fintype (ZMod (N)) := by
have : NeZero N := by exact { out := h }
apply ZMod.fintype N
noncomputable instance : Fintype (GL (Fin n) (ZMod (N))) := by
have : NeZero N := by exact { out := h }
apply Fintype.ofFinite (GL (Fin n) (ZMod N))
lemma card_GL_ZMod : Fintype.card (GL (Fin n) (ZMod (N))) = 1 := by
--failed to synthesize instance Fintype (GL (Fin n) (ZMod N))
rw [←(Nat.factorization_prod_pow_eq_self h)]
This time Lean complains: failed to synthesize instance Fintype (GL (Fin n) (ZMod N))
Johan Commelin (Apr 09 2024 at 13:23):
The instance
instance : Fintype (ZMod (N)) := by
have : NeZero N := by exact { out := h }
apply ZMod.fintype N
can not be applied automatically, because it depends on the explicit variable h
which Lean cannot find automatically. Idem dito for the other Fintype
instance below it.
Chris Birkbeck (Apr 09 2024 at 13:29):
You could use (N : ℕ+)
instead and then you dont need the NeZero
stuff
Chris Birkbeck (Apr 09 2024 at 13:35):
Although I don't think it'll let you rewrite N
in the Zmod N
into Zmod (product of factors of N)
. To use CRT you might want to first turn N
into something like N1 * N2
with N1, N2
coprime and then go from there (as I cant see a version of CRT that breaks ZMod into each prime factor, but I could just be looking in the wrong place)
Thomas Lanard (Apr 09 2024 at 13:36):
But if I use (N : ℕ+)
then the rw
doesn’t work
import Mathlib
open BigOperators
variable (N : ℕ+)
noncomputable instance : Fintype (GL (Fin n) (ZMod (N))) := Fintype.ofFinite (GL (Fin n) (ZMod N))
lemma card_GL_ZMod : Fintype.card (GL (Fin n) (ZMod (N.val))) = 1 := by
have h : N.val ≠ 0 := PNat.ne_zero N
have h2 : N.val = Finsupp.prod (Nat.factorization N.val) fun (x x_1 : ℕ) => x ^ x_1 := by rw [(Nat.factorization_prod_pow_eq_self h)]
rw [h2]
--tactic 'rewrite' failed, motive is not type correct
Thomas Lanard (Apr 09 2024 at 13:39):
Chris Birkbeck said:
Although I don't think it'll let you rewrite
N
in theZmod N
intoZmod (product of factors of N)
. To use CRT you might want to first turnN
into something likeN1 * N2
withN1, N2
coprime and then go from there (as I cant see a version of CRT that breaks ZMod into each prime factor, but I could just be looking in the wrong place)
We could use ZMod.prodEquivPi
no?
Chris Birkbeck (Apr 09 2024 at 13:40):
Ah I missed that one! yes you are right, that would be what you want.
Chris Birkbeck (Apr 09 2024 at 13:46):
You can also try
variable (N : ℕ) [h : Fact (N ≠ 0)]
noncomputable instance : NeZero N := by exact { out := h.out }
instance : Fintype (ZMod (N)) := by
have : NeZero N := by exact { out := h.out }
apply ZMod.fintype N
noncomputable instance : Fintype (GL (Fin n) (ZMod (N))) := by
have : NeZero N := by exact { out := h.out }
apply Fintype.ofFinite (GL (Fin n) (ZMod N))
But I think this will also have the rw problem.
Thomas Lanard (Apr 09 2024 at 13:50):
Yes, same rw problem. Even for this, rw doesn’t work
lemma card_GL_ZMod (N: ℕ) (h : N ≠ 0) [Fintype (GL (Fin n) (ZMod N))]:
Fintype.card (GL (Fin n) (ZMod (N))) = 1 := by
rw [←(Nat.factorization_prod_pow_eq_self h)]
--tactic 'rewrite' failed, motive is not type correct
Chris Birkbeck (Apr 09 2024 at 13:54):
hmm ok what about:
import Mathlib
open BigOperators
variable (N : ℕ)
instance : Fintype (ZMod (N + 1)) := by
apply ZMod.fintype (N + 1)
noncomputable instance : Fintype (GL (Fin n) (ZMod (N+1))) := by
apply Fintype.ofFinite (GL (Fin n) (ZMod (N+ 1)))
lemma card_GL_ZMod : Fintype.card (GL (Fin n) (ZMod (N+1))) = 1 := by
--failed to synthesize instance Fintype (GL (Fin n) (ZMod N))
--have := (Nat.factorization_prod_pow_eq_self h.out)
apply Nat.recOnPosPrimePosCoprime (P := fun N => Fintype.card (GL (Fin n) (ZMod (N+1))) = 1)
Chris Birkbeck (Apr 09 2024 at 13:56):
this is quite ugly since it has N+1
everywhere, but the Nat.recOn
cases you get might be doable
Chris Birkbeck (Apr 09 2024 at 13:57):
or perhaps, just replace the N+1
with N
and use the NeZero stuff.
Chris Birkbeck (Apr 09 2024 at 14:01):
actually that probably wont work as itll factor N and not N+1
Kevin Buzzard (Apr 09 2024 at 14:08):
Why not use Finite
instead of Fintype
? That might solve the motive not being type correct error.
Chris Birkbeck (Apr 09 2024 at 14:14):
ah yes thats a good idea:
import Mathlib
open BigOperators
variable (N : ℕ) [h : Fact (N ≠ 0)]
instance : Fintype (ZMod (N )) := by
haveI : NeZero (N) := by exact {out := h.out}
refine ZMod.fintype N
noncomputable instance : Finite (GL (Fin n) (ZMod (N))) := by
exact instFiniteUnits
lemma card_GL_ZMod : Nat.card (GL (Fin n) (ZMod (N))) = 1 := by
--failed to synthesize instance Fintype (GL (Fin n) (ZMod N))
have := (Nat.factorization_prod_pow_eq_self h.out)
rw [← this]
Chris Birkbeck (Apr 09 2024 at 14:15):
That works
Thomas Lanard (Apr 09 2024 at 14:19):
Thank you! I will try with Nat.card
then!
Thomas Lanard (Apr 12 2024 at 15:21):
It worked with Nat.card :smile:. Thank you!
I have pushed the proof in the repo (and also, as Riccardo wanted, the injectivity of for an injective morphism , and surjectivity for a surjective local ring morphism).
Chris Birkbeck (Apr 12 2024 at 15:22):
Thats great! I'll try and have a look in the next few days. I guess the next thing is to think about cleaning it up to PR it to mathlib :)
Chris Birkbeck (May 27 2024 at 11:22):
"Next few days" was a lie, but I've just bumped the repo. Hopefully I'll have some time soonish to start PRing some of this.
Last updated: May 02 2025 at 03:31 UTC