AFTD Auto-Formalizing Theoretical Domains

quaternion_group_card

theoremverified

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

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.

  1. 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.

    line 4

      have : NeZero (2 * n + 1) := ⟨by omega⟩
  2. 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.

    line 5

    uses QuaternionGroup.card

      rw [QuaternionGroup.card]
  3. 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`).

    line 6

      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

/-- 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
See it in the graphDiscuss this resultChallenge it