@@ -362,24 +362,37 @@ theorem nilpotent_iff_lowerCentralSeries : IsNilpotent G ↔ ∃ n, lowerCentral
362362
363363section Classical
364364
365- variable [hG : IsNilpotent G]
366-
367365variable (G) in
368366open scoped Classical in
369367/-- The nilpotency class of a nilpotent group is the smallest natural `n` such that
370- the `n`-th term of the upper central series is `G`. -/
371- noncomputable def Group.nilpotencyClass : ℕ := Nat.find (IsNilpotent.nilpotent G)
368+ the `n`-th term of the upper central series is `G`. If `G` is not nilpotent then the nilpotency
369+ class takes the junk value 0. -/
370+ noncomputable def Group.nilpotencyClass : ℕ :=
371+ if hG : IsNilpotent G then Nat.find hG.nilpotent else 0
372+
373+ theorem Group.nilpotencyClass_of_not_nilpotent (hG : ¬ IsNilpotent G) :
374+ Group.nilpotencyClass G = 0 :=
375+ dif_neg hG
376+
377+ variable [hG : IsNilpotent G]
372378
373379open scoped Classical in
380+ theorem Group.nilpotencyClass_def :
381+ Group.nilpotencyClass G = Nat.find (IsNilpotent.nilpotent G) :=
382+ dif_pos hG
383+
374384@[simp]
375- theorem upperCentralSeries_nilpotencyClass : upperCentralSeries G (Group.nilpotencyClass G) = ⊤ :=
376- Nat.find_spec (IsNilpotent.nilpotent G)
385+ theorem upperCentralSeries_nilpotencyClass :
386+ upperCentralSeries G (Group.nilpotencyClass G) = ⊤ := by
387+ classical
388+ rw [nilpotencyClass_def, Nat.find_spec (IsNilpotent.nilpotent G)]
377389
378390theorem upperCentralSeries_eq_top_iff_nilpotencyClass_le {n : ℕ} :
379391 upperCentralSeries G n = ⊤ ↔ Group.nilpotencyClass G ≤ n := by
380392 classical
381393 constructor
382394 · intro h
395+ rw [nilpotencyClass_def]
383396 exact Nat.find_le h
384397 · intro h
385398 rw [eq_top_iff, ← upperCentralSeries_nilpotencyClass]
@@ -391,6 +404,7 @@ central series reaches `G` in its `n`-th term. -/
391404theorem least_ascending_central_series_length_eq_nilpotencyClass :
392405 Nat.find ((nilpotent_iff_finite_ascending_central_series G).mp hG) =
393406 Group.nilpotencyClass G := by
407+ rw [nilpotencyClass_def]
394408 refine le_antisymm (Nat.find_mono ?_) (Nat.find_mono ?_)
395409 · intro n hn
396410 exact ⟨upperCentralSeries G, upperCentralSeries_isAscendingCentralSeries G, hn⟩
@@ -513,18 +527,17 @@ theorem lowerCentralSeries_succ_eq_bot {n : ℕ} (h : lowerCentralSeries G n ≤
513527/-- The preimage of a nilpotent group is nilpotent if the kernel of the homomorphism is contained
514528in the center -/
515529theorem isNilpotent_of_ker_le_center {H : Type *} [Group H] (f : G →* H) (hf1 : f.ker ≤ center G)
516- (hH : IsNilpotent H) : IsNilpotent G := by
517- rw [nilpotent_iff_lowerCentralSeries] at *
518- rcases hH with ⟨n, hn⟩
530+ [ IsNilpotent H] : IsNilpotent G := by
531+ rw [nilpotent_iff_lowerCentralSeries]
532+ rcases nilpotent_iff_lowerCentralSeries.mp ‹_› with ⟨n, hn⟩
519533 use n + 1
520534 refine lowerCentralSeries_succ_eq_bot (le_trans ((Subgroup.map_eq_bot_iff _).mp ?_) hf1)
521535 exact eq_bot_iff.mpr (hn ▸ lowerCentralSeries.map f n)
522536
523537theorem nilpotencyClass_le_of_ker_le_center {H : Type *} [Group H] (f : G →* H)
524- (hf1 : f.ker ≤ center G) (hH : IsNilpotent H) :
525- Group.nilpotencyClass (hG := isNilpotent_of_ker_le_center f hf1 hH) ≤
526- Group.nilpotencyClass H + 1 := by
527- haveI : IsNilpotent G := isNilpotent_of_ker_le_center f hf1 hH
538+ (hf1 : f.ker ≤ center G) [IsNilpotent H] :
539+ Group.nilpotencyClass G ≤ Group.nilpotencyClass H + 1 := by
540+ have : IsNilpotent G := isNilpotent_of_ker_le_center f hf1
528541 rw [← lowerCentralSeries_length_eq_nilpotencyClass]
529542 classical apply Nat.find_min'
530543 refine lowerCentralSeries_succ_eq_bot (le_trans ((Subgroup.map_eq_bot_iff _).mp ?_) hf1)
@@ -548,7 +561,9 @@ theorem nilpotent_of_surjective {G' : Type*} [Group G'] [h : IsNilpotent G] (f :
548561nilpotent group is less or equal the nilpotency class of the domain -/
549562theorem nilpotencyClass_le_of_surjective {G' : Type *} [Group G'] (f : G →* G')
550563 (hf : Function.Surjective f) [h : IsNilpotent G] :
551- Group.nilpotencyClass (hG := nilpotent_of_surjective _ hf) ≤ Group.nilpotencyClass G := by
564+ Group.nilpotencyClass G' ≤ Group.nilpotencyClass G := by
565+ have := nilpotent_of_surjective _ hf
566+ rw [nilpotencyClass_def, nilpotencyClass_def]
552567 classical apply Nat.find_mono
553568 intro n hn
554569 rw [eq_top_iff]
@@ -599,12 +614,21 @@ theorem comap_upperCentralSeries_quotient_center (n : ℕ) :
599614theorem nilpotencyClass_zero_iff_subsingleton [IsNilpotent G] :
600615 Group.nilpotencyClass G = 0 ↔ Subsingleton G := by
601616 classical
602- rw [Group.nilpotencyClass , Nat.find_eq_zero, upperCentralSeries_zero,
617+ rw [Group.nilpotencyClass_def , Nat.find_eq_zero, upperCentralSeries_zero,
603618 subsingleton_iff_bot_eq_top, Subgroup.subsingleton_iff]
604619
620+ /-- If the quotient by `center G` is nilpotent, then so is G. -/
621+ theorem of_quotient_center_nilpotent (h : IsNilpotent (G ⧸ center G)) : IsNilpotent G := by
622+ obtain ⟨n, hn⟩ := h.nilpotent
623+ use n.succ
624+ simp [← comap_upperCentralSeries_quotient_center, hn]
625+
605626/-- Quotienting the `center G` reduces the nilpotency class by 1 -/
606- theorem nilpotencyClass_quotient_center [hH : IsNilpotent G] :
627+ theorem nilpotencyClass_quotient_center :
607628 Group.nilpotencyClass (G ⧸ center G) = Group.nilpotencyClass G - 1 := by
629+ by_cases hH : IsNilpotent G; swap
630+ · rw [nilpotencyClass_of_not_nilpotent hH, zero_tsub, nilpotencyClass_of_not_nilpotent]
631+ exact mt of_quotient_center_nilpotent hH
608632 generalize hn : Group.nilpotencyClass G = n
609633 rcases n with (rfl | n)
610634 · simp only [nilpotencyClass_zero_iff_subsingleton, zero_tsub] at *
@@ -619,7 +643,7 @@ theorem nilpotencyClass_quotient_center [hH : IsNilpotent G] :
619643 calc
620644 n + 1 = Group.nilpotencyClass G := hn.symm
621645 _ ≤ Group.nilpotencyClass (G ⧸ center G) + 1 :=
622- nilpotencyClass_le_of_ker_le_center _ (le_of_eq (ker_mk' _)) _
646+ nilpotencyClass_le_of_ker_le_center _ (le_of_eq (ker_mk' _))
623647
624648/-- The nilpotency class of a non-trivial group is one more than its quotient by the center -/
625649theorem nilpotencyClass_eq_quotient_center_plus_one [hH : IsNilpotent G] [Nontrivial G] :
@@ -631,12 +655,6 @@ theorem nilpotencyClass_eq_quotient_center_plus_one [hH : IsNilpotent G] [Nontri
631655 apply false_of_nontrivial_of_subsingleton G
632656 · simp
633657
634- /-- If the quotient by `center G` is nilpotent, then so is G. -/
635- theorem of_quotient_center_nilpotent (h : IsNilpotent (G ⧸ center G)) : IsNilpotent G := by
636- obtain ⟨n, hn⟩ := h.nilpotent
637- use n.succ
638- simp [← comap_upperCentralSeries_quotient_center, hn]
639-
640658/-- A custom induction principle for nilpotent groups. The base case is a trivial group
641659(`subsingleton G`), and in the induction step, one can assume the hypothesis for
642660the group quotiented by its center. -/
0 commit comments