quaternion_group_card
For every natural number n, the cardinality of the generalized quaternion group QuaternionGroup (2 * n + 1) is 8 * n + 4.
Statement
theorem quaternion_group_card (n : ℕ) :
Fintype.card (QuaternionGroup (2 * n + 1)) = 8 * n + 4- Source
- Mathlib.GroupTheory.SpecificGroups.Quaternion
- Verified
- 13 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Used by 1
- cayley_table_graph_quaternion_chromatic_number_geFor every integer n ≥ 1, the chromatic number of the Cayley table graph of the generalized quaternion group QuaternionGroup (2 * n + 1) is…
Read back from the Lean
For every natural number $n$, the cardinality of the quaternion group $\text{QuaternionGroup}(2n + 1)$ (as given by Fintype.card) is equal to $8n + 4$.
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
The proof, explained
The cardinality of the generalized quaternion group with non-zero parameter m is known to be 4 * m. The proof verifies that 2 * n + 1 ≠ 0, rewrites the group's cardinality to 4 * (2 * n + 1) using this general formula, and concludes by simple arithmetic expansion to 8 * n + 4.
2 * n + 1 is non-zero (satisfying the NeZero typeclass)
Since n is a natural number, 2 * n + 1 ≥ 1 > 0. Linear integer arithmetic (`omega`) establishes this inequality, providing the `NeZero (2 * n + 1)` instance required to apply the cardinality formula.
have : NeZero (2 * n + 1) := ⟨by omega⟩
The cardinality of QuaternionGroup (2 * n + 1) reduces to 4 * (2 * n + 1)
Applying the lemma `QuaternionGroup.card` replaces the cardinality of QuaternionGroup (2 * n + 1) with 4 * (2 * n + 1), using the fact that 2 * n + 1 is non-zero.
uses
QuaternionGroup.cardrw [QuaternionGroup.card]4 * (2 * n + 1) = 8 * n + 4
Expanding the multiplication 4 * (2 * n + 1) yields 8 * n + 4, which is verified directly by linear arithmetic (`omega`).
omega
QuaternionGroup.card- For any non-zero natural number n, the cardinality of the generalized quaternion group QuaternionGroup n is 4 * n.
Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
/-- The order of the generalized quaternion group QuaternionGroup (2 * n + 1) is 8 * n + 4. -/theorem quaternion_group_card (n : ℕ) : Fintype.card (QuaternionGroup (2 * n + 1)) = 8 * n + 4 := by have : NeZero (2 * n + 1) := ⟨by omega⟩ rw [QuaternionGroup.card] omega