Theorem: QuaternionGroup.exponent
File: Mathlib/GroupTheory/SpecificGroups/Quaternion.lean

tactic: rw [← normalize_eq 2, ← lcm_mul_left, normalize_eq]
state_before: n : ℕ
⊢ Monoid.exponent (QuaternionGroup n) = 2 * lcm n 2
state_after: n : ℕ
⊢ Monoid.exponent (QuaternionGroup n) = lcm (2 * n) (2 * 2)

tactic: norm_num
state_before: n : ℕ
⊢ Monoid.exponent (QuaternionGroup n) = lcm (2 * n) (2 * 2)
state_after: n : ℕ
⊢ Monoid.exponent (QuaternionGroup n) = lcm (2 * n) 4

tactic: cases' eq_zero_or_neZero n with hn hn
state_before: n : ℕ
⊢ Monoid.exponent (QuaternionGroup n) = lcm (2 * n) 4
state_after: case inl
n : ℕ
hn : n = 0
⊢ Monoid.exponent (QuaternionGroup n) = lcm (2 * n) 4

case inr
n : ℕ
hn : NeZero n
⊢ Monoid.exponent (QuaternionGroup n) = lcm (2 * n) 4

tactic: apply Nat.dvd_antisymm
state_before: case inr
n : ℕ
hn : NeZero n
⊢ Monoid.exponent (QuaternionGroup n) = lcm (2 * n) 4
state_after: case inr.a
n : ℕ
hn : NeZero n
⊢ Monoid.exponent (QuaternionGroup n) ∣ lcm (2 * n) 4

case inr.a
n : ℕ
hn : NeZero n
⊢ lcm (2 * n) 4 ∣ Monoid.exponent (QuaternionGroup n)

tactic: subst hn
state_before: case inl
n : ℕ
hn : n = 0
⊢ Monoid.exponent (QuaternionGroup n) = lcm (2 * n) 4
state_after: case inl

⊢ Monoid.exponent (QuaternionGroup 0) = lcm (2 * 0) 4

tactic: simp only [lcm_zero_left, mul_zero]
state_before: case inl

⊢ Monoid.exponent (QuaternionGroup 0) = lcm (2 * 0) 4
state_after: case inl

⊢ Monoid.exponent (QuaternionGroup 0) = 0

tactic: exact Monoid.exponent_eq_zero_of_order_zero orderOf_a_one
state_before: case inl

⊢ Monoid.exponent (QuaternionGroup 0) = 0
state_after: no goals

tactic: apply Monoid.exponent_dvd_of_forall_pow_eq_one
state_before: case inr.a
n : ℕ
hn : NeZero n
⊢ Monoid.exponent (QuaternionGroup n) ∣ lcm (2 * n) 4
state_after: case inr.a.a
n : ℕ
hn : NeZero n
⊢ ∀ (g : QuaternionGroup n), g ^ lcm (2 * n) 4 = 1

tactic: rintro (m | m)
state_before: case inr.a.a
n : ℕ
hn : NeZero n
⊢ ∀ (g : QuaternionGroup n), g ^ lcm (2 * n) 4 = 1
state_after: case inr.a.a.a
n : ℕ
hn : NeZero n
m : ZMod (2 * n)
⊢ a m ^ lcm (2 * n) 4 = 1

case inr.a.a.xa
n : ℕ
hn : NeZero n
m : ZMod (2 * n)
⊢ xa m ^ lcm (2 * n) 4 = 1

tactic: rw [← orderOf_dvd_iff_pow_eq_one, orderOf_a]
state_before: case inr.a.a.a
n : ℕ
hn : NeZero n
m : ZMod (2 * n)
⊢ a m ^ lcm (2 * n) 4 = 1
state_after: case inr.a.a.a
n : ℕ
hn : NeZero n
m : ZMod (2 * n)
⊢ 2 * n / (2 * n).gcd m.val ∣ lcm (2 * n) 4

tactic: refine Nat.dvd_trans ⟨gcd (2 * n) m.val, ?_⟩ (dvd_lcm_left (2 * n) 4)
state_before: case inr.a.a.a
n : ℕ
hn : NeZero n
m : ZMod (2 * n)
⊢ 2 * n / (2 * n).gcd m.val ∣ lcm (2 * n) 4
state_after: case inr.a.a.a
n : ℕ
hn : NeZero n
m : ZMod (2 * n)
⊢ 2 * n = 2 * n / (2 * n).gcd m.val * gcd (2 * n) m.val

tactic: exact (Nat.div_mul_cancel (Nat.gcd_dvd_left (2 * n) m.val)).symm
state_before: case inr.a.a.a
n : ℕ
hn : NeZero n
m : ZMod (2 * n)
⊢ 2 * n = 2 * n / (2 * n).gcd m.val * gcd (2 * n) m.val
state_after: no goals

tactic: rw [← orderOf_dvd_iff_pow_eq_one, orderOf_xa]
state_before: case inr.a.a.xa
n : ℕ
hn : NeZero n
m : ZMod (2 * n)
⊢ xa m ^ lcm (2 * n) 4 = 1
state_after: case inr.a.a.xa
n : ℕ
hn : NeZero n
m : ZMod (2 * n)
⊢ 4 ∣ lcm (2 * n) 4

tactic: exact dvd_lcm_right (2 * n) 4
state_before: case inr.a.a.xa
n : ℕ
hn : NeZero n
m : ZMod (2 * n)
⊢ 4 ∣ lcm (2 * n) 4
state_after: no goals

tactic: apply lcm_dvd
state_before: case inr.a
n : ℕ
hn : NeZero n
⊢ lcm (2 * n) 4 ∣ Monoid.exponent (QuaternionGroup n)
state_after: case inr.a.hab
n : ℕ
hn : NeZero n
⊢ 2 * n ∣ Monoid.exponent (QuaternionGroup n)

case inr.a.hcb
n : ℕ
hn : NeZero n
⊢ 4 ∣ Monoid.exponent (QuaternionGroup n)

tactic: convert Monoid.order_dvd_exponent (a 1)
state_before: case inr.a.hab
n : ℕ
hn : NeZero n
⊢ 2 * n ∣ Monoid.exponent (QuaternionGroup n)
state_after: case h.e'_3
n : ℕ
hn : NeZero n
⊢ 2 * n = orderOf (a 1)

tactic: exact orderOf_a_one.symm
state_before: case h.e'_3
n : ℕ
hn : NeZero n
⊢ 2 * n = orderOf (a 1)
state_after: no goals

tactic: convert Monoid.order_dvd_exponent (xa (0 : ZMod (2 * n)))
state_before: case inr.a.hcb
n : ℕ
hn : NeZero n
⊢ 4 ∣ Monoid.exponent (QuaternionGroup n)
state_after: case h.e'_3
n : ℕ
hn : NeZero n
⊢ 4 = orderOf (xa 0)

tactic: exact (orderOf_xa 0).symm
state_before: case h.e'_3
n : ℕ
hn : NeZero n
⊢ 4 = orderOf (xa 0)
state_after: no goals