Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

BG §3: Theorem 3.4 (coprime action, fixed-point-free complement)

Definition
OddOrder_BG_Ch1_Preliminary_S03d_Thm34

by burkh4rt · Nov 12, 2026 · Mathlib 0df444a (Lean v4.33.1)

feit-thompsonfinite-groupsgroup-theoryishida-odd-order

Formalizes Theorem 3.4 of Bender–Glauberman, Local Analysis for the Odd Order Theorem, §3: let GGG be a solvable group of odd order with a normal Hall subgroup KKK and a complement RRR of prime order, acting on a vector space VVV over FFF with char F∤∣G∣\mathrm{char}\,F\nmid|G|charF∤∣G∣. If CV(R)=0C_V(R)=0CV​(R)=0 then [R,K]⊆CK(V)[R,K]\subseteq C_K(V)[R,K]⊆CK​(V). It is the main consumer of Theorem 2.5 and opens the chain 3.5 → 3.6 → 10.6.

Main declarations: thm34_isExtraspecial_of_special (BG Theorem 3.4, step 7: a nonabelian special kernel with cyclic ambient centre is extraspecial); exists_irreducible_subrep_apply_ne (BG Theorem 3.4, step 2 (Maschke selection)); thm34_aux (BG Theorem 3.4, group-order strong-induction core (algebraically closed F)); thm34 (BG Theorem 3.4 (general field)).

The bundle also proves 13 supporting lemmas used by later statements.

Definition code
/-
Copyright (c) 2026 Yawara Ishida. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yawara Ishida
-/
-- From github.com/yawara/odd-order @ 20a6fccbb63c (Apache-2.0; LICENSE at that commit):
--   OddOrder/BG/Ch1_Preliminary/S03d_Thm34.lean
-- Generated for Prove2Me by deleting declarations; the remaining commands are verbatim except:
-- `private` dropped where another file uses the declaration, and a solution's main theorem
-- renamed `_root_.solution` (platform convention).
import Definitions.Def_OddOrder_BG_Ch1_Preliminary_S03b_Lemma33
import Definitions.Def_OddOrder_BG_Ch1_Preliminary_S04e_GorThm37
import Definitions.Def_OddOrder_Isaacs_Ch04_Commutators_ForwardFromCh03
import Definitions.Def_OddOrder_GroupTheory_IsExtraspecial
import Definitions.Def_OddOrder_GroupTheory_RepresentationTheory_CliffordConjugateChar
import Definitions.Def_OddOrder_GroupTheory_RepresentationTheory_ExtraspecialThm25Final
import Definitions.Def_OddOrder_GroupTheory_RepresentationTheory_ExtraspecialFaithful
import Definitions.Def_OddOrder_GroupTheory_RepresentationTheory_BaseChange
import Mathlib.RepresentationTheory.Basic
import Mathlib.RepresentationTheory.Subrepresentation
import Mathlib.FieldTheory.IsAlgClosed.Basic
import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure
import Mathlib.GroupTheory.Commutator.Basic
import Mathlib.RingTheory.RootsOfUnity.AlgebraicallyClosed

namespace OddOrder.BG.Ch1.S03d

open OddOrder.Isaacs.Ch03 OddOrder.Isaacs.Ch04 OddOrder.Isaacs.Ch06

open scoped Pointwise commutatorElement

/-- **BG Theorem 3.4, step 6 (closing absurdity for the elementary-abelian case).**
If `G = KR` is a Frobenius group (kernel `K`, complement `R`) on which `K` acts nontrivially over a
field `F` with `char F ∤ |K|`, then some nonzero vector is fixed by all of `R` (Lemma 3.3), so
`C_V(R) ≠ 0` — contradicting the standing hypothesis `C_V(R) = 0`.  In the proof of Theorem 3.4 the
elementary-abelian branch yields `C_K(R) = 1`, hence a Frobenius group (Lemma 3.1), and this lemma
closes that branch. -/
private theorem thm34_frobenius_absurd {F : Type*} [Field F]
    {G : Type*} [Group G] [Finite G] {V : Type*} [AddCommGroup V] [Module F V]
    {K R : Subgroup G} (ρ : Representation F G V)
    (hFrob : IsFrobeniusGroup G K R) (hchar : (Nat.card ↥K : F) ≠ 0)
    (hKnt : ∃ k : ↥K, ρ (k : G) ≠ 1)
    (hCV : ∀ v : V, (∀ r : ↥R, ρ (r : G) v = v) → v = 0) : False := by
  obtain ⟨v, hv0, hvfix⟩ :=
    OddOrder.BG.Ch1.S03b.centralizer_ne_bot_of_nontrivial_kernel hFrob ρ hchar hKnt
  exact hv0 (hCV v hvfix)

/-- **BG Theorem 3.4, step 4 (front half).** If `K` is generated by a family of proper
`R`-invariant subgroups `Hᵢ`, each of which already satisfies `[Hᵢ, R] ⊆ C` (the inductive
conclusion from `wiring_check`), then `[R, K] ⊆ C`.  The commutator distributes over the join
(`commutator_iSup_right`), and each `⁅R, Hᵢ⁆` lands in `ker ρ`.  Combined with the back half
(a `≥ 2`-prime `|K|` is generated by its proper `R`-invariant Sylow subgroups) this gives the
contradiction forcing `|K| = qⁿ`. -/
private theorem thm34_commutator_of_generated {F : Type*} [Field F]
    {G : Type*} [Group G] {V : Type*} [AddCommGroup V] [Module F V]
    (ρ : Representation F G V) {K R : Subgroup G}
    (hproper : ∀ H : Subgroup G, H < K → R ≤ Subgroup.normalizer H → ∀ g ∈ ⁅R, H⁆, ρ g = 1)
    {ι : Type*} (Hs : ι → Subgroup G) (hHlt : ∀ i, Hs i < K)
    (hHinv : ∀ i, R ≤ Subgroup.normalizer (Hs i)) (hgen : ⨆ i, Hs i = K) :
    ∀ g ∈ ⁅R, K⁆, ρ g = 1 := by
  refine (Subgroup.commutator_le (H₁ := R) (H₂ := K) (H₃ := MonoidHom.ker ρ)).mpr ?_
  intro r hr k hk
  -- `Cr = {k | ρ kills ⁅r,k⁆}` is a subgroup: `one` via `⁅r,1⁆=1`; `mul` via the identity
  -- `⁅r,ab⁆ = ⁅r,a⁆·(a⁅r,b⁆a⁻¹)` and `ker ρ` normal; `inv` via `⁅r,a⁻¹⁆ = a⁻¹⁅r,a⁆⁻¹a`.
  -- Each `Hs i ≤ Cr` by `hproper`, so `K = ⨆ Hs ≤ Cr`, giving `⁅r,k⁆ ∈ ker ρ`.
  let Cr : Subgroup G :=
    { carrier := {k | ⁅r, k⁆ ∈ MonoidHom.ker ρ}
      one_mem' := by
        simp only [Set.mem_ofPred_eq, commutatorElement_one_right]; exact one_mem _
      mul_mem' := fun {a b} ha hb => by
        simp only [Set.mem_ofPred_eq] at *
        have hid : ⁅r, a * b⁆ = ⁅r, a⁆ * (a * ⁅r, b⁆ * a⁻¹) := by group
        rw [hid]
        exact mul_mem ha ((MonoidHom.normal_ker ρ).conj_mem _ hb a)
      inv_mem' := fun {a} ha => by
        simp only [Set.mem_ofPred_eq] at *
        have hid : ⁅r, a⁻¹⁆ = a⁻¹ * ⁅r, a⁆⁻¹ * a := by group
        rw [hid]
        simpa only [inv_inv] using (MonoidHom.normal_ker ρ).conj_mem _ (inv_mem ha) a⁻¹ }
  have hKCr : (⨆ i, Hs i) ≤ Cr := by
    refine iSup_le fun i => ?_
    intro k' hk'
    change ⁅r, k'⁆ ∈ MonoidHom.ker ρ
    rw [MonoidHom.mem_ker]
    exact hproper (Hs i) (hHlt i) (hHinv i) _ (Subgroup.commutator_mem_commutator hr hk')
  rw [← hgen] at hk
  exact hKCr hk

/-- A finite group is generated by **any choice** of one Sylow `p`-subgroup per prime divisor
(choice version of `⨆ Sylow = ⊤`, same factorization argument).  Used in step 4 with the
`R`-invariant Sylow subgroups to express `K` as a join of proper `R`-invariant subgroups. -/
private lemma sylow_choice_iSup_eq_top {M : Type*} [Group M] [Finite M]
    (P : ∀ p : (Nat.card M).primeFactors, Sylow p.val M) :
    (⨆ p, (P p : Subgroup M)) = ⊤ := by
  classical
  set sup := ⨆ p, (P p : Subgroup M) with hsup_def
  have h_sup_dvd : Nat.card sup ∣ Nat.card M := Subgroup.card_subgroup_dvd_card sup
  have h_pow_dvd : ∀ p ∈ (Nat.card M).primeFactors,
      p ^ (Nat.card M).factorization p ∣ Nat.card sup := by
    intro p hp
    have : Fact p.Prime := ⟨Nat.prime_of_mem_primeFactors hp⟩
    have hP_le : ((P ⟨p, hp⟩ : Subgroup M)) ≤ sup :=
      le_iSup (fun q : (Nat.card M).primeFactors => (P q : Subgroup M)) ⟨p, hp⟩
    have h_dvd := Subgroup.card_dvd_of_le hP_le
    rwa [Sylow.card_eq_multiplicity] at h_dvd
  have h_le : ∀ p, (Nat.card M).factorization p ≤ (Nat.card sup).factorization p := by
    intro p
    rcases Nat.eq_zero_or_pos ((Nat.card M).factorization p) with h0 | hpos
    · rw [h0]; exact Nat.zero_le _
    · have hp_in : p ∈ (Nat.card M).primeFactors := by
        rw [← Nat.support_factorization]; exact Finsupp.mem_support_iff.mpr (by omega)
      exact ((Nat.prime_of_mem_primeFactors hp_in).pow_dvd_iff_le_factorization
        Nat.card_pos.ne').mp (h_pow_dvd p hp_in)
  have h_le' : ∀ p, (Nat.card sup).factorization p ≤ (Nat.card M).factorization p :=
    fun p => (Nat.factorization_le_iff_dvd Nat.card_pos.ne' Nat.card_pos.ne').mpr h_sup_dvd p
  exact Subgroup.eq_top_of_card_eq sup
    (Nat.eq_of_factorization_eq Nat.card_pos.ne' Nat.card_pos.ne'
      (fun p => le_antisymm (h_le' p) (h_le p)))

/-- **BG Theorem 3.4, step 4 (back half): a non-prime-power kernel is generated by proper
`R`-invariant subgroups.**  Let `K ◁ G` with `R` acting coprimely (here `|R|` coprime to `|K|`).
If `|K|` is *not* a prime power then, for each prime `p ∣ |K|`, there is an `R`-invariant Sylow
`p`-subgroup of `K` (`exists_aInvariant_sylow`, the coprime-action fixed-point theorem); mapped into
`G` these are:
* **proper** (`< K`) — a single Sylow cannot be all of `K`, else `|K|` would be a prime power;
* **`R`-invariant** (`R ≤ normalizer`) — `R` normalises them since they are `φ`-invariant for the
  conjugation action `φ = MulAut.conjNormal ∘ R.subtype`;
* a **generating** family (`⨆ = K`) — the Sylow subgroups of `K` join to `K`.

Feeding this family to `thm34_commutator_of_generated` forces `[R, K] ⊆ C_K(V)` in the minimal
counterexample, a contradiction; hence `|K|` is a prime power (step 4). -/
private lemma exists_proper_aInvariant_iSup_eq_of_not_isPrimePow
    {G : Type*} [Group G] [Finite G] [Group.IsSolvable G] {K R : Subgroup G} [K.Normal]
    (hcop : Nat.Coprime (Nat.card ↥R) (Nat.card ↥K))
    (hnpp : ¬ IsPrimePow (Nat.card ↥K)) :
    ∃ Hs : (Nat.card ↥K).primeFactors → Subgroup G,
      (∀ i, Hs i < K) ∧ (∀ i, R ≤ Subgroup.normalizer (Hs i)) ∧ ⨆ i, Hs i = K := by
  classical
  -- conjugation action of `R` on the normal subgroup `K`, and the value of its (inverse) action
  set φ : ↥R →* MulAut ↥K := (MulAut.conjNormal (G := G) (H := K)).comp R.subtype with hφ
  have hval : ∀ (r : ↥R) (k : ↥K), (((φ r) k : ↥K) : G) = (r : G) * (k : G) * (r : G)⁻¹ := by
    intro r k
    simp only [hφ, MonoidHom.comp_apply, Subgroup.coe_subtype, MulAut.conjNormal_apply]
  have hvalinv : ∀ (r : ↥R) (k : ↥K), (((φ r)⁻¹ k : ↥K) : G) = (r : G)⁻¹ * (k : G) * (r : G) := by
    intro r k
    simp only [hφ, MonoidHom.comp_apply, Subgroup.coe_subtype]
    exact MulAut.conjNormal_inv_apply (r : G) k
  -- choose an `R`-invariant Sylow `p`-subgroup of `K` for each prime `p ∣ |K|`
  have hchoose : ∀ p : (Nat.card ↥K).primeFactors,
      ∃ P : Sylow p.val ↥K, IsAInvariant φ (P : Subgroup ↥K) := by
    intro p
    have : Fact p.val.Prime := ⟨Nat.prime_of_mem_primeFactors p.2⟩
    exact exists_aInvariant_sylow (φ := φ) hcop (Or.inl inferInstance) p.val
  choose P hP using hchoose
  refine ⟨fun p => (P p : Subgroup ↥K).map K.subtype, ?_, ?_, ?_⟩
  · -- properness: `(P p).map K.subtype < K`
    intro p
    refine lt_of_le_of_ne (Subgroup.map_subtype_le _) ?_
    intro heq
    apply hnpp
    have : Fact p.val.Prime := ⟨Nat.prime_of_mem_primeFactors p.2⟩
    have e1 : Nat.card ↥((P p : Subgroup ↥K).map K.subtype) = Nat.card ↥(P p : Subgroup ↥K) :=
      Nat.card_congr (Subgroup.equivMapOfInjective _ _ K.subtype_injective).symm.toEquiv
    have hcard : Nat.card ↥K = p.val ^ (Nat.card ↥K).factorization p.val := by
      conv_lhs => rw [← heq]
      rw [e1, (P p).card_eq_multiplicity]
    exact ⟨p.val, (Nat.card ↥K).factorization p.val, (Nat.prime_of_mem_primeFactors p.2).prime,
      (Nat.prime_of_mem_primeFactors p.2).factorization_pos_of_dvd Nat.card_pos.ne'
        (Nat.dvd_of_mem_primeFactors p.2), hcard.symm⟩
  · -- `R`-invariance: `R ≤ normalizer ((P p).map K.subtype)`
    intro p r hr
    rw [Subgroup.mem_normalizer_iff]
    intro n
    constructor
    · rintro ⟨k, hk, rfl⟩
      refine ⟨(φ ⟨r, hr⟩) k, (hP p).smul_mem ⟨r, hr⟩ hk, ?_⟩
      simp only [Subgroup.coe_subtype] at *
      rw [hval ⟨r, hr⟩ k]
    · rintro ⟨k, hk, hkn⟩
      refine ⟨(φ ⟨r, hr⟩)⁻¹ k, (hP p).inv_smul_mem ⟨r, hr⟩ hk, ?_⟩
      simp only [Subgroup.coe_subtype] at hkn ⊢
      rw [hvalinv ⟨r, hr⟩ k, hkn]
      group
  · -- generating: `⨆ p, (P p).map K.subtype = K`
    rw [← Subgroup.map_iSup, sylow_choice_iSup_eq_top P, ← MonoidHom.range_eq_map,
      Subgroup.range_subtype]

/-- **BG Theorem 3.4, step 4 (packaging): the kernel of a minimal counterexample has prime-power
order.**  Combining step 1 (`hproper`, the inductive conclusion for proper `R`-invariant subgroups,
supplied by `wiring_check`) with the generation lemma
`exists_proper_aInvariant_iSup_eq_of_not_isPrimePow` and `thm34_commutator_of_generated`: if `|K|`
were not a prime power, `K` would be generated by proper `R`-invariant subgroups, forcing
`[R, K] ⊆ C_K(V)` — contradicting the standing minimal-counterexample assumption `[R, K] ⊄ C_K(V)`
(`hRK`).  (The `|K| = 1` case is also covered: there the generating family is empty,
`K = ⊥`, and the
conclusion holds outright, again contradicting `hRK`.) -/
private lemma thm34_isPrimePow_of_minimal {F : Type*} [Field F]
    {G : Type*} [Group G] [Finite G] [Group.IsSolvable G] {V : Type*} [AddCommGroup V] [Module F V]
    (ρ : Representation F G V) {K R : Subgroup G} [K.Normal]
    (hcop : Nat.Coprime (Nat.card ↥R) (Nat.card ↥K))
    (hproper : ∀ H : Subgroup G, H < K → R ≤ Subgroup.normalizer H → ∀ g ∈ ⁅R, H⁆, ρ g = 1)
    (hRK : ¬ ∀ g ∈ ⁅R, K⁆, ρ g = 1) :
    IsPrimePow (Nat.card ↥K) := by
  by_contra hnpp
  obtain ⟨Hs, hlt, hinv, hgen⟩ := exists_proper_aInvariant_iSup_eq_of_not_isPrimePow hcop hnpp
  exact hRK (thm34_commutator_of_generated ρ hproper Hs hlt hinv hgen)

open OddOrder.GroupTheory in
/-- **BG Theorem 3.4, step 7: a nonabelian special kernel with cyclic ambient centre is
extraspecial.**  In the minimal counterexample `G = K ⋊ R` with `G` faithful irreducible (so `Z(G)`
is cyclic by Gorenstein 3.2.2, `hZcyc`), suppose Gorenstein 5.3.7 left `K` *nonabelian special*
(`IsSpecial p K`, not elementary abelian) and `R` centralises `Z(K)` (`hRcent`, the
centralising half
of BG (3.3), since `K' = Z(K)` for a special group).  Then `Z(K) ⊆ Z(G)`: any `↑z` with `z ∈ Z(K)`
commutes with all of `K` (it is central in `K`) and with all of `R` (`hRcent`), and `K ⊔ R = ⊤`
(complement), so its centraliser is everything.  Hence `Z(K)` embeds injectively into the cyclic
`Z(G)`, is itself cyclic, and `of_isSpecial_of_isCyclic_center` (Leaf 1) gives
`IsExtraspecial p K`. -/
private lemma thm34_isExtraspecial_of_special {G : Type*} [Group G] [Finite G]
    {K R : Subgroup G} {p : ℕ} [Fact p.Prime]
    (hcompl : Subgroup.IsComplement' K R)
    (hZcyc : IsCyclic (Subgroup.center G))
    (hRcent : ∀ r ∈ R, ∀ k : ↥K, k ∈ Subgroup.center ↥K → r * (k : G) = (k : G) * r)
    (hsp : IsSpecial p ↥K) (hnonab : ¬ IsElementaryAbelian p ↥K) :
    IsExtraspecial p ↥K := by
  -- every `↑z` with `z ∈ Z(K)` lies in `Z(G)` (its centraliser contains `K ⊔ R = ⊤`)
  have hmem : ∀ z : ↥(Subgroup.center ↥K),
      (K.subtype.comp (Subgroup.center ↥K).subtype) z ∈ Subgroup.center G := by
    intro z
    change ((z : ↥K) : G) ∈ Subgroup.center G
    have hcent : Subgroup.centralizer ({((z : ↥K) : G)} : Set G) = ⊤ := by
      rw [eq_top_iff, ← hcompl.sup_eq_top]
      refine sup_le (fun a ha => ?_) (fun b hb => ?_)
      · rw [Subgroup.mem_centralizer_iff]
        intro h hh
        rw [Set.mem_singleton_iff] at hh; subst hh
        have h2 := congrArg (K.subtype) (Subgroup.mem_center_iff.mp z.2 ⟨a, ha⟩)
        simp only [map_mul, Subgroup.coe_subtype] at h2
        exact h2.symm
      · rw [Subgroup.mem_centralizer_iff]
        intro h hh
        rw [Set.mem_singleton_iff] at hh; subst hh
        exact (hRcent b hb (z : ↥K) z.2).symm
    rw [Subgroup.mem_center_iff]
    intro g
    have hg : g ∈ Subgroup.centralizer ({((z : ↥K) : G)} : Set G) := hcent ▸ Subgroup.mem_top g
    rw [Subgroup.mem_centralizer_iff] at hg
    exact (hg _ rfl).symm
  -- `Z(K) ↪ Z(G)` injectively, hence `Z(K)` is cyclic; conclude via Leaf 1
  let f' : ↥(Subgroup.center ↥K) →* ↥(Subgroup.center G) :=
    (K.subtype.comp (Subgroup.center ↥K).subtype).codRestrict _ hmem
  have hinj : Function.Injective f' := by
    intro a b hab
    have h1 : ((a : ↥K) : G) = ((b : ↥K) : G) :=
      congrArg (Subtype.val : ↥(Subgroup.center G) → G) hab
    exact Subtype.ext (Subtype.ext h1)
  have : IsCyclic (Subgroup.center ↥K) := isCyclic_of_injective f' hinj
  exact IsExtraspecial.of_isSpecial_of_isCyclic_center hsp hnonab this

open OddOrder.RepresentationTheory in
set_option backward.isDefEq.respectTransparency false in
/-- **BG Theorem 3.4, step 2 (Maschke selection).**  Over a field with `char F ∤ |G|` a
finite-dimensional representation `ρ` is semisimple (Maschke).  If `ρ g₀ ≠ 1` then `g₀` acts
nontrivially on some **irreducible** subrepresentation `W`: were `g₀` to fix every simple
subrepresentation pointwise it would fix their join `⊤ = ⨆ simple`, contradicting
`ρ g₀ ≠ 1`.  In the
proof of Theorem 3.4 this is applied to a `g₀ ∈ ⁅R, K⁆` with `ρ g₀ ≠ 1` (from `hRK`) to choose the
irreducible `M` on which `[K, R]` acts nontrivially. -/
theorem exists_irreducible_subrep_apply_ne
    {F : Type*} [Field F] {G : Type*} [Group G] [Finite G]
    {V : Type*} [AddCommGroup V] [Module F V] [NeZero (Nat.card G : F)]
    (ρ : Representation F G V) {g₀ : G} (hg₀ : ρ g₀ ≠ 1) :
    ∃ W : Subrepresentation ρ, (W.toRepresentation).IsIrreducible ∧ W.toRepresentation g₀ ≠ 1 := by
  classical
  have : IsSemisimpleModule (MonoidAlgebra F G) ρ.asModule := by
    rw [← Representation.isSemisimpleRepresentation_iff_isSemisimpleModule_asModule]; infer_instance
  -- find a simple `F[G]`-submodule on which `single g₀ 1` (i.e. `ρ g₀`) acts nontrivially
  have key : ∃ N : Submodule (MonoidAlgebra F G) ρ.asModule,
      IsSimpleModule (MonoidAlgebra F G) ↥N ∧
      ∃ w : ρ.asModule, w ∈ N ∧ MonoidAlgebra.single g₀ (1 : F) • w ≠ w := by
    by_contra hcon
    push Not at hcon
    apply hg₀
    -- `single g₀ 1` fixes every `asModule` element (it fixes every simple, which join to `⊤`)
    have hall : ∀ w : ρ.asModule, MonoidAlgebra.single g₀ (1 : F) • w = w := by
      intro w
      have hv : w ∈
          ⨆ i : ↥{m : Submodule (MonoidAlgebra F G) ρ.asModule |
              IsSimpleModule (MonoidAlgebra F G) ↥m},
            (i : Submodule (MonoidAlgebra F G) ρ.asModule) := by
        rw [← sSup_eq_iSup', IsSemisimpleModule.sSup_simples_eq_top]; exact Submodule.mem_top
      refine Submodule.iSup_induction (motive := fun z => MonoidAlgebra.single g₀ (1 : F) • z = z)
        _ hv (fun i x hx => hcon i.1 i.2 x hx) (by simp)
        (fun a b ha hb => by rw [smul_add, ha, hb])
    ext v
    have hv := congrArg ρ.asModuleEquiv (hall (ρ.asModuleEquiv.symm v))
    rw [Representation.asModuleEquiv_map_smul, Representation.asAlgebraHom_single_one,
      LinearEquiv.apply_symm_apply] at hv
    simpa using hv
  obtain ⟨N, hNs, w, hwN, hwne⟩ := key
  have := hNs
  refine ⟨Subrepresentation.ofSubmodule' N, subRep_isIrreducible ρ N, ?_⟩
  intro hcontra
  apply hwne
  have hwW : w ∈ (Subrepresentation.ofSubmodule' N).toSubmodule :=
    (Subrepresentation.mem_ofSubmodule'_iff).mpr hwN
  have key2 : (Subrepresentation.ofSubmodule' N).toRepresentation g₀ ⟨w, hwW⟩ = ⟨w, hwW⟩ := by
    rw [hcontra]; rfl
  have happ : ρ g₀ w = w := congrArg Subtype.val key2
  refine ρ.asModuleEquiv.injective ?_
  rw [Representation.asModuleEquiv_map_smul, Representation.asAlgebraHom_single_one]
  exact happ

/-- **BG Theorem 3.4, step 2-3 (group theory): a normal subgroup meeting the prime-order complement
trivially lies in the normal Hall kernel.**  `K ◁ G` is a Hall subgroup and `R` a complement of
prime order `p`, so `R` is a Sylow `p`-subgroup.  A normal `N ◁ G` with `N ⊓ R = ⊥` satisfies
`N ≤ K`:
* **`p ∤ |N|`** — otherwise Cauchy gives an order-`p` element `x ∈ N`, which lies in some Sylow
  `p`-subgroup `Q`; conjugating `Q` to `R` (Sylow conjugacy) carries `x` into `R`, and `N`'s
  normality keeps it in `N`, producing a nontrivial element of `N ⊓ R = ⊥`.
* then `|N.map (mk' K)|` divides both `|N|` (coprime to `p`) and `|G/K| = p`, hence is `1`, so
  `N ≤ ker (mk' K) = K`.

In the proof of Theorem 3.4 this is applied with `N = C_G(M)` (the kernel on the chosen irreducible
`M`), giving `N ≤ K` for the `G/N`-quotient step. -/
private lemma normal_le_of_complement_prime_of_inf_eq_bot
    {G : Type*} [Group G] [Finite G] {K N R : Subgroup G} [K.Normal] [N.Normal]
    (hcompl : Subgroup.IsComplement' K R) (hp : (Nat.card ↥R).Prime)
    (hcop : Nat.Coprime (Nat.card ↥K) (Nat.card ↥R)) (hNR : N ⊓ R = ⊥) :
    N ≤ K := by
  have : Fact (Nat.card ↥R).Prime := ⟨hp⟩
  have hpK : ¬ (Nat.card ↥R) ∣ Nat.card ↥K := (hp.coprime_iff_not_dvd).mp hcop.symm
  have hcard_mul : Nat.card ↥K * Nat.card ↥R = Nat.card G := hcompl.card_mul_card
  -- `|G/K| = |R|`
  have hquot : Nat.card (G ⧸ K) = Nat.card ↥R := by
    have h1 : Nat.card G = Nat.card (G ⧸ K) * Nat.card ↥K :=
      Subgroup.card_eq_card_quotient_mul_card_subgroup K
    have h2 : Nat.card (G ⧸ K) * Nat.card ↥K = Nat.card ↥R * Nat.card ↥K := by
      rw [← h1, ← hcard_mul, mul_comm]
    exact Nat.eq_of_mul_eq_mul_right Nat.card_pos h2
  -- `R` is a Sylow `p`-subgroup: its multiplicity is `1`
  have hfact : (Nat.card G).factorization (Nat.card ↥R) = 1 := by
    rw [← hcard_mul, Nat.factorization_mul Nat.card_pos.ne' Nat.card_pos.ne',
      Finsupp.coe_add, Pi.add_apply, Nat.factorization_eq_zero_of_not_dvd hpK,
      hp.factorization_self, zero_add]
  let Rsyl : Sylow (Nat.card ↥R) G := Sylow.ofCard R (by rw [hfact, pow_one])
  -- **Step 1**: `p ∤ |N|`
  have hpN : ¬ (Nat.card ↥R) ∣ Nat.card ↥N := by
    intro hdvd
    obtain ⟨x, hx⟩ := exists_prime_orderOf_dvd_card' (G := ↥N) (Nat.card ↥R) hdvd
    have hxG : orderOf ((x : G)) = Nat.card ↥R := by
      rw [← hx]; exact orderOf_injective N.subtype N.subtype_injective x
    have hPgroup : IsPGroup (Nat.card ↥R) (Subgroup.zpowers ((x : G))) :=
      IsPGroup.of_card (((Nat.card_zpowers _).trans hxG).trans (pow_one _).symm)
    obtain ⟨Q, hQ⟩ := hPgroup.exists_le_sylow
    obtain ⟨g, hg⟩ := MulAction.exists_smul_eq G Q Rsyl
    have hxQ : (x : G) ∈ (Q : Subgroup G) := hQ (Subgroup.mem_zpowers _)
    have hcompute : (MulAut.conj g)⁻¹ • (g * (x : G) * g⁻¹) = (x : G) := by
      rw [← map_inv]; change (MulAut.conj g⁻¹) (g * (x : G) * g⁻¹) = (x : G)
      rw [MulAut.conj_apply]; group
    have hconjR : g * (x : G) * g⁻¹ ∈ R := by
      have hR : (Rsyl : Subgroup G) = R := Sylow.coe_ofCard _ _
      rw [← hR, ← hg, Sylow.coe_subgroup_smul, Subgroup.mem_pointwise_smul_iff_inv_smul_mem,
        hcompute]
      exact hxQ
    have hconjN : g * (x : G) * g⁻¹ ∈ N := ‹N.Normal›.conj_mem (x : G) x.2 g
    have hmem : g * (x : G) * g⁻¹ ∈ N ⊓ R := ⟨hconjN, hconjR⟩
    rw [hNR, Subgroup.mem_bot] at hmem
    have hx1 : (x : G) = 1 := by
      have hc : (MulAut.conj g) (x : G) = 1 := by rw [MulAut.conj_apply]; exact hmem
      exact (MulEquiv.map_eq_one_iff _).mp hc
    rw [hx1, orderOf_one] at hxG
    exact hp.one_lt.ne hxG
  -- **Step 2**: `N ≤ K`
  have hdvd1 : Nat.card (N.map (QuotientGroup.mk' K)) ∣ Nat.card ↥N := Subgroup.card_map_dvd _ _
  have hdvd2 : Nat.card (N.map (QuotientGroup.mk' K)) ∣ Nat.card ↥R := by
    rw [← hquot]; exact Subgroup.card_subgroup_dvd_card _
  have hcop2 : Nat.Coprime (Nat.card ↥N) (Nat.card ↥R) := ((hp.coprime_iff_not_dvd).mpr hpN).symm
  have hone : Nat.card (N.map (QuotientGroup.mk' K)) = 1 :=
    Nat.eq_one_of_dvd_coprimes hcop2 hdvd1 hdvd2
  have hbot : N.map (QuotientGroup.mk' K) = ⊥ := Subgroup.card_eq_one.mp hone
  rw [Subgroup.map_eq_bot_iff, QuotientGroup.ker_mk'] at hbot
  exact hbot

/-- In a finite subgroup `R` of **prime** order, every non-identity element generates `R`
(`⟨r⟩ = R`).  Used in steps 2-3 and 6 of Theorem 3.4 to upgrade "fixed by `r ≠ 1`" to "fixed by all
of `R`" (the prime order forces `R` to be cyclic, generated by any non-identity element). -/
theorem zpowers_eq_of_prime_card {G : Type*} [Group G] [Finite G] {R : Subgroup G}
    (hp : (Nat.card ↥R).Prime) {r : G} (hr : r ∈ R) (hr1 : r ≠ 1) :
    Subgroup.zpowers r = R := by
  have hle : Subgroup.zpowers r ≤ R := (Subgroup.zpowers_le).mpr hr
  have hord : orderOf r = Nat.card ↥R := by
    rcases (Nat.dvd_prime hp).mp (R.orderOf_dvd_natCard hr) with h1 | h
    · exact absurd (orderOf_eq_one_iff.mp h1) hr1
    · exact h
  exact Subgroup.eq_of_le_of_card_ge hle (le_of_eq (by rw [Nat.card_zpowers, hord]))

/-- **BG Theorem 3.4, step 2-3 (B1): the centraliser of the chosen irreducible meets the prime-order
complement trivially.**  With `C_V(R) = 0` (the `S03b` idiom `∀ v, (∀ r, ρ r v = v) → v = 0`) and
`W ≠ ⊥` a subrepresentation, the kernel `N = C_G(W) = ker (W.toRepresentation.asGroupHom)` satisfies
`N ⊓ R = ⊥`: a non-identity `r ∈ N ⊓ R` generates `R` (prime order, `zpowers_eq_of_prime_card`), so
`R ≤ N` and all of `R` fixes `W` pointwise; a nonzero `w ∈ W` is then fixed by all of `R`,
contradicting `C_V(R) = 0`.  Supplies the `hNR` hypothesis of
`normal_le_of_complement_prime_of_inf_eq_bot` in the proof of Theorem 3.4. -/
private lemma ker_subrep_inf_complement_prime_eq_bot
    {F : Type*} [Field F] {G : Type*} [Group G] [Finite G]
    {V : Type*} [AddCommGroup V] [Module F V]
    (ρ : Representation F G V) (W : Subrepresentation ρ) (hWne : W ≠ ⊥)
    {R : Subgroup G} (hp : (Nat.card ↥R).Prime)
    (hCV : ∀ v : V, (∀ r : ↥R, ρ (r : G) v = v) → v = 0) :
    MonoidHom.ker (W.toRepresentation.asGroupHom) ⊓ R = ⊥ := by
  rw [eq_bot_iff]
  intro r hr
  rw [Subgroup.mem_inf] at hr
  obtain ⟨hrN, hrR⟩ := hr
  rw [Subgroup.mem_bot]
  by_contra hr1
  -- `r ≠ 1` generates `R`, so `R ≤ N = ker (asGroupHom)`
  have hgen : Subgroup.zpowers r = R := zpowers_eq_of_prime_card hp hrR hr1
  have hRker : R ≤ MonoidHom.ker (W.toRepresentation.asGroupHom) := by
    rw [← hgen]; exact (Subgroup.zpowers_le).mpr hrN
  -- pick a nonzero `w ∈ W`
  have hWsub : W.toSubmodule ≠ ⊥ := by
    intro h; exact hWne (Subrepresentation.toSubmodule_injective (by rw [h]; rfl))
  obtain ⟨w, hwW, hw0⟩ := (Submodule.ne_bot_iff _).mp hWsub
  -- all of `R` fixes `w`
  have hfix : ∀ r' : ↥R, ρ ((r' : G)) w = w := by
    intro r'
    have hWr' : W.toRepresentation (r' : G) = 1 := by
      rw [← Representation.asGroupHom_apply, MonoidHom.mem_ker.mp (hRker r'.2), Units.val_one]
    have hval : W.toRepresentation (r' : G) ⟨w, hwW⟩ = ⟨w, hwW⟩ := by rw [hWr']; rfl
    exact congrArg Subtype.val hval
  exact hw0 (hCV w hfix)

/-- **BG Theorem 3.4, step 3 (C): the complement structure descends to `G/N`.**  If `K ◁ G` has
complement `R` and `N ◁ G` with `N ≤ K`, then the images `K.map (mk' N)` and `R.map (mk' N)` are
complementary in `G/N`.  (`K̄ ⊔ R̄ = ⊤` since `mk' N` is surjective and `K ⊔ R = ⊤`; `K̄ ⊓ R̄ = ⊥`
because `mk' k = mk' r` forces `k⁻¹r ∈ N ≤ K`, hence `r ∈ K ⊓ R = ⊥`.)  Used to feed the `G/N`
induction hypothesis in the quotient step. -/
private lemma isComplement'_map_mk' {G : Type*} [Group G] [Finite G] {K N R : Subgroup G}
    [K.Normal] [N.Normal] (hcompl : Subgroup.IsComplement' K R) (hNK : N ≤ K) :
    Subgroup.IsComplement' (K.map (QuotientGroup.mk' N)) (R.map (QuotientGroup.mk' N)) := by
  have : (K.map (QuotientGroup.mk' N)).Normal :=
    (‹K.Normal›).map (QuotientGroup.mk' N) (QuotientGroup.mk'_surjective N)
  refine Subgroup.isComplement'_of_disjoint_and_mul_eq_univ ?_ ?_
  · rw [disjoint_iff, eq_bot_iff]
    rintro y hy
    rw [Subgroup.mem_inf] at hy
    obtain ⟨⟨k, hkK, hk⟩, ⟨r, hrR, hr⟩⟩ := hy
    rw [Subgroup.mem_bot]
    have heq : (QuotientGroup.mk' N) k = (QuotientGroup.mk' N) r := hk.trans hr.symm
    rw [QuotientGroup.mk'_apply, QuotientGroup.mk'_apply, QuotientGroup.eq] at heq
    have hrK : r ∈ K := by
      have hmem : k * (k⁻¹ * r) ∈ K := mul_mem hkK (hNK heq)
      simpa using hmem
    have hrKR : r ∈ K ⊓ R := ⟨hrK, hrR⟩
    rw [disjoint_iff.mp hcompl.disjoint, Subgroup.mem_bot] at hrKR
    rw [← hr, hrKR, map_one]
  · have hsup : K.map (QuotientGroup.mk' N) ⊔ R.map (QuotientGroup.mk' N) = ⊤ := by
      rw [← Subgroup.map_sup, hcompl.sup_eq_top,
        Subgroup.map_top_of_surjective _ (QuotientGroup.mk'_surjective N)]
    have hmul := Subgroup.normal_mul (K.map (QuotientGroup.mk' N)) (R.map (QuotientGroup.mk' N))
    rw [hsup, Subgroup.coe_top] at hmul
    exact hmul.symm

/-- **BG Theorem 3.4, step 6 (Frobenius construction from a fixed-point-free prime complement).**
If `K ◁ G` has a prime-order complement `R` and *no* nontrivial element of `K` is centralised by all
of `R` (`hFix`, i.e. `C_K(R) = 1`), then `G = KR` is a Frobenius group.  The Frobenius condition
`a k a⁻¹ ≠ k` (for `a ∈ R^#`, `k ∈ K^#`) follows because `a` of prime order generates `R`
(`zpowers_eq_of_prime_card`), so if `a` centralised `k` then so would every power of
`a`, i.e. all of
`R`, forcing `k = 1` by `hFix`.  Used in the elementary-abelian branch of Theorem 3.4 and at
Theorem 3.6 (3.34) (`S03f_Thm36`, building the Frobenius group `⁅K,R₀⁆·R₀`). -/
lemma isFrobeniusGroup_of_prime_complement_fixedFree
    {G : Type*} [Group G] [Finite G] {K R : Subgroup G} [K.Normal]
    (hcompl : Subgroup.IsComplement' K R) (hp : (Nat.card ↥R).Prime) (hKne : K ≠ ⊥)
    (hFix : ∀ k ∈ K, (∀ r ∈ R, r * k * r⁻¹ = k) → k = 1) :
    IsFrobeniusGroup G K R where
  isNormal := ‹K.Normal›
  isComplement := hcompl
  ne_bot_kernel := hKne
  ne_bot_complement :=
    (Subgroup.nontrivial_iff_ne_bot R).mp (Finite.one_lt_card_iff_nontrivial.mp hp.one_lt)
  conj_frobenius := by
    intro a haR ha n hnK hn hconj
    apply hn
    refine hFix n hnK (fun r hrR => ?_)
    have hcomm : Commute a n := by
      have h := congrArg (· * a) hconj
      simpa [commute_iff_eq, mul_assoc] using h
    have hgen : Subgroup.zpowers a = R := zpowers_eq_of_prime_card hp haR ha
    rw [← hgen, Subgroup.mem_zpowers_iff] at hrR
    obtain ⟨j, rfl⟩ := hrR
    rw [(hcomm.zpow_left j).eq, mul_inv_cancel_right]

/-- The image under `K.subtype` of a *proper* subgroup of `↥K` is a proper subgroup of `K`. -/
private lemma map_subtype_lt_of_ne_top {G : Type*} [Group G] {K : Subgroup G}
    {N : Subgroup ↥K} (hN : N ≠ ⊤) : N.map K.subtype < K := by
  refine lt_of_le_of_ne (Subgroup.map_subtype_le N) (fun heq => hN ?_)
  have hKeq : K = (⊤ : Subgroup ↥K).map K.subtype := by
    rw [← MonoidHom.range_eq_map, K.range_subtype]
  exact Subgroup.map_injective K.subtype_injective (heq.trans hKeq)

/-- A subgroup `N ≤ K` that is invariant under the conjugation action `φ = conjNormal ∘ R.subtype`
of `R` is normalised by `R` once pushed forward into `G` (`R ≤ N_G(N.map K.subtype)`).  This is the
bridge from the `IsAInvariant` formulation used by Gorenstein 5.3.7 to the `R ≤ normalizer _`
formulation of `wiring_check`.  (Same computation as in
`exists_proper_aInvariant_iSup_eq_of_not_isPrimePow`.) -/
private lemma le_normalizer_map_subtype_of_isAInvariant {G : Type*} [Group G] {K R : Subgroup G}
    [K.Normal] {N : Subgroup ↥K}
    (hN : OddOrder.Isaacs.Ch03.IsAInvariant
        ((MulAut.conjNormal (G := G) (H := K)).comp R.subtype) N) :
    R ≤ Subgroup.normalizer (N.map K.subtype) := by
  set φ : ↥R →* MulAut ↥K := (MulAut.conjNormal (G := G) (H := K)).comp R.subtype with hφ
  have hval : ∀ (r : ↥R) (k : ↥K), (((φ r) k : ↥K) : G) = (r : G) * (k : G) * (r : G)⁻¹ := by
    intro r k
    simp only [hφ, MonoidHom.comp_apply, Subgroup.coe_subtype, MulAut.conjNormal_apply]
  have hvalinv : ∀ (r : ↥R) (k : ↥K), (((φ r)⁻¹ k : ↥K) : G) = (r : G)⁻¹ * (k : G) * (r : G) := by
    intro r k
    simp only [hφ, MonoidHom.comp_apply, Subgroup.coe_subtype]
    exact MulAut.conjNormal_inv_apply (r : G) k
  intro r hr
  rw [Subgroup.mem_normalizer_iff]
  intro y
  constructor
  · rintro ⟨k, hk, rfl⟩
    refine ⟨(φ ⟨r, hr⟩) k, hN.smul_mem ⟨r, hr⟩ hk, ?_⟩
    simp only [Subgroup.coe_subtype]
    rw [hval ⟨r, hr⟩ k]
  · rintro ⟨k, hk, hkn⟩
    refine ⟨(φ ⟨r, hr⟩)⁻¹ k, hN.inv_smul_mem ⟨r, hr⟩ hk, ?_⟩
    simp only [Subgroup.coe_subtype] at hkn ⊢
    rw [hvalinv ⟨r, hr⟩ k, hkn]
    group

open OddOrder.RepresentationTheory OddOrder.RepresentationTheory.EigenspaceUnderCyclicAction
  OddOrder.BG.Ch1.S04 OddOrder.GroupTheory in
/-- **BG Theorem 3.4, group-order strong-induction core** (algebraically closed `F`).

`Nat.card G = n` での強帰納法. 結論は `∀ g ∈ ⁅R, K⁆, ρ g = 1` (= `[R,K] ⊆ C_K(V)`,
`[R,K] ⊆ K` は `K` 正規より自動). `C_V(R) = 0` は `∀ v, (∀ r:R, ρ r v = v) → v = 0` (S03b idiom).

Hall 条件は `Coprime |K| |R|` で表現 (`R` 素数位数 ⟹ `|R| ∤ |K|`). -/
private theorem thm34_aux : ∀ (n : ℕ)
    {F : Type*} [Field F] [IsAlgClosed F]
    {G : Type*} [Group G] [Finite G] [Group.IsSolvable G]
    {V : Type*} [AddCommGroup V] [Module F V] [FiniteDimensional F V]
    (ρ : Representation F G V) (K R : Subgroup G) [K.Normal],
    Subgroup.IsComplement' K R →
    Nat.Coprime (Nat.card ↥K) (Nat.card ↥R) →
    (∃ p : ℕ, p.Prime ∧ Nat.card ↥R = p) →
    Odd (Nat.card G) →
    (Nat.card G : F) ≠ 0 →
    (∀ v : V, (∀ r : ↥R, ρ (r : G) v = v) → v = 0) →
    Nat.card G = n →
    ∀ g ∈ ⁅R, K⁆, ρ g = 1 := by
  intro n
  induction n using Nat.strong_induction_on with
  | _ n IH =>
    intro F _ _ G _ _ _ V _ _ _ ρ K R _ hcompl hHall hRp hodd hchar hCV hn
    -- IH-WIRING CHECK (subgroup branch, BG step 1): for a proper `R`-invariant `H < K`, the group
    -- `HR = H ⊔ R` satisfies the hypotheses with `|HR| < |G|`, so IH gives `[H,R] ⊆ C`.
    have wiring_check : ∀ H : Subgroup G, H < K → R ≤ Subgroup.normalizer H →
        ∀ g ∈ ⁅R, H⁆, ρ g = 1 := by
      intro H hHltK hHRnorm
      have hHK : H ≤ K := hHltK.le
      have : Finite ↥(H ⊔ R) := inferInstance
      have : Group.IsSolvable ↥(H ⊔ R) := inferInstance
      have hHRle : (H ⊔ R) ≤ Subgroup.normalizer H := sup_le Subgroup.le_normalizer hHRnorm
      have hHnormHR : (H.subgroupOf (H ⊔ R)).Normal :=
        Subgroup.normal_subgroupOf_of_le_normalizer hHRle
      have hRcard : Nat.card ↥(R.subgroupOf (H ⊔ R)) = Nat.card ↥R :=
        Nat.card_congr (Subgroup.subgroupOfEquivOfLe (le_sup_right)).toEquiv
      have hHcard : Nat.card ↥(H.subgroupOf (H ⊔ R)) = Nat.card ↥H :=
        Nat.card_congr (Subgroup.subgroupOfEquivOfLe (le_sup_left)).toEquiv
      have hHRdvd : Nat.card ↥(H ⊔ R) ∣ Nat.card G := Subgroup.card_subgroup_dvd_card _
      have hchar' : (Nat.card ↥(H ⊔ R) : F) ≠ 0 := by
        obtain ⟨m, hm⟩ := hHRdvd
        intro h0; apply hchar; rw [hm, Nat.cast_mul, h0, zero_mul]
      have hodd' : Odd (Nat.card ↥(H ⊔ R)) := by
        obtain ⟨m, hm⟩ := hHRdvd; rw [hm, Nat.odd_mul] at hodd; exact hodd.1
      have hRp' : ∃ p : ℕ, p.Prime ∧ Nat.card ↥(R.subgroupOf (H ⊔ R)) = p := by
        obtain ⟨p, hp, hpc⟩ := hRp; exact ⟨p, hp, hRcard.trans hpc⟩
      have hHall' : Nat.Coprime (Nat.card ↥(H.subgroupOf (H ⊔ R)))
          (Nat.card ↥(R.subgroupOf (H ⊔ R))) := by
        rw [hHcard, hRcard]; exact hHall.coprime_dvd_left (Subgroup.card_dvd_of_le hHK)
      have hCV' : ∀ v : V, (∀ r : ↥(R.subgroupOf (H ⊔ R)),
          (ρ.comp (H ⊔ R).subtype) (r : ↥(H ⊔ R)) v = v) → v = 0 := by
        intro v hv
        refine hCV v fun r => ?_
        have hrHR : (r : G) ∈ (H ⊔ R) := (le_sup_right : R ≤ H ⊔ R) r.2
        have hmem : (⟨(r : G), hrHR⟩ : ↥(H ⊔ R)) ∈ R.subgroupOf (H ⊔ R) := by
          rw [Subgroup.mem_subgroupOf]; exact r.2
        simpa using hv ⟨⟨(r : G), hrHR⟩, hmem⟩
      have hcompl' : Subgroup.IsComplement' (H.subgroupOf (H ⊔ R)) (R.subgroupOf (H ⊔ R)) := by
        refine Subgroup.isComplement'_of_disjoint_and_mul_eq_univ ?_ ?_
        · refine disjoint_iff.mpr (eq_bot_iff.mpr fun x hx => ?_)
          rw [Subgroup.mem_inf] at hx
          simp only [Subgroup.mem_subgroupOf] at hx
          have hmem : (x : G) ∈ H ⊓ R := ⟨hx.1, hx.2⟩
          have hdisjHR : Disjoint H R := hcompl.disjoint.mono_left hHK
          rw [hdisjHR.eq_bot, Subgroup.mem_bot] at hmem
          rw [Subgroup.mem_bot]; exact Subtype.ext (by simpa using hmem)
        · have hsup : (H.subgroupOf (H ⊔ R)) ⊔ (R.subgroupOf (H ⊔ R)) = ⊤ := by
            rw [← Subgroup.subgroupOf_sup le_sup_left le_sup_right, Subgroup.subgroupOf_self]
          have hmul := Subgroup.normal_mul (H.subgroupOf (H ⊔ R)) (R.subgroupOf (H ⊔ R))
          rw [hsup, Subgroup.coe_top] at hmul
          exact hmul.symm
      have hcardHR : Nat.card ↥(H ⊔ R) < n := by
        have e1 : Nat.card ↥(H.subgroupOf (H ⊔ R)) * Nat.card ↥(R.subgroupOf (H ⊔ R))
            = Nat.card ↥(H ⊔ R) := hcompl'.card_mul_card
        have e2 : Nat.card ↥K * Nat.card ↥R = Nat.card G := hcompl.card_mul_card
        rw [hHcard, hRcard] at e1
        have hHlt : Nat.card ↥H < Nat.card ↥K := by
          have hdvd := Subgroup.card_dvd_of_le hHK
          refine lt_of_le_of_ne (Nat.le_of_dvd Nat.card_pos hdvd) (fun heq => ?_)
          exact (ne_of_lt hHltK) (Subgroup.eq_of_le_of_card_ge hHK heq.ge)
        rw [← hn, ← e2, ← e1]
        exact mul_lt_mul_of_pos_right hHlt Nat.card_pos
      have hIH := IH (Nat.card ↥(H ⊔ R)) hcardHR (ρ.comp (H ⊔ R).subtype)
        (H.subgroupOf (H ⊔ R)) (R.subgroupOf (H ⊔ R)) hcompl' hHall' hRp' hodd' hchar' hCV' rfl
      -- `hIH : ∀ g' ∈ ⁅R.subgroupOf (H⊔R), H.subgroupOf (H⊔R)⁆, (ρ.comp (H⊔R).subtype) g' = 1`.
      -- Pull back along `(H⊔R).subtype`: `⁅R,H⁆ = ⁅R',H'⁆.map subtype`, so every `g ∈ ⁅R,H⁆`
      -- lifts to a `g' ∈ ⁅R',H'⁆` with `ρ g = (ρ.comp subtype) g' = 1`.
      intro g hg
      have hmap : (⁅R, H⁆ : Subgroup G)
          = (⁅R.subgroupOf (H ⊔ R), H.subgroupOf (H ⊔ R)⁆).map (H ⊔ R).subtype := by
        rw [Subgroup.map_commutator, Subgroup.subgroupOf_map_subtype,
          Subgroup.subgroupOf_map_subtype, inf_eq_left.mpr le_sup_right,
          inf_eq_left.mpr le_sup_left]
      rw [hmap, Subgroup.mem_map] at hg
      obtain ⟨g', hg'mem, hg'eq⟩ := hg
      rw [← hg'eq]
      exact hIH g' hg'mem
    -- `|R|` is prime; `char F ∤ |G|` gives the Maschke hypothesis `NeZero (|G| : F)`.
    obtain ⟨p, hp, hpcard⟩ := hRp
    have hRp' : (Nat.card ↥R).Prime := hpcard ▸ hp
    have : NeZero (Nat.card G : F) := ⟨hchar⟩
    -- **Minimal counterexample**: suppose `[R, K] ⊄ C_K(V)`.
    by_contra hRK
    -- **step 4**: then `|K|` is a prime power (else `K` is generated by proper
    -- `R`-invariant Sylows).
    have hKpp : IsPrimePow (Nat.card ↥K) :=
      thm34_isPrimePow_of_minimal ρ hHall.symm wiring_check hRK
    -- **step 2**: pick `g₀ ∈ ⁅R, K⁆` acting nontrivially, and an irreducible `W`
    -- (Maschke selection).
    push Not at hRK
    obtain ⟨g₀, hg₀mem, hg₀ne⟩ := hRK
    obtain ⟨W, hWirr, hWg₀⟩ := exists_irreducible_subrep_apply_ne ρ hg₀ne
    have hWnt : Nontrivial ↥W.toSubmodule := by
      by_contra hcon
      rw [not_nontrivial_iff_subsingleton] at hcon
      have := hcon
      exact hWg₀ (Subsingleton.elim _ _)
    have hWsub : W.toSubmodule ≠ ⊥ := Submodule.nontrivial_iff_ne_bot.mp hWnt
    have hWne : W ≠ ⊥ := fun h => hWsub (by rw [h]; rfl)
    have hWirr' : W.toRepresentation.IsIrreducible := hWirr
    -- **step 3**: `N = C_G(W) = ker (W.toRepresentation.asGroupHom)` is a normal subgroup with
    -- `N ⊓ R = ⊥` (B1) and `N ≤ K` (B2).
    have hNnorm : (MonoidHom.ker W.toRepresentation.asGroupHom).Normal := MonoidHom.normal_ker _
    have hNR : MonoidHom.ker W.toRepresentation.asGroupHom ⊓ R = ⊥ :=
      ker_subrep_inf_complement_prime_eq_bot ρ W hWne hRp' hCV
    have hNK : MonoidHom.ker W.toRepresentation.asGroupHom ≤ K :=
      normal_le_of_complement_prime_of_inf_eq_bot hcompl hRp' hHall hNR
    -- **piece D**: the `G/N` induction hypothesis forces `N = ⊥` (else `[R,K]` would
    -- be trivial on `W`).
    have hNbot : MonoidHom.ker W.toRepresentation.asGroupHom = ⊥ := by
      set N := MonoidHom.ker W.toRepresentation.asGroupHom with hNdef
      by_contra hNne
      -- `N` acts trivially on `W`, so `ρ` factors through `G/N` as `ρ̄ = ofQuotient`.
      have hIsTriv : Representation.IsTrivial (W.toRepresentation.comp N.subtype) := by
        constructor
        intro n
        change W.toRepresentation (n : G) = LinearMap.id
        have hnk : W.toRepresentation.asGroupHom (n : G) = 1 := MonoidHom.mem_ker.mp n.2
        rw [← Representation.asGroupHom_apply, hnk, Units.val_one]; rfl
      have : (K.map (QuotientGroup.mk' N)).Normal :=
        (‹K.Normal›).map (QuotientGroup.mk' N) (QuotientGroup.mk'_surjective N)
      -- `|G| = |G/N| · |N|`, so `|G/N| ∣ |G|` and (since `|N| > 1`) `|G/N| < |G|`.
      have hGcard : Nat.card G = Nat.card (G ⧸ N) * Nat.card ↥N :=
        Subgroup.card_eq_card_quotient_mul_card_subgroup N
      have hGNdvd : Nat.card (G ⧸ N) ∣ Nat.card G := ⟨_, hGcard⟩
      have hNgt : 1 < Nat.card ↥N := by
        have : Nontrivial ↥N := (Subgroup.nontrivial_iff_ne_bot N).mpr hNne
        exact Finite.one_lt_card_iff_nontrivial.mpr this
      have hlt : Nat.card (G ⧸ N) < n := by
        rw [← hn, hGcard]
        exact (Nat.lt_mul_iff_one_lt_right Nat.card_pos).mpr hNgt
      have hoddQ : Odd (Nat.card (G ⧸ N)) := (Nat.odd_mul.mp (hGcard ▸ hodd)).1
      have hcharQ : (Nat.card (G ⧸ N) : F) ≠ 0 := by
        obtain ⟨m, hm⟩ := hGNdvd
        intro h0; apply hchar; rw [hm, Nat.cast_mul, h0, zero_mul]
      -- `R̄ = R.map mk'` has the same (prime) order as `R`; `K̄` and `R̄` stay
      -- complementary/coprime.
      have hRQcard : Nat.card ↥(R.map (QuotientGroup.mk' N)) = Nat.card ↥R := by
        rcases (Nat.dvd_prime hRp').mp (Subgroup.card_map_dvd R (QuotientGroup.mk' N)) with h1 | h
        · exfalso
          have hbot : R.map (QuotientGroup.mk' N) = ⊥ := Subgroup.card_eq_one.mp h1
          rw [Subgroup.map_eq_bot_iff, QuotientGroup.ker_mk'] at hbot
          have hRbot : R = ⊥ := by
            rw [eq_bot_iff]; intro x hx
            have hxNR : x ∈ N ⊓ R := ⟨hbot hx, hx⟩
            rwa [hNR, Subgroup.mem_bot] at hxNR
          have hRcard1 : Nat.card ↥R = 1 := Subgroup.card_eq_one.mpr hRbot
          exact hp.ne_one (hpcard ▸ hRcard1)
        · exact h
      have hcomplQ : Subgroup.IsComplement' (K.map (QuotientGroup.mk' N))
          (R.map (QuotientGroup.mk' N)) := isComplement'_map_mk' hcompl hNK
      have hHallQ : Nat.Coprime (Nat.card ↥(K.map (QuotientGroup.mk' N)))
          (Nat.card ↥(R.map (QuotientGroup.mk' N))) := by
        rw [hRQcard]
        exact Nat.Coprime.coprime_dvd_left (Subgroup.card_map_dvd K (QuotientGroup.mk' N)) hHall
      have hRpQ : ∃ q : ℕ, q.Prime ∧ Nat.card ↥(R.map (QuotientGroup.mk' N)) = q :=
        ⟨p, hp, hRQcard.trans hpcard⟩
      -- `C_W̄(R̄) = 0`: a fixed `v` is `R`-fixed in `V`, hence `0` by `C_V(R) = 0`.
      have hCVQ : ∀ v : ↥W.toSubmodule, (∀ rQ : ↥(R.map (QuotientGroup.mk' N)),
          (Representation.ofQuotient W.toRepresentation N) (rQ : G ⧸ N) v = v) → v = 0 := by
        intro v hv
        have hv2 : ∀ r : ↥R, ρ ((r : G)) (v : V) = (v : V) := by
          intro r
          have hrQmem : (QuotientGroup.mk' N) (r : G) ∈ R.map (QuotientGroup.mk' N) :=
            Subgroup.mem_map_of_mem _ r.2
          have hfix := hv ⟨(QuotientGroup.mk' N) (r : G), hrQmem⟩
          have hkey : (Representation.ofQuotient W.toRepresentation N) ((r : G) : G ⧸ N) v = v :=
            hfix
          rw [Representation.ofQuotient_coe_apply] at hkey
          exact congrArg Subtype.val hkey
        exact Submodule.coe_eq_zero.mp (hCV (v : V) hv2)
      -- apply the induction hypothesis to `G/N` acting on `W`
      have hIHconcl := IH (Nat.card (G ⧸ N)) hlt (Representation.ofQuotient W.toRepresentation N)
        (K.map (QuotientGroup.mk' N)) (R.map (QuotientGroup.mk' N)) hcomplQ hHallQ hRpQ hoddQ hcharQ
        hCVQ rfl
      -- pull `g₀ ∈ ⁅R, K⁆` to `G/N`: `ρ̄ (mk' g₀) = 1`, i.e. `W.toRep g₀ = 1`, contradiction.
      have hg₀bar : (QuotientGroup.mk' N) g₀ ∈
          ⁅R.map (QuotientGroup.mk' N), K.map (QuotientGroup.mk' N)⁆ := by
        rw [← Subgroup.map_commutator]; exact Subgroup.mem_map_of_mem _ hg₀mem
      apply hWg₀
      ext x
      have h1 := hIHconcl _ hg₀bar
      have h2 : (Representation.ofQuotient W.toRepresentation N) ((g₀ : G) : G ⧸ N) x
          = (1 : Module.End F ↥W.toSubmodule) x := congrFun (congrArg DFunLike.coe h1) x
      rw [Representation.ofQuotient_coe_apply] at h2
      exact congrArg Subtype.val h2
    -- **piece E**: `N = ⊥` ⟹ `W` is faithful and irreducible ⟹ Gorenstein 3.2.2 gives
    -- `Z(G)` cyclic.
    have hWf : Function.Injective W.toRepresentation := by
      have hinj : Function.Injective W.toRepresentation.asGroupHom :=
        (MonoidHom.ker_eq_bot_iff _).mp hNbot
      intro a b hab
      apply hinj
      rw [Units.ext_iff, W.toRepresentation.asGroupHom_apply, W.toRepresentation.asGroupHom_apply]
      exact hab
    have : FiniteDimensional F ↥W.toSubmodule := inferInstance
    have hZcyc : IsCyclic (Subgroup.center G) :=
      OddOrder.RepresentationTheory.isCyclic_center_of_faithful_irreducible W.toRepresentation hWf
    -- **steps 5-8.**  `ρ` is faithful (`ker ρ ≤ ker (W.toRep.asGroupHom) = ⊥`).
    have hρf : ∀ g : G, ρ g = 1 → g = 1 := by
      intro g hg
      apply hWf
      apply LinearMap.ext
      intro x
      apply Subtype.ext
      change ρ g (x : V) = (W.toRepresentation (1 : G) x : V)
      rw [hg, map_one]; rfl
    -- `g₀ ∈ ⁅R, K⁆ ⊆ K`; `K` acts nontrivially (`ρ g₀ ≠ 1`).
    have hg₀K : g₀ ∈ K := (Subgroup.commutator_le_right R K) hg₀mem
    have hKne : K ≠ ⊥ := by
      intro hKbot; apply hg₀ne
      rw [show g₀ = 1 by rw [hKbot, Subgroup.mem_bot] at hg₀K; exact hg₀K, map_one]
    -- `q` : the prime with `|K| = q^kk` (`kk ≥ 1`); `K` is a nontrivial nilpotent `q`-group.
    obtain ⟨q, kk, hq, hkk_pos, hqk⟩ := hKpp
    have hqFact : Fact q.Prime := ⟨Nat.prime_iff.mpr hq⟩
    have hKpgroup : IsPGroup q ↥K := IsPGroup.of_card hqk.symm
    have hKnilp : Group.IsNilpotent ↥K := hKpgroup.isNilpotent
    have hKnt : Nontrivial ↥K := by
      have h1 : 1 < Nat.card ↥K := by
        rw [← hqk]; exact Nat.one_lt_pow hkk_pos.ne' (Nat.prime_iff.mpr hq).one_lt
      exact Finite.one_lt_card_iff_nontrivial.mp h1
    -- conjugation action `φ : R →* MulAut K`.
    set φ : ↥R →* MulAut ↥K := (MulAut.conjNormal (G := G) (H := K)).comp R.subtype with hφ
    have hφval : ∀ (r : ↥R) (k : ↥K), ((φ r) k : G) = (r : G) * (k : G) * (r : G)⁻¹ := by
      intro r k
      simp only [hφ, MonoidHom.comp_apply, Subgroup.coe_subtype, MulAut.conjNormal_apply]
    -- a nontrivial `ψ ∈ R`; it generates `R` (prime order).
    have hRnt : Nontrivial ↥R := Finite.one_lt_card_iff_nontrivial.mp hRp'.one_lt
    obtain ⟨ψ, hψ1⟩ := exists_ne (1 : ↥R)
    have hψ1G : (ψ : G) ≠ 1 := fun h => hψ1 (Subtype.ext h)
    have hψgenR : Subgroup.zpowers (ψ : G) = R := zpowers_eq_of_prime_card hRp' ψ.2 hψ1G
    -- **R centralizes every proper R-invariant subgroup** (`wiring_check` + faithfulness).
    have hRcentProper : ∀ H : Subgroup G, H < K → R ≤ Subgroup.normalizer H →
        ∀ r ∈ R, ∀ h ∈ H, r * h * r⁻¹ = h := by
      intro H hHK hHnorm r hrR h hhH
      have hker := wiring_check H hHK hHnorm ⁅r, h⁆ (Subgroup.commutator_mem_commutator hrR hhH)
      have heq : r * h * r⁻¹ * h⁻¹ = 1 := by rw [← commutatorElement_def]; exact hρf _ hker
      exact mul_inv_eq_one.mp heq
    -- `ψ` acts nontrivially on `K` (else all of `R` centralizes `K`, so `⁅R,K⁆ = ⊥ ∌ g₀`).
    have hψntriv : ¬ ∀ k : ↥K, φ ψ k = k := by
      intro hψtriv
      apply hg₀ne
      have hRKbot : (⁅R, K⁆ : Subgroup G) = ⊥ := by
        rw [eq_bot_iff]
        refine (Subgroup.commutator_le (H₁ := R) (H₂ := K) (H₃ := ⊥)).mpr (fun r hrR k hkK => ?_)
        rw [Subgroup.mem_bot]
        have hψc : (ψ : G) * k * (ψ : G)⁻¹ = k := by
          have hk := congrArg Subtype.val (hψtriv ⟨k, hkK⟩)
          rwa [hφval ψ ⟨k, hkK⟩] at hk
        have hψcomm : Commute (ψ : G) k := mul_inv_eq_iff_eq_mul.mp hψc
        have hrz : (r : G) ∈ Subgroup.zpowers (ψ : G) := by rw [hψgenR]; exact hrR
        rw [Subgroup.mem_zpowers_iff] at hrz
        obtain ⟨j, hj⟩ := hrz
        rw [← hj]
        exact commutatorElement_eq_one_iff_commute.mpr (hψcomm.zpow_left j)
      rw [show g₀ = 1 by rw [hRKbot, Subgroup.mem_bot] at hg₀mem; exact hg₀mem, map_one]
    -- **Gorenstein 5.3.7** applied to `(φ, ψ)`.  Needs `ψ` trivial on proper normal
    -- `A`-inv subgroups.
    have hψ_proper : ∀ N : Subgroup ↥K, N.Normal → IsAInvariant φ N → N ≠ ⊤ →
        ∀ n ∈ N, φ ψ n = n := by
      intro N _ hNinv hNtop n hn
      have hcent := hRcentProper (N.map K.subtype) (map_subtype_lt_of_ne_top hNtop)
        (le_normalizer_map_subtype_of_isAInvariant hNinv) (ψ : G) ψ.2 (n : G)
        (Subgroup.mem_map_of_mem _ hn)
      exact Subtype.ext (by rw [hφval ψ n]; exact hcent)
    obtain ⟨hK'Z, -, hRirr, -, hKsp⟩ :=
      isSpecial_of_pprimeAction_trivialOnProper φ hKpgroup hHall.symm hψntriv hψ_proper
    -- **The fixed subgroup `Fix = C_K(R)`** and the key identity `Fix = K' = commutator K`.
    let Fix : Subgroup ↥K :=
      { carrier := {k | ∀ r : ↥R, φ r k = k}
        one_mem' := fun r => by rw [map_one]
        mul_mem' := fun {a b} ha hb r => by rw [map_mul, ha r, hb r]
        inv_mem' := fun {a} ha r => by rw [map_inv, ha r] }
    have hmemFix : ∀ k : ↥K, k ∈ Fix ↔ ∀ r : ↥R, φ r k = k := fun k => Iff.rfl
    have hFixAinv : IsAInvariant φ Fix := by
      rw [OddOrder.Isaacs.Ch03.isAInvariant_iff_smul_mem]
      intro s g hg r
      rw [(hmemFix _).mp hg s]; exact (hmemFix _).mp hg r
    have hK'ne : commutator ↥K ≠ ⊤ :=
      (commutator_lt_self_of_isNilpotent_ambient (E := (⊤ : Subgroup ↥K)) (F := ⊤)
        bot_lt_top.ne').ne
    have hK'inv : IsAInvariant φ (commutator ↥K) := IsAInvariant.commutator_self φ
    have hK'Fix : commutator ↥K ≤ Fix := by
      intro k hk r
      have hcent := hRcentProper _ (map_subtype_lt_of_ne_top hK'ne)
        (le_normalizer_map_subtype_of_isAInvariant hK'inv) (r : G) r.2 (k : G)
        (Subgroup.mem_map_of_mem _ hk)
      exact Subtype.ext (by rw [hφval r k]; exact hcent)
    have hFixne : Fix ≠ ⊤ := fun hFixtop =>
      hψntriv (fun k => (hmemFix k).mp (hFixtop ▸ Subgroup.mem_top k) ψ)
    have hFixeq : Fix = commutator ↥K := (hRirr Fix hFixAinv hK'Fix).resolve_right hFixne
    -- `p ∣ |G|`, `|K| ∣ |G|`, so `(p : F) ≠ 0` and `(|K| : F) ≠ 0`.
    have hpdvd : p ∣ Nat.card G :=
      ⟨Nat.card ↥K, by rw [← hcompl.card_mul_card, hpcard, mul_comm]⟩
    have hKdvd : Nat.card ↥K ∣ Nat.card G := ⟨Nat.card ↥R, hcompl.card_mul_card.symm⟩
    have hpF : (p : F) ≠ 0 := by
      obtain ⟨m, hm⟩ := hpdvd; intro h0; apply hchar; rw [hm, Nat.cast_mul, h0, zero_mul]
    have hKcardF : (Nat.card ↥K : F) ≠ 0 := by
      obtain ⟨m, hm⟩ := hKdvd; intro h0; apply hchar; rw [hm, Nat.cast_mul, h0, zero_mul]
    have hpodd : Odd p := Odd.of_dvd_nat hodd hpdvd
    by_cases hEA : IsElementaryAbelian q ↥K
    · -- ===== elementary-abelian case: Frobenius contradiction (steps 6) =====
      have hK'bot : commutator ↥K = ⊥ := by
        rw [eq_bot_iff]
        refine (Subgroup.commutator_le (H₁ := ⊤) (H₂ := ⊤) (H₃ := ⊥)).mpr (fun a _ b _ => ?_)
        rw [Subgroup.mem_bot, commutatorElement_eq_one_iff_commute]
        exact hEA.comm a b
      have hFixbot : Fix = ⊥ := hFixeq.trans hK'bot
      have hFrob : IsFrobeniusGroup G K R :=
        isFrobeniusGroup_of_prime_complement_fixedFree hcompl hRp' hKne (fun k hk hfix => by
          have hkFix : (⟨k, hk⟩ : ↥K) ∈ Fix := fun r =>
            Subtype.ext (by rw [hφval r ⟨k, hk⟩]; exact hfix (r : G) r.2)
          rw [hFixbot, Subgroup.mem_bot] at hkFix
          exact congrArg Subtype.val hkFix)
      exact thm34_frobenius_absurd ρ hFrob hKcardF ⟨⟨g₀, hg₀K⟩, hg₀ne⟩ hCV
    · -- ===== nonabelian special case: extraspecial + Theorem 2.5 contradiction (steps 7-8) =====
      -- `Z(K) = K' = Fix`; `R` centralizes `Z(K)`; `K` extraspecial.
      have hZK_eq : Subgroup.center ↥K = commutator ↥K := by
        rcases hKsp.2 with hea | ⟨hc, _, _⟩
        · exact absurd hea hEA
        · exact hc.symm
      have hRcentZ : ∀ r ∈ R, ∀ k : ↥K, k ∈ Subgroup.center ↥K → r * (k : G) = (k : G) * r := by
        intro r hrR k hkZ
        have hkFix : k ∈ Fix := by rw [hFixeq, ← hZK_eq]; exact hkZ
        have hc : (r : G) * (k : G) * (r : G)⁻¹ = (k : G) := by
          have h := congrArg Subtype.val ((hmemFix k).mp hkFix ⟨r, hrR⟩)
          rwa [hφval ⟨r, hrR⟩ k] at h
        exact mul_inv_eq_iff_eq_mul.mp hc
      have hKe : IsExtraspecial q ↥K :=
        thm34_isExtraspecial_of_special hcompl hZcyc hRcentZ hKsp hEA
      -- Theorem 2.5 setup: `x = ψ`, order `p`; primitive `p`-th root `ε`; generation; coprimality.
      have : NeZero p := ⟨hp.pos.ne'⟩
      have : NeZero (p : F) := ⟨hpF⟩
      let : Invertible (Nat.card ↥K : F) := invertibleOfNonzero hKcardF
      have hψp : ψ ^ p = 1 := by
        rw [← orderOf_dvd_iff_pow_eq_one, ← hpcard]; exact orderOf_dvd_natCard ψ
      have hxp : (ψ : G) ^ p = 1 := by rw [← Subgroup.coe_pow, hψp, Subgroup.coe_one]
      obtain ⟨ε, hε⟩ := HasEnoughRootsOfUnity.exists_primitiveRoot F p
      have hgen : Subgroup.closure ((K : Set G) ∪ {(ψ : G)}) = ⊤ := by
        rw [Subgroup.closure_union, Subgroup.closure_eq, ← Subgroup.zpowers_eq_closure, hψgenR]
        exact hcompl.sup_eq_top
      have hcop_pK : Nat.Coprime p (Nat.card ↥K) := by
        rw [Nat.coprime_comm, ← hpcard]; exact hHall
      have hord : orderOf (ψ : G) = p := by
        rcases (Nat.dvd_prime hp).mp (hpcard ▸ R.orderOf_dvd_natCard ψ.2) with h1 | h
        · exact absurd (orderOf_eq_one_iff.mp h1) hψ1G
        · exact h
      -- `x` centralizes `Z(K)` (via `conjAutOfNormal`).
      have hxZ : ∀ z : ↥K, z ∈ Subgroup.center ↥K → conjAutOfNormal K (ψ : G) z = z := by
        intro z hz
        have hzFix : z ∈ Fix := by rw [hFixeq, ← hZK_eq]; exact hz
        apply Subtype.ext
        rw [conjAutOfNormal_apply_coe]
        have h := congrArg Subtype.val ((hmemFix z).mp hzFix ψ)
        rwa [hφval ψ z] at h
      -- `C_K(xᵏ) ⊆ Z(K)` for `xᵏ ≠ 1` (`xᵏ` generates `R`, so a fixed point lies in `Fix = Z(K)`).
      have hCP : ∀ k : ZMod p, k ≠ 0 → ∀ qq : ↥K,
          (conjAutOfNormal K (ψ : G) ^ k.val) qq = qq → qq ∈ Subgroup.center ↥K := by
        intro k hk qq hfix
        rw [hZK_eq, ← hFixeq]
        intro r
        have hcoe : (ψ : G) ^ k.val * (qq : G) * ((ψ : G) ^ k.val)⁻¹ = (qq : G) := by
          have h := congrArg Subtype.val hfix
          rwa [conjAutOfNormal_pow_apply_coe] at h
        have hψk_ne : (ψ : G) ^ k.val ≠ 1 := by
          intro h
          have hpd : p ∣ k.val := by
            have hpd0 : orderOf (ψ : G) ∣ k.val := orderOf_dvd_of_pow_eq_one h
            rwa [hord] at hpd0
          have hk_pos : 0 < k.val :=
            Nat.pos_of_ne_zero fun h0 => hk (by rw [← ZMod.natCast_zmod_val k, h0, Nat.cast_zero])
          exact absurd (Nat.le_of_dvd hk_pos hpd) (not_le.mpr (ZMod.val_lt k))
        have hgenk : Subgroup.zpowers ((ψ : G) ^ k.val) = R :=
          zpowers_eq_of_prime_card hRp' (pow_mem ψ.2 k.val) hψk_ne
        have hrz : (r : G) ∈ Subgroup.zpowers ((ψ : G) ^ k.val) := by rw [hgenk]; exact r.2
        rw [Subgroup.mem_zpowers_iff] at hrz
        obtain ⟨j, hj⟩ := hrz
        have hcomm : Commute ((ψ : G) ^ k.val) (qq : G) := mul_inv_eq_iff_eq_mul.mp hcoe
        exact Subtype.ext (by rw [hφval r qq, ← hj, (hcomm.zpow_left j).eq, mul_inv_cancel_right])
      -- The restriction to `K` is irreducible (BG 2.2(a)) and faithful: `(dim M)² = |K/Z(K)|`.
      have hKres_irr : Representation.IsIrreducible (W.toRepresentation.comp K.subtype) :=
        restriction_isIrreducible_of_extraspecial (ρ := W.toRepresentation) hWf hKe (ψ : G) hgen
          (fun z hz => by rw [conjNormalMulAut_eq_conjAutOfNormal]; exact hxZ z hz)
      have hKres_f : Function.Injective (W.toRepresentation.comp K.subtype) := by
        intro a b hab
        simp only [MonoidHom.comp_apply, Subgroup.coe_subtype] at hab
        exact Subtype.ext (hWf hab)
      have hsq : Module.finrank F ↥W.toSubmodule ^ 2 = Nat.card (↥K ⧸ Subgroup.center ↥K) :=
        sq_finrank_eq_card_quotient_center (W.toRepresentation.comp K.subtype) hKres_f
          hKe.commutator_eq_center.le
      -- `K` nonabelian ⟹ `Z(K) ≠ ⊤` ⟹ `dim M ≥ 2`.
      have hcenter_ne_top : Subgroup.center ↥K ≠ ⊤ := fun htop => hK'ne (hZK_eq ▸ htop)
      have hV2 : 2 ≤ Module.finrank F ↥W.toSubmodule := by
        rcases Nat.lt_or_ge (Module.finrank F ↥W.toSubmodule) 2 with hlt | hge
        · exfalso
          have hdim1 : Module.finrank F ↥W.toSubmodule = 1 := by
            have hpos : 0 < Module.finrank F ↥W.toSubmodule := Module.finrank_pos
            omega
          rw [hdim1, one_pow] at hsq
          exact hcenter_ne_top (Subgroup.index_eq_one.mp hsq.symm)
        · exact hge
      -- `C_M(x) = 0`: the eigenvalue-`1` eigenspace of `ρ x` is trivial.
      have heig_bot : cyclicEigenspace ε
          (W.toRepresentation.asGroupHom (ψ : G) : Module.End F ↥W.toSubmodule) 0 = ⊥ := by
        rw [eq_bot_iff]
        intro m hm
        rw [mem_cyclicEigenspace_iff, pow_zero, one_smul] at hm
        have hψfixV : ρ (ψ : G) (m : V) = (m : V) := by
          have h := congrArg Subtype.val hm
          rwa [W.toRepresentation.asGroupHom_apply] at h
        let Stab : Subgroup G :=
          { carrier := {g | ρ g (m : V) = (m : V)}
            one_mem' := by simp only [Set.mem_ofPred_eq, map_one, Module.End.one_apply]
            mul_mem' := fun {a b} ha hb => by
              simp only [Set.mem_ofPred_eq, map_mul] at *
              rw [Module.End.mul_apply, hb, ha]
            inv_mem' := fun {a} ha => by
              simp only [Set.mem_ofPred_eq] at *
              have h1 : ρ a⁻¹ (ρ a (m : V)) = (m : V) := by
                rw [← Module.End.mul_apply, ← map_mul, inv_mul_cancel, map_one,
                  Module.End.one_apply]
              rwa [ha] at h1 }
        have hRStab : R ≤ Stab := by rw [← hψgenR]; exact (Subgroup.zpowers_le).mpr hψfixV
        have hm0 : (m : V) = 0 := hCV (m : V) (fun r => hRStab r.2)
        exact Submodule.coe_eq_zero.mp hm0
      have hCVeig : cyclicEigenspaceFinDim ε
          (W.toRepresentation.asGroupHom (ψ : G) : Module.End F ↥W.toSubmodule)
          (0 : Fin p) = 0 := by
        change Module.finrank F ↥(cyclicEigenspace ε
          (W.toRepresentation.asGroupHom (ψ : G) : Module.End F ↥W.toSubmodule)
          ((0 : Fin p) : ℕ)) = 0
        rw [show ((0 : Fin p) : ℕ) = 0 from rfl, heig_bot, finrank_bot]
      -- **Theorem 2.5**: `dim M = p - 1`.
      have hdim : (Module.finrank F ↥W.toSubmodule : ℤ) = (p : ℤ) - 1 :=
        finrank_eq_sub_one_of_extraspecial K W.toRepresentation hWf hKe (ψ : G) hxp hp.two_le
          hε hpF hcop_pK hgen hxZ hCP hV2 hCVeig
      -- **Parity contradiction**: `dim M = p - 1` is even, but `(dim M)² = |K/Z(K)|` is odd.
      have hdimN : Module.finrank F ↥W.toSubmodule = p - 1 := by
        have hp2 : 2 ≤ p := hp.two_le; omega
      have hdim_even : Even (Module.finrank F ↥W.toSubmodule) := by
        rw [hdimN]; exact Nat.Odd.sub_odd hpodd odd_one
      have hquot_odd : Odd (Nat.card (↥K ⧸ Subgroup.center ↥K)) :=
        Odd.of_dvd_nat hodd (dvd_trans (show Nat.card (↥K ⧸ Subgroup.center ↥K) ∣ Nat.card ↥K from
          ⟨Nat.card (Subgroup.center ↥K),
            Subgroup.card_eq_card_quotient_mul_card_subgroup _⟩) hKdvd)
      have hdim_odd : Odd (Module.finrank F ↥W.toSubmodule) :=
        Odd.of_dvd_nat (hsq ▸ hquot_odd) (dvd_pow_self _ two_ne_zero)
      exact (Nat.not_even_iff_odd.mpr hdim_odd) hdim_even

/-- **BG Theorem 3.4** (algebraically closed core).  `G` solvable of odd order, `K` a normal Hall
subgroup with prime-order complement `R`, `G` acting on `V/F` with `char F ∤ |G|` and `F`
algebraically closed.  If `C_V(R) = 0` then `[R, K] ⊆ C_K(V)`. -/
theorem thm34_algClosed
    {F : Type*} [Field F] [IsAlgClosed F]
    {G : Type*} [Group G] [Finite G] [Group.IsSolvable G]
    {V : Type*} [AddCommGroup V] [Module F V] [FiniteDimensional F V]
    (ρ : Representation F G V) (K R : Subgroup G) [K.Normal]
    (hcompl : Subgroup.IsComplement' K R)
    (hHall : Nat.Coprime (Nat.card ↥K) (Nat.card ↥R))
    (hRp : ∃ p : ℕ, p.Prime ∧ Nat.card ↥R = p)
    (hodd : Odd (Nat.card G))
    (hchar : (Nat.card G : F) ≠ 0)
    (hCV : ∀ v : V, (∀ r : ↥R, ρ (r : G) v = v) → v = 0) :
    ∀ g ∈ ⁅R, K⁆, ρ g = 1 :=
  thm34_aux (Nat.card G) ρ K R hcompl hHall hRp hodd hchar hCV rfl

open OddOrder.RepresentationTheory in
/-- **BG Theorem 3.4** (general field).  `G` solvable of odd order, `K` a normal Hall subgroup with
prime-order complement `R`, `G` acting on `V/F` with `char F ∤ |G|` (any field `F`).  If
`C_V(R) = 0` then `[R, K] ⊆ C_K(V)`.

Reduces to the algebraically closed core `thm34_algClosed` by base change to the algebraic closure
`F̄` (BG (2.9)): `char F̄ ∤ |G|` and `C_{F̄⊗V}(R) = 0` transfer along `F → F̄`
(`invariants_baseChangeRepresentation_eq_bot`), and `ρ̄ g = 1 ⟹ ρ g = 1` descends because
`v ↦ 1 ⊗ v` is injective (`F̄` is faithfully flat over `F`). -/
theorem thm34
    {F : Type*} [Field F]
    {G : Type*} [Group G] [Finite G] [Group.IsSolvable G]
    {V : Type*} [AddCommGroup V] [Module F V] [FiniteDimensional F V]
    (ρ : Representation F G V) (K R : Subgroup G) [K.Normal]
    (hcompl : Subgroup.IsComplement' K R)
    (hHall : Nat.Coprime (Nat.card ↥K) (Nat.card ↥R))
    (hRp : ∃ p : ℕ, p.Prime ∧ Nat.card ↥R = p)
    (hodd : Odd (Nat.card G))
    (hchar : (Nat.card G : F) ≠ 0)
    (hCV : ∀ v : V, (∀ r : ↥R, ρ (r : G) v = v) → v = 0) :
    ∀ g ∈ ⁅R, K⁆, ρ g = 1 := by
  -- `char F̄ ∤ |G|`.
  have hchar' : (Nat.card G : AlgebraicClosure F) ≠ 0 := by
    rw [← map_natCast (algebraMap F (AlgebraicClosure F))]
    rwa [Ne, map_eq_zero_iff _ (algebraMap F (AlgebraicClosure F)).injective]
  -- `C_V(R) = 0` ⟹ `C_{F̄⊗V}(R) = 0` (vanishing of invariants survives base change).
  have hCVinv : Representation.invariants (ρ.comp R.subtype) = ⊥ := by
    rw [Submodule.eq_bot_iff]
    exact fun v hv => hCV v hv
  have hCVinv' : Representation.invariants
      ((baseChangeRepresentation (AlgebraicClosure F) ρ).comp R.subtype) = ⊥ := by
    rw [← baseChangeRepresentation_comp]
    exact invariants_baseChangeRepresentation_eq_bot (AlgebraicClosure F) (ρ.comp R.subtype) hCVinv
  have hCV' : ∀ v : TensorProduct F (AlgebraicClosure F) V,
      (∀ r : ↥R, baseChangeRepresentation (AlgebraicClosure F) ρ (r : G) v = v) → v = 0 := by
    intro v hv
    have hmem : v ∈ Representation.invariants
        ((baseChangeRepresentation (AlgebraicClosure F) ρ).comp R.subtype) := hv
    rwa [hCVinv', Submodule.mem_bot] at hmem
  -- apply the algebraically closed core over `F̄`, then descend `v ↦ 1 ⊗ v`.
  intro g hg
  have hbar : baseChangeRepresentation (AlgebraicClosure F) ρ g = 1 :=
    thm34_algClosed (baseChangeRepresentation (AlgebraicClosure F) ρ) K R hcompl hHall hRp hodd
      hchar' hCV' g hg
  apply LinearMap.ext
  intro v
  apply Module.FaithfullyFlat.tensorProduct_mk_injective (A := F) (B := AlgebraicClosure F) V
  have hmap := congrArg
    (fun f : TensorProduct F (AlgebraicClosure F) V →ₗ[AlgebraicClosure F]
      TensorProduct F (AlgebraicClosure F) V => f (1 ⊗ₜ[F] v)) hbar
  simpa using hmap

end OddOrder.BG.Ch1.S03d
Source
Yawara Ishida, Lean 4 formalization of the Feit–Thompson (odd order) theorem, github.com/yawara/odd-order @ 20a6fccbb63c (Apache-2.0), https://github.com/yawara/odd-order/blob/20a6fccbb63c0b138acda9f7fafd798c42f9441b/OddOrder/BG/Ch1_Preliminary/S03d_Thm34.lean

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me