Concrete groups and cohomology for the counterexamples
DefinitionLocalConjugacy_ExamplesThe standard groups , , and ; the imprimitive wreath product through its three-coordinate permutation action; the Heisenberg group of order through upper-unitriangular coordinates; and nonabelian for explicit finite-group actions. The general linear group in the target is Mathlib's .
import Definitions.Def_LocalConjugacy_Cohomology
/-!
# Concrete groups and finite cohomology for the two counterexamples
Mathlib supplies the quaternion group, permutation groups, general linear group,
cyclic groups (`Multiplicative (ZMod n)`), Sylow subgroups, and semidirect products.
The imprimitive wreath product here uses the natural action of S₃ on three points;
the regular wreath product would have six base coordinates and the wrong order.
The Heisenberg model records the three upper-unitriangular matrix coordinates.
Finite cocycles need no extra continuity predicate: all finite groups in the
examples carry their discrete topology, in which every map is continuous.
-/
namespace LocalConjugacy
/-- The symmetric group on three letters, using Mathlib's permutation group. -/
abbrev S3 := Equiv.Perm (Fin 3)
/-- The quaternion group of order eight, using Mathlib's standard presentation. -/
abbrev Q8 := QuaternionGroup 2
/-- The cyclic group of order three, written multiplicatively. -/
abbrev C3 := Multiplicative (ZMod 3)
/-- The base of the imprimitive wreath product: one C₃ for each of three letters. -/
abbrev WreathBase := Fin 3 → C3
/-- Permuting coordinates is a homomorphism S₃ → Aut(C₃³).
The inverse permutation in `arrowCongr` gives a left group action. -/
def wreathAction : S3 →* MulAut WreathBase where
toFun s := MulEquiv.arrowCongr s (MulEquiv.refl C3)
map_one' := by
-- Equality of coordinate permutations reduces to equality at each coordinate.
ext b i
rfl
map_mul' s t := by
-- The inverse of a product reverses the two precompositions.
ext b i
rfl
/-- The natural, imprimitive wreath product C₃ ≀ S₃, of order 3³ · 6 = 162. -/
abbrev WreathC3S3 := WreathBase ⋊[wreathAction] S3
/-- Coordinates of the matrix [[1,a,c],[0,1,b],[0,0,1]] over F₃.
This fixes the Heisenberg group itself, rather than only its order and exponent. -/
@[ext] structure Heisenberg3 where
a : ZMod 3
b : ZMod 3
c : ZMod 3
/-- Matrix multiplication in the three coordinates; the cross term is a · b'. -/
instance heisenbergMul : Mul Heisenberg3 :=
⟨fun x y => ⟨x.a + y.a, x.b + y.b, x.c + y.c + x.a * y.b⟩⟩
/-- The identity matrix has all three upper-diagonal coordinates zero. -/
instance heisenbergOne : One Heisenberg3 := ⟨⟨0, 0, 0⟩⟩
/-- Matrix inversion introduces the cross-term correction in the top-right entry. -/
instance heisenbergInv : Inv Heisenberg3 :=
⟨fun x => ⟨-x.a, -x.b, -x.c + x.a * x.b⟩⟩
/-- The matrix coordinate operations satisfy the group axioms over F₃. -/
instance : Group Heisenberg3 where
mul := heisenbergMul.mul
one := heisenbergOne.one
inv := heisenbergInv.inv
mul_assoc x y z := by
-- The group law is associative by the distributive law in F₃.
apply Heisenberg3.ext
· change (x.a + y.a) + z.a = x.a + (y.a + z.a)
ring
· change (x.b + y.b) + z.b = x.b + (y.b + z.b)
ring
· change (x.c + y.c + x.a * y.b) + z.c + (x.a + y.a) * z.b =
x.c + (y.c + z.c + y.a * z.b) + x.a * (y.b + z.b)
ring
one_mul x := by
-- The zero triple is the identity matrix.
apply Heisenberg3.ext
· change 0 + x.a = x.a
ring
· change 0 + x.b = x.b
ring
· change 0 + x.c + 0 * x.b = x.c
ring
mul_one x := by
apply Heisenberg3.ext
· change x.a + 0 = x.a
ring
· change x.b + 0 = x.b
ring
· change x.c + 0 + x.a * 0 = x.c
ring
inv_mul_cancel x := by
-- The correction a · b in the inverse cancels the cross term.
apply Heisenberg3.ext
· change -x.a + x.a = 0
ring
· change -x.b + x.b = 0
ring
· change (-x.c + x.a * x.b) + x.c + (-x.a) * x.b = 0
ring
/-- Nonabelian cocycles for an explicitly supplied finite-group action. -/
def FiniteCocycle {J N : Type*} [Group J] [Group N] (a : J →* MulAut N) :=
{f : J → N // ∀ x y, f (x * y) = f x * a x (f y)}
/-- Two cocycles differ by one global coboundary coefficient.
The structural equivalence proof is included so the quotient is an actual type. -/
def finiteCohomologySetoid {J N : Type*} [Group J] [Group N]
(a : J →* MulAut N) : Setoid (FiniteCocycle a) where
r f g := ∃ n : N, ∀ x, g.val x = n⁻¹ * f.val x * a x n
iseqv := by
constructor
· -- The identity coefficient leaves a cocycle unchanged.
intro f
exact ⟨1, by simp⟩
· -- Inverting a witness reverses the cohomology relation.
rintro f g ⟨n, hn⟩
refine ⟨n⁻¹, fun x => ?_⟩
rw [hn x]
simp [mul_assoc]
· -- Multiplication composes the two global witnesses.
rintro f g h ⟨n, hn⟩ ⟨m, hm⟩
refine ⟨n * m, fun x => ?_⟩
rw [hm x, hn x]
simp [mul_assoc]
/-- Nonabelian H¹ for finite discrete groups, as an actual quotient of cocycles. -/
def FiniteH1 {J N : Type*} [Group J] [Group N] (a : J →* MulAut N) :=
Quotient (finiteCohomologySetoid a)
/-- Finite local conjugacy, expressed directly with Mathlib's Sylow subgroups.
The subgroup embeddings place both Sylow subgroups in the same ambient group.
Primes not dividing a subgroup order are included; their Sylow subgroups are trivial. -/
def FiniteLocallyConjugate {G : Type*} [Group G] (H K : Subgroup G) : Prop :=
∀ (p : ℕ) (hp : p.Prime),
letI : Fact p.Prime := ⟨hp⟩
∃ (P : Sylow p H) (Q : Sylow p K),
Conjugate (P.toSubgroup.map H.subtype) (Q.toSubgroup.map K.subtype)
/-- The normal copy of Q₈ in its semidirect product with S₃. -/
def quaternionKernel (a : S3 →* MulAut Q8) : Subgroup (Q8 ⋊[a] S3) :=
(SemidirectProduct.inl : Q8 →* Q8 ⋊[a] S3).range
/-- The canonical S₃ complement in the same semidirect product. -/
def quaternionComplement (a : S3 →* MulAut Q8) : Subgroup (Q8 ⋊[a] S3) :=
(SemidirectProduct.inr : S3 →* Q8 ⋊[a] S3).range
end LocalConjugacy
Read-back
What the Lean code literally says, in plain math · GPT-6 family (exact model variant not exposed)
S3. This abbreviation denotes the group of all permutations of the three-element set , with permutation composition as its group operation.
Q8. This abbreviation denotes the generalized quaternion group with parameter , namely the eight-element quaternion group. Concretely, its elements are and for , with products , , , and ; the identity is , and inverses are and .
C3. This abbreviation denotes the additive group of regarded as a multiplicatively written group: multiplication is addition modulo , the multiplicative identity corresponds to , and multiplicative inversion corresponds to additive negation. It does not denote the group of units of .
WreathBase. This abbreviation denotes the group of functions from the three-element set to the additive group of written multiplicatively. Its operations are pointwise, so its underlying group is the direct product of three cyclic groups of order .
wreathAction. This defines a group homomorphism from the permutation group of to the group of multiplicative automorphisms of the group of functions , where is the additive group of written multiplicatively. The permutation acts by for every function and index ; the inverse automorphism sends to . The supplied proofs assert preservation of the identity permutation and of multiplication of permutations.
WreathC3S3. This abbreviation denotes the semidirect product of the group of functions , with pointwise multiplication, by the permutation group of , where is the additive group of written multiplicatively and acts by . Its elements are pairs and its product is .
Heisenberg3. This structure consists of triples with all three coordinates in , with no additional equations or restrictions on the coordinates. Its named projections return , , and , and the extensionality attribute registers that equality of the three coordinates implies equality of the triples. The structure declaration itself does not supply multiplication.
heisenbergMul. This supplies multiplication on the type of triples by , with all coordinate arithmetic in . This declaration supplies the operation; it does not itself assert its group laws.
heisenbergOne. This supplies the distinguished multiplicative identity candidate on the type of triples in as . The identity laws are not part of this particular declaration.
heisenbergInv. This supplies inversion on the type of triples in by , with arithmetic in . The inverse laws are not part of this particular declaration.
Anonymous group instance on Heisenberg3. This equips the type of all triples in with a group structure whose multiplication is , whose identity is , and whose inverse is . The declaration supplies proofs that this multiplication is associative for every three triples, that is both a left and a right identity for every triple, and that for every triple .
FiniteCocycle. For arbitrary groups and and a group homomorphism , this defines the type of functions together with the condition for every . Neither nor is assumed finite, and no topology or continuity condition is imposed.
finiteCohomologySetoid. For arbitrary groups and and a group homomorphism , this defines an equivalence relation on the functions satisfying for all . Two such functions are related exactly when there exists one such that for every . The declaration proves reflexivity, symmetry, and transitivity of this relation. There are no finiteness, topology, or continuity hypotheses.
FiniteH1. For arbitrary groups and and a group homomorphism , this defines the quotient set of functions satisfying for every , where and represent the same quotient element exactly when there is such that for all . There is no finiteness assumption on either group or on the quotient, and no continuity condition.
FiniteLocallyConjugate. For an arbitrary group and subgroups , this is the proposition that for every natural number that is prime, there exist a Sylow -subgroup of the abstract group and a Sylow -subgroup of the abstract group whose images in under the subgroup inclusions are conjugate: there is with , after identifying these images with subgroups of . Here a Sylow -subgroup means a maximal -subgroup, where a group is a -group if every element satisfies for some natural number . No finiteness or topology is assumed on , and the quantifier includes every prime, including primes that divide none of the orders when the groups are finite. The choices of may depend on .
quaternionKernel. For any group homomorphism , where is the permutation group of and is the eight-element quaternion group, this defines the subgroup of consisting of the pairs with . It is the image of the canonical homomorphism ; the ambient semidirect product has multiplication .
quaternionComplement. For any group homomorphism , where is the permutation group of and is the eight-element quaternion group, this defines the subgroup of consisting of the pairs with . It is the image of the canonical homomorphism ; the ambient semidirect product has multiplication .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.