Theorem: Polynomial.IsWeaklyEisensteinAt.exists_mem_adjoin_mul_eq_pow_natDegree
File: Mathlib/RingTheory/Polynomial/Eisenstein/Basic.lean

Proof steps:
state_before: R : Type u
inst✝² : CommRing R
𝓟 : Ideal R
f : R[X]
hf✝ : f.IsWeaklyEisensteinAt 𝓟
S : Type v
inst✝¹ : CommRing S
inst✝ : Algebra R S
p : R
x : S
hx : (aeval x) f = 0
hmo : f.Monic
hf : f.IsWeaklyEisensteinAt (Submodule.span R {p})
⊢ ∃ y ∈ adjoin R {x}, (algebraMap R S) p * y = x ^ (Polynomial.map (algebraMap R S) f).natDegree
state_after: R : Type u
inst✝² : CommRing R
𝓟 : Ideal R
f : R[X]
hf✝ : f.IsWeaklyEisensteinAt 𝓟
S : Type v
inst✝¹ : CommRing S
inst✝ : Algebra R S
p : R
x : S
hx :
  x ^ (Polynomial.map (algebraMap R S) f).natDegree +
      ∑ i : Fin (Polynomial.map (algebraMap R S) f).natDegree, (Polynomial.map (algebraMap R S) f).coeff ↑i * x ^ ↑i =
    0
hmo : f.Monic
hf : f.IsWeaklyEisensteinAt (Submodule.span R {p})
⊢ ∃ y ∈ adjoin R {x}, (algebraMap R S) p * y = x ^ (Polynomial.map (algebraMap R S) f).natDegree
tactic: rw [aeval_def, Polynomial.eval₂_eq_eval_map, eval_eq_sum_range, range_add_one,
    sum_insert not_mem_range_self, sum_range, (hmo.map (algebraMap R S)).coeff_natDegree,
    one_mul] at hx
state_before: R : Type u
inst✝² : CommRing R
𝓟 : Ideal R
f : R[X]
hf✝ : f.IsWeaklyEisensteinAt 𝓟
S : Type v
inst✝¹ : CommRing S
inst✝ : Algebra R S
p : R
x : S
hx :
  x ^ (Polynomial.map (algebraMap R S) f).natDegree +
      ∑ i : Fin (Polynomial.map (algebraMap R S) f).natDegree, (Polynomial.map (algebraMap R S) f).coeff ↑i * x ^ ↑i =
    0
hmo : f.Monic
hf : f.IsWeaklyEisensteinAt (Submodule.span R {p})
⊢ ∃ y ∈ adjoin R {x}, (algebraMap R S) p * y = x ^ (Polynomial.map (algebraMap R S) f).natDegree
state_after: R : Type u
inst✝² : CommRing R
𝓟 : Ideal R
f : R[X]
hf✝ : f.IsWeaklyEisensteinAt 𝓟
S : Type v
inst✝¹ : CommRing S
inst✝ : Algebra R S
p : R
x : S
hmo : f.Monic
hf : f.IsWeaklyEisensteinAt (Submodule.span R {p})
hx :
  x ^ (Polynomial.map (algebraMap R S) f).natDegree =
    -∑ i : Fin (Polynomial.map (algebraMap R S) f).natDegree, (Polynomial.map (algebraMap R S) f).coeff ↑i * x ^ ↑i
⊢ ∃ y ∈ adjoin R {x}, (algebraMap R S) p * y = x ^ (Polynomial.map (algebraMap R S) f).natDegree
tactic: replace hx := eq_neg_of_add_eq_zero_left hx
state_before: R : Type u
inst✝² : CommRing R
𝓟 : Ideal R
f : R[X]
hf✝ : f.IsWeaklyEisensteinAt 𝓟
S : Type v
inst✝¹ : CommRing S
inst✝ : Algebra R S
p : R
x : S
hmo : f.Monic
hf : f.IsWeaklyEisensteinAt (Submodule.span R {p})
hx :
  x ^ (Polynomial.map (algebraMap R S) f).natDegree =
    -∑ i : Fin (Polynomial.map (algebraMap R S) f).natDegree, (Polynomial.map (algebraMap R S) f).coeff ↑i * x ^ ↑i
⊢ ∃ y ∈ adjoin R {x}, (algebraMap R S) p * y = x ^ (Polynomial.map (algebraMap R S) f).natDegree
state_after: R : Type u
inst✝² : CommRing R
𝓟 : Ideal R
f : R[X]
hf✝ : f.IsWeaklyEisensteinAt 𝓟
S : Type v
inst✝¹ : CommRing S
inst✝ : Algebra R S
p : R
x : S
hmo : f.Monic
hf : f.IsWeaklyEisensteinAt (Submodule.span R {p})
hx :
  x ^ (Polynomial.map (algebraMap R S) f).natDegree =
    -∑ i : Fin (Polynomial.map (algebraMap R S) f).natDegree, (Polynomial.map (algebraMap R S) f).coeff ↑i * x ^ ↑i
this : ∀ n < f.natDegree, p ∣ f.coeff n
⊢ ∃ y ∈ adjoin R {x}, (algebraMap R S) p * y = x ^ (Polynomial.map (algebraMap R S) f).natDegree
tactic: have : ∀ n < f.natDegree, p ∣ f.coeff n := by
    intro n hn
    exact mem_span_singleton.1 (by simpa using hf.mem hn)
state_before: R : Type u
inst✝² : CommRing R
𝓟 : Ideal R
f : R[X]
hf✝ : f.IsWeaklyEisensteinAt 𝓟
S : Type v
inst✝¹ : CommRing S
inst✝ : Algebra R S
p : R
x : S
hmo : f.Monic
hf : f.IsWeaklyEisensteinAt (Submodule.span R {p})
hx :
  x ^ (Polynomial.map (algebraMap R S) f).natDegree =
    -∑ i : Fin (Polynomial.map (algebraMap R S) f).natDegree, (Polynomial.map (algebraMap R S) f).coeff ↑i * x ^ ↑i
this : ∀ n < f.natDegree, p ∣ f.coeff n
⊢ ∃ y ∈ adjoin R {x}, (algebraMap R S) p * y = x ^ (Polynomial.map (algebraMap R S) f).natDegree
state_after: R : Type u
inst✝² : CommRing R
𝓟 : Ideal R
f : R[X]
hf✝ : f.IsWeaklyEisensteinAt 𝓟
S : Type v
inst✝¹ : CommRing S
inst✝ : Algebra R S
p : R
x : S
hmo : f.Monic
hf : f.IsWeaklyEisensteinAt (Submodule.span R {p})
hx :
  x ^ (Polynomial.map (algebraMap R S) f).natDegree =
    -∑ i : Fin (Polynomial.map (algebraMap R S) f).natDegree, (Polynomial.map (algebraMap R S) f).coeff ↑i * x ^ ↑i
φ : ℕ → R
hφ : ∀ n < f.natDegree, f.coeff n = p * φ n
⊢ ∃ y ∈ adjoin R {x}, (algebraMap R S) p * y = x ^ (Polynomial.map (algebraMap R S) f).natDegree
tactic: choose! φ hφ using this
state_before: R : Type u
inst✝² : CommRing R
𝓟 : Ideal R
f : R[X]
hf✝ : f.IsWeaklyEisensteinAt 𝓟
S : Type v
inst✝¹ : CommRing S
inst✝ : Algebra R S
p : R
x : S
hmo : f.Monic
hf : f.IsWeaklyEisensteinAt (Submodule.span R {p})
φ : ℕ → R
hx :
  x ^ (Polynomial.map (algebraMap R S) f).natDegree =
    -∑ i : Fin (Polynomial.map (algebraMap R S) f).natDegree, (algebraMap R S) p * ((algebraMap R S) (φ ↑i) * x ^ ↑i)
hφ : ∀ n < f.natDegree, f.coeff n = p * φ n
⊢ ∃ y ∈ adjoin R {x}, (algebraMap R S) p * y = x ^ (Polynomial.map (algebraMap R S) f).natDegree
state_after: R : Type u
inst✝² : CommRing R
𝓟 : Ideal R
f : R[X]
hf✝ : f.IsWeaklyEisensteinAt 𝓟
S : Type v
inst✝¹ : CommRing S
inst✝ : Algebra R S
p : R
x : S
hmo : f.Monic
hf : f.IsWeaklyEisensteinAt (Submodule.span R {p})
φ : ℕ → R
hx :
  x ^ (Polynomial.map (algebraMap R S) f).natDegree =
    -∑ i : Fin (Polynomial.map (algebraMap R S) f).natDegree, (algebraMap R S) p * ((algebraMap R S) (φ ↑i) * x ^ ↑i)
hφ : ∀ n < f.natDegree, f.coeff n = p * φ n
⊢ ∃ y ∈ adjoin R {x},
    (algebraMap R S) p * y =
      (algebraMap R S) p *
        (-1 * ∑ i : Fin (Polynomial.map (algebraMap R S) f).natDegree, (algebraMap R S) (φ ↑i) * x ^ ↑i)
tactic: rw [hx, ← mul_sum, neg_eq_neg_one_mul, ← mul_assoc (-1 : S), mul_comm (-1 : S), mul_assoc]
state_before: R : Type u
inst✝² : CommRing R
𝓟 : Ideal R
f : R[X]
hf✝ : f.IsWeaklyEisensteinAt 𝓟
S : Type v
inst✝¹ : CommRing S
inst✝ : Algebra R S
p : R
x : S
hmo : f.Monic
hf : f.IsWeaklyEisensteinAt (Submodule.span R {p})
φ : ℕ → R
hx :
  x ^ (Polynomial.map (algebraMap R S) f).natDegree =
    -∑ i : Fin (Polynomial.map (algebraMap R S) f).natDegree, (algebraMap R S) p * ((algebraMap R S) (φ ↑i) * x ^ ↑i)
hφ : ∀ n < f.natDegree, f.coeff n = p * φ n
⊢ ∃ y ∈ adjoin R {x},
    (algebraMap R S) p * y =
      (algebraMap R S) p *
        (-1 * ∑ i : Fin (Polynomial.map (algebraMap R S) f).natDegree, (algebraMap R S) (φ ↑i) * x ^ ↑i)
state_after: R : Type u
inst✝² : CommRing R
𝓟 : Ideal R
f : R[X]
hf✝ : f.IsWeaklyEisensteinAt 𝓟
S : Type v
inst✝¹ : CommRing S
inst✝ : Algebra R S
p : R
x : S
hmo : f.Monic
hf : f.IsWeaklyEisensteinAt (Submodule.span R {p})
φ : ℕ → R
hx :
  x ^ (Polynomial.map (algebraMap R S) f).natDegree =
    -∑ i : Fin (Polynomial.map (algebraMap R S) f).natDegree, (algebraMap R S) p * ((algebraMap R S) (φ ↑i) * x ^ ↑i)
hφ : ∀ n < f.natDegree, f.coeff n = p * φ n
⊢ -1 * ∑ i : Fin (Polynomial.map (algebraMap R S) f).natDegree, (algebraMap R S) (φ ↑i) * x ^ ↑i ∈ adjoin R {x}
tactic: refine
    ⟨-1 * ∑ i : Fin (f.map (algebraMap R S)).natDegree, (algebraMap R S) (φ i.1) * x ^ i.1, ?_, rfl⟩
state_before: R : Type u
inst✝² : CommRing R
𝓟 : Ideal R
f : R[X]
hf✝ : f.IsWeaklyEisensteinAt 𝓟
S : Type v
inst✝¹ : CommRing S
inst✝ : Algebra R S
p : R
x : S
hmo : f.Monic
hf : f.IsWeaklyEisensteinAt (Submodule.span R {p})
φ : ℕ → R
hx :
  x ^ (Polynomial.map (algebraMap R S) f).natDegree =
    -∑ i : Fin (Polynomial.map (algebraMap R S) f).natDegree, (algebraMap R S) p * ((algebraMap R S) (φ ↑i) * x ^ ↑i)
hφ : ∀ n < f.natDegree, f.coeff n = p * φ n
⊢ -1 * ∑ i : Fin (Polynomial.map (algebraMap R S) f).natDegree, (algebraMap R S) (φ ↑i) * x ^ ↑i ∈ adjoin R {x}
state_after: no goals
tactic: exact
    Subalgebra.mul_mem _ (Subalgebra.neg_mem _ (Subalgebra.one_mem _))
      (Subalgebra.sum_mem _ fun i _ =>
        Subalgebra.mul_mem _ (Subalgebra.algebraMap_mem _ _)
          (Subalgebra.pow_mem _ (subset_adjoin (Set.mem_singleton x)) _))