Theorem: orderOf_eq_iff
File: Mathlib/GroupTheory/OrderOfElement.lean

tactic: simp_rw [Ne, ← isPeriodicPt_mul_iff_pow_eq_one, orderOf, minimalPeriod]
state_before: G : Type u
A : Type v
x y : G
a b : A
n✝ m : ℕ
inst✝¹ : Monoid G
inst✝ : AddMonoid A
n : ℕ
h : 0 < n
⊢ orderOf x = n ↔ x ^ n = 1 ∧ ∀ (m : ℕ), m < n → 0 < m → x ^ m ≠ 1

tactic: split_ifs with h1
state_before: G : Type u
A : Type v
x y : G
a b : A
n✝ m : ℕ
inst✝¹ : Monoid G
inst✝ : AddMonoid A
n : ℕ
h : 0 < n
⊢ (if h : 1 ∈ periodicPts fun x_1 => x * x_1 then Nat.find h else 0) = n ↔
    IsPeriodicPt (fun x_1 => x * x_1) n 1 ∧ ∀ (m : ℕ), m < n → 0 < m → ¬IsPeriodicPt (fun x_1 => x * x_1) m 1

tactic: classical
rw [find_eq_iff]
simp only [h, true_and]
push_neg
rfl
state_before: case inl
G : Type u
A : Type v
x y : G
a b : A
n✝ m : ℕ
inst✝¹ : Monoid G
inst✝ : AddMonoid A
n : ℕ
h : 0 < n
h1 : 1 ∈ periodicPts fun x_1 => x * x_1
⊢ Nat.find h1 = n ↔
    IsPeriodicPt (fun x_1 => x * x_1) n 1 ∧ ∀ (m : ℕ), m < n → 0 < m → ¬IsPeriodicPt (fun x_1 => x * x_1) m 1

tactic: rw [find_eq_iff]
state_before: case inl
G : Type u
A : Type v
x y : G
a b : A
n✝ m : ℕ
inst✝¹ : Monoid G
inst✝ : AddMonoid A
n : ℕ
h : 0 < n
h1 : 1 ∈ periodicPts fun x_1 => x * x_1
⊢ Nat.find h1 = n ↔
    IsPeriodicPt (fun x_1 => x * x_1) n 1 ∧ ∀ (m : ℕ), m < n → 0 < m → ¬IsPeriodicPt (fun x_1 => x * x_1) m 1

tactic: simp only [h, true_and]
state_before: case inl
G : Type u
A : Type v
x y : G
a b : A
n✝ m : ℕ
inst✝¹ : Monoid G
inst✝ : AddMonoid A
n : ℕ
h : 0 < n
h1 : 1 ∈ periodicPts fun x_1 => x * x_1
⊢ ((n > 0 ∧ IsPeriodicPt (fun x_1 => x * x_1) n 1) ∧
      ∀ (n_1 : ℕ), n_1 < n → ¬(n_1 > 0 ∧ IsPeriodicPt (fun x_1 => x * x_1) n_1 1)) ↔
    IsPeriodicPt (fun x_1 => x * x_1) n 1 ∧ ∀ (m : ℕ), m < n → 0 < m → ¬IsPeriodicPt (fun x_1 => x * x_1) m 1

tactic: push_neg
state_before: case inl
G : Type u
A : Type v
x y : G
a b : A
n✝ m : ℕ
inst✝¹ : Monoid G
inst✝ : AddMonoid A
n : ℕ
h : 0 < n
h1 : 1 ∈ periodicPts fun x_1 => x * x_1
⊢ (IsPeriodicPt (fun x_1 => x * x_1) n 1 ∧
      ∀ (n_1 : ℕ), n_1 < n → ¬(n_1 > 0 ∧ IsPeriodicPt (fun x_1 => x * x_1) n_1 1)) ↔
    IsPeriodicPt (fun x_1 => x * x_1) n 1 ∧ ∀ (m : ℕ), m < n → 0 < m → ¬IsPeriodicPt (fun x_1 => x * x_1) m 1

tactic: rfl
state_before: case inl
G : Type u
A : Type v
x y : G
a b : A
n✝ m : ℕ
inst✝¹ : Monoid G
inst✝ : AddMonoid A
n : ℕ
h : 0 < n
h1 : 1 ∈ periodicPts fun x_1 => x * x_1
⊢ (IsPeriodicPt (fun x_1 => x * x_1) n 1 ∧ ∀ (n_1 : ℕ), n_1 < n → n_1 > 0 → ¬IsPeriodicPt (fun x_1 => x * x_1) n_1 1) ↔
    IsPeriodicPt (fun x_1 => x * x_1) n 1 ∧ ∀ (m : ℕ), m < n → 0 < m → ¬IsPeriodicPt (fun x_1 => x * x_1) m 1

tactic: rw [iff_false_left h.ne]
state_before: case inr
G : Type u
A : Type v
x y : G
a b : A
n✝ m : ℕ
inst✝¹ : Monoid G
inst✝ : AddMonoid A
n : ℕ
h : 0 < n
h1 : ¬1 ∈ periodicPts fun x_1 => x * x_1
⊢ 0 = n ↔ IsPeriodicPt (fun x_1 => x * x_1) n 1 ∧ ∀ (m : ℕ), m < n → 0 < m → ¬IsPeriodicPt (fun x_1 => x * x_1) m 1

tactic: rintro ⟨h', -⟩
state_before: case inr
G : Type u
A : Type v
x y : G
a b : A
n✝ m : ℕ
inst✝¹ : Monoid G
inst✝ : AddMonoid A
n : ℕ
h : 0 < n
h1 : ¬1 ∈ periodicPts fun x_1 => x * x_1
⊢ ¬(IsPeriodicPt (fun x_1 => x * x_1) n 1 ∧ ∀ (m : ℕ), m < n → 0 < m → ¬IsPeriodicPt (fun x_1 => x * x_1) m 1)

tactic: exact h1 ⟨n, h, h'⟩
state_before: case inr.intro
G : Type u
A : Type v
x y : G
a b : A
n✝ m : ℕ
inst✝¹ : Monoid G
inst✝ : AddMonoid A
n : ℕ
h : 0 < n
h1 : ¬1 ∈ periodicPts fun x_1 => x * x_1
h' : IsPeriodicPt (fun x_1 => x * x_1) n 1
⊢ False