Theorem: isCoprime_of_gcd_eq_one_of_FLT
File: Mathlib/NumberTheory/FLT/Basic.lean

tactic: rcases eq_or_ne n 0 with rfl | hn
state_before: α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
a b c : ℤ
Hgcd : {a, b, c}.gcd id = 1
HF : a ^ n + b ^ n + c ^ n = 0
⊢ IsCoprime a b
state_after: case inl
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n : ℕ
a b c : ℤ
Hgcd : {a, b, c}.gcd id = 1
HF : a ^ 0 + b ^ 0 + c ^ 0 = 0
⊢ IsCoprime a b

case inr
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
a b c : ℤ
Hgcd : {a, b, c}.gcd id = 1
HF : a ^ n + b ^ n + c ^ n = 0
hn : n ≠ 0
⊢ IsCoprime a b

tactic: refine isCoprime_of_prime_dvd  ?_ <| (fun p hp hpa hpb ↦ hp.not_dvd_one ?_)
state_before: case inr
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
a b c : ℤ
Hgcd : {a, b, c}.gcd id = 1
HF : a ^ n + b ^ n + c ^ n = 0
hn : n ≠ 0
⊢ IsCoprime a b
state_after: case inr.refine_1
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
a b c : ℤ
Hgcd : {a, b, c}.gcd id = 1
HF : a ^ n + b ^ n + c ^ n = 0
hn : n ≠ 0
⊢ ¬(a = 0 ∧ b = 0)

case inr.refine_2
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
a b c : ℤ
Hgcd : {a, b, c}.gcd id = 1
HF : a ^ n + b ^ n + c ^ n = 0
hn : n ≠ 0
p : ℤ
hp : Prime p
hpa : p ∣ a
hpb : p ∣ b
⊢ p ∣ 1

tactic: simp only [pow_zero, Int.reduceAdd, OfNat.ofNat_ne_zero] at HF
state_before: case inl
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n : ℕ
a b c : ℤ
Hgcd : {a, b, c}.gcd id = 1
HF : a ^ 0 + b ^ 0 + c ^ 0 = 0
⊢ IsCoprime a b
state_after: no goals

tactic: rintro ⟨rfl, rfl⟩
state_before: case inr.refine_1
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
a b c : ℤ
Hgcd : {a, b, c}.gcd id = 1
HF : a ^ n + b ^ n + c ^ n = 0
hn : n ≠ 0
⊢ ¬(a = 0 ∧ b = 0)
state_after: case inr.refine_1.intro
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
c : ℤ
hn : n ≠ 0
Hgcd : {0, 0, c}.gcd id = 1
HF : 0 ^ n + 0 ^ n + c ^ n = 0
⊢ False

tactic: simp only [ne_eq, hn, not_false_eq_true, zero_pow, add_zero, zero_add, pow_eq_zero_iff]
  at HF
state_before: case inr.refine_1.intro
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
c : ℤ
hn : n ≠ 0
Hgcd : {0, 0, c}.gcd id = 1
HF : 0 ^ n + 0 ^ n + c ^ n = 0
⊢ False
state_after: case inr.refine_1.intro
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
c : ℤ
hn : n ≠ 0
Hgcd : {0, 0, c}.gcd id = 1
HF : c = 0
⊢ False

tactic: simp only [HF, Finset.mem_singleton, Finset.insert_eq_of_mem, Finset.gcd_singleton, id_eq,
  map_zero, zero_ne_one] at Hgcd
state_before: case inr.refine_1.intro
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
c : ℤ
hn : n ≠ 0
Hgcd : {0, 0, c}.gcd id = 1
HF : c = 0
⊢ False
state_after: no goals

tactic: rw [← Hgcd]
state_before: case inr.refine_2
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
a b c : ℤ
Hgcd : {a, b, c}.gcd id = 1
HF : a ^ n + b ^ n + c ^ n = 0
hn : n ≠ 0
p : ℤ
hp : Prime p
hpa : p ∣ a
hpb : p ∣ b
⊢ p ∣ 1
state_after: case inr.refine_2
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
a b c : ℤ
Hgcd : {a, b, c}.gcd id = 1
HF : a ^ n + b ^ n + c ^ n = 0
hn : n ≠ 0
p : ℤ
hp : Prime p
hpa : p ∣ a
hpb : p ∣ b
⊢ p ∣ {a, b, c}.gcd id

tactic: refine Finset.dvd_gcd_iff.mpr fun x hx ↦ ?_
state_before: case inr.refine_2
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
a b c : ℤ
Hgcd : {a, b, c}.gcd id = 1
HF : a ^ n + b ^ n + c ^ n = 0
hn : n ≠ 0
p : ℤ
hp : Prime p
hpa : p ∣ a
hpb : p ∣ b
⊢ p ∣ {a, b, c}.gcd id
state_after: case inr.refine_2
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
a b c : ℤ
Hgcd : {a, b, c}.gcd id = 1
HF : a ^ n + b ^ n + c ^ n = 0
hn : n ≠ 0
p : ℤ
hp : Prime p
hpa : p ∣ a
hpb : p ∣ b
x : ℤ
hx : x ∈ {a, b, c}
⊢ p ∣ id x

tactic: simp only [Finset.mem_insert, Finset.mem_singleton] at hx
state_before: case inr.refine_2
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
a b c : ℤ
Hgcd : {a, b, c}.gcd id = 1
HF : a ^ n + b ^ n + c ^ n = 0
hn : n ≠ 0
p : ℤ
hp : Prime p
hpa : p ∣ a
hpb : p ∣ b
x : ℤ
hx : x ∈ {a, b, c}
⊢ p ∣ id x
state_after: case inr.refine_2
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
a b c : ℤ
Hgcd : {a, b, c}.gcd id = 1
HF : a ^ n + b ^ n + c ^ n = 0
hn : n ≠ 0
p : ℤ
hp : Prime p
hpa : p ∣ a
hpb : p ∣ b
x : ℤ
hx : x = a ∨ x = b ∨ x = c
⊢ p ∣ id x

tactic: rcases hx with hx | hx | hx <;> simp only [id_eq, hx, hpa, hpb,
  dvd_c_of_prime_of_dvd_a_of_dvd_b_of_FLT hp hpa hpb HF]
state_before: case inr.refine_2
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
a b c : ℤ
Hgcd : {a, b, c}.gcd id = 1
HF : a ^ n + b ^ n + c ^ n = 0
hn : n ≠ 0
p : ℤ
hp : Prime p
hpa : p ∣ a
hpb : p ∣ b
x : ℤ
hx : x = a ∨ x = b ∨ x = c
⊢ p ∣ id x
state_after: no goals