Theorem: Polynomial.IsUnitTrinomial.coeff_isUnit
File: Mathlib/Algebra/Polynomial/UnitTrinomial.lean

tactic: obtain ⟨k, m, n, hkm, hmn, u, v, w, rfl⟩ := hp
state_before: p q : ℤ[X]
hp : p.IsUnitTrinomial
k : ℕ
hk : k ∈ p.support
⊢ IsUnit (p.coeff k)
state_after: case intro.intro.intro.intro.intro.intro.intro.intro
q : ℤ[X]
k✝ k m n : ℕ
hkm : k < m
hmn : m < n
u v w : ℤˣ
hk : k✝ ∈ (trinomial k m n ↑u ↑v ↑w).support
⊢ IsUnit ((trinomial k m n ↑u ↑v ↑w).coeff k✝)

tactic: have := support_trinomial' k m n (u : ℤ) v w hk
state_before: case intro.intro.intro.intro.intro.intro.intro.intro
q : ℤ[X]
k✝ k m n : ℕ
hkm : k < m
hmn : m < n
u v w : ℤˣ
hk : k✝ ∈ (trinomial k m n ↑u ↑v ↑w).support
⊢ IsUnit ((trinomial k m n ↑u ↑v ↑w).coeff k✝)
state_after: case intro.intro.intro.intro.intro.intro.intro.intro
q : ℤ[X]
k✝ k m n : ℕ
hkm : k < m
hmn : m < n
u v w : ℤˣ
hk : k✝ ∈ (trinomial k m n ↑u ↑v ↑w).support
this : k✝ ∈ {k, m, n}
⊢ IsUnit ((trinomial k m n ↑u ↑v ↑w).coeff k✝)

tactic: rw [mem_insert, mem_insert, mem_singleton] at this
state_before: case intro.intro.intro.intro.intro.intro.intro.intro
q : ℤ[X]
k✝ k m n : ℕ
hkm : k < m
hmn : m < n
u v w : ℤˣ
hk : k✝ ∈ (trinomial k m n ↑u ↑v ↑w).support
this : k✝ ∈ {k, m, n}
⊢ IsUnit ((trinomial k m n ↑u ↑v ↑w).coeff k✝)
state_after: case intro.intro.intro.intro.intro.intro.intro.intro
q : ℤ[X]
k✝ k m n : ℕ
hkm : k < m
hmn : m < n
u v w : ℤˣ
hk : k✝ ∈ (trinomial k m n ↑u ↑v ↑w).support
this : k✝ = k ∨ k✝ = m ∨ k✝ = n
⊢ IsUnit ((trinomial k m n ↑u ↑v ↑w).coeff k✝)

tactic: rcases this with (rfl | rfl | rfl)
state_before: case intro.intro.intro.intro.intro.intro.intro.intro
q : ℤ[X]
k✝ k m n : ℕ
hkm : k < m
hmn : m < n
u v w : ℤˣ
hk : k✝ ∈ (trinomial k m n ↑u ↑v ↑w).support
this : k✝ = k ∨ k✝ = m ∨ k✝ = n
⊢ IsUnit ((trinomial k m n ↑u ↑v ↑w).coeff k✝)
state_after: case intro.intro.intro.intro.intro.intro.intro.intro.inl
q : ℤ[X]
k m n : ℕ
hmn : m < n
u v w : ℤˣ
hkm : k < m
hk : k ∈ (trinomial k m n ↑u ↑v ↑w).support
⊢ IsUnit ((trinomial k m n ↑u ↑v ↑w).coeff k)

case intro.intro.intro.intro.intro.intro.intro.intro.inr.inl
q : ℤ[X]
k✝ k n : ℕ
u v w : ℤˣ
hkm : k < k✝
hmn : k✝ < n
hk : k✝ ∈ (trinomial k k✝ n ↑u ↑v ↑w).support
⊢ IsUnit ((trinomial k k✝ n ↑u ↑v ↑w).coeff k✝)

case intro.intro.intro.intro.intro.intro.intro.intro.inr.inr
q : ℤ[X]
k✝ k m : ℕ
hkm : k < m
u v w : ℤˣ
hmn : m < k✝
hk : k✝ ∈ (trinomial k m k✝ ↑u ↑v ↑w).support
⊢ IsUnit ((trinomial k m k✝ ↑u ↑v ↑w).coeff k✝)

tactic: refine ⟨u, by rw [trinomial_trailing_coeff' hkm hmn]⟩
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.inl
q : ℤ[X]
k m n : ℕ
hmn : m < n
u v w : ℤˣ
hkm : k < m
hk : k ∈ (trinomial k m n ↑u ↑v ↑w).support
⊢ IsUnit ((trinomial k m n ↑u ↑v ↑w).coeff k)
state_after: no goals

tactic: rw [trinomial_trailing_coeff' hkm hmn]
state_before: q : ℤ[X]
k m n : ℕ
hmn : m < n
u v w : ℤˣ
hkm : k < m
hk : k ∈ (trinomial k m n ↑u ↑v ↑w).support
⊢ ↑u = (trinomial k m n ↑u ↑v ↑w).coeff k
state_after: no goals

tactic: refine ⟨v, by rw [trinomial_middle_coeff hkm hmn]⟩
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.inr.inl
q : ℤ[X]
k✝ k n : ℕ
u v w : ℤˣ
hkm : k < k✝
hmn : k✝ < n
hk : k✝ ∈ (trinomial k k✝ n ↑u ↑v ↑w).support
⊢ IsUnit ((trinomial k k✝ n ↑u ↑v ↑w).coeff k✝)
state_after: no goals

tactic: rw [trinomial_middle_coeff hkm hmn]
state_before: q : ℤ[X]
k✝ k n : ℕ
u v w : ℤˣ
hkm : k < k✝
hmn : k✝ < n
hk : k✝ ∈ (trinomial k k✝ n ↑u ↑v ↑w).support
⊢ ↑v = (trinomial k k✝ n ↑u ↑v ↑w).coeff k✝
state_after: no goals

tactic: refine ⟨w, by rw [trinomial_leading_coeff' hkm hmn]⟩
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.inr.inr
q : ℤ[X]
k✝ k m : ℕ
hkm : k < m
u v w : ℤˣ
hmn : m < k✝
hk : k✝ ∈ (trinomial k m k✝ ↑u ↑v ↑w).support
⊢ IsUnit ((trinomial k m k✝ ↑u ↑v ↑w).coeff k✝)
state_after: no goals

tactic: rw [trinomial_leading_coeff' hkm hmn]
state_before: q : ℤ[X]
k✝ k m : ℕ
hkm : k < m
u v w : ℤˣ
hmn : m < k✝
hk : k✝ ∈ (trinomial k m k✝ ↑u ↑v ↑w).support
⊢ ↑w = (trinomial k m k✝ ↑u ↑v ↑w).coeff k✝
state_after: no goals