Theorem: ex_1_2_8 (AlgebraI/Subgroups.lean)

State before:
G : Type u_1
inst✝ : Group G
h : ∀ (g : G), g = 1 ∨ orderOf g = 2
a b : G
⊢ a * b = b * a
Tactic:
refine Commute.of_orderOf_dvd_two (fun g => ?_) a b
State after:
G : Type u_1
inst✝ : Group G
h : ∀ (g : G), g = 1 ∨ orderOf g = 2
a b g : G
⊢ orderOf g ∣ 2

State before:
G : Type u_1
inst✝ : Group G
h : ∀ (g : G), g = 1 ∨ orderOf g = 2
a b g : G
⊢ orderOf g ∣ 2
Tactic:
obtain rfl | h := h g
State after:
case inl
G : Type u_1
inst✝ : Group G
h : ∀ (g : G), g = 1 ∨ orderOf g = 2
a b : G
⊢ orderOf 1 ∣ 2

case inr
G : Type u_1
inst✝ : Group G
h✝ : ∀ (g : G), g = 1 ∨ orderOf g = 2
a b g : G
h : orderOf g = 2
⊢ orderOf g ∣ 2

State before:
case inl
G : Type u_1
inst✝ : Group G
h : ∀ (g : G), g = 1 ∨ orderOf g = 2
a b : G
⊢ orderOf 1 ∣ 2
Tactic:
rw [orderOf_one]
State after:
case inl
G : Type u_1
inst✝ : Group G
h : ∀ (g : G), g = 1 ∨ orderOf g = 2
a b : G
⊢ 1 ∣ 2

State before:
case inl
G : Type u_1
inst✝ : Group G
h : ∀ (g : G), g = 1 ∨ orderOf g = 2
a b : G
⊢ 1 ∣ 2
Tactic:
exact one_dvd _
State after:
no goals

State before:
case inr
G : Type u_1
inst✝ : Group G
h✝ : ∀ (g : G), g = 1 ∨ orderOf g = 2
a b g : G
h : orderOf g = 2
⊢ orderOf g ∣ 2
Tactic:
rw [← h]
State after:
no goals