Theorem: Valuation.Integers.mem_of_integral
File: Mathlib/RingTheory/Valuation/Integral.lean

tactic: rw [hpm.as_sum, eval₂_add, eval₂_pow, eval₂_X, eval₂_finset_sum, add_eq_zero_iff_eq_neg] at hpx
state_before: R : Type u
Γ₀ : Type v
inst✝³ : CommRing R
inst✝² : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x : R
hx : IsIntegral O x
p : O[X]
hpm : Monic p
hpx : eval₂ (algebraMap O R) x p = 0
hvx : 1 < ↑v x
⊢ False

tactic: replace hpx := congr_arg v hpx
state_before: R : Type u
Γ₀ : Type v
inst✝³ : CommRing R
inst✝² : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x : R
hx : IsIntegral O x
p : O[X]
hpm : Monic p
hpx : x ^ natDegree p = -∑ i in Finset.range (natDegree p), eval₂ (algebraMap O R) x (↑C (coeff p i) * X ^ i)
hvx : 1 < ↑v x
⊢ False

tactic: refine' ne_of_gt _ hpx
state_before: R : Type u
Γ₀ : Type v
inst✝³ : CommRing R
inst✝² : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x : R
hx : IsIntegral O x
p : O[X]
hpm : Monic p
hvx : 1 < ↑v x
hpx : ↑v (x ^ natDegree p) = ↑v (-∑ i in Finset.range (natDegree p), eval₂ (algebraMap O R) x (↑C (coeff p i) * X ^ i))
⊢ False

tactic: rw [v.map_neg, v.map_pow]
state_before: R : Type u
Γ₀ : Type v
inst✝³ : CommRing R
inst✝² : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x : R
hx : IsIntegral O x
p : O[X]
hpm : Monic p
hvx : 1 < ↑v x
hpx : ↑v (x ^ natDegree p) = ↑v (-∑ i in Finset.range (natDegree p), eval₂ (algebraMap O R) x (↑C (coeff p i) * X ^ i))
⊢ ↑v (-∑ i in Finset.range (natDegree p), eval₂ (algebraMap O R) x (↑C (coeff p i) * X ^ i)) < ↑v (x ^ natDegree p)

tactic: refine' v.map_sum_lt' (zero_lt_one.trans_le (one_le_pow_of_one_le' hvx.le _)) fun i hi => _
state_before: R : Type u
Γ₀ : Type v
inst✝³ : CommRing R
inst✝² : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x : R
hx : IsIntegral O x
p : O[X]
hpm : Monic p
hvx : 1 < ↑v x
hpx : ↑v (x ^ natDegree p) = ↑v (-∑ i in Finset.range (natDegree p), eval₂ (algebraMap O R) x (↑C (coeff p i) * X ^ i))
⊢ ↑v (∑ i in Finset.range (natDegree p), eval₂ (algebraMap O R) x (↑C (coeff p i) * X ^ i)) < ↑v x ^ natDegree p

tactic: rw [eval₂_mul, eval₂_pow, eval₂_C, eval₂_X, v.map_mul, v.map_pow, ←
  one_mul (v x ^ p.natDegree)]
state_before: R : Type u
Γ₀ : Type v
inst✝³ : CommRing R
inst✝² : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x : R
hx : IsIntegral O x
p : O[X]
hpm : Monic p
hvx : 1 < ↑v x
hpx : ↑v (x ^ natDegree p) = ↑v (-∑ i in Finset.range (natDegree p), eval₂ (algebraMap O R) x (↑C (coeff p i) * X ^ i))
i : ℕ
hi : i ∈ Finset.range (natDegree p)
⊢ ↑v (eval₂ (algebraMap O R) x (↑C (coeff p i) * X ^ i)) < ↑v x ^ natDegree p

tactic: cases' (hv.2 <| p.coeff i).lt_or_eq with hvpi hvpi
state_before: R : Type u
Γ₀ : Type v
inst✝³ : CommRing R
inst✝² : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x : R
hx : IsIntegral O x
p : O[X]
hpm : Monic p
hvx : 1 < ↑v x
hpx : ↑v (x ^ natDegree p) = ↑v (-∑ i in Finset.range (natDegree p), eval₂ (algebraMap O R) x (↑C (coeff p i) * X ^ i))
i : ℕ
hi : i ∈ Finset.range (natDegree p)
⊢ ↑v (↑(algebraMap O R) (coeff p i)) * ↑v x ^ i < 1 * ↑v x ^ natDegree p

tactic: exact mul_lt_mul₀ hvpi (pow_lt_pow₀ hvx <| Finset.mem_range.1 hi)
state_before: case inl
R : Type u
Γ₀ : Type v
inst✝³ : CommRing R
inst✝² : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x : R
hx : IsIntegral O x
p : O[X]
hpm : Monic p
hvx : 1 < ↑v x
hpx : ↑v (x ^ natDegree p) = ↑v (-∑ i in Finset.range (natDegree p), eval₂ (algebraMap O R) x (↑C (coeff p i) * X ^ i))
i : ℕ
hi : i ∈ Finset.range (natDegree p)
hvpi : ↑v (↑(algebraMap O R) (coeff p i)) < 1
⊢ ↑v (↑(algebraMap O R) (coeff p i)) * ↑v x ^ i < 1 * ↑v x ^ natDegree p

tactic: erw [hvpi]
state_before: case inr
R : Type u
Γ₀ : Type v
inst✝³ : CommRing R
inst✝² : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x : R
hx : IsIntegral O x
p : O[X]
hpm : Monic p
hvx : 1 < ↑v x
hpx : ↑v (x ^ natDegree p) = ↑v (-∑ i in Finset.range (natDegree p), eval₂ (algebraMap O R) x (↑C (coeff p i) * X ^ i))
i : ℕ
hi : i ∈ Finset.range (natDegree p)
hvpi : ↑v (↑(algebraMap O R) (coeff p i)) = 1
⊢ ↑v (↑(algebraMap O R) (coeff p i)) * ↑v x ^ i < 1 * ↑v x ^ natDegree p

tactic: rw [one_mul, one_mul]
state_before: case inr
R : Type u
Γ₀ : Type v
inst✝³ : CommRing R
inst✝² : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x : R
hx : IsIntegral O x
p : O[X]
hpm : Monic p
hvx : 1 < ↑v x
hpx : ↑v (x ^ natDegree p) = ↑v (-∑ i in Finset.range (natDegree p), eval₂ (algebraMap O R) x (↑C (coeff p i) * X ^ i))
i : ℕ
hi : i ∈ Finset.range (natDegree p)
hvpi : ↑v (↑(algebraMap O R) (coeff p i)) = 1
⊢ 1 * ↑v x ^ i < 1 * ↑v x ^ natDegree p

tactic: exact pow_lt_pow₀ hvx (Finset.mem_range.1 hi)
state_before: case inr
R : Type u
Γ₀ : Type v
inst✝³ : CommRing R
inst✝² : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
O : Type w
inst✝¹ : CommRing O
inst✝ : Algebra O R
hv : Integers v O
x : R
hx : IsIntegral O x
p : O[X]
hpm : Monic p
hvx : 1 < ↑v x
hpx : ↑v (x ^ natDegree p) = ↑v (-∑ i in Finset.range (natDegree p), eval₂ (algebraMap O R) x (↑C (coeff p i) * X ^ i))
i : ℕ
hi : i ∈ Finset.range (natDegree p)
hvpi : ↑v (↑(algebraMap O R) (coeff p i)) = 1
⊢ ↑v x ^ i < ↑v x ^ natDegree p