Theorem: DihedralGroup.exponent
File: Mathlib/GroupTheory/SpecificGroups/Dihedral.lean

tactic: rcases eq_zero_or_neZero n with (rfl | hn)
state_before: n : ℕ
⊢ Monoid.exponent (DihedralGroup n) = lcm n 2
state_after: case inl

⊢ Monoid.exponent (DihedralGroup 0) = lcm 0 2

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

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

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

tactic: exact Monoid.exponent_eq_zero_of_order_zero orderOf_r_one
state_before: case inl

⊢ Monoid.exponent (DihedralGroup 0) = lcm 0 2
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 (DihedralGroup n) ∣ lcm n 2
state_after: case inr.a.a
n : ℕ
hn : NeZero n
⊢ ∀ (g : DihedralGroup n), g ^ lcm n 2 = 1

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

case inr.a.a.sr
n : ℕ
hn : NeZero n
m : ZMod n
⊢ sr m ^ lcm n 2 = 1

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

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

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

tactic: rw [← orderOf_dvd_iff_pow_eq_one, orderOf_sr]
state_before: case inr.a.a.sr
n : ℕ
hn : NeZero n
m : ZMod n
⊢ sr m ^ lcm n 2 = 1
state_after: case inr.a.a.sr
n : ℕ
hn : NeZero n
m : ZMod n
⊢ 2 ∣ lcm n 2

tactic: exact dvd_lcm_right n 2
state_before: case inr.a.a.sr
n : ℕ
hn : NeZero n
m : ZMod n
⊢ 2 ∣ lcm n 2
state_after: no goals

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

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

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

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

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

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