feat(group_theory/iwasawa.lean): add a proof of the Iwasawa criterion for simplicity#10253
feat(group_theory/iwasawa.lean): add a proof of the Iwasawa criterion for simplicity#10253AntoineChambert-Loir wants to merge 16 commits intomasterfrom
Conversation
src/group_theory/iwasawa.lean
Outdated
|
|
||
| **Lemma.** If the action is 2-transitive, then it is primitive. | ||
|
|
||
| **Theorem (Iwasawa criterion).** Let G be a group with a primitive action on a set X. |
There was a problem hiding this comment.
Thanks for this module docstring at the top of the file!
Could you please cross-link to the Lean code below, by adding the name of Lean theorems/defs (in backticks) to this list of thms/defs? The generated html documentation will automatically turn those into hyperlinks and people who open this file will quickly know the Lean name of the main result.
src/group_theory/iwasawa.lean
Outdated
|
|
||
| /-- An subgroup is maximal if it is maximal in the collection of proper subgroups. -/ | ||
| class subgroup.is_maximal (K : subgroup G) : Prop := | ||
| (out : is_coatom K) |
There was a problem hiding this comment.
| (out : is_coatom K) | |
| (out : is_coatom K) |
src/group_theory/iwasawa.lean
Outdated
| theorem is_maximal_iff {K: subgroup G} : K.is_maximal ↔ | ||
| K ≠ ⊤ ∧ ∀ (H: subgroup G) g, K ≤ H → g ∉ K → g ∈ H → H = ⊤ := | ||
| begin | ||
| split, |
There was a problem hiding this comment.
Please put { } around the subproofs that work on the two goals.
I see that you are structuring your proof with newlines, which also indicates the subproofs, but the mathlib style is to use { }-blocks around subproofs.
src/group_theory/iwasawa.lean
Outdated
| begin | ||
| simp, intro z, rw z at hgK, exact hgK hgH, | ||
| end, |
There was a problem hiding this comment.
Two remarks:
- You can save two lines, by just writing
{ some, tactic, proof },instead of thebegin .. endblock. - Please replace
simpby the output ofsqueeze_simp. (In VScode, you can even click on the output in the goal view, and it will automatically replace it.) The reason we don't want a baresimphalfway a proof is the following: if someone adds new simp-lemmas to fileX, and in a later PR fileXis added as import to one of the dependencies of this Iwasawa file, all of a sudden, thissimpmight do more/different stuff from what it is doing now. And then this proof breaks. But the person who is adding this import maybe doesn't understand the maths in this file. So now they have a PR with a broken proof in random part of the library that they don't know how to fix.
Long story short:squeeze_simphelps a lot with long-term maintenance of proofs. See also https://leanprover-community.github.io/glossary.html#non-terminal-simp
There was a problem hiding this comment.
Thanks! The main reason for my begin … end blocks is that I wrote theorem …… := …,
and the {… } syntax didn't work until I changed the := to ,.
Regarding 2, this is an issue I had imagined you could have, when people rewrite/extend tactics.
Most often, squeeze_simp suggests a simp only [do_stuff]
and I see that rw do_stuff suffices.
Is it enough to leave the simp only or is it better to change it to rw?
There was a problem hiding this comment.
Usually simp only is fine. rw is slightly faster, but is a bit less powerful than simp only. I wouldn't worry too much for now. simp only is stable and pretty fast.
src/group_theory/iwasawa.lean
Outdated
| end | ||
|
|
||
| /-- f(f⁻¹(t)) = f.range ∩ t -/ | ||
| lemma map_comap_of {α β : Type*} (f: α → β) (t: set β): |
There was a problem hiding this comment.
I think the more predictable name would be to use image_preimage_eq. Also, these lemmas should move to some basic file about set.
src/group_theory/iwasawa.lean
Outdated
| by rw [← set.image_univ, ← set.image_inter_preimage f set.univ t, set.univ_inter] | ||
|
|
||
| /-- If f is surjective, then f(f⁻¹(t)) = t -/ | ||
| lemma map_comap_of_surjective {α β : Type*} (f : α → β) (t : set β) : |
There was a problem hiding this comment.
How to guess whether they exist in some form ?
There was a problem hiding this comment.
You can try to prove them by library_search. That might tell you they already exist.
tb65536
left a comment
There was a problem hiding this comment.
Golfed the last two proofs.
|
I have one question about lines 202, 203, 214, where I want to use |
|
Some checks fail, I don't understand why, nor whether it's important. |
tb65536
left a comment
There was a problem hiding this comment.
In addition to these comments, can you also refactor the PR to comply with https://leanprover-community.github.io/contribute/style.html
In particular, 2 spaces to indent, spaces after binders, hypotheses before colon, single tactic per line, braces should not be alone on a line.
src/group_theory/iwasawa.lean
Outdated
| intros is_surj is_comm, | ||
| apply is_commutative.mk, | ||
| intros a b, | ||
| obtain ⟨a', ha'⟩ := is_surj a, obtain ⟨b', hb'⟩ := is_surj b, | ||
| rw ← ha', rw ← hb', | ||
| let z := ⇑φ, let z₂ := φ.to_fun, have : z = z₂ , by refl, | ||
| rw ← mul_hom.map_mul φ a' b', | ||
| rw ← mul_hom.map_mul φ b' a', | ||
| apply φ.congr_arg, | ||
| refine is_commutative.cases_on is_comm _, intro, | ||
| exact comm a' b', |
There was a problem hiding this comment.
| intros is_surj is_comm, | |
| apply is_commutative.mk, | |
| intros a b, | |
| obtain ⟨a', ha'⟩ := is_surj a, obtain ⟨b', hb'⟩ := is_surj b, | |
| rw ← ha', rw ← hb', | |
| let z := ⇑φ, let z₂ := φ.to_fun, have : z = z₂ , by refl, | |
| rw ← mul_hom.map_mul φ a' b', | |
| rw ← mul_hom.map_mul φ b' a', | |
| apply φ.congr_arg, | |
| refine is_commutative.cases_on is_comm _, intro, | |
| exact comm a' b', | |
| refine λ hφ hG, ⟨λ a b, _⟩, | |
| obtain ⟨a, rfl⟩ := hφ a, | |
| obtain ⟨b, rfl⟩ := hφ b, | |
| rw [←φ.map_mul, ←φ.map_mul, hG.comm], |
|
|
||
| variables (G X) | ||
| structure is_primitive | ||
| extends is_transitive G X : Prop := |
There was a problem hiding this comment.
Why not just use is_pretransitive? The only serious issue arises in the proof of Iwasawa_mk, but there you can deduce nonempty X from mul_action.fixed_points N X ≠ ⊤.
| extends is_transitive G X : Prop := | |
| extends is_pretransitive G X : Prop := |
There was a problem hiding this comment.
The name of the structure should reflect its mathematical name.
As you notice, the Iwasawa lemma uses two properties of is_primitive, is_transitive and has_maximal_stabilizers, while the third one, as you indicate, could be derived from the other hypothesis.
Does it make sense to define is_preprimitive which would just remove the is_nonempty field?
There was a problem hiding this comment.
Either is_primitive or is_preprimitive is fine with me.
src/group_theory/iwasawa.lean
Outdated
| lemma surj_to_comm {G H : Type*} [has_mul G] [has_mul H] (φ: mul_hom G H) : | ||
| function.surjective φ → is_commutative G (*) → is_commutative H (*) := | ||
| begin | ||
| intros is_surj is_comm, |
There was a problem hiding this comment.
If your proof starts with intros then you should have put something before the colon:
| lemma surj_to_comm {G H : Type*} [has_mul G] [has_mul H] (φ: mul_hom G H) : | |
| function.surjective φ → is_commutative G (*) → is_commutative H (*) := | |
| begin | |
| intros is_surj is_comm, | |
| lemma surj_to_comm {G H : Type*} [has_mul G] [has_mul H] (φ : mul_hom G H) | |
| (is_surj : function.surjective φ) (is_comm : is_commutative G (*)) : is_commutative H (*) := | |
| begin |
There was a problem hiding this comment.
Oh yes ! I learned recently about the style convention for universal assumptions.
| } | ||
| end | ||
|
|
||
| private lemma stupid_lemma {A : Type*} [group A] (B : subgroup A) : |
There was a problem hiding this comment.
This should be called subgroup.comap_subtype_self to match submodule.comap_subtype_self, and should go in subgroup/basic.lean.
|
|
||
| namespace subgroup | ||
| /-- An subgroup is maximal if it is maximal in the collection of proper subgroups. -/ | ||
| class is_maximal (K : subgroup G) : Prop := |
There was a problem hiding this comment.
You make this a class, yet you never have [is_maximal K] anywhere.
There was a problem hiding this comment.
I just copied what was done for maximal ideals.
There was a problem hiding this comment.
I definitely agree with this being a class to be consistent - I imagine that instances will accumulate as people do more group theory.
src/group_theory/iwasawa.lean
Outdated
| lemma surj_to_comm {G H : Type*} [has_mul G] [has_mul H] (φ: mul_hom G H) | ||
| (is_surj : function.surjective φ) (is_comm : is_commutative G (*)) : | ||
| is_commutative H (*) := |
There was a problem hiding this comment.
mathlib indent style, and a better name:
| lemma surj_to_comm {G H : Type*} [has_mul G] [has_mul H] (φ: mul_hom G H) | |
| (is_surj : function.surjective φ) (is_comm : is_commutative G (*)) : | |
| is_commutative H (*) := | |
| lemma function.surjective.mul_commutative {G H : Type*} [has_mul G] [has_mul H] (φ : mul_hom G H) | |
| (is_surj : function.surjective φ) (is_comm : is_commutative G (*)) : | |
| is_commutative H (*) := |
There was a problem hiding this comment.
Also, I recommend using commutative ((*) → G → G) instead of is_commutative G (*), which will eliminate the is_commutative.mk and is_commutative.cases_on below.
There was a problem hiding this comment.
Do you mean : commutative ((*) : G → G → G) ?
There was a problem hiding this comment.
(In any case, that worked as you indicated with this modification…)
There was a problem hiding this comment.
There are a lot of other is_commutative to rewrite and I wonder whether it is not clearer to refer to the structural properties of objects (groups, etc.) rather than going back to their internal law.
Is there a way to shorten : commutative ((*) : (quotient_group.quotient N) → (quotient_group.quotient N) → (quotient_group.quotient N)) ?
There was a problem hiding this comment.
Does commutative ((*) : _ → _ → quotient_group.quotient N) work?
There was a problem hiding this comment.
No, but you certainly know how to recover, if G is a group/monoid/... its mul law, or any of its types that are part of its structure. (What if there are many of them?)
There was a problem hiding this comment.
I don't understand the question
There was a problem hiding this comment.
I had hoped that something like (quotient_group.quotient N).mul would give me the mul part of the group (monoid) structure of quotient_group.quotient N. But that didn't work like that.
src/group_theory/iwasawa.lean
Outdated
| obtain ⟨a', ha'⟩ := is_surj a, obtain ⟨b', hb'⟩ := is_surj b, | ||
| rw ← ha', rw ← hb', | ||
| let z := ⇑φ, let z₂ := φ.to_fun, have : z = z₂ , by refl, |
There was a problem hiding this comment.
| obtain ⟨a', ha'⟩ := is_surj a, obtain ⟨b', hb'⟩ := is_surj b, | |
| rw ← ha', rw ← hb', | |
| let z := ⇑φ, let z₂ := φ.to_fun, have : z = z₂ , by refl, | |
| obtain ⟨a', rfl⟩ := is_surj a, | |
| obtain ⟨b', rfl⟩ := is_surj b, |
you never used this have or let.
… for simplicity Add the Iwasawa criterion for simplicity. This criterion can be used in the proof of simplicity of some classical groups such as the alternating group or the projective special linear group (these applications are TODO).
…tuff Use shortened proofs as suggested by @tb65536 Use set.image_preimage and remove unused basic lemmas Use nontrivial and remove useless intermediate results
…he alternating group is perfect Prove what is said: the alternating group on α, with 5 ≤ fintype.card α, is perfect, aka equal to its commutator subgroup. Prove two intermediate lemmas, that 3-cycles are commutators and are contained in the commutator subgroup Prove two ugly lemmas that should be (and certainly will) golfed by people more competent than me.
… lemmas Shorten the proof of `alternating_group_is_perfect` using a simplification by Johan Commelin
71667a8 to
d1ca2d4
Compare
|
As I wrote to Patrick this morning, I am self-disappointed. The plan I had to write this proof broke down 5 minutes before its conclusion. |
|
Can you elaborate a bit @AntoineChambert-Loir ? The things you say are now formalized are they in this PR or somewhere else? |
|
@alexjbest I applied the Iwasawa criterion (which already belongs to this PR) to the action of the Presumably, one can apply the criterion to the action of The files of the formalization are certainly worth of drastic refactoring. I did a lot of stuff by bare hands, probably because I don't know some idioms, or some parts of the library. |
|
I have explained a bit of the math on the blog post : https://freedommathdance.blogspot.com/2021/12/not-simple-proofs-of-simplicity.html |
Add the Iwasawa criterion for simplicity.
This criterion can be used in the proof of simplicity of some classical
groups such as the alternating group or the projective special linear group
(these applications are TODO).