Theorem: isField_of_isIntegral_of_isField
File: Mathlib/RingTheory/IntegralClosure.lean

tactic: refine' ⟨⟨0, 1, zero_ne_one⟩, mul_comm, fun {a} ha => _⟩
state_before: R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
⊢ IsField R

tactic: obtain ⟨a_inv, ha_inv⟩ := hS.mul_inv_cancel
  fun h => ha (hRS (_root_.trans h (RingHom.map_zero _).symm))
state_before: R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
⊢ ∃ b, a * b = 1

tactic: obtain ⟨p, p_monic, hp⟩ := H a_inv
state_before: case intro
R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
⊢ ∃ b, a * b = 1

tactic: use -∑ i : ℕ in Finset.range p.natDegree, p.coeff i * a ^ (p.natDegree - i - 1)
state_before: case intro.intro.intro
R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
⊢ ∃ b, a * b = 1

tactic: have hq : (∑ i : ℕ in Finset.range (p.natDegree + 1), p.coeff i * a ^ (p.natDegree - i)) = 0 := by
  apply (injective_iff_map_eq_zero (algebraMap R S)).mp hRS
  have a_inv_ne_zero : a_inv ≠ 0 := right_ne_zero_of_mul (mt ha_inv.symm.trans one_ne_zero)
  refine' (mul_eq_zero.mp _).resolve_right (pow_ne_zero p.natDegree a_inv_ne_zero)
  rw [eval₂_eq_sum_range] at hp
  rw [map_sum, Finset.sum_mul]
  refine' (Finset.sum_congr rfl fun i hi => _).trans hp
  rw [RingHom.map_mul, mul_assoc]
  congr
  have : a_inv ^ p.natDegree = a_inv ^ (p.natDegree - i) * a_inv ^ i := by
    rw [← pow_add a_inv, tsub_add_cancel_of_le (Nat.le_of_lt_succ (Finset.mem_range.mp hi))]
  rw [RingHom.map_pow, this, ← mul_assoc, ← mul_pow, ha_inv, one_pow, one_mul]
state_before: case intro.intro.intro
R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
⊢ a * -∑ i in Finset.range (natDegree p), coeff p i * a ^ (natDegree p - i - 1) = 1

tactic: rw [Finset.sum_range_succ_comm, p_monic.coeff_natDegree, one_mul, tsub_self, pow_zero,
  add_eq_zero_iff_eq_neg, eq_comm] at hq
state_before: case intro.intro.intro
R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
hq : ∑ i in Finset.range (natDegree p + 1), coeff p i * a ^ (natDegree p - i) = 0
⊢ a * -∑ i in Finset.range (natDegree p), coeff p i * a ^ (natDegree p - i - 1) = 1

tactic: rw [mul_comm, neg_mul, Finset.sum_mul]
state_before: case intro.intro.intro
R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
hq✝ : a ^ (natDegree p - natDegree p) + ∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 0
hq : -∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 1
⊢ a * -∑ i in Finset.range (natDegree p), coeff p i * a ^ (natDegree p - i - 1) = 1

tactic: convert hq using 2
state_before: case intro.intro.intro
R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
hq✝ : a ^ (natDegree p - natDegree p) + ∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 0
hq : -∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 1
⊢ -∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x - 1) * a = 1

tactic: refine' Finset.sum_congr rfl fun i hi => _
state_before: case h.e'_2.h.e'_3
R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
hq✝ : a ^ (natDegree p - natDegree p) + ∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 0
hq : -∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 1
⊢ ∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x - 1) * a =
    ∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x)

tactic: have : 1 ≤ p.natDegree - i := le_tsub_of_add_le_left (Finset.mem_range.mp hi)
state_before: case h.e'_2.h.e'_3
R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
hq✝ : a ^ (natDegree p - natDegree p) + ∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 0
hq : -∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 1
i : ℕ
hi : i ∈ Finset.range (natDegree p)
⊢ coeff p i * a ^ (natDegree p - i - 1) * a = coeff p i * a ^ (natDegree p - i)

tactic: rw [mul_assoc, ← pow_succ', tsub_add_cancel_of_le this]
state_before: case h.e'_2.h.e'_3
R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
hq✝ : a ^ (natDegree p - natDegree p) + ∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 0
hq : -∑ x in Finset.range (natDegree p), coeff p x * a ^ (natDegree p - x) = 1
i : ℕ
hi : i ∈ Finset.range (natDegree p)
this : 1 ≤ natDegree p - i
⊢ coeff p i * a ^ (natDegree p - i - 1) * a = coeff p i * a ^ (natDegree p - i)

tactic: apply (injective_iff_map_eq_zero (algebraMap R S)).mp hRS
state_before: R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
⊢ ∑ i in Finset.range (natDegree p + 1), coeff p i * a ^ (natDegree p - i) = 0

tactic: have a_inv_ne_zero : a_inv ≠ 0 := right_ne_zero_of_mul (mt ha_inv.symm.trans one_ne_zero)
state_before: case a
R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
⊢ ↑(algebraMap R S) (∑ i in Finset.range (natDegree p + 1), coeff p i * a ^ (natDegree p - i)) = 0

tactic: refine' (mul_eq_zero.mp _).resolve_right (pow_ne_zero p.natDegree a_inv_ne_zero)
state_before: case a
R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
a_inv_ne_zero : a_inv ≠ 0
⊢ ↑(algebraMap R S) (∑ i in Finset.range (natDegree p + 1), coeff p i * a ^ (natDegree p - i)) = 0

tactic: rw [eval₂_eq_sum_range] at hp
state_before: case a
R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : eval₂ (algebraMap R S) a_inv p = 0
a_inv_ne_zero : a_inv ≠ 0
⊢ ↑(algebraMap R S) (∑ i in Finset.range (natDegree p + 1), coeff p i * a ^ (natDegree p - i)) * a_inv ^ natDegree p = 0

tactic: rw [map_sum, Finset.sum_mul]
state_before: case a
R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : ∑ i in Finset.range (natDegree p + 1), ↑(algebraMap R S) (coeff p i) * a_inv ^ i = 0
a_inv_ne_zero : a_inv ≠ 0
⊢ ↑(algebraMap R S) (∑ i in Finset.range (natDegree p + 1), coeff p i * a ^ (natDegree p - i)) * a_inv ^ natDegree p = 0

tactic: refine' (Finset.sum_congr rfl fun i hi => _).trans hp
state_before: case a
R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : ∑ i in Finset.range (natDegree p + 1), ↑(algebraMap R S) (coeff p i) * a_inv ^ i = 0
a_inv_ne_zero : a_inv ≠ 0
⊢ ∑ x in Finset.range (natDegree p + 1), ↑(algebraMap R S) (coeff p x * a ^ (natDegree p - x)) * a_inv ^ natDegree p = 0

tactic: rw [RingHom.map_mul, mul_assoc]
state_before: case a
R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : ∑ i in Finset.range (natDegree p + 1), ↑(algebraMap R S) (coeff p i) * a_inv ^ i = 0
a_inv_ne_zero : a_inv ≠ 0
i : ℕ
hi : i ∈ Finset.range (natDegree p + 1)
⊢ ↑(algebraMap R S) (coeff p i * a ^ (natDegree p - i)) * a_inv ^ natDegree p =
    ↑(algebraMap R S) (coeff p i) * a_inv ^ i

tactic: congr
state_before: case a
R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : ∑ i in Finset.range (natDegree p + 1), ↑(algebraMap R S) (coeff p i) * a_inv ^ i = 0
a_inv_ne_zero : a_inv ≠ 0
i : ℕ
hi : i ∈ Finset.range (natDegree p + 1)
⊢ ↑(algebraMap R S) (coeff p i) * (↑(algebraMap R S) (a ^ (natDegree p - i)) * a_inv ^ natDegree p) =
    ↑(algebraMap R S) (coeff p i) * a_inv ^ i

tactic: have : a_inv ^ p.natDegree = a_inv ^ (p.natDegree - i) * a_inv ^ i := by
  rw [← pow_add a_inv, tsub_add_cancel_of_le (Nat.le_of_lt_succ (Finset.mem_range.mp hi))]
state_before: case a.e_a
R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : ∑ i in Finset.range (natDegree p + 1), ↑(algebraMap R S) (coeff p i) * a_inv ^ i = 0
a_inv_ne_zero : a_inv ≠ 0
i : ℕ
hi : i ∈ Finset.range (natDegree p + 1)
⊢ ↑(algebraMap R S) (a ^ (natDegree p - i)) * a_inv ^ natDegree p = a_inv ^ i

tactic: rw [RingHom.map_pow, this, ← mul_assoc, ← mul_pow, ha_inv, one_pow, one_mul]
state_before: case a.e_a
R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : ∑ i in Finset.range (natDegree p + 1), ↑(algebraMap R S) (coeff p i) * a_inv ^ i = 0
a_inv_ne_zero : a_inv ≠ 0
i : ℕ
hi : i ∈ Finset.range (natDegree p + 1)
this : a_inv ^ natDegree p = a_inv ^ (natDegree p - i) * a_inv ^ i
⊢ ↑(algebraMap R S) (a ^ (natDegree p - i)) * a_inv ^ natDegree p = a_inv ^ i

tactic: rw [← pow_add a_inv, tsub_add_cancel_of_le (Nat.le_of_lt_succ (Finset.mem_range.mp hi))]
state_before: R✝ : Type ?u.1593781
A : Type ?u.1593784
B : Type ?u.1593787
S✝ : Type ?u.1593790
T : Type ?u.1593793
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing A
inst✝¹¹ : CommRing B
inst✝¹⁰ : CommRing S✝
inst✝⁹ : CommRing T
inst✝⁸ : Algebra A B
inst✝⁷ : Algebra R✝ B
f : R✝ →+* S✝
g : S✝ →+* T
inst✝⁶ : Algebra R✝ A
inst✝⁵ : IsScalarTower R✝ A B
R : Type u_1
S : Type u_2
inst✝⁴ : CommRing R
inst✝³ : Nontrivial R
inst✝² : CommRing S
inst✝¹ : IsDomain S
inst✝ : Algebra R S
H : Algebra.IsIntegral R S
hRS : Function.Injective ↑(algebraMap R S)
hS : IsField S
a : R
ha : a ≠ 0
a_inv : S
ha_inv : ↑(algebraMap R S) a * a_inv = 1
p : R[X]
p_monic : Monic p
hp : ∑ i in Finset.range (natDegree p + 1), ↑(algebraMap R S) (coeff p i) * a_inv ^ i = 0
a_inv_ne_zero : a_inv ≠ 0
i : ℕ
hi : i ∈ Finset.range (natDegree p + 1)
⊢ a_inv ^ natDegree p = a_inv ^ (natDegree p - i) * a_inv ^ i