l3lab/ntp-mathlib huggingface dataset:
theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
    (hp : p.leadingCoeff ∈ (algebraMap R Rₘ).range) :
    p.scaleRoots (algebraMap R Rₘ <| IsLocalization.commonDenom M p.support p.coeff) ∈
      Polynomial.lifts (algebraMap R Rₘ) := by
  

Proof state:
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type u_3
inst✝⁶ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
p : Rₘ[X]
hp : leadingCoeff p ∈ RingHom.range (algebraMap R Rₘ)
⊢ scaleRoots p ((algebraMap R Rₘ) ↑(commonDenom M (support p) (coeff p))) ∈ lifts (algebraMap R Rₘ)

Next tactic:
rw [Polynomial.lifts_iff_coeff_lifts]
theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
    (hp : p.leadingCoeff ∈ (algebraMap R Rₘ).range) :
    p.scaleRoots (algebraMap R Rₘ <| IsLocalization.commonDenom M p.support p.coeff) ∈
      Polynomial.lifts (algebraMap R Rₘ) := by
  rw [Polynomial.lifts_iff_coeff_lifts]
  

Proof state:
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type u_3
inst✝⁶ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
p : Rₘ[X]
hp : leadingCoeff p ∈ RingHom.range (algebraMap R Rₘ)
⊢ ∀ (n : ℕ),
    coeff (scaleRoots p ((algebraMap R Rₘ) ↑(commonDenom M (support p) (coeff p)))) n ∈ Set.range ⇑(algebraMap R Rₘ)

Next tactic:
intro n
theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
    (hp : p.leadingCoeff ∈ (algebraMap R Rₘ).range) :
    p.scaleRoots (algebraMap R Rₘ <| IsLocalization.commonDenom M p.support p.coeff) ∈
      Polynomial.lifts (algebraMap R Rₘ) := by
  rw [Polynomial.lifts_iff_coeff_lifts]
  intro n
  

Proof state:
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type u_3
inst✝⁶ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
p : Rₘ[X]
hp : leadingCoeff p ∈ RingHom.range (algebraMap R Rₘ)
n : ℕ
⊢ coeff (scaleRoots p ((algebraMap R Rₘ) ↑(commonDenom M (support p) (coeff p)))) n ∈ Set.range ⇑(algebraMap R Rₘ)

Next tactic:
rw [Polynomial.coeff_scaleRoots]
theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
    (hp : p.leadingCoeff ∈ (algebraMap R Rₘ).range) :
    p.scaleRoots (algebraMap R Rₘ <| IsLocalization.commonDenom M p.support p.coeff) ∈
      Polynomial.lifts (algebraMap R Rₘ) := by
  rw [Polynomial.lifts_iff_coeff_lifts]
  intro n
  rw [Polynomial.coeff_scaleRoots]
  

Proof state:
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type u_3
inst✝⁶ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
p : Rₘ[X]
hp : leadingCoeff p ∈ RingHom.range (algebraMap R Rₘ)
n : ℕ
⊢ coeff p n * (algebraMap R Rₘ) ↑(commonDenom M (support p) (coeff p)) ^ (natDegree p - n) ∈
    Set.range ⇑(algebraMap R Rₘ)

Next tactic:
by_cases h₁ : n ∈ p.support
theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
    (hp : p.leadingCoeff ∈ (algebraMap R Rₘ).range) :
    p.scaleRoots (algebraMap R Rₘ <| IsLocalization.commonDenom M p.support p.coeff) ∈
      Polynomial.lifts (algebraMap R Rₘ) := by
  rw [Polynomial.lifts_iff_coeff_lifts]
  intro n
  rw [Polynomial.coeff_scaleRoots]
  by_cases h₁ : n ∈ p.support
  

Proof state:
case pos
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type u_3
inst✝⁶ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
p : Rₘ[X]
hp : leadingCoeff p ∈ RingHom.range (algebraMap R Rₘ)
n : ℕ
h₁ : n ∈ support p
⊢ coeff p n * (algebraMap R Rₘ) ↑(commonDenom M (support p) (coeff p)) ^ (natDegree p - n) ∈
    Set.range ⇑(algebraMap R Rₘ)
case neg
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type u_3
inst✝⁶ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
p : Rₘ[X]
hp : leadingCoeff p ∈ RingHom.range (algebraMap R Rₘ)
n : ℕ
h₁ : n ∉ support p
⊢ coeff p n * (algebraMap R Rₘ) ↑(commonDenom M (support p) (coeff p)) ^ (natDegree p - n) ∈
    Set.range ⇑(algebraMap R Rₘ)

Next tactic:
by_cases h₂ : n = p.natDegree
theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
    (hp : p.leadingCoeff ∈ (algebraMap R Rₘ).range) :
    p.scaleRoots (algebraMap R Rₘ <| IsLocalization.commonDenom M p.support p.coeff) ∈
      Polynomial.lifts (algebraMap R Rₘ) := by
  rw [Polynomial.lifts_iff_coeff_lifts]
  intro n
  rw [Polynomial.coeff_scaleRoots]
  by_cases h₁ : n ∈ p.support
  by_cases h₂ : n = p.natDegree
  · 

Proof state:
case pos
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type u_3
inst✝⁶ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
p : Rₘ[X]
hp : leadingCoeff p ∈ RingHom.range (algebraMap R Rₘ)
n : ℕ
h₁ : n ∈ support p
h₂ : n = natDegree p
⊢ coeff p n * (algebraMap R Rₘ) ↑(commonDenom M (support p) (coeff p)) ^ (natDegree p - n) ∈
    Set.range ⇑(algebraMap R Rₘ)

Next tactic:
rwa [h₂, Polynomial.coeff_natDegree, tsub_self, pow_zero, _root_.mul_one]
theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
    (hp : p.leadingCoeff ∈ (algebraMap R Rₘ).range) :
    p.scaleRoots (algebraMap R Rₘ <| IsLocalization.commonDenom M p.support p.coeff) ∈
      Polynomial.lifts (algebraMap R Rₘ) := by
  rw [Polynomial.lifts_iff_coeff_lifts]
  intro n
  rw [Polynomial.coeff_scaleRoots]
  by_cases h₁ : n ∈ p.support
  by_cases h₂ : n = p.natDegree
  · rwa [h₂, Polynomial.coeff_natDegree, tsub_self, pow_zero, _root_.mul_one]
  · 

Proof state:
case neg
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type u_3
inst✝⁶ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
p : Rₘ[X]
hp : leadingCoeff p ∈ RingHom.range (algebraMap R Rₘ)
n : ℕ
h₁ : n ∈ support p
h₂ : ¬n = natDegree p
⊢ coeff p n * (algebraMap R Rₘ) ↑(commonDenom M (support p) (coeff p)) ^ (natDegree p - n) ∈
    Set.range ⇑(algebraMap R Rₘ)

Next tactic:
have : n + 1 ≤ p.natDegree := lt_of_le_of_ne (Polynomial.le_natDegree_of_mem_supp _ h₁) h₂
theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
    (hp : p.leadingCoeff ∈ (algebraMap R Rₘ).range) :
    p.scaleRoots (algebraMap R Rₘ <| IsLocalization.commonDenom M p.support p.coeff) ∈
      Polynomial.lifts (algebraMap R Rₘ) := by
  rw [Polynomial.lifts_iff_coeff_lifts]
  intro n
  rw [Polynomial.coeff_scaleRoots]
  by_cases h₁ : n ∈ p.support
  by_cases h₂ : n = p.natDegree
  · rwa [h₂, Polynomial.coeff_natDegree, tsub_self, pow_zero, _root_.mul_one]
  · have : n + 1 ≤ p.natDegree := lt_of_le_of_ne (Polynomial.le_natDegree_of_mem_supp _ h₁) h₂
    

Proof state:
case neg
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type u_3
inst✝⁶ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
p : Rₘ[X]
hp : leadingCoeff p ∈ RingHom.range (algebraMap R Rₘ)
n : ℕ
h₁ : n ∈ support p
h₂ : ¬n = natDegree p
this : n + 1 ≤ natDegree p
⊢ coeff p n * (algebraMap R Rₘ) ↑(commonDenom M (support p) (coeff p)) ^ (natDegree p - n) ∈
    Set.range ⇑(algebraMap R Rₘ)

Next tactic:
rw [← tsub_add_cancel_of_le (le_tsub_of_add_le_left this), pow_add, pow_one, mul_comm,
      _root_.mul_assoc, ← map_pow]
theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
    (hp : p.leadingCoeff ∈ (algebraMap R Rₘ).range) :
    p.scaleRoots (algebraMap R Rₘ <| IsLocalization.commonDenom M p.support p.coeff) ∈
      Polynomial.lifts (algebraMap R Rₘ) := by
  rw [Polynomial.lifts_iff_coeff_lifts]
  intro n
  rw [Polynomial.coeff_scaleRoots]
  by_cases h₁ : n ∈ p.support
  by_cases h₂ : n = p.natDegree
  · rwa [h₂, Polynomial.coeff_natDegree, tsub_self, pow_zero, _root_.mul_one]
  · have : n + 1 ≤ p.natDegree := lt_of_le_of_ne (Polynomial.le_natDegree_of_mem_supp _ h₁) h₂
    rw [← tsub_add_cancel_of_le (le_tsub_of_add_le_left this), pow_add, pow_one, mul_comm,
      _root_.mul_assoc, ← map_pow]
    

Proof state:
case neg
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type u_3
inst✝⁶ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
p : Rₘ[X]
hp : leadingCoeff p ∈ RingHom.range (algebraMap R Rₘ)
n : ℕ
h₁ : n ∈ support p
h₂ : ¬n = natDegree p
this : n + 1 ≤ natDegree p
⊢ (algebraMap R Rₘ) (↑(commonDenom M (support p) (coeff p)) ^ (natDegree p - n - 1)) *
      ((algebraMap R Rₘ) ↑(commonDenom M (support p) (coeff p)) * coeff p n) ∈
    Set.range ⇑(algebraMap R Rₘ)

Next tactic:
change _ ∈ (algebraMap R Rₘ).range
theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
    (hp : p.leadingCoeff ∈ (algebraMap R Rₘ).range) :
    p.scaleRoots (algebraMap R Rₘ <| IsLocalization.commonDenom M p.support p.coeff) ∈
      Polynomial.lifts (algebraMap R Rₘ) := by
  rw [Polynomial.lifts_iff_coeff_lifts]
  intro n
  rw [Polynomial.coeff_scaleRoots]
  by_cases h₁ : n ∈ p.support
  by_cases h₂ : n = p.natDegree
  · rwa [h₂, Polynomial.coeff_natDegree, tsub_self, pow_zero, _root_.mul_one]
  · have : n + 1 ≤ p.natDegree := lt_of_le_of_ne (Polynomial.le_natDegree_of_mem_supp _ h₁) h₂
    rw [← tsub_add_cancel_of_le (le_tsub_of_add_le_left this), pow_add, pow_one, mul_comm,
      _root_.mul_assoc, ← map_pow]
    change _ ∈ (algebraMap R Rₘ).range
    

Proof state:
case neg
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type u_3
inst✝⁶ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
p : Rₘ[X]
hp : leadingCoeff p ∈ RingHom.range (algebraMap R Rₘ)
n : ℕ
h₁ : n ∈ support p
h₂ : ¬n = natDegree p
this : n + 1 ≤ natDegree p
⊢ (algebraMap R Rₘ) (↑(commonDenom M (support p) (coeff p)) ^ (natDegree p - n - 1)) *
      ((algebraMap R Rₘ) ↑(commonDenom M (support p) (coeff p)) * coeff p n) ∈
    RingHom.range (algebraMap R Rₘ)

Next tactic:
apply mul_mem
theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
    (hp : p.leadingCoeff ∈ (algebraMap R Rₘ).range) :
    p.scaleRoots (algebraMap R Rₘ <| IsLocalization.commonDenom M p.support p.coeff) ∈
      Polynomial.lifts (algebraMap R Rₘ) := by
  rw [Polynomial.lifts_iff_coeff_lifts]
  intro n
  rw [Polynomial.coeff_scaleRoots]
  by_cases h₁ : n ∈ p.support
  by_cases h₂ : n = p.natDegree
  · rwa [h₂, Polynomial.coeff_natDegree, tsub_self, pow_zero, _root_.mul_one]
  · have : n + 1 ≤ p.natDegree := lt_of_le_of_ne (Polynomial.le_natDegree_of_mem_supp _ h₁) h₂
    rw [← tsub_add_cancel_of_le (le_tsub_of_add_le_left this), pow_add, pow_one, mul_comm,
      _root_.mul_assoc, ← map_pow]
    change _ ∈ (algebraMap R Rₘ).range
    apply mul_mem
    · 

Proof state:
case neg.a
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type u_3
inst✝⁶ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
p : Rₘ[X]
hp : leadingCoeff p ∈ RingHom.range (algebraMap R Rₘ)
n : ℕ
h₁ : n ∈ support p
h₂ : ¬n = natDegree p
this : n + 1 ≤ natDegree p
⊢ (algebraMap R Rₘ) (↑(commonDenom M (support p) (coeff p)) ^ (natDegree p - n - 1)) ∈ RingHom.range (algebraMap R Rₘ)

Next tactic:
exact RingHom.mem_range_self _ _
theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
    (hp : p.leadingCoeff ∈ (algebraMap R Rₘ).range) :
    p.scaleRoots (algebraMap R Rₘ <| IsLocalization.commonDenom M p.support p.coeff) ∈
      Polynomial.lifts (algebraMap R Rₘ) := by
  rw [Polynomial.lifts_iff_coeff_lifts]
  intro n
  rw [Polynomial.coeff_scaleRoots]
  by_cases h₁ : n ∈ p.support
  by_cases h₂ : n = p.natDegree
  · rwa [h₂, Polynomial.coeff_natDegree, tsub_self, pow_zero, _root_.mul_one]
  · have : n + 1 ≤ p.natDegree := lt_of_le_of_ne (Polynomial.le_natDegree_of_mem_supp _ h₁) h₂
    rw [← tsub_add_cancel_of_le (le_tsub_of_add_le_left this), pow_add, pow_one, mul_comm,
      _root_.mul_assoc, ← map_pow]
    change _ ∈ (algebraMap R Rₘ).range
    apply mul_mem
    · exact RingHom.mem_range_self _ _
    · 

Proof state:
case neg.a
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type u_3
inst✝⁶ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
p : Rₘ[X]
hp : leadingCoeff p ∈ RingHom.range (algebraMap R Rₘ)
n : ℕ
h₁ : n ∈ support p
h₂ : ¬n = natDegree p
this : n + 1 ≤ natDegree p
⊢ (algebraMap R Rₘ) ↑(commonDenom M (support p) (coeff p)) * coeff p n ∈ RingHom.range (algebraMap R Rₘ)

Next tactic:
rw [← Algebra.smul_def]
theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
    (hp : p.leadingCoeff ∈ (algebraMap R Rₘ).range) :
    p.scaleRoots (algebraMap R Rₘ <| IsLocalization.commonDenom M p.support p.coeff) ∈
      Polynomial.lifts (algebraMap R Rₘ) := by
  rw [Polynomial.lifts_iff_coeff_lifts]
  intro n
  rw [Polynomial.coeff_scaleRoots]
  by_cases h₁ : n ∈ p.support
  by_cases h₂ : n = p.natDegree
  · rwa [h₂, Polynomial.coeff_natDegree, tsub_self, pow_zero, _root_.mul_one]
  · have : n + 1 ≤ p.natDegree := lt_of_le_of_ne (Polynomial.le_natDegree_of_mem_supp _ h₁) h₂
    rw [← tsub_add_cancel_of_le (le_tsub_of_add_le_left this), pow_add, pow_one, mul_comm,
      _root_.mul_assoc, ← map_pow]
    change _ ∈ (algebraMap R Rₘ).range
    apply mul_mem
    · exact RingHom.mem_range_self _ _
    · rw [← Algebra.smul_def]
      

Proof state:
case neg.a
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type u_3
inst✝⁶ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
p : Rₘ[X]
hp : leadingCoeff p ∈ RingHom.range (algebraMap R Rₘ)
n : ℕ
h₁ : n ∈ support p
h₂ : ¬n = natDegree p
this : n + 1 ≤ natDegree p
⊢ ↑(commonDenom M (support p) (coeff p)) • coeff p n ∈ RingHom.range (algebraMap R Rₘ)

Next tactic:
exact ⟨_, IsLocalization.map_integerMultiple M p.support p.coeff ⟨n, h₁⟩⟩
theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
    (hp : p.leadingCoeff ∈ (algebraMap R Rₘ).range) :
    p.scaleRoots (algebraMap R Rₘ <| IsLocalization.commonDenom M p.support p.coeff) ∈
      Polynomial.lifts (algebraMap R Rₘ) := by
  rw [Polynomial.lifts_iff_coeff_lifts]
  intro n
  rw [Polynomial.coeff_scaleRoots]
  by_cases h₁ : n ∈ p.support
  by_cases h₂ : n = p.natDegree
  · rwa [h₂, Polynomial.coeff_natDegree, tsub_self, pow_zero, _root_.mul_one]
  · have : n + 1 ≤ p.natDegree := lt_of_le_of_ne (Polynomial.le_natDegree_of_mem_supp _ h₁) h₂
    rw [← tsub_add_cancel_of_le (le_tsub_of_add_le_left this), pow_add, pow_one, mul_comm,
      _root_.mul_assoc, ← map_pow]
    change _ ∈ (algebraMap R Rₘ).range
    apply mul_mem
    · exact RingHom.mem_range_self _ _
    · rw [← Algebra.smul_def]
      exact ⟨_, IsLocalization.map_integerMultiple M p.support p.coeff ⟨n, h₁⟩⟩
  · 

Proof state:
case neg
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type u_3
inst✝⁶ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
p : Rₘ[X]
hp : leadingCoeff p ∈ RingHom.range (algebraMap R Rₘ)
n : ℕ
h₁ : n ∉ support p
⊢ coeff p n * (algebraMap R Rₘ) ↑(commonDenom M (support p) (coeff p)) ^ (natDegree p - n) ∈
    Set.range ⇑(algebraMap R Rₘ)

Next tactic:
rw [Polynomial.not_mem_support_iff] at h₁
theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
    (hp : p.leadingCoeff ∈ (algebraMap R Rₘ).range) :
    p.scaleRoots (algebraMap R Rₘ <| IsLocalization.commonDenom M p.support p.coeff) ∈
      Polynomial.lifts (algebraMap R Rₘ) := by
  rw [Polynomial.lifts_iff_coeff_lifts]
  intro n
  rw [Polynomial.coeff_scaleRoots]
  by_cases h₁ : n ∈ p.support
  by_cases h₂ : n = p.natDegree
  · rwa [h₂, Polynomial.coeff_natDegree, tsub_self, pow_zero, _root_.mul_one]
  · have : n + 1 ≤ p.natDegree := lt_of_le_of_ne (Polynomial.le_natDegree_of_mem_supp _ h₁) h₂
    rw [← tsub_add_cancel_of_le (le_tsub_of_add_le_left this), pow_add, pow_one, mul_comm,
      _root_.mul_assoc, ← map_pow]
    change _ ∈ (algebraMap R Rₘ).range
    apply mul_mem
    · exact RingHom.mem_range_self _ _
    · rw [← Algebra.smul_def]
      exact ⟨_, IsLocalization.map_integerMultiple M p.support p.coeff ⟨n, h₁⟩⟩
  · rw [Polynomial.not_mem_support_iff] at h₁
    

Proof state:
case neg
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type u_3
inst✝⁶ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
p : Rₘ[X]
hp : leadingCoeff p ∈ RingHom.range (algebraMap R Rₘ)
n : ℕ
h₁ : coeff p n = 0
⊢ coeff p n * (algebraMap R Rₘ) ↑(commonDenom M (support p) (coeff p)) ^ (natDegree p - n) ∈
    Set.range ⇑(algebraMap R Rₘ)

Next tactic:
rw [h₁, zero_mul]
theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
    (hp : p.leadingCoeff ∈ (algebraMap R Rₘ).range) :
    p.scaleRoots (algebraMap R Rₘ <| IsLocalization.commonDenom M p.support p.coeff) ∈
      Polynomial.lifts (algebraMap R Rₘ) := by
  rw [Polynomial.lifts_iff_coeff_lifts]
  intro n
  rw [Polynomial.coeff_scaleRoots]
  by_cases h₁ : n ∈ p.support
  by_cases h₂ : n = p.natDegree
  · rwa [h₂, Polynomial.coeff_natDegree, tsub_self, pow_zero, _root_.mul_one]
  · have : n + 1 ≤ p.natDegree := lt_of_le_of_ne (Polynomial.le_natDegree_of_mem_supp _ h₁) h₂
    rw [← tsub_add_cancel_of_le (le_tsub_of_add_le_left this), pow_add, pow_one, mul_comm,
      _root_.mul_assoc, ← map_pow]
    change _ ∈ (algebraMap R Rₘ).range
    apply mul_mem
    · exact RingHom.mem_range_self _ _
    · rw [← Algebra.smul_def]
      exact ⟨_, IsLocalization.map_integerMultiple M p.support p.coeff ⟨n, h₁⟩⟩
  · rw [Polynomial.not_mem_support_iff] at h₁
    rw [h₁, zero_mul]
    

Proof state:
case neg
R : Type u_1
inst✝⁹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
P : Type u_3
inst✝⁶ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization M Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
p : Rₘ[X]
hp : leadingCoeff p ∈ RingHom.range (algebraMap R Rₘ)
n : ℕ
h₁ : coeff p n = 0
⊢ 0 ∈ Set.range ⇑(algebraMap R Rₘ)

Next tactic:
exact zero_mem (algebraMap R Rₘ).range
theorem IsIntegral.exists_multiple_integral_of_isLocalization [Algebra Rₘ S] [IsScalarTower R Rₘ S]
    (x : S) (hx : IsIntegral Rₘ x) : ∃ m : M, IsIntegral R (m • x) := by
  

Proof state:
R : Type u_1
inst✝¹¹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝¹⁰ : CommRing S
inst✝⁹ : Algebra R S
P : Type u_3
inst✝⁸ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁷ : CommRing Rₘ
inst✝⁶ : CommRing Sₘ
inst✝⁵ : Algebra R Rₘ
inst✝⁴ : IsLocalization M Rₘ
inst✝³ : Algebra S Sₘ
inst✝² : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
inst✝¹ : Algebra Rₘ S
inst✝ : IsScalarTower R Rₘ S
x : S
hx : IsIntegral Rₘ x
⊢ ∃ m, IsIntegral R (m • x)

Next tactic:
cases' subsingleton_or_nontrivial Rₘ with _ nontriv
theorem IsIntegral.exists_multiple_integral_of_isLocalization [Algebra Rₘ S] [IsScalarTower R Rₘ S]
    (x : S) (hx : IsIntegral Rₘ x) : ∃ m : M, IsIntegral R (m • x) := by
  cases' subsingleton_or_nontrivial Rₘ with _ nontriv <;> 

Proof state:
case inl
R : Type u_1
inst✝¹¹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝¹⁰ : CommRing S
inst✝⁹ : Algebra R S
P : Type u_3
inst✝⁸ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁷ : CommRing Rₘ
inst✝⁶ : CommRing Sₘ
inst✝⁵ : Algebra R Rₘ
inst✝⁴ : IsLocalization M Rₘ
inst✝³ : Algebra S Sₘ
inst✝² : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
inst✝¹ : Algebra Rₘ S
inst✝ : IsScalarTower R Rₘ S
x : S
hx : IsIntegral Rₘ x
h✝ : Subsingleton Rₘ
⊢ ∃ m, IsIntegral R (m • x)

Next tactic:
skip
theorem IsIntegral.exists_multiple_integral_of_isLocalization [Algebra Rₘ S] [IsScalarTower R Rₘ S]
    (x : S) (hx : IsIntegral Rₘ x) : ∃ m : M, IsIntegral R (m • x) := by
  cases' subsingleton_or_nontrivial Rₘ with _ nontriv <;> 

Proof state:
case inr
R : Type u_1
inst✝¹¹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝¹⁰ : CommRing S
inst✝⁹ : Algebra R S
P : Type u_3
inst✝⁸ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁷ : CommRing Rₘ
inst✝⁶ : CommRing Sₘ
inst✝⁵ : Algebra R Rₘ
inst✝⁴ : IsLocalization M Rₘ
inst✝³ : Algebra S Sₘ
inst✝² : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
inst✝¹ : Algebra Rₘ S
inst✝ : IsScalarTower R Rₘ S
x : S
hx : IsIntegral Rₘ x
nontriv : Nontrivial Rₘ
⊢ ∃ m, IsIntegral R (m • x)

Next tactic:
skip
theorem IsIntegral.exists_multiple_integral_of_isLocalization [Algebra Rₘ S] [IsScalarTower R Rₘ S]
    (x : S) (hx : IsIntegral Rₘ x) : ∃ m : M, IsIntegral R (m • x) := by
  cases' subsingleton_or_nontrivial Rₘ with _ nontriv <;> skip
  · 

Proof state:
case inl
R : Type u_1
inst✝¹¹ : CommRing R
M : Submonoid R
S : Type u_2
inst✝¹⁰ : CommRing S
inst✝⁹ : Algebra R S
P : Type u_3
inst✝⁸ : CommRing P
Rₘ : Type u_4
Sₘ : Type u_5
inst✝⁷ : CommRing Rₘ
inst✝⁶ : CommRing Sₘ
inst✝⁵ : Algebra R Rₘ
inst✝⁴ : IsLocalization M Rₘ
inst✝³ : Algebra S Sₘ
inst✝² : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ
inst✝¹ : Algebra Rₘ S
inst✝ : IsScalarTower R Rₘ S
x : S
hx : IsIntegral Rₘ x
h✝ : Subsingleton Rₘ
⊢ ∃ m, IsIntegral R (m • x)

Next tactic:
haveI := (_root_.algebraMap Rₘ S).codomain_trivial