[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
p : ℕ
h✝ : CharP R p
h : ∀ (x : ℕ), ↑x = 0 ↔ p ∣ x
n : ℕ
⊢ ↑n = 0 ↔ p ∣ n
[PROOFSTEP]
rw [← map_natCast C, ← C_0, C_inj, h]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : WithBot ℕ
f : R[X]
⊢ f ∈ degreeLE R n ↔ degree f ≤ n
[PROOFSTEP]
simp only [degreeLE, Submodule.mem_iInf, degree_le_iff_coeff_zero, LinearMap.mem_ker]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : WithBot ℕ
f : R[X]
⊢ (∀ (i : ℕ), ↑i > n → ↑(lcoeff R i) f = 0) ↔ ∀ (m : ℕ), n < ↑m → coeff f m = 0
[PROOFSTEP]
rfl
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
⊢ degreeLE R ↑n = Submodule.span R ↑(image (fun n => X ^ n) (range (n + 1)))
[PROOFSTEP]
apply le_antisymm
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
⊢ degreeLE R ↑n ≤ Submodule.span R ↑(image (fun n => X ^ n) (range (n + 1)))
[PROOFSTEP]
intro p hp
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : p ∈ degreeLE R ↑n
⊢ p ∈ Submodule.span R ↑(image (fun n => X ^ n) (range (n + 1)))
[PROOFSTEP]
replace hp := mem_degreeLE.1 hp
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : degree p ≤ ↑n
⊢ p ∈ Submodule.span R ↑(image (fun n => X ^ n) (range (n + 1)))
[PROOFSTEP]
rw [← Polynomial.sum_monomial_eq p, Polynomial.sum]
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : degree p ≤ ↑n
⊢ ∑ n in support p, ↑(monomial n) (coeff p n) ∈ Submodule.span R ↑(image (fun n => X ^ n) (range (n + 1)))
[PROOFSTEP]
refine' Submodule.sum_mem _ fun k hk => _
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : degree p ≤ ↑n
k : ℕ
hk : k ∈ support p
⊢ ↑(monomial k) (coeff p k) ∈ Submodule.span R ↑(image (fun n => X ^ n) (range (n + 1)))
[PROOFSTEP]
have := WithBot.coe_le_coe.1 (Finset.sup_le_iff.1 hp k hk)
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : degree p ≤ ↑n
k : ℕ
hk : k ∈ support p
this : k ≤ ↑n
⊢ ↑(monomial k) (coeff p k) ∈ Submodule.span R ↑(image (fun n => X ^ n) (range (n + 1)))
[PROOFSTEP]
rw [← C_mul_X_pow_eq_monomial, C_mul']
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : degree p ≤ ↑n
k : ℕ
hk : k ∈ support p
this : k ≤ ↑n
⊢ coeff p k • X ^ k ∈ Submodule.span R ↑(image (fun n => X ^ n) (range (n + 1)))
[PROOFSTEP]
refine'
  Submodule.smul_mem _ _
    (Submodule.subset_span <|
      Finset.mem_coe.2 <| Finset.mem_image.2 ⟨_, Finset.mem_range.2 (Nat.lt_succ_of_le this), rfl⟩)
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
⊢ Submodule.span R ↑(image (fun n => X ^ n) (range (n + 1))) ≤ degreeLE R ↑n
[PROOFSTEP]
rw [Submodule.span_le, Finset.coe_image, Set.image_subset_iff]
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
⊢ ↑(range (n + 1)) ⊆ (fun n => X ^ n) ⁻¹' ↑(degreeLE R ↑n)
[PROOFSTEP]
intro k hk
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n k : ℕ
hk : k ∈ ↑(range (n + 1))
⊢ k ∈ (fun n => X ^ n) ⁻¹' ↑(degreeLE R ↑n)
[PROOFSTEP]
apply mem_degreeLE.2
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n k : ℕ
hk : k ∈ ↑(range (n + 1))
⊢ degree ((fun n => X ^ n) k) ≤ ↑n
[PROOFSTEP]
exact (degree_X_pow_le _).trans (WithBot.coe_le_coe.2 <| Nat.le_of_lt_succ <| Finset.mem_range.1 hk)
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
f : R[X]
⊢ f ∈ degreeLT R n ↔ degree f < ↑n
[PROOFSTEP]
rw [degreeLT, Submodule.mem_iInf]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
f : R[X]
⊢ (∀ (i : ℕ), f ∈ ⨅ (_ : i ≥ n), LinearMap.ker (lcoeff R i)) ↔ degree f < ↑n
[PROOFSTEP]
conv_lhs => intro i; rw [Submodule.mem_iInf]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
f : R[X]
| ∀ (i : ℕ), f ∈ ⨅ (_ : i ≥ n), LinearMap.ker (lcoeff R i)
[PROOFSTEP]
intro i; rw [Submodule.mem_iInf]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
f : R[X]
| ∀ (i : ℕ), f ∈ ⨅ (_ : i ≥ n), LinearMap.ker (lcoeff R i)
[PROOFSTEP]
intro i; rw [Submodule.mem_iInf]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
f : R[X]
| ∀ (i : ℕ), f ∈ ⨅ (_ : i ≥ n), LinearMap.ker (lcoeff R i)
[PROOFSTEP]
intro i
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
f : R[X]
i : ℕ
| f ∈ ⨅ (_ : i ≥ n), LinearMap.ker (lcoeff R i)
[PROOFSTEP]
rw [Submodule.mem_iInf]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
f : R[X]
⊢ (∀ (i : ℕ), i ≥ n → f ∈ LinearMap.ker (lcoeff R i)) ↔ degree f < ↑n
[PROOFSTEP]
rw [degree, Finset.max_eq_sup_coe]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
f : R[X]
⊢ (∀ (i : ℕ), i ≥ n → f ∈ LinearMap.ker (lcoeff R i)) ↔ sup (support f) WithBot.some < ↑n
[PROOFSTEP]
rw [Finset.sup_lt_iff ?_]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
f : R[X]
⊢ (∀ (i : ℕ), i ≥ n → f ∈ LinearMap.ker (lcoeff R i)) ↔ ∀ (b : ℕ), b ∈ support f → ↑b < ↑n
R : Type u S : Type u_1 inst✝ : Semiring R n : ℕ f : R[X] ⊢ ⊥ < ↑n
[PROOFSTEP]
rotate_left
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
f : R[X]
⊢ ⊥ < ↑n
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
f : R[X]
⊢ (∀ (i : ℕ), i ≥ n → f ∈ LinearMap.ker (lcoeff R i)) ↔ ∀ (b : ℕ), b ∈ support f → ↑b < ↑n
[PROOFSTEP]
apply WithBot.bot_lt_coe
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
f : R[X]
⊢ (∀ (i : ℕ), i ≥ n → f ∈ LinearMap.ker (lcoeff R i)) ↔ ∀ (b : ℕ), b ∈ support f → ↑b < ↑n
[PROOFSTEP]
conv_rhs =>
  simp only [mem_support_iff]
  intro b
  rw [Nat.cast_withBot, WithBot.coe_lt_coe, lt_iff_not_le, Ne, not_imp_not]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
f : R[X]
| ∀ (b : ℕ), b ∈ support f → ↑b < ↑n
[PROOFSTEP]
  simp only [mem_support_iff]
  intro b
  rw [Nat.cast_withBot, WithBot.coe_lt_coe, lt_iff_not_le, Ne, not_imp_not]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
f : R[X]
| ∀ (b : ℕ), b ∈ support f → ↑b < ↑n
[PROOFSTEP]
  simp only [mem_support_iff]
  intro b
  rw [Nat.cast_withBot, WithBot.coe_lt_coe, lt_iff_not_le, Ne, not_imp_not]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
f : R[X]
| ∀ (b : ℕ), b ∈ support f → ↑b < ↑n
[PROOFSTEP]
simp only [mem_support_iff]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
f : R[X]
| ∀ (b : ℕ), coeff f b ≠ 0 → ↑b < ↑n
[PROOFSTEP]
intro b
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
f : R[X]
b : ℕ
| coeff f b ≠ 0 → ↑b < ↑n
[PROOFSTEP]
rw [Nat.cast_withBot, WithBot.coe_lt_coe, lt_iff_not_le, Ne, not_imp_not]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
⊢ degreeLT R n = Submodule.span R ↑(image (fun n => X ^ n) (range n))
[PROOFSTEP]
apply le_antisymm
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
⊢ degreeLT R n ≤ Submodule.span R ↑(image (fun n => X ^ n) (range n))
[PROOFSTEP]
intro p hp
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : p ∈ degreeLT R n
⊢ p ∈ Submodule.span R ↑(image (fun n => X ^ n) (range n))
[PROOFSTEP]
replace hp := mem_degreeLT.1 hp
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : degree p < ↑n
⊢ p ∈ Submodule.span R ↑(image (fun n => X ^ n) (range n))
[PROOFSTEP]
rw [← Polynomial.sum_monomial_eq p, Polynomial.sum]
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : degree p < ↑n
⊢ ∑ n in support p, ↑(monomial n) (coeff p n) ∈ Submodule.span R ↑(image (fun n => X ^ n) (range n))
[PROOFSTEP]
refine' Submodule.sum_mem _ fun k hk => _
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : degree p < ↑n
k : ℕ
hk : k ∈ support p
⊢ ↑(monomial k) (coeff p k) ∈ Submodule.span R ↑(image (fun n => X ^ n) (range n))
[PROOFSTEP]
have := WithBot.coe_lt_coe.1 ((Finset.sup_lt_iff <| WithBot.bot_lt_coe n).1 hp k hk)
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : degree p < ↑n
k : ℕ
hk : k ∈ support p
this : k < n
⊢ ↑(monomial k) (coeff p k) ∈ Submodule.span R ↑(image (fun n => X ^ n) (range n))
[PROOFSTEP]
rw [← C_mul_X_pow_eq_monomial, C_mul']
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : degree p < ↑n
k : ℕ
hk : k ∈ support p
this : k < n
⊢ coeff p k • X ^ k ∈ Submodule.span R ↑(image (fun n => X ^ n) (range n))
[PROOFSTEP]
refine'
  Submodule.smul_mem _ _
    (Submodule.subset_span <| Finset.mem_coe.2 <| Finset.mem_image.2 ⟨_, Finset.mem_range.2 this, rfl⟩)
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
⊢ Submodule.span R ↑(image (fun n => X ^ n) (range n)) ≤ degreeLT R n
[PROOFSTEP]
rw [Submodule.span_le, Finset.coe_image, Set.image_subset_iff]
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
⊢ ↑(range n) ⊆ (fun n => X ^ n) ⁻¹' ↑(degreeLT R n)
[PROOFSTEP]
intro k hk
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n k : ℕ
hk : k ∈ ↑(range n)
⊢ k ∈ (fun n => X ^ n) ⁻¹' ↑(degreeLT R n)
[PROOFSTEP]
apply mem_degreeLT.2
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n k : ℕ
hk : k ∈ ↑(range n)
⊢ degree ((fun n => X ^ n) k) < ↑n
[PROOFSTEP]
exact lt_of_le_of_lt (degree_X_pow_le _) (WithBot.coe_lt_coe.2 <| Finset.mem_range.1 hk)
[GOAL]
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
p q : { x // x ∈ degreeLT R n }
⊢ (fun p n_1 => coeff ↑p ↑n_1) (p + q) = (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q
[PROOFSTEP]
ext
[GOAL]
case h
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
p q : { x // x ∈ degreeLT R n }
x✝ : Fin n
⊢ (fun p n_1 => coeff ↑p ↑n_1) (p + q) x✝ = ((fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) x✝
[PROOFSTEP]
dsimp
[GOAL]
case h
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
p q : { x // x ∈ degreeLT R n }
x✝ : Fin n
⊢ coeff (↑p + ↑q) ↑x✝ = coeff ↑p ↑x✝ + coeff ↑q ↑x✝
[PROOFSTEP]
rw [coeff_add]
[GOAL]
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
x : R
p : { x // x ∈ degreeLT R n }
⊢ AddHom.toFun
      { toFun := fun p n_1 => coeff ↑p ↑n_1,
        map_add' :=
          (_ :
            ∀ (p q : { x // x ∈ degreeLT R n }),
              (fun p n_1 => coeff ↑p ↑n_1) (p + q) = (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) }
      (x • p) =
    ↑(RingHom.id R) x •
      AddHom.toFun
        { toFun := fun p n_1 => coeff ↑p ↑n_1,
          map_add' :=
            (_ :
              ∀ (p q : { x // x ∈ degreeLT R n }),
                (fun p n_1 => coeff ↑p ↑n_1) (p + q) =
                  (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) }
        p
[PROOFSTEP]
ext
[GOAL]
case h
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
x : R
p : { x // x ∈ degreeLT R n }
x✝ : Fin n
⊢ AddHom.toFun
      { toFun := fun p n_1 => coeff ↑p ↑n_1,
        map_add' :=
          (_ :
            ∀ (p q : { x // x ∈ degreeLT R n }),
              (fun p n_1 => coeff ↑p ↑n_1) (p + q) = (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) }
      (x • p) x✝ =
    (↑(RingHom.id R) x •
        AddHom.toFun
          { toFun := fun p n_1 => coeff ↑p ↑n_1,
            map_add' :=
              (_ :
                ∀ (p q : { x // x ∈ degreeLT R n }),
                  (fun p n_1 => coeff ↑p ↑n_1) (p + q) =
                    (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) }
          p)
      x✝
[PROOFSTEP]
dsimp
[GOAL]
case h
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
x : R
p : { x // x ∈ degreeLT R n }
x✝ : Fin n
⊢ coeff (x • ↑p) ↑x✝ = x * coeff ↑p ↑x✝
[PROOFSTEP]
rw [coeff_smul]
[GOAL]
case h
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
x : R
p : { x // x ∈ degreeLT R n }
x✝ : Fin n
⊢ x • coeff ↑p ↑x✝ = x * coeff ↑p ↑x✝
[PROOFSTEP]
rfl
[GOAL]
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
⊢ Function.LeftInverse
    (fun f =>
      { val := ∑ i : Fin n, ↑(monomial ↑i) (f i), property := (_ : ∑ i : Fin n, ↑(monomial ↑i) (f i) ∈ degreeLT R n) })
    {
          toAddHom :=
            { toFun := fun p n_1 => coeff ↑p ↑n_1,
              map_add' :=
                (_ :
                  ∀ (p q : { x // x ∈ degreeLT R n }),
                    (fun p n_1 => coeff ↑p ↑n_1) (p + q) =
                      (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) },
          map_smul' :=
            (_ :
              ∀ (x : R) (p : { x // x ∈ degreeLT R n }),
                AddHom.toFun
                    { toFun := fun p n_1 => coeff ↑p ↑n_1,
                      map_add' :=
                        (_ :
                          ∀ (p q : { x // x ∈ degreeLT R n }),
                            (fun p n_1 => coeff ↑p ↑n_1) (p + q) =
                              (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) }
                    (x • p) =
                  ↑(RingHom.id R) x •
                    AddHom.toFun
                      { toFun := fun p n_1 => coeff ↑p ↑n_1,
                        map_add' :=
                          (_ :
                            ∀ (p q : { x // x ∈ degreeLT R n }),
                              (fun p n_1 => coeff ↑p ↑n_1) (p + q) =
                                (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) }
                      p) }.toAddHom.toFun
[PROOFSTEP]
rintro ⟨p, hp⟩
[GOAL]
case mk
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : p ∈ degreeLT R n
⊢ (fun f =>
        { val := ∑ i : Fin n, ↑(monomial ↑i) (f i),
          property := (_ : ∑ i : Fin n, ↑(monomial ↑i) (f i) ∈ degreeLT R n) })
      (AddHom.toFun
        {
            toAddHom :=
              { toFun := fun p n_1 => coeff ↑p ↑n_1,
                map_add' :=
                  (_ :
                    ∀ (p q : { x // x ∈ degreeLT R n }),
                      (fun p n_1 => coeff ↑p ↑n_1) (p + q) =
                        (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) },
            map_smul' :=
              (_ :
                ∀ (x : R) (p : { x // x ∈ degreeLT R n }),
                  AddHom.toFun
                      { toFun := fun p n_1 => coeff ↑p ↑n_1,
                        map_add' :=
                          (_ :
                            ∀ (p q : { x // x ∈ degreeLT R n }),
                              (fun p n_1 => coeff ↑p ↑n_1) (p + q) =
                                (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) }
                      (x • p) =
                    ↑(RingHom.id R) x •
                      AddHom.toFun
                        { toFun := fun p n_1 => coeff ↑p ↑n_1,
                          map_add' :=
                            (_ :
                              ∀ (p q : { x // x ∈ degreeLT R n }),
                                (fun p n_1 => coeff ↑p ↑n_1) (p + q) =
                                  (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) }
                        p) }.toAddHom
        { val := p, property := hp }) =
    { val := p, property := hp }
[PROOFSTEP]
ext1
[GOAL]
case mk.a
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : p ∈ degreeLT R n
⊢ ↑((fun f =>
          { val := ∑ i : Fin n, ↑(monomial ↑i) (f i),
            property := (_ : ∑ i : Fin n, ↑(monomial ↑i) (f i) ∈ degreeLT R n) })
        (AddHom.toFun
          {
              toAddHom :=
                { toFun := fun p n_1 => coeff ↑p ↑n_1,
                  map_add' :=
                    (_ :
                      ∀ (p q : { x // x ∈ degreeLT R n }),
                        (fun p n_1 => coeff ↑p ↑n_1) (p + q) =
                          (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) },
              map_smul' :=
                (_ :
                  ∀ (x : R) (p : { x // x ∈ degreeLT R n }),
                    AddHom.toFun
                        { toFun := fun p n_1 => coeff ↑p ↑n_1,
                          map_add' :=
                            (_ :
                              ∀ (p q : { x // x ∈ degreeLT R n }),
                                (fun p n_1 => coeff ↑p ↑n_1) (p + q) =
                                  (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) }
                        (x • p) =
                      ↑(RingHom.id R) x •
                        AddHom.toFun
                          { toFun := fun p n_1 => coeff ↑p ↑n_1,
                            map_add' :=
                              (_ :
                                ∀ (p q : { x // x ∈ degreeLT R n }),
                                  (fun p n_1 => coeff ↑p ↑n_1) (p + q) =
                                    (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) }
                          p) }.toAddHom
          { val := p, property := hp })) =
    ↑{ val := p, property := hp }
[PROOFSTEP]
simp only [Submodule.coe_mk]
[GOAL]
case mk.a
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : p ∈ degreeLT R n
⊢ ∑ x : Fin n, ↑(monomial ↑x) (coeff p ↑x) = p
[PROOFSTEP]
by_cases hp0 : p = 0
[GOAL]
case pos
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : p ∈ degreeLT R n
hp0 : p = 0
⊢ ∑ x : Fin n, ↑(monomial ↑x) (coeff p ↑x) = p
[PROOFSTEP]
subst hp0
[GOAL]
case pos
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
hp : 0 ∈ degreeLT R n
⊢ ∑ x : Fin n, ↑(monomial ↑x) (coeff 0 ↑x) = 0
[PROOFSTEP]
simp only [coeff_zero, LinearMap.map_zero, Finset.sum_const_zero]
[GOAL]
case neg
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : p ∈ degreeLT R n
hp0 : ¬p = 0
⊢ ∑ x : Fin n, ↑(monomial ↑x) (coeff p ↑x) = p
[PROOFSTEP]
rw [mem_degreeLT, degree_eq_natDegree hp0, Nat.cast_withBot, Nat.cast_withBot, WithBot.coe_lt_coe] at hp
[GOAL]
case neg
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : natDegree p < n
hp0 : ¬p = 0
⊢ ∑ x : Fin n, ↑(monomial ↑x) (coeff p ↑x) = p
[PROOFSTEP]
conv_rhs => rw [p.as_sum_range' n hp, ← Fin.sum_univ_eq_sum_range]
[GOAL]
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : natDegree p < n
hp0 : ¬p = 0
| p
[PROOFSTEP]
rw [p.as_sum_range' n hp, ← Fin.sum_univ_eq_sum_range]
[GOAL]
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : natDegree p < n
hp0 : ¬p = 0
| p
[PROOFSTEP]
rw [p.as_sum_range' n hp, ← Fin.sum_univ_eq_sum_range]
[GOAL]
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : natDegree p < n
hp0 : ¬p = 0
| p
[PROOFSTEP]
rw [p.as_sum_range' n hp, ← Fin.sum_univ_eq_sum_range]
[GOAL]
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
f : Fin n → R
⊢ AddHom.toFun
      {
          toAddHom :=
            { toFun := fun p n_1 => coeff ↑p ↑n_1,
              map_add' :=
                (_ :
                  ∀ (p q : { x // x ∈ degreeLT R n }),
                    (fun p n_1 => coeff ↑p ↑n_1) (p + q) =
                      (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) },
          map_smul' :=
            (_ :
              ∀ (x : R) (p : { x // x ∈ degreeLT R n }),
                AddHom.toFun
                    { toFun := fun p n_1 => coeff ↑p ↑n_1,
                      map_add' :=
                        (_ :
                          ∀ (p q : { x // x ∈ degreeLT R n }),
                            (fun p n_1 => coeff ↑p ↑n_1) (p + q) =
                              (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) }
                    (x • p) =
                  ↑(RingHom.id R) x •
                    AddHom.toFun
                      { toFun := fun p n_1 => coeff ↑p ↑n_1,
                        map_add' :=
                          (_ :
                            ∀ (p q : { x // x ∈ degreeLT R n }),
                              (fun p n_1 => coeff ↑p ↑n_1) (p + q) =
                                (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) }
                      p) }.toAddHom
      ((fun f =>
          { val := ∑ i : Fin n, ↑(monomial ↑i) (f i),
            property := (_ : ∑ i : Fin n, ↑(monomial ↑i) (f i) ∈ degreeLT R n) })
        f) =
    f
[PROOFSTEP]
ext i
[GOAL]
case h
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
f : Fin n → R
i : Fin n
⊢ AddHom.toFun
      {
          toAddHom :=
            { toFun := fun p n_1 => coeff ↑p ↑n_1,
              map_add' :=
                (_ :
                  ∀ (p q : { x // x ∈ degreeLT R n }),
                    (fun p n_1 => coeff ↑p ↑n_1) (p + q) =
                      (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) },
          map_smul' :=
            (_ :
              ∀ (x : R) (p : { x // x ∈ degreeLT R n }),
                AddHom.toFun
                    { toFun := fun p n_1 => coeff ↑p ↑n_1,
                      map_add' :=
                        (_ :
                          ∀ (p q : { x // x ∈ degreeLT R n }),
                            (fun p n_1 => coeff ↑p ↑n_1) (p + q) =
                              (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) }
                    (x • p) =
                  ↑(RingHom.id R) x •
                    AddHom.toFun
                      { toFun := fun p n_1 => coeff ↑p ↑n_1,
                        map_add' :=
                          (_ :
                            ∀ (p q : { x // x ∈ degreeLT R n }),
                              (fun p n_1 => coeff ↑p ↑n_1) (p + q) =
                                (fun p n_1 => coeff ↑p ↑n_1) p + (fun p n_1 => coeff ↑p ↑n_1) q) }
                      p) }.toAddHom
      ((fun f =>
          { val := ∑ i : Fin n, ↑(monomial ↑i) (f i),
            property := (_ : ∑ i : Fin n, ↑(monomial ↑i) (f i) ∈ degreeLT R n) })
        f)
      i =
    f i
[PROOFSTEP]
simp only [finset_sum_coeff, Submodule.coe_mk]
[GOAL]
case h
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
f : Fin n → R
i : Fin n
⊢ ∑ b : Fin n, coeff (↑(monomial ↑b) (f b)) ↑i = f i
[PROOFSTEP]
rw [Finset.sum_eq_single i, coeff_monomial, if_pos rfl]
[GOAL]
case h.h₀
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
f : Fin n → R
i : Fin n
⊢ ∀ (b : Fin n), b ∈ univ → b ≠ i → coeff (↑(monomial ↑b) (f b)) ↑i = 0
[PROOFSTEP]
rintro j - hji
[GOAL]
case h.h₀
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
f : Fin n → R
i j : Fin n
hji : j ≠ i
⊢ coeff (↑(monomial ↑j) (f j)) ↑i = 0
[PROOFSTEP]
rw [coeff_monomial, if_neg]
[GOAL]
case h.h₀.hnc
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
f : Fin n → R
i j : Fin n
hji : j ≠ i
⊢ ¬↑j = ↑i
[PROOFSTEP]
rwa [← Fin.ext_iff]
[GOAL]
case h.h₁
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
f : Fin n → R
i : Fin n
⊢ ¬i ∈ univ → coeff (↑(monomial ↑i) (f i)) ↑i = 0
[PROOFSTEP]
intro h
[GOAL]
case h.h₁
R✝ : Type u
S : Type u_1
inst✝¹ : Semiring R✝
R : Type ?u.20302
inst✝ : Semiring R
n : ℕ
f : Fin n → R
i : Fin n
h : ¬i ∈ univ
⊢ coeff (↑(monomial ↑i) (f i)) ↑i = 0
[PROOFSTEP]
exact (h (Finset.mem_univ _)).elim
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : p ∈ degreeLT R n
⊢ ↑(degreeLTEquiv R n) { val := p, property := hp } = 0 ↔ p = 0
[PROOFSTEP]
rw [LinearEquiv.map_eq_zero_iff, Submodule.mk_eq_zero]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : p ∈ degreeLT R n
x : R
⊢ eval x p = ∑ i : Fin n, ↑(degreeLTEquiv R n) { val := p, property := hp } i * x ^ ↑i
[PROOFSTEP]
simp_rw [eval_eq_sum]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : p ∈ degreeLT R n
x : R
⊢ (sum p fun e a => a * x ^ e) = ∑ x_1 : Fin n, ↑(degreeLTEquiv R n) { val := p, property := hp } x_1 * x ^ ↑x_1
[PROOFSTEP]
exact (sum_fin _ (by simp_rw [zero_mul, forall_const]) (mem_degreeLT.mp hp)).symm
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
p : R[X]
hp : p ∈ degreeLT R n
x : R
⊢ ∀ (i : ℕ), 0 * x ^ i = 0
[PROOFSTEP]
simp_rw [zero_mul, forall_const]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
p : R[X]
c : R
⊢ c ∈ frange p ↔ ∃ n, n ∈ support p ∧ c = coeff p n
[PROOFSTEP]
simp [frange, eq_comm]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
⊢ frange 1 ⊆ {1}
[PROOFSTEP]
simp only [frange]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
⊢ image (fun n => coeff 1 n) (support 1) ⊆ {1}
[PROOFSTEP]
rw [Finset.image_subset_iff]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
⊢ ∀ (x : ℕ), x ∈ support 1 → coeff 1 x ∈ {1}
[PROOFSTEP]
simp only [mem_support_iff, ne_eq, mem_singleton, ← C_1, coeff_C]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
⊢ ∀ (x : ℕ), ¬(if x = 0 then 1 else 0) = 0 → (if x = 0 then 1 else 0) = 1
[PROOFSTEP]
intro n hn
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
hn : ¬(if n = 0 then 1 else 0) = 0
⊢ (if n = 0 then 1 else 0) = 1
[PROOFSTEP]
simp only [exists_prop, ite_eq_right_iff, not_forall] at hn
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
hn : n = 0 ∧ ¬1 = 0
⊢ (if n = 0 then 1 else 0) = 1
[PROOFSTEP]
simp [hn]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
p : R[X]
n : ℕ
h : coeff p n ≠ 0
⊢ coeff p n ∈ frange p
[PROOFSTEP]
simp only [frange, exists_prop, mem_support_iff, Finset.mem_image, Ne.def]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
p : R[X]
n : ℕ
h : coeff p n ≠ 0
⊢ ∃ a, ¬coeff p a = 0 ∧ coeff p a = coeff p n
[PROOFSTEP]
exact ⟨n, h, rfl⟩
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
⊢ comp (∑ i in range n, X ^ i) (X + 1) = ∑ i in range n, ↑(Nat.choose n (i + 1)) * X ^ i
[PROOFSTEP]
ext i
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Semiring R
n i : ℕ
⊢ coeff (comp (∑ i in range n, X ^ i) (X + 1)) i = coeff (∑ i in range n, ↑(Nat.choose n (i + 1)) * X ^ i) i
[PROOFSTEP]
trans (n.choose (i + 1) : R)
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n i : ℕ
⊢ coeff (comp (∑ i in range n, X ^ i) (X + 1)) i = ↑(Nat.choose n (i + 1))
R : Type u
S : Type u_1
inst✝ : Semiring R
n i : ℕ
⊢ ↑(Nat.choose n (i + 1)) = coeff (∑ i in range n, ↑(Nat.choose n (i + 1)) * X ^ i) i
[PROOFSTEP]
swap
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n i : ℕ
⊢ ↑(Nat.choose n (i + 1)) = coeff (∑ i in range n, ↑(Nat.choose n (i + 1)) * X ^ i) i
[PROOFSTEP]
simp only [finset_sum_coeff, ← C_eq_nat_cast, coeff_C_mul_X_pow]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n i : ℕ
⊢ ↑(Nat.choose n (i + 1)) = ∑ x in range n, if i = x then ↑(Nat.choose n (x + 1)) else 0
[PROOFSTEP]
rw [Finset.sum_eq_single i, if_pos rfl]
[GOAL]
case h₀
R : Type u
S : Type u_1
inst✝ : Semiring R
n i : ℕ
⊢ ∀ (b : ℕ), b ∈ range n → b ≠ i → (if i = b then ↑(Nat.choose n (b + 1)) else 0) = 0
[PROOFSTEP]
simp (config := { contextual := true }) only [@eq_comm _ i, if_false, eq_self_iff_true, imp_true_iff]
[GOAL]
case h₁
R : Type u
S : Type u_1
inst✝ : Semiring R
n i : ℕ
⊢ ¬i ∈ range n → (if i = i then ↑(Nat.choose n (i + 1)) else 0) = 0
[PROOFSTEP]
simp (config := { contextual := true }) only [Nat.lt_add_one_iff, Nat.choose_eq_zero_of_lt, Nat.cast_zero,
  Finset.mem_range, not_lt, eq_self_iff_true, if_true, imp_true_iff]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n i : ℕ
⊢ coeff (comp (∑ i in range n, X ^ i) (X + 1)) i = ↑(Nat.choose n (i + 1))
[PROOFSTEP]
induction' n with n ih generalizing i
[GOAL]
case zero
R : Type u
S : Type u_1
inst✝ : Semiring R
i✝ i : ℕ
⊢ coeff (comp (∑ i in range Nat.zero, X ^ i) (X + 1)) i = ↑(Nat.choose Nat.zero (i + 1))
[PROOFSTEP]
dsimp
[GOAL]
case zero
R : Type u
S : Type u_1
inst✝ : Semiring R
i✝ i : ℕ
⊢ coeff (comp 0 (X + 1)) i = ↑0
[PROOFSTEP]
simp only [zero_comp, coeff_zero, Nat.cast_zero]
[GOAL]
case succ
R : Type u
S : Type u_1
inst✝ : Semiring R
i✝ n : ℕ
ih : ∀ (i : ℕ), coeff (comp (∑ i in range n, X ^ i) (X + 1)) i = ↑(Nat.choose n (i + 1))
i : ℕ
⊢ coeff (comp (∑ i in range (Nat.succ n), X ^ i) (X + 1)) i = ↑(Nat.choose (Nat.succ n) (i + 1))
[PROOFSTEP]
simp only [geom_sum_succ', ih, add_comp, X_pow_comp, coeff_add, Nat.choose_succ_succ, Nat.cast_add, coeff_X_add_one_pow]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
P : R[X]
hP : Monic P
hdeg : 0 < natDegree P
n : ℕ
hn : n ≠ 0
⊢ Monic (∑ i in range n, P ^ i)
[PROOFSTEP]
nontriviality R
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
P : R[X]
hP : Monic P
hdeg : 0 < natDegree P
n : ℕ
hn : n ≠ 0
✝ : Nontrivial R
⊢ Monic (∑ i in range n, P ^ i)
[PROOFSTEP]
obtain ⟨n, rfl⟩ := Nat.exists_eq_succ_of_ne_zero hn
[GOAL]
case intro
R : Type u
S : Type u_1
inst✝ : Semiring R
P : R[X]
hP : Monic P
hdeg : 0 < natDegree P
✝ : Nontrivial R
n : ℕ
hn : Nat.succ n ≠ 0
⊢ Monic (∑ i in range (Nat.succ n), P ^ i)
[PROOFSTEP]
rw [geom_sum_succ']
[GOAL]
case intro
R : Type u
S : Type u_1
inst✝ : Semiring R
P : R[X]
hP : Monic P
hdeg : 0 < natDegree P
✝ : Nontrivial R
n : ℕ
hn : Nat.succ n ≠ 0
⊢ Monic (P ^ n + ∑ i in range n, P ^ i)
[PROOFSTEP]
refine' (hP.pow _).add_of_left _
[GOAL]
case intro
R : Type u
S : Type u_1
inst✝ : Semiring R
P : R[X]
hP : Monic P
hdeg : 0 < natDegree P
✝ : Nontrivial R
n : ℕ
hn : Nat.succ n ≠ 0
⊢ degree (∑ i in range n, P ^ i) < degree (P ^ n)
[PROOFSTEP]
refine' lt_of_le_of_lt (degree_sum_le _ _) _
[GOAL]
case intro
R : Type u
S : Type u_1
inst✝ : Semiring R
P : R[X]
hP : Monic P
hdeg : 0 < natDegree P
✝ : Nontrivial R
n : ℕ
hn : Nat.succ n ≠ 0
⊢ (sup (range n) fun b => degree (P ^ b)) < degree (P ^ n)
[PROOFSTEP]
rw [Finset.sup_lt_iff]
[GOAL]
case intro
R : Type u
S : Type u_1
inst✝ : Semiring R
P : R[X]
hP : Monic P
hdeg : 0 < natDegree P
✝ : Nontrivial R
n : ℕ
hn : Nat.succ n ≠ 0
⊢ ∀ (b : ℕ), b ∈ range n → degree (P ^ b) < degree (P ^ n)
[PROOFSTEP]
simp only [Finset.mem_range, degree_eq_natDegree (hP.pow _).ne_zero]
[GOAL]
case intro
R : Type u
S : Type u_1
inst✝ : Semiring R
P : R[X]
hP : Monic P
hdeg : 0 < natDegree P
✝ : Nontrivial R
n : ℕ
hn : Nat.succ n ≠ 0
⊢ ∀ (b : ℕ), b < n → ↑(natDegree (P ^ b)) < ↑(natDegree (P ^ n))
[PROOFSTEP]
simp only [Nat.cast_withBot, WithBot.coe_lt_coe, hP.natDegree_pow]
[GOAL]
case intro
R : Type u
S : Type u_1
inst✝ : Semiring R
P : R[X]
hP : Monic P
hdeg : 0 < natDegree P
✝ : Nontrivial R
n : ℕ
hn : Nat.succ n ≠ 0
⊢ ∀ (b : ℕ), b < n → b * natDegree P < n * natDegree P
[PROOFSTEP]
intro k
[GOAL]
case intro
R : Type u
S : Type u_1
inst✝ : Semiring R
P : R[X]
hP : Monic P
hdeg : 0 < natDegree P
✝ : Nontrivial R
n : ℕ
hn : Nat.succ n ≠ 0
k : ℕ
⊢ k < n → k * natDegree P < n * natDegree P
[PROOFSTEP]
exact nsmul_lt_nsmul hdeg
[GOAL]
case intro
R : Type u
S : Type u_1
inst✝ : Semiring R
P : R[X]
hP : Monic P
hdeg : 0 < natDegree P
✝ : Nontrivial R
n : ℕ
hn : Nat.succ n ≠ 0
⊢ ⊥ < degree (P ^ n)
[PROOFSTEP]
rw [bot_lt_iff_ne_bot, Ne.def, degree_eq_bot]
[GOAL]
case intro
R : Type u
S : Type u_1
inst✝ : Semiring R
P : R[X]
hP : Monic P
hdeg : 0 < natDegree P
✝ : Nontrivial R
n : ℕ
hn : Nat.succ n ≠ 0
⊢ ¬P ^ n = 0
[PROOFSTEP]
exact (hP.pow _).ne_zero
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
hn : n ≠ 0
⊢ Monic (∑ i in range n, X ^ i)
[PROOFSTEP]
nontriviality R
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
hn : n ≠ 0
✝ : Nontrivial R
⊢ Monic (∑ i in range n, X ^ i)
[PROOFSTEP]
apply monic_X.geom_sum _ hn
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
n : ℕ
hn : n ≠ 0
✝ : Nontrivial R
⊢ 0 < natDegree X
[PROOFSTEP]
simp only [natDegree_X, zero_lt_one]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
n : ℕ
⊢ ↑(coeff (restriction p) n) = coeff p n
[PROOFSTEP]
simp only [restriction, coeff_monomial, finset_sum_coeff, mem_support_iff, Finset.sum_ite_eq', Ne.def, ite_not]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
n : ℕ
⊢ ↑(if coeff p n = 0 then 0 else { val := coeff p n, property := (_ : coeff p n ∈ Subring.closure ↑(frange p)) }) =
    coeff p n
[PROOFSTEP]
split_ifs with h
[GOAL]
case pos
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
n : ℕ
h : coeff p n = 0
⊢ ↑0 = coeff p n
[PROOFSTEP]
rw [h]
[GOAL]
case pos
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
n : ℕ
h : coeff p n = 0
⊢ ↑0 = 0
[PROOFSTEP]
rfl
[GOAL]
case neg
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
n : ℕ
h : ¬coeff p n = 0
⊢ ↑{ val := coeff p n, property := (_ : coeff p n ∈ Subring.closure ↑(frange p)) } = coeff p n
[PROOFSTEP]
rfl
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
⊢ support (restriction p) = support p
[PROOFSTEP]
ext i
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
i : ℕ
⊢ i ∈ support (restriction p) ↔ i ∈ support p
[PROOFSTEP]
simp only [mem_support_iff, not_iff_not, Ne.def]
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
i : ℕ
⊢ coeff (restriction p) i = 0 ↔ coeff p i = 0
[PROOFSTEP]
conv_rhs => rw [← coeff_restriction]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
i : ℕ
| coeff p i = 0
[PROOFSTEP]
rw [← coeff_restriction]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
i : ℕ
| coeff p i = 0
[PROOFSTEP]
rw [← coeff_restriction]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
i : ℕ
| coeff p i = 0
[PROOFSTEP]
rw [← coeff_restriction]
[GOAL]
case a
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
i : ℕ
⊢ coeff (restriction p) i = 0 ↔ ↑(coeff (restriction p) i) = 0
[PROOFSTEP]
exact ⟨fun H => by rw [H, ZeroMemClass.coe_zero], fun H => Subtype.coe_injective H⟩
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
i : ℕ
H : coeff (restriction p) i = 0
⊢ ↑(coeff (restriction p) i) = 0
[PROOFSTEP]
rw [H, ZeroMemClass.coe_zero]
[GOAL]
R✝ : Type u
S : Type u_1
inst✝¹ : Ring R✝
R : Type u
inst✝ : CommRing R
p : R[X]
n : ℕ
⊢ coeff (map (algebraMap { x // x ∈ Subring.closure ↑(frange p) } R) (restriction p)) n = coeff p n
[PROOFSTEP]
rw [coeff_map, Algebra.algebraMap_ofSubring_apply, coeff_restriction]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
⊢ degree (restriction p) = degree p
[PROOFSTEP]
simp [degree]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
⊢ natDegree (restriction p) = natDegree p
[PROOFSTEP]
simp [natDegree]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
⊢ Monic (restriction p) ↔ Monic p
[PROOFSTEP]
simp only [Monic, leadingCoeff, natDegree_restriction]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
⊢ coeff (restriction p) (natDegree p) = 1 ↔ coeff p (natDegree p) = 1
[PROOFSTEP]
rw [← @coeff_restriction _ _ p]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
⊢ coeff (restriction p) (natDegree p) = 1 ↔ ↑(coeff (restriction p) (natDegree p)) = 1
[PROOFSTEP]
exact ⟨fun H => by rw [H, OneMemClass.coe_one], fun H => Subtype.coe_injective H⟩
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
p : R[X]
H : coeff (restriction p) (natDegree p) = 1
⊢ ↑(coeff (restriction p) (natDegree p)) = 1
[PROOFSTEP]
rw [H, OneMemClass.coe_one]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
⊢ restriction 0 = 0
[PROOFSTEP]
simp only [restriction, Finset.sum_empty, support_zero]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
i : ℕ
⊢ ↑(coeff (restriction 1) i) = ↑(coeff 1 i)
[PROOFSTEP]
rw [coeff_restriction', coeff_one, coeff_one]
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
i : ℕ
⊢ (if 0 = i then 1 else 0) = ↑(if 0 = i then 1 else 0)
[PROOFSTEP]
split_ifs
[GOAL]
case pos
R : Type u
S : Type u_1
inst✝ : Ring R
i : ℕ
h✝ : 0 = i
⊢ 1 = ↑1
[PROOFSTEP]
rfl
[GOAL]
case neg
R : Type u
S : Type u_1
inst✝ : Ring R
i : ℕ
h✝ : ¬0 = i
⊢ 0 = ↑0
[PROOFSTEP]
rfl
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
⊢ eval₂ f x p = eval₂ (RingHom.comp f (Subring.subtype (Subring.closure ↑(frange p)))) x (restriction p)
[PROOFSTEP]
simp only [eval₂_eq_sum, sum, support_restriction, ← @coeff_restriction _ _ p, RingHom.comp_apply, Subring.coeSubtype]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
n : ℕ
⊢ ↑(coeff (toSubring p T hp) n) = coeff p n
[PROOFSTEP]
simp only [toSubring, coeff_monomial, finset_sum_coeff, mem_support_iff, Finset.sum_ite_eq', Ne.def, ite_not]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
n : ℕ
⊢ ↑(if coeff p n = 0 then 0 else { val := coeff p n, property := (_ : coeff p n ∈ T) }) = coeff p n
[PROOFSTEP]
split_ifs with h
[GOAL]
case pos
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
n : ℕ
h : coeff p n = 0
⊢ ↑0 = coeff p n
[PROOFSTEP]
rw [h]
[GOAL]
case pos
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
n : ℕ
h : coeff p n = 0
⊢ ↑0 = 0
[PROOFSTEP]
rfl
[GOAL]
case neg
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
n : ℕ
h : ¬coeff p n = 0
⊢ ↑{ val := coeff p n, property := (_ : coeff p n ∈ T) } = coeff p n
[PROOFSTEP]
rfl
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
⊢ support (toSubring p T hp) = support p
[PROOFSTEP]
ext i
[GOAL]
case a
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
i : ℕ
⊢ i ∈ support (toSubring p T hp) ↔ i ∈ support p
[PROOFSTEP]
simp only [mem_support_iff, not_iff_not, Ne.def]
[GOAL]
case a
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
i : ℕ
⊢ coeff (toSubring p T hp) i = 0 ↔ coeff p i = 0
[PROOFSTEP]
conv_rhs => rw [← coeff_toSubring p T hp]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
i : ℕ
| coeff p i = 0
[PROOFSTEP]
rw [← coeff_toSubring p T hp]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
i : ℕ
| coeff p i = 0
[PROOFSTEP]
rw [← coeff_toSubring p T hp]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
i : ℕ
| coeff p i = 0
[PROOFSTEP]
rw [← coeff_toSubring p T hp]
[GOAL]
case a
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
i : ℕ
⊢ coeff (toSubring p T hp) i = 0 ↔ ↑(coeff (toSubring p T hp) i) = 0
[PROOFSTEP]
exact ⟨fun H => by rw [H, ZeroMemClass.coe_zero], fun H => Subtype.coe_injective H⟩
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
i : ℕ
H : coeff (toSubring p T hp) i = 0
⊢ ↑(coeff (toSubring p T hp) i) = 0
[PROOFSTEP]
rw [H, ZeroMemClass.coe_zero]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
⊢ degree (toSubring p T hp) = degree p
[PROOFSTEP]
simp [degree]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
⊢ natDegree (toSubring p T hp) = natDegree p
[PROOFSTEP]
simp [natDegree]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
⊢ Monic (toSubring p T hp) ↔ Monic p
[PROOFSTEP]
simp_rw [Monic, leadingCoeff, natDegree_toSubring, ← coeff_toSubring p T hp]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
⊢ coeff (toSubring p T hp) (natDegree p) = 1 ↔ ↑(coeff (toSubring p T hp) (natDegree p)) = 1
[PROOFSTEP]
exact ⟨fun H => by rw [H, OneMemClass.coe_one], fun H => Subtype.coe_injective H⟩
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
H : coeff (toSubring p T hp) (natDegree p) = 1
⊢ ↑(coeff (toSubring p T hp) (natDegree p)) = 1
[PROOFSTEP]
rw [H, OneMemClass.coe_one]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
⊢ ↑(frange 0) ⊆ ↑T
[PROOFSTEP]
simp [frange_zero]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
⊢ toSubring 0 T (_ : ↑∅ ⊆ ↑T) = 0
[PROOFSTEP]
ext i
[GOAL]
case a.a
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
i : ℕ
⊢ ↑(coeff (toSubring 0 T (_ : ↑∅ ⊆ ↑T)) i) = ↑(coeff 0 i)
[PROOFSTEP]
simp
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
i : ℕ
⊢ ↑(coeff (toSubring 1 T (_ : ↑(frange 1) ⊆ ↑T)) i) = ↑(coeff 1 i)
[PROOFSTEP]
rw [coeff_toSubring', coeff_one, coeff_one, apply_ite Subtype.val, ZeroMemClass.coe_zero, OneMemClass.coe_one]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
⊢ map (Subring.subtype T) (toSubring p T hp) = p
[PROOFSTEP]
ext n
[GOAL]
case a
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
p : R[X]
T : Subring R
hp : ↑(frange p) ⊆ ↑T
n : ℕ
⊢ coeff (map (Subring.subtype T) (toSubring p T hp)) n = coeff p n
[PROOFSTEP]
simp [coeff_map]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
T : Subring R
p : { x // x ∈ T }[X]
n : ℕ
⊢ coeff (ofSubring T p) n = ↑(coeff p n)
[PROOFSTEP]
simp only [ofSubring, coeff_monomial, finset_sum_coeff, mem_support_iff, Finset.sum_ite_eq', ite_eq_right_iff, Ne.def,
  ite_not, Classical.not_not, ite_eq_left_iff]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
T : Subring R
p : { x // x ∈ T }[X]
n : ℕ
⊢ coeff p n = 0 → 0 = ↑(coeff p n)
[PROOFSTEP]
intro h
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
T : Subring R
p : { x // x ∈ T }[X]
n : ℕ
h : coeff p n = 0
⊢ 0 = ↑(coeff p n)
[PROOFSTEP]
rw [h, ZeroMemClass.coe_zero]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
T : Subring R
p : { x // x ∈ T }[X]
⊢ ↑(frange (ofSubring T p)) ⊆ ↑T
[PROOFSTEP]
intro i hi
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
T : Subring R
p : { x // x ∈ T }[X]
i : R
hi : i ∈ ↑(frange (ofSubring T p))
⊢ i ∈ ↑T
[PROOFSTEP]
simp only [frange, Set.mem_image, mem_support_iff, Ne.def, Finset.mem_coe, Finset.coe_image] at hi
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
T : Subring R
p : { x // x ∈ T }[X]
i : R
hi : ∃ x, ¬coeff (ofSubring T p) x = 0 ∧ coeff (ofSubring T p) x = i
⊢ i ∈ ↑T
[PROOFSTEP]
rcases hi with ⟨n, _, h'n⟩
[GOAL]
case intro.intro
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
T : Subring R
p : { x // x ∈ T }[X]
i : R
n : ℕ
left✝ : ¬coeff (ofSubring T p) n = 0
h'n : coeff (ofSubring T p) n = i
⊢ i ∈ ↑T
[PROOFSTEP]
rw [← h'n, coeff_ofSubring]
[GOAL]
case intro.intro
R : Type u
S : Type u_1
inst✝¹ : Ring R
inst✝ : Semiring S
f : R →+* S
x : S
T : Subring R
p : { x // x ∈ T }[X]
i : R
n : ℕ
left✝ : ¬coeff (ofSubring T p) n = 0
h'n : coeff (ofSubring T p) n = i
⊢ ↑(coeff p n) ∈ ↑T
[PROOFSTEP]
exact Subtype.mem (coeff p n : T)
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
I : Ideal R[X]
c : R
x : R[X]
H :
  x ∈
    { toAddSubsemigroup := { carrier := I.carrier, add_mem' := (_ : ∀ {a b : R[X]}, a ∈ I → b ∈ I → a + b ∈ I) },
          zero_mem' := (_ : 0 ∈ I) }.toAddSubsemigroup.carrier
⊢ c • x ∈
    { toAddSubsemigroup := { carrier := I.carrier, add_mem' := (_ : ∀ {a b : R[X]}, a ∈ I → b ∈ I → a + b ∈ I) },
          zero_mem' := (_ : 0 ∈ I) }.toAddSubsemigroup.carrier
[PROOFSTEP]
rw [← C_mul']
[GOAL]
R : Type u
S : Type u_1
inst✝ : Semiring R
I : Ideal R[X]
c : R
x : R[X]
H :
  x ∈
    { toAddSubsemigroup := { carrier := I.carrier, add_mem' := (_ : ∀ {a b : R[X]}, a ∈ I → b ∈ I → a + b ∈ I) },
          zero_mem' := (_ : 0 ∈ I) }.toAddSubsemigroup.carrier
⊢ ↑C c * x ∈
    { toAddSubsemigroup := { carrier := I.carrier, add_mem' := (_ : ∀ {a b : R[X]}, a ∈ I → b ∈ I → a + b ∈ I) },
          zero_mem' := (_ : 0 ∈ I) }.toAddSubsemigroup.carrier
[PROOFSTEP]
exact I.mul_mem_left _ H
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
⊢ f ∈ map C I ↔ ∀ (n : ℕ), coeff f n ∈ I
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
⊢ f ∈ map C I → ∀ (n : ℕ), coeff f n ∈ I
[PROOFSTEP]
intro hf
[GOAL]
case mp
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : f ∈ map C I
⊢ ∀ (n : ℕ), coeff f n ∈ I
[PROOFSTEP]
apply @Submodule.span_induction _ _ _ _ _ f _ _ hf
[GOAL]
case mp.Hs
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : f ∈ map C I
⊢ ∀ (x : R[X]), x ∈ ↑C '' ↑I → ∀ (n : ℕ), coeff x n ∈ I
[PROOFSTEP]
intro f hf n
[GOAL]
case mp.Hs
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f✝ : R[X]
hf✝ : f✝ ∈ map C I
f : R[X]
hf : f ∈ ↑C '' ↑I
n : ℕ
⊢ coeff f n ∈ I
[PROOFSTEP]
cases' (Set.mem_image _ _ _).mp hf with x hx
[GOAL]
case mp.Hs.intro
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f✝ : R[X]
hf✝ : f✝ ∈ map C I
f : R[X]
hf : f ∈ ↑C '' ↑I
n : ℕ
x : R
hx : x ∈ ↑I ∧ ↑C x = f
⊢ coeff f n ∈ I
[PROOFSTEP]
rw [← hx.right, coeff_C]
[GOAL]
case mp.Hs.intro
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f✝ : R[X]
hf✝ : f✝ ∈ map C I
f : R[X]
hf : f ∈ ↑C '' ↑I
n : ℕ
x : R
hx : x ∈ ↑I ∧ ↑C x = f
⊢ (if n = 0 then x else 0) ∈ I
[PROOFSTEP]
by_cases h : n = 0
[GOAL]
case pos
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f✝ : R[X]
hf✝ : f✝ ∈ map C I
f : R[X]
hf : f ∈ ↑C '' ↑I
n : ℕ
x : R
hx : x ∈ ↑I ∧ ↑C x = f
h : n = 0
⊢ (if n = 0 then x else 0) ∈ I
[PROOFSTEP]
simpa [h] using hx.left
[GOAL]
case neg
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f✝ : R[X]
hf✝ : f✝ ∈ map C I
f : R[X]
hf : f ∈ ↑C '' ↑I
n : ℕ
x : R
hx : x ∈ ↑I ∧ ↑C x = f
h : ¬n = 0
⊢ (if n = 0 then x else 0) ∈ I
[PROOFSTEP]
simp [h]
[GOAL]
case mp.H0
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : f ∈ map C I
⊢ ∀ (n : ℕ), coeff 0 n ∈ I
[PROOFSTEP]
simp
[GOAL]
case mp.H1
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : f ∈ map C I
⊢ ∀ (x y : R[X]), (∀ (n : ℕ), coeff x n ∈ I) → (∀ (n : ℕ), coeff y n ∈ I) → ∀ (n : ℕ), coeff (x + y) n ∈ I
[PROOFSTEP]
exact fun f g hf hg n => by simp [I.add_mem (hf n) (hg n)]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f✝ : R[X]
hf✝ : f✝ ∈ map C I
f g : R[X]
hf : ∀ (n : ℕ), coeff f n ∈ I
hg : ∀ (n : ℕ), coeff g n ∈ I
n : ℕ
⊢ coeff (f + g) n ∈ I
[PROOFSTEP]
simp [I.add_mem (hf n) (hg n)]
[GOAL]
case mp.H2
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : f ∈ map C I
⊢ ∀ (a x : R[X]), (∀ (n : ℕ), coeff x n ∈ I) → ∀ (n : ℕ), coeff (a • x) n ∈ I
[PROOFSTEP]
refine' fun f g hg n => _
[GOAL]
case mp.H2
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f✝ : R[X]
hf : f✝ ∈ map C I
f g : R[X]
hg : ∀ (n : ℕ), coeff g n ∈ I
n : ℕ
⊢ coeff (f • g) n ∈ I
[PROOFSTEP]
rw [smul_eq_mul, coeff_mul]
[GOAL]
case mp.H2
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f✝ : R[X]
hf : f✝ ∈ map C I
f g : R[X]
hg : ∀ (n : ℕ), coeff g n ∈ I
n : ℕ
⊢ ∑ x in Nat.antidiagonal n, coeff f x.fst * coeff g x.snd ∈ I
[PROOFSTEP]
exact I.sum_mem fun c _ => I.mul_mem_left (f.coeff c.fst) (hg c.snd)
[GOAL]
case mpr
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
⊢ (∀ (n : ℕ), coeff f n ∈ I) → f ∈ map C I
[PROOFSTEP]
intro hf
[GOAL]
case mpr
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : ∀ (n : ℕ), coeff f n ∈ I
⊢ f ∈ map C I
[PROOFSTEP]
rw [← sum_monomial_eq f]
[GOAL]
case mpr
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : ∀ (n : ℕ), coeff f n ∈ I
⊢ (sum f fun n a => ↑(monomial n) a) ∈ map C I
[PROOFSTEP]
refine' (I.map C : Ideal R[X]).sum_mem fun n _ => _
[GOAL]
case mpr
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : ∀ (n : ℕ), coeff f n ∈ I
n : ℕ
x✝ : n ∈ support f
⊢ (fun n a => ↑(monomial n) a) n (coeff f n) ∈ map C I
[PROOFSTEP]
simp [← C_mul_X_pow_eq_monomial]
[GOAL]
case mpr
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : ∀ (n : ℕ), coeff f n ∈ I
n : ℕ
x✝ : n ∈ support f
⊢ ↑C (coeff f n) * X ^ n ∈ map C I
[PROOFSTEP]
rw [mul_comm]
[GOAL]
case mpr
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : ∀ (n : ℕ), coeff f n ∈ I
n : ℕ
x✝ : n ∈ support f
⊢ X ^ n * ↑C (coeff f n) ∈ map C I
[PROOFSTEP]
exact (I.map C : Ideal R[X]).mul_mem_left _ (mem_map_of_mem _ (hf n))
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
f : R →+* S
⊢ LinearMap.ker (RingHom.toSemilinearMap (mapRingHom f)) = map C (RingHom.ker f)
[PROOFSTEP]
ext
[GOAL]
case h
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
f : R →+* S
x✝ : R[X]
⊢ x✝ ∈ LinearMap.ker (RingHom.toSemilinearMap (mapRingHom f)) ↔ x✝ ∈ map C (RingHom.ker f)
[PROOFSTEP]
simp only [LinearMap.mem_ker, RingHom.toSemilinearMap_apply, coe_mapRingHom]
[GOAL]
case h
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
f : R →+* S
x✝ : R[X]
⊢ Polynomial.map f x✝ = 0 ↔ x✝ ∈ map C (RingHom.ker f)
[PROOFSTEP]
rw [mem_map_C_iff, Polynomial.ext_iff]
[GOAL]
case h
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
f : R →+* S
x✝ : R[X]
⊢ (∀ (n : ℕ), coeff (Polynomial.map f x✝) n = coeff 0 n) ↔ ∀ (n : ℕ), coeff x✝ n ∈ RingHom.ker f
[PROOFSTEP]
simp_rw [RingHom.mem_ker f, coeff_map, coeff_zero]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
n : ℕ
x : R
⊢ x ∈ leadingCoeffNth I n ↔ ∃ p, p ∈ I ∧ degree p ≤ ↑n ∧ Polynomial.leadingCoeff p = x
[PROOFSTEP]
simp only [leadingCoeffNth, degreeLE, Submodule.mem_map, lcoeff_apply, Submodule.mem_inf, mem_degreeLE]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
n : ℕ
x : R
⊢ (∃ y, (degree y ≤ ↑n ∧ y ∈ ofPolynomial I) ∧ coeff y n = x) ↔
    ∃ p, p ∈ I ∧ degree p ≤ ↑n ∧ Polynomial.leadingCoeff p = x
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
n : ℕ
x : R
⊢ (∃ y, (degree y ≤ ↑n ∧ y ∈ ofPolynomial I) ∧ coeff y n = x) →
    ∃ p, p ∈ I ∧ degree p ≤ ↑n ∧ Polynomial.leadingCoeff p = x
[PROOFSTEP]
rintro ⟨p, ⟨hpdeg, hpI⟩, rfl⟩
[GOAL]
case mp.intro.intro.intro
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
n : ℕ
p : R[X]
hpdeg : degree p ≤ ↑n
hpI : p ∈ ofPolynomial I
⊢ ∃ p_1, p_1 ∈ I ∧ degree p_1 ≤ ↑n ∧ Polynomial.leadingCoeff p_1 = coeff p n
[PROOFSTEP]
cases' lt_or_eq_of_le hpdeg with hpdeg hpdeg
[GOAL]
case mp.intro.intro.intro.inl
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
n : ℕ
p : R[X]
hpdeg✝ : degree p ≤ ↑n
hpI : p ∈ ofPolynomial I
hpdeg : degree p < ↑n
⊢ ∃ p_1, p_1 ∈ I ∧ degree p_1 ≤ ↑n ∧ Polynomial.leadingCoeff p_1 = coeff p n
[PROOFSTEP]
refine' ⟨0, I.zero_mem, bot_le, _⟩
[GOAL]
case mp.intro.intro.intro.inl
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
n : ℕ
p : R[X]
hpdeg✝ : degree p ≤ ↑n
hpI : p ∈ ofPolynomial I
hpdeg : degree p < ↑n
⊢ Polynomial.leadingCoeff 0 = coeff p n
[PROOFSTEP]
rw [leadingCoeff_zero, eq_comm]
[GOAL]
case mp.intro.intro.intro.inl
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
n : ℕ
p : R[X]
hpdeg✝ : degree p ≤ ↑n
hpI : p ∈ ofPolynomial I
hpdeg : degree p < ↑n
⊢ coeff p n = 0
[PROOFSTEP]
exact coeff_eq_zero_of_degree_lt hpdeg
[GOAL]
case mp.intro.intro.intro.inr
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
n : ℕ
p : R[X]
hpdeg✝ : degree p ≤ ↑n
hpI : p ∈ ofPolynomial I
hpdeg : degree p = ↑n
⊢ ∃ p_1, p_1 ∈ I ∧ degree p_1 ≤ ↑n ∧ Polynomial.leadingCoeff p_1 = coeff p n
[PROOFSTEP]
refine' ⟨p, hpI, le_of_eq hpdeg, _⟩
[GOAL]
case mp.intro.intro.intro.inr
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
n : ℕ
p : R[X]
hpdeg✝ : degree p ≤ ↑n
hpI : p ∈ ofPolynomial I
hpdeg : degree p = ↑n
⊢ Polynomial.leadingCoeff p = coeff p n
[PROOFSTEP]
rw [Polynomial.leadingCoeff, natDegree, hpdeg, Nat.cast_withBot, WithBot.unbot'_coe]
[GOAL]
case mpr
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
n : ℕ
x : R
⊢ (∃ p, p ∈ I ∧ degree p ≤ ↑n ∧ Polynomial.leadingCoeff p = x) →
    ∃ y, (degree y ≤ ↑n ∧ y ∈ ofPolynomial I) ∧ coeff y n = x
[PROOFSTEP]
rintro ⟨p, hpI, hpdeg, rfl⟩
[GOAL]
case mpr.intro.intro.intro
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
n : ℕ
p : R[X]
hpI : p ∈ I
hpdeg : degree p ≤ ↑n
⊢ ∃ y, (degree y ≤ ↑n ∧ y ∈ ofPolynomial I) ∧ coeff y n = Polynomial.leadingCoeff p
[PROOFSTEP]
have : natDegree p + (n - natDegree p) = n := add_tsub_cancel_of_le (natDegree_le_of_degree_le hpdeg)
[GOAL]
case mpr.intro.intro.intro
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
n : ℕ
p : R[X]
hpI : p ∈ I
hpdeg : degree p ≤ ↑n
this : natDegree p + (n - natDegree p) = n
⊢ ∃ y, (degree y ≤ ↑n ∧ y ∈ ofPolynomial I) ∧ coeff y n = Polynomial.leadingCoeff p
[PROOFSTEP]
refine' ⟨p * X ^ (n - natDegree p), ⟨_, I.mul_mem_right _ hpI⟩, _⟩
[GOAL]
case mpr.intro.intro.intro.refine'_1
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
n : ℕ
p : R[X]
hpI : p ∈ I
hpdeg : degree p ≤ ↑n
this : natDegree p + (n - natDegree p) = n
⊢ degree (p * X ^ (n - natDegree p)) ≤ ↑n
[PROOFSTEP]
apply le_trans (degree_mul_le _ _) _
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
n : ℕ
p : R[X]
hpI : p ∈ I
hpdeg : degree p ≤ ↑n
this : natDegree p + (n - natDegree p) = n
⊢ degree p + degree (X ^ (n - natDegree p)) ≤ ↑n
[PROOFSTEP]
apply le_trans (add_le_add degree_le_natDegree (degree_X_pow_le _)) _
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
n : ℕ
p : R[X]
hpI : p ∈ I
hpdeg : degree p ≤ ↑n
this : natDegree p + (n - natDegree p) = n
⊢ ↑(natDegree p) + ↑(n - natDegree p) ≤ ↑n
[PROOFSTEP]
rw [Nat.cast_withBot, Nat.cast_withBot, ← WithBot.coe_add, this, Nat.cast_withBot]
[GOAL]
case mpr.intro.intro.intro.refine'_2
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
n : ℕ
p : R[X]
hpI : p ∈ I
hpdeg : degree p ≤ ↑n
this : natDegree p + (n - natDegree p) = n
⊢ coeff (p * X ^ (n - natDegree p)) n = Polynomial.leadingCoeff p
[PROOFSTEP]
rw [Polynomial.leadingCoeff, ← coeff_mul_X_pow p (n - natDegree p), this]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
x : R
x✝ : ∃ p, p ∈ I ∧ degree p ≤ ↑0 ∧ Polynomial.leadingCoeff p = x
p : R[X]
hpI : p ∈ I
hpdeg : degree p ≤ ↑0
hpx : Polynomial.leadingCoeff p = x
⊢ ↑C x ∈ I
[PROOFSTEP]
rwa [← hpx, Polynomial.leadingCoeff, Nat.eq_zero_of_le_zero (natDegree_le_of_degree_le hpdeg), ←
  eq_C_of_degree_le_zero hpdeg]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
m n : ℕ
H : m ≤ n
⊢ leadingCoeffNth I m ≤ leadingCoeffNth I n
[PROOFSTEP]
intro r hr
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
m n : ℕ
H : m ≤ n
r : R
hr : r ∈ leadingCoeffNth I m
⊢ r ∈ leadingCoeffNth I n
[PROOFSTEP]
simp only [SetLike.mem_coe, mem_leadingCoeffNth] at hr ⊢
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
m n : ℕ
H : m ≤ n
r : R
hr : ∃ p, p ∈ I ∧ degree p ≤ ↑m ∧ Polynomial.leadingCoeff p = r
⊢ ∃ p, p ∈ I ∧ degree p ≤ ↑n ∧ Polynomial.leadingCoeff p = r
[PROOFSTEP]
rcases hr with ⟨p, hpI, hpdeg, rfl⟩
[GOAL]
case intro.intro.intro
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
m n : ℕ
H : m ≤ n
p : R[X]
hpI : p ∈ I
hpdeg : degree p ≤ ↑m
⊢ ∃ p_1, p_1 ∈ I ∧ degree p_1 ≤ ↑n ∧ Polynomial.leadingCoeff p_1 = Polynomial.leadingCoeff p
[PROOFSTEP]
refine' ⟨p * X ^ (n - m), I.mul_mem_right _ hpI, _, leadingCoeff_mul_X_pow⟩
[GOAL]
case intro.intro.intro
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
m n : ℕ
H : m ≤ n
p : R[X]
hpI : p ∈ I
hpdeg : degree p ≤ ↑m
⊢ degree (p * X ^ (n - m)) ≤ ↑n
[PROOFSTEP]
refine' le_trans (degree_mul_le _ _) _
[GOAL]
case intro.intro.intro
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
m n : ℕ
H : m ≤ n
p : R[X]
hpI : p ∈ I
hpdeg : degree p ≤ ↑m
⊢ degree p + degree (X ^ (n - m)) ≤ ↑n
[PROOFSTEP]
refine' le_trans (add_le_add hpdeg (degree_X_pow_le _)) _
[GOAL]
case intro.intro.intro
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
m n : ℕ
H : m ≤ n
p : R[X]
hpI : p ∈ I
hpdeg : degree p ≤ ↑m
⊢ ↑m + ↑(n - m) ≤ ↑n
[PROOFSTEP]
rw [Nat.cast_withBot, Nat.cast_withBot, ← WithBot.coe_add, add_tsub_cancel_of_le H, Nat.cast_withBot]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
x : R
⊢ x ∈ leadingCoeff I ↔ ∃ p, p ∈ I ∧ Polynomial.leadingCoeff p = x
[PROOFSTEP]
rw [leadingCoeff, Submodule.mem_iSup_of_directed]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
x : R
⊢ (∃ i, x ∈ leadingCoeffNth I i) ↔ ∃ p, p ∈ I ∧ Polynomial.leadingCoeff p = x
case H
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
x : R
⊢ Directed (fun x x_1 => x ≤ x_1) fun n => leadingCoeffNth I n
[PROOFSTEP]
simp only [mem_leadingCoeffNth]
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
x : R
⊢ (∃ i p, p ∈ I ∧ degree p ≤ ↑i ∧ Polynomial.leadingCoeff p = x) ↔ ∃ p, p ∈ I ∧ Polynomial.leadingCoeff p = x
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
x : R
⊢ (∃ i p, p ∈ I ∧ degree p ≤ ↑i ∧ Polynomial.leadingCoeff p = x) → ∃ p, p ∈ I ∧ Polynomial.leadingCoeff p = x
[PROOFSTEP]
rintro ⟨i, p, hpI, _, rfl⟩
[GOAL]
case mp.intro.intro.intro.intro
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
i : ℕ
p : R[X]
hpI : p ∈ I
left✝ : degree p ≤ ↑i
⊢ ∃ p_1, p_1 ∈ I ∧ Polynomial.leadingCoeff p_1 = Polynomial.leadingCoeff p
[PROOFSTEP]
exact ⟨p, hpI, rfl⟩
[GOAL]
case mpr
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
x : R
⊢ (∃ p, p ∈ I ∧ Polynomial.leadingCoeff p = x) → ∃ i p, p ∈ I ∧ degree p ≤ ↑i ∧ Polynomial.leadingCoeff p = x
[PROOFSTEP]
rintro ⟨p, hpI, rfl⟩
[GOAL]
case mpr.intro.intro
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
p : R[X]
hpI : p ∈ I
⊢ ∃ i p_1, p_1 ∈ I ∧ degree p_1 ≤ ↑i ∧ Polynomial.leadingCoeff p_1 = Polynomial.leadingCoeff p
[PROOFSTEP]
exact ⟨natDegree p, p, hpI, degree_le_natDegree, rfl⟩
[GOAL]
case H
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
x : R
⊢ Directed (fun x x_1 => x ≤ x_1) fun n => leadingCoeffNth I n
[PROOFSTEP]
intro i j
[GOAL]
case H
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R[X]
x : R
i j : ℕ
⊢ ∃ z,
    (fun x x_1 => x ≤ x_1) ((fun n => leadingCoeffNth I n) i) ((fun n => leadingCoeffNth I n) z) ∧
      (fun x x_1 => x ≤ x_1) ((fun n => leadingCoeffNth I n) j) ((fun n => leadingCoeffNth I n) z)
[PROOFSTEP]
exact ⟨i + j, I.leadingCoeffNth_mono (Nat.le_add_right _ _), I.leadingCoeffNth_mono (Nat.le_add_left _ _)⟩
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I✝ : Ideal R[X]
ι : Type u_2
s : Finset ι
f : ι → R[X]
I : Ideal R
n : ι → ℕ
h : ∀ (i : ι), i ∈ s → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
k : ℕ
⊢ coeff (Finset.prod s f) k ∈ I ^ (Finset.sum s n - k)
[PROOFSTEP]
classical
induction' s using Finset.induction with a s ha hs generalizing k
· rw [sum_empty, prod_empty, coeff_one, zero_tsub, pow_zero, Ideal.one_eq_top]
  exact Submodule.mem_top
· rw [sum_insert ha, prod_insert ha, coeff_mul]
  apply sum_mem
  rintro ⟨i, j⟩ e
  obtain rfl : i + j = k := Nat.mem_antidiagonal.mp e
  apply Ideal.pow_le_pow add_tsub_add_le_tsub_add_tsub
  rw [pow_add]
  exact
    Ideal.mul_mem_mul (h _ (Finset.mem_insert.mpr <| Or.inl rfl) _)
      (hs (fun i hi k => h _ (Finset.mem_insert.mpr <| Or.inr hi) _) j)
[GOAL]
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I✝ : Ideal R[X]
ι : Type u_2
s : Finset ι
f : ι → R[X]
I : Ideal R
n : ι → ℕ
h : ∀ (i : ι), i ∈ s → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
k : ℕ
⊢ coeff (Finset.prod s f) k ∈ I ^ (Finset.sum s n - k)
[PROOFSTEP]
induction' s using Finset.induction with a s ha hs generalizing k
[GOAL]
case empty
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I✝ : Ideal R[X]
ι : Type u_2
s : Finset ι
f : ι → R[X]
I : Ideal R
n : ι → ℕ
h✝ : ∀ (i : ι), i ∈ s → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
k✝ : ℕ
h : ∀ (i : ι), i ∈ ∅ → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
k : ℕ
⊢ coeff (Finset.prod ∅ f) k ∈ I ^ (Finset.sum ∅ n - k)
[PROOFSTEP]
rw [sum_empty, prod_empty, coeff_one, zero_tsub, pow_zero, Ideal.one_eq_top]
[GOAL]
case empty
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I✝ : Ideal R[X]
ι : Type u_2
s : Finset ι
f : ι → R[X]
I : Ideal R
n : ι → ℕ
h✝ : ∀ (i : ι), i ∈ s → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
k✝ : ℕ
h : ∀ (i : ι), i ∈ ∅ → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
k : ℕ
⊢ (if 0 = k then 1 else 0) ∈ ⊤
[PROOFSTEP]
exact Submodule.mem_top
[GOAL]
case insert
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I✝ : Ideal R[X]
ι : Type u_2
s✝ : Finset ι
f : ι → R[X]
I : Ideal R
n : ι → ℕ
h✝ : ∀ (i : ι), i ∈ s✝ → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
k✝ : ℕ
a : ι
s : Finset ι
ha : ¬a ∈ s
hs :
  (∀ (i : ι), i ∈ s → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)) →
    ∀ (k : ℕ), coeff (Finset.prod s f) k ∈ I ^ (Finset.sum s n - k)
h : ∀ (i : ι), i ∈ insert a s → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
k : ℕ
⊢ coeff (Finset.prod (insert a s) f) k ∈ I ^ (Finset.sum (insert a s) n - k)
[PROOFSTEP]
rw [sum_insert ha, prod_insert ha, coeff_mul]
[GOAL]
case insert
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I✝ : Ideal R[X]
ι : Type u_2
s✝ : Finset ι
f : ι → R[X]
I : Ideal R
n : ι → ℕ
h✝ : ∀ (i : ι), i ∈ s✝ → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
k✝ : ℕ
a : ι
s : Finset ι
ha : ¬a ∈ s
hs :
  (∀ (i : ι), i ∈ s → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)) →
    ∀ (k : ℕ), coeff (Finset.prod s f) k ∈ I ^ (Finset.sum s n - k)
h : ∀ (i : ι), i ∈ insert a s → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
k : ℕ
⊢ ∑ x in Nat.antidiagonal k, coeff (f a) x.fst * coeff (∏ x in s, f x) x.snd ∈ I ^ (n a + ∑ x in s, n x - k)
[PROOFSTEP]
apply sum_mem
[GOAL]
case insert.a
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I✝ : Ideal R[X]
ι : Type u_2
s✝ : Finset ι
f : ι → R[X]
I : Ideal R
n : ι → ℕ
h✝ : ∀ (i : ι), i ∈ s✝ → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
k✝ : ℕ
a : ι
s : Finset ι
ha : ¬a ∈ s
hs :
  (∀ (i : ι), i ∈ s → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)) →
    ∀ (k : ℕ), coeff (Finset.prod s f) k ∈ I ^ (Finset.sum s n - k)
h : ∀ (i : ι), i ∈ insert a s → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
k : ℕ
⊢ ∀ (c : ℕ × ℕ),
    c ∈ Nat.antidiagonal k → coeff (f a) c.fst * coeff (∏ x in s, f x) c.snd ∈ I ^ (n a + ∑ x in s, n x - k)
[PROOFSTEP]
rintro ⟨i, j⟩ e
[GOAL]
case insert.a.mk
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I✝ : Ideal R[X]
ι : Type u_2
s✝ : Finset ι
f : ι → R[X]
I : Ideal R
n : ι → ℕ
h✝ : ∀ (i : ι), i ∈ s✝ → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
k✝ : ℕ
a : ι
s : Finset ι
ha : ¬a ∈ s
hs :
  (∀ (i : ι), i ∈ s → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)) →
    ∀ (k : ℕ), coeff (Finset.prod s f) k ∈ I ^ (Finset.sum s n - k)
h : ∀ (i : ι), i ∈ insert a s → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
k i j : ℕ
e : (i, j) ∈ Nat.antidiagonal k
⊢ coeff (f a) (i, j).fst * coeff (∏ x in s, f x) (i, j).snd ∈ I ^ (n a + ∑ x in s, n x - k)
[PROOFSTEP]
obtain rfl : i + j = k := Nat.mem_antidiagonal.mp e
[GOAL]
case insert.a.mk
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I✝ : Ideal R[X]
ι : Type u_2
s✝ : Finset ι
f : ι → R[X]
I : Ideal R
n : ι → ℕ
h✝ : ∀ (i : ι), i ∈ s✝ → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
k : ℕ
a : ι
s : Finset ι
ha : ¬a ∈ s
hs :
  (∀ (i : ι), i ∈ s → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)) →
    ∀ (k : ℕ), coeff (Finset.prod s f) k ∈ I ^ (Finset.sum s n - k)
h : ∀ (i : ι), i ∈ insert a s → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
i j : ℕ
e : (i, j) ∈ Nat.antidiagonal (i + j)
⊢ coeff (f a) (i, j).fst * coeff (∏ x in s, f x) (i, j).snd ∈ I ^ (n a + ∑ x in s, n x - (i + j))
[PROOFSTEP]
apply Ideal.pow_le_pow add_tsub_add_le_tsub_add_tsub
[GOAL]
case insert.a.mk.a
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I✝ : Ideal R[X]
ι : Type u_2
s✝ : Finset ι
f : ι → R[X]
I : Ideal R
n : ι → ℕ
h✝ : ∀ (i : ι), i ∈ s✝ → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
k : ℕ
a : ι
s : Finset ι
ha : ¬a ∈ s
hs :
  (∀ (i : ι), i ∈ s → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)) →
    ∀ (k : ℕ), coeff (Finset.prod s f) k ∈ I ^ (Finset.sum s n - k)
h : ∀ (i : ι), i ∈ insert a s → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
i j : ℕ
e : (i, j) ∈ Nat.antidiagonal (i + j)
⊢ coeff (f a) (i, j).fst * coeff (∏ x in s, f x) (i, j).snd ∈ I ^ (n a - i + (∑ x in s, n x - j))
[PROOFSTEP]
rw [pow_add]
[GOAL]
case insert.a.mk.a
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I✝ : Ideal R[X]
ι : Type u_2
s✝ : Finset ι
f : ι → R[X]
I : Ideal R
n : ι → ℕ
h✝ : ∀ (i : ι), i ∈ s✝ → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
k : ℕ
a : ι
s : Finset ι
ha : ¬a ∈ s
hs :
  (∀ (i : ι), i ∈ s → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)) →
    ∀ (k : ℕ), coeff (Finset.prod s f) k ∈ I ^ (Finset.sum s n - k)
h : ∀ (i : ι), i ∈ insert a s → ∀ (k : ℕ), coeff (f i) k ∈ I ^ (n i - k)
i j : ℕ
e : (i, j) ∈ Nat.antidiagonal (i + j)
⊢ coeff (f a) (i, j).fst * coeff (∏ x in s, f x) (i, j).snd ∈ I ^ (n a - i) * I ^ (∑ x in s, n x - j)
[PROOFSTEP]
exact
  Ideal.mul_mem_mul (h _ (Finset.mem_insert.mpr <| Or.inl rfl) _)
    (hs (fun i hi k => h _ (Finset.mem_insert.mpr <| Or.inr hi) _) j)
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
⊢ ¬IsField R[X]
[PROOFSTEP]
nontriviality R
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
✝ : Nontrivial R
⊢ ¬IsField R[X]
[PROOFSTEP]
intro hR
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
✝ : Nontrivial R
hR : IsField R[X]
⊢ False
[PROOFSTEP]
obtain ⟨p, hp⟩ := hR.mul_inv_cancel X_ne_zero
[GOAL]
case intro
R : Type u
S : Type u_1
inst✝ : Ring R
✝ : Nontrivial R
hR : IsField R[X]
p : R[X]
hp : X * p = 1
⊢ False
[PROOFSTEP]
have hp0 : p ≠ 0 := right_ne_zero_of_mul_eq_one hp
[GOAL]
case intro
R : Type u
S : Type u_1
inst✝ : Ring R
✝ : Nontrivial R
hR : IsField R[X]
p : R[X]
hp : X * p = 1
hp0 : p ≠ 0
⊢ False
[PROOFSTEP]
have := degree_lt_degree_mul_X hp0
[GOAL]
case intro
R : Type u
S : Type u_1
inst✝ : Ring R
✝ : Nontrivial R
hR : IsField R[X]
p : R[X]
hp : X * p = 1
hp0 : p ≠ 0
this : degree p < degree (p * X)
⊢ False
[PROOFSTEP]
rw [← X_mul, congr_arg degree hp, degree_one, Nat.WithBot.lt_zero_iff, degree_eq_bot] at this
[GOAL]
case intro
R : Type u
S : Type u_1
inst✝ : Ring R
✝ : Nontrivial R
hR : IsField R[X]
p : R[X]
hp : X * p = 1
hp0 : p ≠ 0
this : p = 0
⊢ False
[PROOFSTEP]
exact hp0 this
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
hR : IsField R
I : Ideal R[X]
hI : IsMaximal I
x : R
hx : ↑C x ∈ I
⊢ x = 0
[PROOFSTEP]
refine' Classical.by_contradiction fun hx0 => hI.ne_top ((eq_top_iff_one I).2 _)
[GOAL]
R : Type u
S : Type u_1
inst✝ : Ring R
hR : IsField R
I : Ideal R[X]
hI : IsMaximal I
x : R
hx : ↑C x ∈ I
hx0 : ¬x = 0
⊢ 1 ∈ I
[PROOFSTEP]
obtain ⟨y, hy⟩ := hR.mul_inv_cancel hx0
[GOAL]
case intro
R : Type u
S : Type u_1
inst✝ : Ring R
hR : IsField R
I : Ideal R[X]
hI : IsMaximal I
x : R
hx : ↑C x ∈ I
hx0 : ¬x = 0
y : R
hy : x * y = 1
⊢ 1 ∈ I
[PROOFSTEP]
convert I.mul_mem_left (C y) hx
[GOAL]
case h.e'_4
R : Type u
S : Type u_1
inst✝ : Ring R
hR : IsField R
I : Ideal R[X]
hI : IsMaximal I
x : R
hx : ↑C x ∈ I
hx0 : ¬x = 0
y : R
hy : x * y = 1
⊢ 1 = ↑C y * ↑C x
[PROOFSTEP]
rw [← C.map_mul, hR.mul_comm y x, hy, RingHom.map_one]
[GOAL]
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
⊢ IsPrime (map C P) ↔ IsPrime P
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
⊢ IsPrime (map C P) → IsPrime P
[PROOFSTEP]
intro H
[GOAL]
case mp
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
H : IsPrime (map C P)
⊢ IsPrime P
[PROOFSTEP]
have := @comap_isPrime R R[X] (R →+* R[X]) _ _ _ C (map C P) H
[GOAL]
case mp
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
H : IsPrime (map C P)
this : IsPrime (comap C (map C P))
⊢ IsPrime P
[PROOFSTEP]
convert this using 1
[GOAL]
case h.e'_3
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
H : IsPrime (map C P)
this : IsPrime (comap C (map C P))
⊢ P = comap C (map C P)
[PROOFSTEP]
ext x
[GOAL]
case h.e'_3.h
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
H : IsPrime (map C P)
this : IsPrime (comap C (map C P))
x : R
⊢ x ∈ P ↔ x ∈ comap C (map C P)
[PROOFSTEP]
simp only [mem_comap, mem_map_C_iff]
[GOAL]
case h.e'_3.h
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
H : IsPrime (map C P)
this : IsPrime (comap C (map C P))
x : R
⊢ x ∈ P ↔ ∀ (n : ℕ), coeff (↑C x) n ∈ P
[PROOFSTEP]
constructor
[GOAL]
case h.e'_3.h.mp
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
H : IsPrime (map C P)
this : IsPrime (comap C (map C P))
x : R
⊢ x ∈ P → ∀ (n : ℕ), coeff (↑C x) n ∈ P
[PROOFSTEP]
rintro h (- | n)
[GOAL]
case h.e'_3.h.mp.zero
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
H : IsPrime (map C P)
this : IsPrime (comap C (map C P))
x : R
h : x ∈ P
⊢ coeff (↑C x) Nat.zero ∈ P
[PROOFSTEP]
rwa [coeff_C_zero]
[GOAL]
case h.e'_3.h.mp.succ
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
H : IsPrime (map C P)
this : IsPrime (comap C (map C P))
x : R
h : x ∈ P
n : ℕ
⊢ coeff (↑C x) (Nat.succ n) ∈ P
[PROOFSTEP]
simp only [coeff_C_ne_zero (Nat.succ_ne_zero _), Submodule.zero_mem]
[GOAL]
case h.e'_3.h.mpr
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
H : IsPrime (map C P)
this : IsPrime (comap C (map C P))
x : R
⊢ (∀ (n : ℕ), coeff (↑C x) n ∈ P) → x ∈ P
[PROOFSTEP]
intro h
[GOAL]
case h.e'_3.h.mpr
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
H : IsPrime (map C P)
this : IsPrime (comap C (map C P))
x : R
h : ∀ (n : ℕ), coeff (↑C x) n ∈ P
⊢ x ∈ P
[PROOFSTEP]
simpa only [coeff_C_zero] using h 0
[GOAL]
case mpr
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
⊢ IsPrime P → IsPrime (map C P)
[PROOFSTEP]
intro h
[GOAL]
case mpr
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
⊢ IsPrime (map C P)
[PROOFSTEP]
constructor
[GOAL]
case mpr.ne_top'
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
⊢ map C P ≠ ⊤
[PROOFSTEP]
rw [Ne.def, eq_top_iff_one, mem_map_C_iff, not_forall]
[GOAL]
case mpr.ne_top'
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
⊢ ∃ x, ¬coeff 1 x ∈ P
[PROOFSTEP]
use 0
[GOAL]
case h
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
⊢ ¬coeff 1 0 ∈ P
[PROOFSTEP]
rw [coeff_one_zero, ← eq_top_iff_one]
[GOAL]
case h
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
⊢ ¬P = ⊤
[PROOFSTEP]
exact h.1
[GOAL]
case mpr.mem_or_mem'
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
⊢ ∀ {x y : R[X]}, x * y ∈ map C P → x ∈ map C P ∨ y ∈ map C P
[PROOFSTEP]
intro f g
[GOAL]
case mpr.mem_or_mem'
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
⊢ f * g ∈ map C P → f ∈ map C P ∨ g ∈ map C P
[PROOFSTEP]
simp only [mem_map_C_iff]
[GOAL]
case mpr.mem_or_mem'
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
⊢ (∀ (n : ℕ), coeff (f * g) n ∈ P) → (∀ (n : ℕ), coeff f n ∈ P) ∨ ∀ (n : ℕ), coeff g n ∈ P
[PROOFSTEP]
contrapose!
[GOAL]
case mpr.mem_or_mem'
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
⊢ ((∃ n, ¬coeff f n ∈ P) ∧ ∃ n, ¬coeff g n ∈ P) → ∃ n, ¬coeff (f * g) n ∈ P
[PROOFSTEP]
rintro ⟨hf, hg⟩
[GOAL]
case mpr.mem_or_mem'.intro
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
⊢ ∃ n, ¬coeff (f * g) n ∈ P
[PROOFSTEP]
classical
let m := Nat.find hf
let n := Nat.find hg
refine' ⟨m + n, _⟩
rw [coeff_mul, ← Finset.insert_erase ((@Finset.Nat.mem_antidiagonal _ (m, n)).mpr rfl),
  Finset.sum_insert (Finset.not_mem_erase _ _), (P.add_mem_iff_left _).not]
· apply mt h.2
  rw [not_or]
  exact ⟨Nat.find_spec hf, Nat.find_spec hg⟩
apply P.sum_mem
rintro ⟨i, j⟩ hij
rw [Finset.mem_erase, Finset.Nat.mem_antidiagonal] at hij
simp only [Ne.def, Prod.mk.inj_iff, not_and_or] at hij
obtain hi | hj : i < m ∨ j < n := by
  rw [or_iff_not_imp_left, not_lt, le_iff_lt_or_eq]
  rintro (hmi | rfl)
  · rw [← not_le]
    intro hnj
    exact (add_lt_add_of_lt_of_le hmi hnj).ne hij.2.symm
  · simp only [eq_self_iff_true, not_true, false_or_iff, add_right_inj, not_and_self_iff] at hij
· rw [mul_comm]
  apply P.mul_mem_left
  exact Classical.not_not.1 (Nat.find_min hf hi)
· apply P.mul_mem_left
  exact Classical.not_not.1 (Nat.find_min hg hj)
[GOAL]
case mpr.mem_or_mem'.intro
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
⊢ ∃ n, ¬coeff (f * g) n ∈ P
[PROOFSTEP]
let m := Nat.find hf
[GOAL]
case mpr.mem_or_mem'.intro
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
⊢ ∃ n, ¬coeff (f * g) n ∈ P
[PROOFSTEP]
let n := Nat.find hg
[GOAL]
case mpr.mem_or_mem'.intro
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
⊢ ∃ n, ¬coeff (f * g) n ∈ P
[PROOFSTEP]
refine' ⟨m + n, _⟩
[GOAL]
case mpr.mem_or_mem'.intro
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
⊢ ¬coeff (f * g) (m + n) ∈ P
[PROOFSTEP]
rw [coeff_mul, ← Finset.insert_erase ((@Finset.Nat.mem_antidiagonal _ (m, n)).mpr rfl),
  Finset.sum_insert (Finset.not_mem_erase _ _), (P.add_mem_iff_left _).not]
[GOAL]
case mpr.mem_or_mem'.intro
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
⊢ ¬coeff f (m, n).fst * coeff g (m, n).snd ∈ P
[PROOFSTEP]
apply mt h.2
[GOAL]
case mpr.mem_or_mem'.intro
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
⊢ ¬(coeff f (m, n).fst ∈ P ∨ coeff g (m, n).snd ∈ P)
[PROOFSTEP]
rw [not_or]
[GOAL]
case mpr.mem_or_mem'.intro
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
⊢ ¬coeff f (m, n).fst ∈ P ∧ ¬coeff g (m, n).snd ∈ P
[PROOFSTEP]
exact ⟨Nat.find_spec hf, Nat.find_spec hg⟩
[GOAL]
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
⊢ ∑ x in Finset.erase (Nat.antidiagonal ((m, n).fst + (m, n).snd)) (m, n), coeff f x.fst * coeff g x.snd ∈ P
[PROOFSTEP]
apply P.sum_mem
[GOAL]
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
⊢ ∀ (c : ℕ × ℕ),
    c ∈ Finset.erase (Nat.antidiagonal ((m, n).fst + (m, n).snd)) (m, n) → coeff f c.fst * coeff g c.snd ∈ P
[PROOFSTEP]
rintro ⟨i, j⟩ hij
[GOAL]
case mk
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
i j : ℕ
hij : (i, j) ∈ Finset.erase (Nat.antidiagonal ((m, n).fst + (m, n).snd)) (m, n)
⊢ coeff f (i, j).fst * coeff g (i, j).snd ∈ P
[PROOFSTEP]
rw [Finset.mem_erase, Finset.Nat.mem_antidiagonal] at hij
[GOAL]
case mk
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
i j : ℕ
hij : (i, j) ≠ (m, n) ∧ (i, j).fst + (i, j).snd = (m, n).fst + (m, n).snd
⊢ coeff f (i, j).fst * coeff g (i, j).snd ∈ P
[PROOFSTEP]
simp only [Ne.def, Prod.mk.inj_iff, not_and_or] at hij
[GOAL]
case mk
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
i j : ℕ
hij : (¬i = Nat.find hf ∨ ¬j = Nat.find hg) ∧ i + j = Nat.find hf + Nat.find hg
⊢ coeff f (i, j).fst * coeff g (i, j).snd ∈ P
[PROOFSTEP]
obtain hi | hj : i < m ∨ j < n := by
  rw [or_iff_not_imp_left, not_lt, le_iff_lt_or_eq]
  rintro (hmi | rfl)
  · rw [← not_le]
    intro hnj
    exact (add_lt_add_of_lt_of_le hmi hnj).ne hij.2.symm
  · simp only [eq_self_iff_true, not_true, false_or_iff, add_right_inj, not_and_self_iff] at hij
[GOAL]
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
i j : ℕ
hij : (¬i = Nat.find hf ∨ ¬j = Nat.find hg) ∧ i + j = Nat.find hf + Nat.find hg
⊢ i < m ∨ j < n
[PROOFSTEP]
rw [or_iff_not_imp_left, not_lt, le_iff_lt_or_eq]
[GOAL]
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
i j : ℕ
hij : (¬i = Nat.find hf ∨ ¬j = Nat.find hg) ∧ i + j = Nat.find hf + Nat.find hg
⊢ m < i ∨ m = i → j < n
[PROOFSTEP]
rintro (hmi | rfl)
[GOAL]
case inl
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
i j : ℕ
hij : (¬i = Nat.find hf ∨ ¬j = Nat.find hg) ∧ i + j = Nat.find hf + Nat.find hg
hmi : m < i
⊢ j < n
[PROOFSTEP]
rw [← not_le]
[GOAL]
case inl
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
i j : ℕ
hij : (¬i = Nat.find hf ∨ ¬j = Nat.find hg) ∧ i + j = Nat.find hf + Nat.find hg
hmi : m < i
⊢ ¬n ≤ j
[PROOFSTEP]
intro hnj
[GOAL]
case inl
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
i j : ℕ
hij : (¬i = Nat.find hf ∨ ¬j = Nat.find hg) ∧ i + j = Nat.find hf + Nat.find hg
hmi : m < i
hnj : n ≤ j
⊢ False
[PROOFSTEP]
exact (add_lt_add_of_lt_of_le hmi hnj).ne hij.2.symm
[GOAL]
case inr
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
j : ℕ
hij : (¬m = Nat.find hf ∨ ¬j = Nat.find hg) ∧ m + j = Nat.find hf + Nat.find hg
⊢ j < n
[PROOFSTEP]
simp only [eq_self_iff_true, not_true, false_or_iff, add_right_inj, not_and_self_iff] at hij
[GOAL]
case mk.inl
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
i j : ℕ
hij : (¬i = Nat.find hf ∨ ¬j = Nat.find hg) ∧ i + j = Nat.find hf + Nat.find hg
hi : i < m
⊢ coeff f (i, j).fst * coeff g (i, j).snd ∈ P
[PROOFSTEP]
rw [mul_comm]
[GOAL]
case mk.inl
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
i j : ℕ
hij : (¬i = Nat.find hf ∨ ¬j = Nat.find hg) ∧ i + j = Nat.find hf + Nat.find hg
hi : i < m
⊢ coeff g (i, j).snd * coeff f (i, j).fst ∈ P
[PROOFSTEP]
apply P.mul_mem_left
[GOAL]
case mk.inl.a
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
i j : ℕ
hij : (¬i = Nat.find hf ∨ ¬j = Nat.find hg) ∧ i + j = Nat.find hf + Nat.find hg
hi : i < m
⊢ coeff f (i, j).fst ∈ P
[PROOFSTEP]
exact Classical.not_not.1 (Nat.find_min hf hi)
[GOAL]
case mk.inr
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
i j : ℕ
hij : (¬i = Nat.find hf ∨ ¬j = Nat.find hg) ∧ i + j = Nat.find hf + Nat.find hg
hj : j < n
⊢ coeff f (i, j).fst * coeff g (i, j).snd ∈ P
[PROOFSTEP]
apply P.mul_mem_left
[GOAL]
case mk.inr.a
R : Type u
S : Type u_1
inst✝ : CommRing R
P : Ideal R
h : IsPrime P
f g : R[X]
hf : ∃ n, ¬coeff f n ∈ P
hg : ∃ n, ¬coeff g n ∈ P
m : ℕ := Nat.find hf
n : ℕ := Nat.find hg
i j : ℕ
hij : (¬i = Nat.find hf ∨ ¬j = Nat.find hg) ∧ i + j = Nat.find hf + Nat.find hg
hj : j < n
⊢ coeff g (i, j).snd ∈ P
[PROOFSTEP]
exact Classical.not_not.1 (Nat.find_min hg hj)
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
⊢ Prime r → Prime (↑C r)
[PROOFSTEP]
intro hr
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Prime r
⊢ Prime (↑C r)
[PROOFSTEP]
have := hr.1
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Prime r
this : r ≠ 0
⊢ Prime (↑C r)
[PROOFSTEP]
rw [← Ideal.span_singleton_prime] at hr ⊢
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Ideal.IsPrime (Ideal.span {r})
this : r ≠ 0
⊢ Ideal.IsPrime (Ideal.span {↑C r})
[PROOFSTEP]
rw [← Set.image_singleton, ← Ideal.map_span]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Ideal.IsPrime (Ideal.span {r})
this : r ≠ 0
⊢ Ideal.IsPrime (Ideal.map C (Ideal.span {r}))
[PROOFSTEP]
apply Ideal.isPrime_map_C_of_isPrime hr
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Ideal.IsPrime (Ideal.span {r})
this : r ≠ 0
⊢ ↑C r ≠ 0
[PROOFSTEP]
intro h
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Ideal.IsPrime (Ideal.span {r})
this : r ≠ 0
h : ↑C r = 0
⊢ False
[PROOFSTEP]
apply (this (C_eq_zero.mp h))
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Prime r
this : r ≠ 0
⊢ r ≠ 0
[PROOFSTEP]
assumption
[GOAL]
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
⊢ Prime (↑C r) ↔ Prime r
[PROOFSTEP]
let f (d : ℕ) := (finSuccEquiv R d).symm.toMulEquiv
[GOAL]
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
⊢ Prime (↑C r) ↔ Prime r
[PROOFSTEP]
let _coe' (d : ℕ) :
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R)
    (fun _ => (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R) :=
  inferInstance
[GOAL]
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
⊢ Prime (↑C r) ↔ Prime r
[PROOFSTEP]
have that (d : ℕ) : @C R (Fin (d + 1)) _ r = (f d) (Polynomial.C (@C R (Fin d) _ r)) := by
  rw [← finSuccEquiv_comp_C_eq_C]; rfl
[GOAL]
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
d : ℕ
⊢ ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
[PROOFSTEP]
rw [← finSuccEquiv_comp_C_eq_C]
[GOAL]
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
d : ℕ
⊢ ↑(RingHom.comp (↑(AlgEquiv.symm (finSuccEquiv R d))) (RingHom.comp Polynomial.C C)) r = ↑(f d) (↑Polynomial.C (↑C r))
[PROOFSTEP]
rfl
[GOAL]
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
⊢ Prime (↑C r) ↔ Prime r
[PROOFSTEP]
rw [(renameEquiv R (Fintype.equivFin σ)).toMulEquiv.prime_iff]
[GOAL]
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
⊢ Prime (↑(AlgEquiv.toMulEquiv (renameEquiv R (Fintype.equivFin σ))) (↑C r)) ↔ Prime r
[PROOFSTEP]
convert_to Prime (C r) ↔ _
[GOAL]
case h.e'_1.a
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
⊢ Prime (↑(AlgEquiv.toMulEquiv (renameEquiv R (Fintype.equivFin σ))) (↑C r)) ↔ Prime (↑C r)
[PROOFSTEP]
congr!
[GOAL]
case h.e'_1.a.a.h.e'_3
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
⊢ ↑(AlgEquiv.toMulEquiv (renameEquiv R (Fintype.equivFin σ))) (↑C r) = ↑C r
[PROOFSTEP]
apply rename_C
[GOAL]
case convert_3
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
⊢ Prime (↑C r) ↔ Prime r
[PROOFSTEP]
symm
[GOAL]
case convert_3
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
⊢ Prime r ↔ Prime (↑C r)
[PROOFSTEP]
induction' Fintype.card σ with d hd
[GOAL]
case convert_3.zero
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
⊢ Prime r ↔ Prime (↑C r)
[PROOFSTEP]
exact (isEmptyAlgEquiv R (Fin 0)).toMulEquiv.symm.prime_iff
[GOAL]
case convert_3.succ
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
d : ℕ
hd : Prime r ↔ Prime (↑C r)
⊢ Prime r ↔ Prime (↑C r)
[PROOFSTEP]
rw [hd, ← Polynomial.prime_C_iff]
[GOAL]
case convert_3.succ
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
d : ℕ
hd : Prime r ↔ Prime (↑C r)
⊢ Prime (↑Polynomial.C (↑C r)) ↔ Prime (↑C r)
[PROOFSTEP]
rw [that d]
  -- Porting note: change ?_ to _ and watch it time out
[GOAL]
case convert_3.succ
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
d : ℕ
hd : Prime r ↔ Prime (↑C r)
⊢ Prime (↑Polynomial.C (↑C r)) ↔ Prime (↑(f d) (↑Polynomial.C (↑C r)))
[PROOFSTEP]
refine
  @MulEquiv.prime_iff (MvPolynomial (Fin d) R)[X] (MvPolynomial (Fin (d + 1)) R) ?_ ?_ (Polynomial.C (C r))
    ?_
      -- Porting note: @'s help with multiple timeouts. It seems like there are too many things to unify
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Prime r
h : ↑C r = 0
⊢ r = 0
[PROOFSTEP]
rw [← C_inj, h]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Prime r
h : ↑C r = 0
⊢ 0 = ↑C 0
[PROOFSTEP]
simp
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Prime r
h : IsUnit (↑C r)
⊢ IsUnit r
[PROOFSTEP]
rw [← constantCoeff_C _ r]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Prime r
h : IsUnit (↑C r)
⊢ IsUnit (↑constantCoeff (↑C r))
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Prime r
h : IsUnit (↑C r)
⊢ Type ?u.516051
[PROOFSTEP]
exact h.map _
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Prime r
a b : (fun x => MvPolynomial σ R) r
hd : ↑C r ∣ a * b
⊢ ↑C r ∣ a ∨ ↑C r ∣ b
[PROOFSTEP]
obtain ⟨s, a', b', rfl, rfl⟩ := exists_finset_rename₂ a b
[GOAL]
case intro.intro.intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Prime r
s : Finset σ
a' b' : MvPolynomial { x // x ∈ s } R
hd : ↑C r ∣ ↑(rename Subtype.val) a' * ↑(rename Subtype.val) b'
⊢ ↑C r ∣ ↑(rename Subtype.val) a' ∨ ↑C r ∣ ↑(rename Subtype.val) b'
[PROOFSTEP]
rw [← algebraMap_eq] at hd
[GOAL]
case intro.intro.intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Prime r
s : Finset σ
a' b' : MvPolynomial { x // x ∈ s } R
hd : ↑(algebraMap R (MvPolynomial σ R)) r ∣ ↑(rename Subtype.val) a' * ↑(rename Subtype.val) b'
⊢ ↑C r ∣ ↑(rename Subtype.val) a' ∨ ↑C r ∣ ↑(rename Subtype.val) b'
[PROOFSTEP]
have := (@killCompl s σ R _ ((↑) : s → σ) Subtype.coe_injective).toRingHom.map_dvd hd
[GOAL]
case intro.intro.intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Prime r
s : Finset σ
a' b' : MvPolynomial { x // x ∈ s } R
hd : ↑(algebraMap R (MvPolynomial σ R)) r ∣ ↑(rename Subtype.val) a' * ↑(rename Subtype.val) b'
this :
  ↑↑(killCompl (_ : Function.Injective fun a => ↑a)) (↑(algebraMap R (MvPolynomial σ R)) r) ∣
    ↑↑(killCompl (_ : Function.Injective fun a => ↑a)) (↑(rename Subtype.val) a' * ↑(rename Subtype.val) b')
⊢ ↑C r ∣ ↑(rename Subtype.val) a' ∨ ↑C r ∣ ↑(rename Subtype.val) b'
[PROOFSTEP]
have : algebraMap R _ r ∣ a' * b' := by convert this <;> simp
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Prime r
s : Finset σ
a' b' : MvPolynomial { x // x ∈ s } R
hd : ↑(algebraMap R (MvPolynomial σ R)) r ∣ ↑(rename Subtype.val) a' * ↑(rename Subtype.val) b'
this :
  ↑↑(killCompl (_ : Function.Injective fun a => ↑a)) (↑(algebraMap R (MvPolynomial σ R)) r) ∣
    ↑↑(killCompl (_ : Function.Injective fun a => ↑a)) (↑(rename Subtype.val) a' * ↑(rename Subtype.val) b')
⊢ ↑(algebraMap R (MvPolynomial { x // x ∈ s } R)) r ∣ a' * b'
[PROOFSTEP]
convert this
[GOAL]
case h.e'_3
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Prime r
s : Finset σ
a' b' : MvPolynomial { x // x ∈ s } R
hd : ↑(algebraMap R (MvPolynomial σ R)) r ∣ ↑(rename Subtype.val) a' * ↑(rename Subtype.val) b'
this :
  ↑↑(killCompl (_ : Function.Injective fun a => ↑a)) (↑(algebraMap R (MvPolynomial σ R)) r) ∣
    ↑↑(killCompl (_ : Function.Injective fun a => ↑a)) (↑(rename Subtype.val) a' * ↑(rename Subtype.val) b')
⊢ ↑(algebraMap R (MvPolynomial { x // x ∈ s } R)) r =
    ↑↑(killCompl (_ : Function.Injective fun a => ↑a)) (↑(algebraMap R (MvPolynomial σ R)) r)
[PROOFSTEP]
simp
[GOAL]
case h.e'_4
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Prime r
s : Finset σ
a' b' : MvPolynomial { x // x ∈ s } R
hd : ↑(algebraMap R (MvPolynomial σ R)) r ∣ ↑(rename Subtype.val) a' * ↑(rename Subtype.val) b'
this :
  ↑↑(killCompl (_ : Function.Injective fun a => ↑a)) (↑(algebraMap R (MvPolynomial σ R)) r) ∣
    ↑↑(killCompl (_ : Function.Injective fun a => ↑a)) (↑(rename Subtype.val) a' * ↑(rename Subtype.val) b')
⊢ a' * b' = ↑↑(killCompl (_ : Function.Injective fun a => ↑a)) (↑(rename Subtype.val) a' * ↑(rename Subtype.val) b')
[PROOFSTEP]
simp
[GOAL]
case intro.intro.intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Prime r
s : Finset σ
a' b' : MvPolynomial { x // x ∈ s } R
hd : ↑(algebraMap R (MvPolynomial σ R)) r ∣ ↑(rename Subtype.val) a' * ↑(rename Subtype.val) b'
this✝ :
  ↑↑(killCompl (_ : Function.Injective fun a => ↑a)) (↑(algebraMap R (MvPolynomial σ R)) r) ∣
    ↑↑(killCompl (_ : Function.Injective fun a => ↑a)) (↑(rename Subtype.val) a' * ↑(rename Subtype.val) b')
this : ↑(algebraMap R (MvPolynomial { x // x ∈ s } R)) r ∣ a' * b'
⊢ ↑C r ∣ ↑(rename Subtype.val) a' ∨ ↑C r ∣ ↑(rename Subtype.val) b'
[PROOFSTEP]
rw [← rename_C ((↑) : s → σ)]
[GOAL]
case intro.intro.intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Prime r
s : Finset σ
a' b' : MvPolynomial { x // x ∈ s } R
hd : ↑(algebraMap R (MvPolynomial σ R)) r ∣ ↑(rename Subtype.val) a' * ↑(rename Subtype.val) b'
this✝ :
  ↑↑(killCompl (_ : Function.Injective fun a => ↑a)) (↑(algebraMap R (MvPolynomial σ R)) r) ∣
    ↑↑(killCompl (_ : Function.Injective fun a => ↑a)) (↑(rename Subtype.val) a' * ↑(rename Subtype.val) b')
this : ↑(algebraMap R (MvPolynomial { x // x ∈ s } R)) r ∣ a' * b'
⊢ ↑(rename Subtype.val) (↑C r) ∣ ↑(rename Subtype.val) a' ∨ ↑(rename Subtype.val) (↑C r) ∣ ↑(rename Subtype.val) b'
[PROOFSTEP]
let f := @AlgHom.toRingHom R (MvPolynomial s R) (MvPolynomial σ R) _ _ _ _ _ (@rename _ _ R _ ((↑) : s → σ))
[GOAL]
case intro.intro.intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
hr : Prime r
s : Finset σ
a' b' : MvPolynomial { x // x ∈ s } R
hd : ↑(algebraMap R (MvPolynomial σ R)) r ∣ ↑(rename Subtype.val) a' * ↑(rename Subtype.val) b'
this✝ :
  ↑↑(killCompl (_ : Function.Injective fun a => ↑a)) (↑(algebraMap R (MvPolynomial σ R)) r) ∣
    ↑↑(killCompl (_ : Function.Injective fun a => ↑a)) (↑(rename Subtype.val) a' * ↑(rename Subtype.val) b')
this : ↑(algebraMap R (MvPolynomial { x // x ∈ s } R)) r ∣ a' * b'
f : MvPolynomial { x // x ∈ s } R →+* MvPolynomial σ R := ↑(rename Subtype.val)
⊢ ↑(rename Subtype.val) (↑C r) ∣ ↑(rename Subtype.val) a' ∨ ↑(rename Subtype.val) (↑C r) ∣ ↑(rename Subtype.val) b'
[PROOFSTEP]
exact (((prime_C_iff_of_fintype s).2 hr).2.2 a' b' this).imp f.map_dvd f.map_dvd
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
⊢ Prime (↑(rename Subtype.val) p) ↔ Prime p
[PROOFSTEP]
classical
symm
let eqv := (sumAlgEquiv R (↥sᶜ) s).symm.trans (renameEquiv R <| (Equiv.sumComm (↥sᶜ) s).trans <| Equiv.Set.sumCompl s)
have : (rename (↑)).toRingHom = eqv.toAlgHom.toRingHom.comp C :=
  by
  apply ringHom_ext
  · intro
    dsimp
    erw [iterToSum_C_C, rename_C, rename_C]
  · intro
    dsimp
    erw [iterToSum_C_X, rename_X, rename_X]
    rfl
rw [← @prime_C_iff (MvPolynomial s R) (↥sᶜ) instCommRingMvPolynomial p]
rw [@MulEquiv.prime_iff (MvPolynomial ↑sᶜ (MvPolynomial (↑s) R)) (MvPolynomial σ R) (_) (_)]
rotate_left
exact eqv.toMulEquiv
convert Iff.rfl
apply RingHom.congr_fun this p
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
⊢ Prime (↑(rename Subtype.val) p) ↔ Prime p
[PROOFSTEP]
symm
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
⊢ Prime p ↔ Prime (↑(rename Subtype.val) p)
[PROOFSTEP]
let eqv := (sumAlgEquiv R (↥sᶜ) s).symm.trans (renameEquiv R <| (Equiv.sumComm (↥sᶜ) s).trans <| Equiv.Set.sumCompl s)
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
⊢ Prime p ↔ Prime (↑(rename Subtype.val) p)
[PROOFSTEP]
have : (rename (↑)).toRingHom = eqv.toAlgHom.toRingHom.comp C :=
  by
  apply ringHom_ext
  · intro
    dsimp
    erw [iterToSum_C_C, rename_C, rename_C]
  · intro
    dsimp
    erw [iterToSum_C_X, rename_X, rename_X]
    rfl
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
⊢ ↑(rename Subtype.val) = RingHom.comp (↑↑eqv) C
[PROOFSTEP]
apply ringHom_ext
[GOAL]
case hC
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
⊢ ∀ (r : R), ↑↑(rename Subtype.val) (↑C r) = ↑(RingHom.comp (↑↑eqv) C) (↑C r)
[PROOFSTEP]
intro
[GOAL]
case hC
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
r✝ : R
⊢ ↑↑(rename Subtype.val) (↑C r✝) = ↑(RingHom.comp (↑↑eqv) C) (↑C r✝)
[PROOFSTEP]
dsimp
[GOAL]
case hC
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
r✝ : R
⊢ ↑(rename Subtype.val) (↑C r✝) =
    ↑(rename (↑(Equiv.Set.sumCompl s) ∘ Sum.swap)) (↑(AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s)) (↑C (↑C r✝)))
[PROOFSTEP]
erw [iterToSum_C_C, rename_C, rename_C]
[GOAL]
case hX
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
⊢ ∀ (i : ↑s), ↑↑(rename Subtype.val) (X i) = ↑(RingHom.comp (↑↑eqv) C) (X i)
[PROOFSTEP]
intro
[GOAL]
case hX
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
i✝ : ↑s
⊢ ↑↑(rename Subtype.val) (X i✝) = ↑(RingHom.comp (↑↑eqv) C) (X i✝)
[PROOFSTEP]
dsimp
[GOAL]
case hX
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
i✝ : ↑s
⊢ ↑(rename Subtype.val) (X i✝) =
    ↑(rename (↑(Equiv.Set.sumCompl s) ∘ Sum.swap)) (↑(AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s)) (↑C (X i✝)))
[PROOFSTEP]
erw [iterToSum_C_X, rename_X, rename_X]
[GOAL]
case hX
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
i✝ : ↑s
⊢ X ↑i✝ = X ((↑(Equiv.Set.sumCompl s) ∘ Sum.swap) (Sum.inr i✝))
[PROOFSTEP]
rfl
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
this : ↑(rename Subtype.val) = RingHom.comp (↑↑eqv) C
⊢ Prime p ↔ Prime (↑(rename Subtype.val) p)
[PROOFSTEP]
rw [← @prime_C_iff (MvPolynomial s R) (↥sᶜ) instCommRingMvPolynomial p]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
this : ↑(rename Subtype.val) = RingHom.comp (↑↑eqv) C
⊢ Prime (↑C p) ↔ Prime (↑(rename Subtype.val) p)
[PROOFSTEP]
rw [@MulEquiv.prime_iff (MvPolynomial ↑sᶜ (MvPolynomial (↑s) R)) (MvPolynomial σ R) (_) (_)]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
this : ↑(rename Subtype.val) = RingHom.comp (↑↑eqv) C
⊢ Prime (↑?e (↑C p)) ↔ Prime (↑(rename Subtype.val) p)
case e
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
this : ↑(rename Subtype.val) = RingHom.comp (↑↑eqv) C
⊢ MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃* MvPolynomial σ R
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
this : ↑(rename Subtype.val) = RingHom.comp (↑↑eqv) C
⊢ CommMonoidWithZero (MvPolynomial σ R)
[PROOFSTEP]
rotate_left
[GOAL]
case e
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
this : ↑(rename Subtype.val) = RingHom.comp (↑↑eqv) C
⊢ MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃* MvPolynomial σ R
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
this : ↑(rename Subtype.val) = RingHom.comp (↑↑eqv) C
⊢ CommMonoidWithZero (MvPolynomial σ R)
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
this : ↑(rename Subtype.val) = RingHom.comp (↑↑eqv) C
⊢ Prime (↑?e (↑C p)) ↔ Prime (↑(rename Subtype.val) p)
[PROOFSTEP]
exact eqv.toMulEquiv
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
this : ↑(rename Subtype.val) = RingHom.comp (↑↑eqv) C
⊢ Prime (↑(AlgEquiv.toMulEquiv eqv) (↑C p)) ↔ Prime (↑(rename Subtype.val) p)
[PROOFSTEP]
convert Iff.rfl
[GOAL]
case h.e'_2.h.e'_3
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
r : R
s : Set σ
p : MvPolynomial (↑s) R
eqv : MvPolynomial (↑sᶜ) (MvPolynomial (↑s) R) ≃ₐ[R] MvPolynomial σ R :=
  AlgEquiv.trans (AlgEquiv.symm (sumAlgEquiv R ↑sᶜ ↑s))
    (renameEquiv R ((Equiv.sumComm ↑sᶜ ↑s).trans (Equiv.Set.sumCompl s)))
this : ↑(rename Subtype.val) = RingHom.comp (↑↑eqv) C
⊢ ↑(rename Subtype.val) p = ↑(AlgEquiv.toMulEquiv eqv) (↑C p)
[PROOFSTEP]
apply RingHom.congr_fun this p
[GOAL]
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
⊢ WellFounded DvdNotUnit
[PROOFSTEP]
classical
refine'
  RelHomClass.wellFounded
    (⟨fun p : R[X] => ((if p = 0 then ⊤ else ↑p.degree : WithTop (WithBot ℕ)), p.leadingCoeff), _⟩ :
      DvdNotUnit →r Prod.Lex (· < ·) DvdNotUnit)
    (WellFounded.prod_lex (WithTop.wellFounded_lt <| WithBot.wellFounded_lt Nat.lt_wfRel.wf)
      ‹WfDvdMonoid R›.wellFounded_dvdNotUnit)
rintro a b ⟨ane0, ⟨c, ⟨not_unit_c, rfl⟩⟩⟩
dsimp
rw [Polynomial.degree_mul, if_neg ane0]
split_ifs with hac
· rw [hac, Polynomial.leadingCoeff_zero]
  apply Prod.Lex.left
  exact lt_of_le_of_ne le_top WithTop.coe_ne_top
have cne0 : c ≠ 0 := right_ne_zero_of_mul hac
simp only [cne0, ane0, Polynomial.leadingCoeff_mul]
by_cases hdeg : c.degree = 0
· simp only [hdeg, add_zero]
  refine' Prod.Lex.right _ ⟨_, ⟨c.leadingCoeff, fun unit_c => not_unit_c _, rfl⟩⟩
  · rwa [Ne, Polynomial.leadingCoeff_eq_zero]
  rw [Polynomial.isUnit_iff, Polynomial.eq_C_of_degree_eq_zero hdeg]
  use c.leadingCoeff, unit_c
  rw [Polynomial.leadingCoeff, Polynomial.natDegree_eq_of_degree_eq_some hdeg]; rfl
· apply Prod.Lex.left
  rw [Polynomial.degree_eq_natDegree cne0] at *
  rw [WithTop.coe_lt_coe, Polynomial.degree_eq_natDegree ane0, Nat.cast_withBot, Nat.cast_withBot, ← WithBot.coe_add,
    WithBot.coe_lt_coe]
  exact lt_add_of_pos_right _ (Nat.pos_of_ne_zero fun h => hdeg (h.symm ▸ WithBot.coe_zero))
[GOAL]
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
⊢ WellFounded DvdNotUnit
[PROOFSTEP]
refine'
  RelHomClass.wellFounded
    (⟨fun p : R[X] => ((if p = 0 then ⊤ else ↑p.degree : WithTop (WithBot ℕ)), p.leadingCoeff), _⟩ :
      DvdNotUnit →r Prod.Lex (· < ·) DvdNotUnit)
    (WellFounded.prod_lex (WithTop.wellFounded_lt <| WithBot.wellFounded_lt Nat.lt_wfRel.wf)
      ‹WfDvdMonoid R›.wellFounded_dvdNotUnit)
[GOAL]
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
⊢ ∀ {a b : R[X]},
    DvdNotUnit a b →
      Prod.Lex (fun x x_1 => x < x_1) DvdNotUnit ((fun p => (if p = 0 then ⊤ else ↑(degree p), leadingCoeff p)) a)
        ((fun p => (if p = 0 then ⊤ else ↑(degree p), leadingCoeff p)) b)
[PROOFSTEP]
rintro a b ⟨ane0, ⟨c, ⟨not_unit_c, rfl⟩⟩⟩
[GOAL]
case intro.intro.intro
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
⊢ Prod.Lex (fun x x_1 => x < x_1) DvdNotUnit ((fun p => (if p = 0 then ⊤ else ↑(degree p), leadingCoeff p)) a)
    ((fun p => (if p = 0 then ⊤ else ↑(degree p), leadingCoeff p)) (a * c))
[PROOFSTEP]
dsimp
[GOAL]
case intro.intro.intro
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
⊢ Prod.Lex (fun x x_1 => x < x_1) DvdNotUnit (if a = 0 then ⊤ else ↑(degree a), leadingCoeff a)
    (if a * c = 0 then ⊤ else ↑(degree (a * c)), leadingCoeff (a * c))
[PROOFSTEP]
rw [Polynomial.degree_mul, if_neg ane0]
[GOAL]
case intro.intro.intro
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
⊢ Prod.Lex (fun x x_1 => x < x_1) DvdNotUnit (↑(degree a), leadingCoeff a)
    (if a * c = 0 then ⊤ else ↑(degree a + degree c), leadingCoeff (a * c))
[PROOFSTEP]
split_ifs with hac
[GOAL]
case pos
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
hac : a * c = 0
⊢ Prod.Lex (fun x x_1 => x < x_1) DvdNotUnit (↑(degree a), leadingCoeff a) (⊤, leadingCoeff (a * c))
[PROOFSTEP]
rw [hac, Polynomial.leadingCoeff_zero]
[GOAL]
case pos
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
hac : a * c = 0
⊢ Prod.Lex (fun x x_1 => x < x_1) DvdNotUnit (↑(degree a), leadingCoeff a) (⊤, 0)
[PROOFSTEP]
apply Prod.Lex.left
[GOAL]
case pos.h
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
hac : a * c = 0
⊢ ↑(degree a) < ⊤
[PROOFSTEP]
exact lt_of_le_of_ne le_top WithTop.coe_ne_top
[GOAL]
case neg
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
hac : ¬a * c = 0
⊢ Prod.Lex (fun x x_1 => x < x_1) DvdNotUnit (↑(degree a), leadingCoeff a)
    (↑(degree a + degree c), leadingCoeff (a * c))
[PROOFSTEP]
have cne0 : c ≠ 0 := right_ne_zero_of_mul hac
[GOAL]
case neg
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
hac : ¬a * c = 0
cne0 : c ≠ 0
⊢ Prod.Lex (fun x x_1 => x < x_1) DvdNotUnit (↑(degree a), leadingCoeff a)
    (↑(degree a + degree c), leadingCoeff (a * c))
[PROOFSTEP]
simp only [cne0, ane0, Polynomial.leadingCoeff_mul]
[GOAL]
case neg
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
hac : ¬a * c = 0
cne0 : c ≠ 0
⊢ Prod.Lex (fun x x_1 => x < x_1) DvdNotUnit (↑(degree a), leadingCoeff a)
    (↑(degree a + degree c), leadingCoeff a * leadingCoeff c)
[PROOFSTEP]
by_cases hdeg : c.degree = 0
[GOAL]
case pos
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
hac : ¬a * c = 0
cne0 : c ≠ 0
hdeg : degree c = 0
⊢ Prod.Lex (fun x x_1 => x < x_1) DvdNotUnit (↑(degree a), leadingCoeff a)
    (↑(degree a + degree c), leadingCoeff a * leadingCoeff c)
[PROOFSTEP]
simp only [hdeg, add_zero]
[GOAL]
case pos
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
hac : ¬a * c = 0
cne0 : c ≠ 0
hdeg : degree c = 0
⊢ Prod.Lex (fun x x_1 => x < x_1) DvdNotUnit (↑(degree a), leadingCoeff a)
    (↑(degree a), leadingCoeff a * leadingCoeff c)
[PROOFSTEP]
refine' Prod.Lex.right _ ⟨_, ⟨c.leadingCoeff, fun unit_c => not_unit_c _, rfl⟩⟩
[GOAL]
case pos.refine'_1
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
hac : ¬a * c = 0
cne0 : c ≠ 0
hdeg : degree c = 0
⊢ leadingCoeff a ≠ 0
[PROOFSTEP]
rwa [Ne, Polynomial.leadingCoeff_eq_zero]
[GOAL]
case pos.refine'_2
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
hac : ¬a * c = 0
cne0 : c ≠ 0
hdeg : degree c = 0
unit_c : IsUnit (leadingCoeff c)
⊢ IsUnit c
[PROOFSTEP]
rw [Polynomial.isUnit_iff, Polynomial.eq_C_of_degree_eq_zero hdeg]
[GOAL]
case pos.refine'_2
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
hac : ¬a * c = 0
cne0 : c ≠ 0
hdeg : degree c = 0
unit_c : IsUnit (leadingCoeff c)
⊢ ∃ r, IsUnit r ∧ ↑C r = ↑C (coeff c 0)
[PROOFSTEP]
use c.leadingCoeff, unit_c
[GOAL]
case right
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
hac : ¬a * c = 0
cne0 : c ≠ 0
hdeg : degree c = 0
unit_c : IsUnit (leadingCoeff c)
⊢ ↑C (leadingCoeff c) = ↑C (coeff c 0)
[PROOFSTEP]
rw [Polynomial.leadingCoeff, Polynomial.natDegree_eq_of_degree_eq_some hdeg]
[GOAL]
case right
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
hac : ¬a * c = 0
cne0 : c ≠ 0
hdeg : degree c = 0
unit_c : IsUnit (leadingCoeff c)
⊢ ↑C (coeff c Zero.zero) = ↑C (coeff c 0)
[PROOFSTEP]
rfl
[GOAL]
case neg
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
hac : ¬a * c = 0
cne0 : c ≠ 0
hdeg : ¬degree c = 0
⊢ Prod.Lex (fun x x_1 => x < x_1) DvdNotUnit (↑(degree a), leadingCoeff a)
    (↑(degree a + degree c), leadingCoeff a * leadingCoeff c)
[PROOFSTEP]
apply Prod.Lex.left
[GOAL]
case neg.h
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
hac : ¬a * c = 0
cne0 : c ≠ 0
hdeg : ¬degree c = 0
⊢ ↑(degree a) < ↑(degree a + degree c)
[PROOFSTEP]
rw [Polynomial.degree_eq_natDegree cne0] at *
[GOAL]
case neg.h
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
hac : ¬a * c = 0
cne0 : c ≠ 0
hdeg : ¬↑(natDegree c) = 0
⊢ ↑(degree a) < ↑(degree a + ↑(natDegree c))
[PROOFSTEP]
rw [WithTop.coe_lt_coe, Polynomial.degree_eq_natDegree ane0, Nat.cast_withBot, Nat.cast_withBot, ← WithBot.coe_add,
  WithBot.coe_lt_coe]
[GOAL]
case neg.h
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
a : R[X]
ane0 : a ≠ 0
c : R[X]
not_unit_c : ¬IsUnit c
hac : ¬a * c = 0
cne0 : c ≠ 0
hdeg : ¬↑(natDegree c) = 0
⊢ natDegree a < natDegree a + natDegree c
[PROOFSTEP]
exact lt_add_of_pos_right _ (Nat.pos_of_ne_zero fun h => hdeg (h.symm ▸ WithBot.coe_zero))
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
inst : IsNoetherianRing R
I : Ideal R[X]
⊢ IsNoetherian R R
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
k : ℕ
h : N < k
x : R
hx : x ∈ Ideal.leadingCoeffNth I k
hxm : ¬x ∈ M
this : IsNoetherian R R
⊢ ¬M < Ideal.leadingCoeffNth I k
[PROOFSTEP]
refine' WellFounded.not_lt_min (wellFounded_submodule_gt R R) _ _ _
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
k : ℕ
h : N < k
x : R
hx : x ∈ Ideal.leadingCoeffNth I k
hxm : ¬x ∈ M
this : IsNoetherian R R
⊢ Ideal.leadingCoeffNth I k ∈ Set.range (Ideal.leadingCoeffNth I)
[PROOFSTEP]
exact ⟨k, rfl⟩
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
⊢ I ≤ Submodule.span R[X] ↑s
[PROOFSTEP]
have : Submodule.span R[X] ↑s = Ideal.span ↑s := by rfl
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
⊢ Submodule.span R[X] ↑s = Ideal.span ↑s
[PROOFSTEP]
rfl
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this : Submodule.span R[X] ↑s = Ideal.span ↑s
⊢ I ≤ Submodule.span R[X] ↑s
[PROOFSTEP]
rw [this]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this : Submodule.span R[X] ↑s = Ideal.span ↑s
⊢ I ≤ Ideal.span ↑s
[PROOFSTEP]
intro p hp
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this : Submodule.span R[X] ↑s = Ideal.span ↑s
p : R[X]
hp : p ∈ I
⊢ p ∈ Ideal.span ↑s
[PROOFSTEP]
generalize hn : p.natDegree = k
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this : Submodule.span R[X] ↑s = Ideal.span ↑s
p : R[X]
hp : p ∈ I
k : ℕ
hn : natDegree p = k
⊢ p ∈ Ideal.span ↑s
[PROOFSTEP]
induction' k using Nat.strong_induction_on with k ih generalizing p
[GOAL]
case h
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
⊢ p ∈ Ideal.span ↑s
[PROOFSTEP]
cases' le_or_lt k N with h h
[GOAL]
case h.inl
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : k ≤ N
⊢ p ∈ Ideal.span ↑s
[PROOFSTEP]
subst k
[GOAL]
case h.inl
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k : ℕ
hn : natDegree p✝ = k
p : R[X]
hp : p ∈ I
ih : ∀ (m : ℕ), m < natDegree p → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
h : natDegree p ≤ N
⊢ p ∈ Ideal.span ↑s
[PROOFSTEP]
refine' hs2 ⟨Polynomial.mem_degreeLE.2 (le_trans Polynomial.degree_le_natDegree <| WithBot.coe_le_coe.2 h), hp⟩
[GOAL]
case h.inr
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
⊢ p ∈ Ideal.span ↑s
[PROOFSTEP]
have hp0 : p ≠ 0 := by
  rintro rfl
  cases hn
  exact Nat.not_lt_zero _ h
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
⊢ p ≠ 0
[PROOFSTEP]
rintro rfl
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this : Submodule.span R[X] ↑s = Ideal.span ↑s
p : R[X]
hp✝ : p ∈ I
k✝ : ℕ
hn✝ : natDegree p = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
h : N < k
hp : 0 ∈ I
hn : natDegree 0 = k
⊢ False
[PROOFSTEP]
cases hn
[GOAL]
case refl
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this : Submodule.span R[X] ↑s = Ideal.span ↑s
p : R[X]
hp✝ : p ∈ I
k : ℕ
hn : natDegree p = k
hp : 0 ∈ I
ih : ∀ (m : ℕ), m < natDegree 0 → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
h : N < natDegree 0
⊢ False
[PROOFSTEP]
exact Nat.not_lt_zero _ h
[GOAL]
case h.inr
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
⊢ p ∈ Ideal.span ↑s
[PROOFSTEP]
have : (0 : R) ≠ 1 := by
  intro h
  apply hp0
  ext i
  refine' (mul_one _).symm.trans _
  rw [← h, mul_zero]
  rfl
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
⊢ 0 ≠ 1
[PROOFSTEP]
intro h
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h✝ : N < k
hp0 : p ≠ 0
h : 0 = 1
⊢ False
[PROOFSTEP]
apply hp0
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h✝ : N < k
hp0 : p ≠ 0
h : 0 = 1
⊢ p = 0
[PROOFSTEP]
ext i
[GOAL]
case a
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h✝ : N < k
hp0 : p ≠ 0
h : 0 = 1
i : ℕ
⊢ coeff p i = coeff 0 i
[PROOFSTEP]
refine' (mul_one _).symm.trans _
[GOAL]
case a
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h✝ : N < k
hp0 : p ≠ 0
h : 0 = 1
i : ℕ
⊢ coeff p i * 1 = coeff 0 i
[PROOFSTEP]
rw [← h, mul_zero]
[GOAL]
case a
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h✝ : N < k
hp0 : p ≠ 0
h : 0 = 1
i : ℕ
⊢ 0 = coeff 0 i
[PROOFSTEP]
rfl
[GOAL]
case h.inr
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this : 0 ≠ 1
⊢ p ∈ Ideal.span ↑s
[PROOFSTEP]
haveI : Nontrivial R := ⟨⟨0, 1, this⟩⟩
[GOAL]
case h.inr
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
⊢ p ∈ Ideal.span ↑s
[PROOFSTEP]
have : p.leadingCoeff ∈ I.leadingCoeffNth N := by
  rw [HN]
  exact hm2 k ((I.mem_leadingCoeffNth _ _).2 ⟨_, hp, hn ▸ Polynomial.degree_le_natDegree, rfl⟩)
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
⊢ leadingCoeff p ∈ Ideal.leadingCoeffNth I N
[PROOFSTEP]
rw [HN]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
⊢ leadingCoeff p ∈ M
[PROOFSTEP]
exact hm2 k ((I.mem_leadingCoeffNth _ _).2 ⟨_, hp, hn ▸ Polynomial.degree_le_natDegree, rfl⟩)
[GOAL]
case h.inr
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝² : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝¹ : 0 ≠ 1
this✝ : Nontrivial R
this : leadingCoeff p ∈ Ideal.leadingCoeffNth I N
⊢ p ∈ Ideal.span ↑s
[PROOFSTEP]
rw [I.mem_leadingCoeffNth] at this
[GOAL]
case h.inr
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝² : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝¹ : 0 ≠ 1
this✝ : Nontrivial R
this : ∃ p_1, p_1 ∈ I ∧ degree p_1 ≤ ↑N ∧ leadingCoeff p_1 = leadingCoeff p
⊢ p ∈ Ideal.span ↑s
[PROOFSTEP]
rcases this with ⟨q, hq, hdq, hlqp⟩
[GOAL]
case h.inr.intro.intro.intro
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
⊢ p ∈ Ideal.span ↑s
[PROOFSTEP]
have hq0 : q ≠ 0 := by
  intro H
  rw [← Polynomial.leadingCoeff_eq_zero] at H
  rw [hlqp, Polynomial.leadingCoeff_eq_zero] at H
  exact hp0 H
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
⊢ q ≠ 0
[PROOFSTEP]
intro H
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
H : q = 0
⊢ False
[PROOFSTEP]
rw [← Polynomial.leadingCoeff_eq_zero] at H
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
H : leadingCoeff q = 0
⊢ False
[PROOFSTEP]
rw [hlqp, Polynomial.leadingCoeff_eq_zero] at H
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
H : p = 0
⊢ False
[PROOFSTEP]
exact hp0 H
[GOAL]
case h.inr.intro.intro.intro
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
⊢ p ∈ Ideal.span ↑s
[PROOFSTEP]
have h1 : p.degree = (q * Polynomial.X ^ (k - q.natDegree)).degree :=
  by
  rw [Polynomial.degree_mul', Polynomial.degree_X_pow]
  rw [Polynomial.degree_eq_natDegree hp0, Polynomial.degree_eq_natDegree hq0]
  rw [Nat.cast_withBot, Nat.cast_withBot, Nat.cast_withBot, ← WithBot.coe_add, add_tsub_cancel_of_le, hn]
  · refine' le_trans (Polynomial.natDegree_le_of_degree_le hdq) (le_of_lt h)
  rw [Polynomial.leadingCoeff_X_pow, mul_one]
  exact mt Polynomial.leadingCoeff_eq_zero.1 hq0
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
⊢ degree p = degree (q * X ^ (k - natDegree q))
[PROOFSTEP]
rw [Polynomial.degree_mul', Polynomial.degree_X_pow]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
⊢ degree p = degree q + ↑(k - natDegree q)
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
⊢ leadingCoeff q * leadingCoeff (X ^ (k - natDegree q)) ≠ 0
[PROOFSTEP]
rw [Polynomial.degree_eq_natDegree hp0, Polynomial.degree_eq_natDegree hq0]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
⊢ ↑(natDegree p) = ↑(natDegree q) + ↑(k - natDegree q)
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
⊢ leadingCoeff q * leadingCoeff (X ^ (k - natDegree q)) ≠ 0
[PROOFSTEP]
rw [Nat.cast_withBot, Nat.cast_withBot, Nat.cast_withBot, ← WithBot.coe_add, add_tsub_cancel_of_le, hn]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
⊢ natDegree q ≤ k
[PROOFSTEP]
refine' le_trans (Polynomial.natDegree_le_of_degree_le hdq) (le_of_lt h)
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
⊢ leadingCoeff q * leadingCoeff (X ^ (k - natDegree q)) ≠ 0
[PROOFSTEP]
rw [Polynomial.leadingCoeff_X_pow, mul_one]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
⊢ leadingCoeff q ≠ 0
[PROOFSTEP]
exact mt Polynomial.leadingCoeff_eq_zero.1 hq0
[GOAL]
case h.inr.intro.intro.intro
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
h1 : degree p = degree (q * X ^ (k - natDegree q))
⊢ p ∈ Ideal.span ↑s
[PROOFSTEP]
have h2 : p.leadingCoeff = (q * Polynomial.X ^ (k - q.natDegree)).leadingCoeff := by
  rw [← hlqp, Polynomial.leadingCoeff_mul_X_pow]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
h1 : degree p = degree (q * X ^ (k - natDegree q))
⊢ leadingCoeff p = leadingCoeff (q * X ^ (k - natDegree q))
[PROOFSTEP]
rw [← hlqp, Polynomial.leadingCoeff_mul_X_pow]
[GOAL]
case h.inr.intro.intro.intro
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝¹ : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝ : 0 ≠ 1
this : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
h1 : degree p = degree (q * X ^ (k - natDegree q))
h2 : leadingCoeff p = leadingCoeff (q * X ^ (k - natDegree q))
⊢ p ∈ Ideal.span ↑s
[PROOFSTEP]
have := Polynomial.degree_sub_lt h1 hp0 h2
[GOAL]
case h.inr.intro.intro.intro
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝² : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝¹ : 0 ≠ 1
this✝ : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
h1 : degree p = degree (q * X ^ (k - natDegree q))
h2 : leadingCoeff p = leadingCoeff (q * X ^ (k - natDegree q))
this : degree (p - q * X ^ (k - natDegree q)) < degree p
⊢ p ∈ Ideal.span ↑s
[PROOFSTEP]
rw [Polynomial.degree_eq_natDegree hp0] at this
[GOAL]
case h.inr.intro.intro.intro
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝² : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝¹ : 0 ≠ 1
this✝ : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
h1 : degree p = degree (q * X ^ (k - natDegree q))
h2 : leadingCoeff p = leadingCoeff (q * X ^ (k - natDegree q))
this : degree (p - q * X ^ (k - natDegree q)) < ↑(natDegree p)
⊢ p ∈ Ideal.span ↑s
[PROOFSTEP]
rw [← sub_add_cancel p (q * Polynomial.X ^ (k - q.natDegree))]
[GOAL]
case h.inr.intro.intro.intro
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝² : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝¹ : 0 ≠ 1
this✝ : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
h1 : degree p = degree (q * X ^ (k - natDegree q))
h2 : leadingCoeff p = leadingCoeff (q * X ^ (k - natDegree q))
this : degree (p - q * X ^ (k - natDegree q)) < ↑(natDegree p)
⊢ p - q * X ^ (k - natDegree q) + q * X ^ (k - natDegree q) ∈ Ideal.span ↑s
[PROOFSTEP]
refine' (Ideal.span ↑s).add_mem _ ((Ideal.span ↑s).mul_mem_right _ _)
[GOAL]
case h.inr.intro.intro.intro.refine'_1
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝² : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝¹ : 0 ≠ 1
this✝ : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
h1 : degree p = degree (q * X ^ (k - natDegree q))
h2 : leadingCoeff p = leadingCoeff (q * X ^ (k - natDegree q))
this : degree (p - q * X ^ (k - natDegree q)) < ↑(natDegree p)
⊢ p - q * X ^ (k - natDegree q) ∈ Ideal.span ↑s
[PROOFSTEP]
by_cases hpq : p - q * Polynomial.X ^ (k - q.natDegree) = 0
[GOAL]
case pos
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝² : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝¹ : 0 ≠ 1
this✝ : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
h1 : degree p = degree (q * X ^ (k - natDegree q))
h2 : leadingCoeff p = leadingCoeff (q * X ^ (k - natDegree q))
this : degree (p - q * X ^ (k - natDegree q)) < ↑(natDegree p)
hpq : p - q * X ^ (k - natDegree q) = 0
⊢ p - q * X ^ (k - natDegree q) ∈ Ideal.span ↑s
[PROOFSTEP]
rw [hpq]
[GOAL]
case pos
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝² : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝¹ : 0 ≠ 1
this✝ : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
h1 : degree p = degree (q * X ^ (k - natDegree q))
h2 : leadingCoeff p = leadingCoeff (q * X ^ (k - natDegree q))
this : degree (p - q * X ^ (k - natDegree q)) < ↑(natDegree p)
hpq : p - q * X ^ (k - natDegree q) = 0
⊢ 0 ∈ Ideal.span ↑s
[PROOFSTEP]
exact Ideal.zero_mem _
[GOAL]
case neg
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝² : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝¹ : 0 ≠ 1
this✝ : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
h1 : degree p = degree (q * X ^ (k - natDegree q))
h2 : leadingCoeff p = leadingCoeff (q * X ^ (k - natDegree q))
this : degree (p - q * X ^ (k - natDegree q)) < ↑(natDegree p)
hpq : ¬p - q * X ^ (k - natDegree q) = 0
⊢ p - q * X ^ (k - natDegree q) ∈ Ideal.span ↑s
[PROOFSTEP]
refine' ih _ _ (I.sub_mem hp (I.mul_mem_right _ hq)) rfl
[GOAL]
case neg
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝² : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝¹ : 0 ≠ 1
this✝ : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
h1 : degree p = degree (q * X ^ (k - natDegree q))
h2 : leadingCoeff p = leadingCoeff (q * X ^ (k - natDegree q))
this : degree (p - q * X ^ (k - natDegree q)) < ↑(natDegree p)
hpq : ¬p - q * X ^ (k - natDegree q) = 0
⊢ natDegree (p - q * X ^ (k - natDegree q)) < k
[PROOFSTEP]
rwa [Polynomial.degree_eq_natDegree hpq, Nat.cast_withBot, Nat.cast_withBot, WithBot.coe_lt_coe, hn] at this
[GOAL]
case h.inr.intro.intro.intro.refine'_2
R : Type u
S : Type u_1
σ : Type v
M✝ : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M✝
inst✝ : Module R M✝
inst : IsNoetherianRing R
I : Ideal R[X]
M : Submodule R R :=
  WellFounded.min (_ : WellFounded fun x x_1 => x > x_1) (Set.range (Ideal.leadingCoeffNth I))
    (_ : ∃ x, x ∈ Set.range (Ideal.leadingCoeffNth I))
hm : M ∈ Set.range (Ideal.leadingCoeffNth I)
N : ℕ
HN : Ideal.leadingCoeffNth I N = M
s : Finset R[X]
hs : Submodule.span R ↑s = Ideal.degreeLE I ↑N
hm2 : ∀ (k : ℕ), Ideal.leadingCoeffNth I k ≤ M
hs2 : ∀ {x : R[X]}, x ∈ Ideal.degreeLE I ↑N → x ∈ Ideal.span ↑s
this✝² : Submodule.span R[X] ↑s = Ideal.span ↑s
p✝ : R[X]
hp✝ : p✝ ∈ I
k✝ : ℕ
hn✝ : natDegree p✝ = k✝
k : ℕ
ih : ∀ (m : ℕ), m < k → ∀ ⦃p : R[X]⦄, p ∈ I → natDegree p = m → p ∈ Ideal.span ↑s
p : R[X]
hp : p ∈ I
hn : natDegree p = k
h : N < k
hp0 : p ≠ 0
this✝¹ : 0 ≠ 1
this✝ : Nontrivial R
q : R[X]
hq : q ∈ I
hdq : degree q ≤ ↑N
hlqp : leadingCoeff q = leadingCoeff p
hq0 : q ≠ 0
h1 : degree p = degree (q * X ^ (k - natDegree q))
h2 : leadingCoeff p = leadingCoeff (q * X ^ (k - natDegree q))
this : degree (p - q * X ^ (k - natDegree q)) < ↑(natDegree p)
⊢ q ∈ Ideal.span ↑s
[PROOFSTEP]
exact hs2 ⟨Polynomial.mem_degreeLE.2 hdq, hq⟩
[GOAL]
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
f : R[X]
hf : 0 < natDegree f
⊢ 0 < degree f
[PROOFSTEP]
contrapose! hf
[GOAL]
R✝ : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : WfDvdMonoid R
f : R[X]
hf : degree f ≤ 0
⊢ natDegree f ≤ 0
[PROOFSTEP]
exact natDegree_le_of_degree_le hf
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
v : M
⊢ (LinearIndependent R fun n => ↑(f ^ n) v) ↔ ∀ (p : R[X]), ↑(↑(aeval f) p) v = 0 → p = 0
[PROOFSTEP]
rw [linearIndependent_iff]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
v : M
⊢ (∀ (l : ℕ →₀ R), ↑(Finsupp.total ℕ ((fun x => M) v) R fun n => ↑(f ^ n) v) l = 0 → l = 0) ↔
    ∀ (p : R[X]), ↑(↑(aeval f) p) v = 0 → p = 0
[PROOFSTEP]
simp only [Finsupp.total_apply, aeval_endomorphism, forall_iff_forall_finsupp, Sum, support, coeff, ofFinsupp_eq_zero]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
v : M
⊢ (∀ (l : ℕ →₀ R), (Finsupp.sum l fun i a => a • ↑(f ^ i) v) = 0 → l = 0) ↔
    ∀ (q : AddMonoidAlgebra R ℕ), (sum { toFinsupp := q } fun n b => b • ↑(f ^ n) v) = 0 → q = 0
[PROOFSTEP]
exact Iff.rfl
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
hpq : IsCoprime p q
⊢ Disjoint (LinearMap.ker (↑(aeval f) p)) (LinearMap.ker (↑(aeval f) q))
[PROOFSTEP]
rw [disjoint_iff_inf_le]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
hpq : IsCoprime p q
⊢ LinearMap.ker (↑(aeval f) p) ⊓ LinearMap.ker (↑(aeval f) q) ≤ ⊥
[PROOFSTEP]
intro v hv
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
hpq : IsCoprime p q
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) p) ⊓ LinearMap.ker (↑(aeval f) q)
⊢ v ∈ ⊥
[PROOFSTEP]
rcases hpq with ⟨p', q', hpq'⟩
[GOAL]
case intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) p) ⊓ LinearMap.ker (↑(aeval f) q)
p' q' : R[X]
hpq' : p' * p + q' * q = 1
⊢ v ∈ ⊥
[PROOFSTEP]
simpa [LinearMap.mem_ker.1 (Submodule.mem_inf.1 hv).1, LinearMap.mem_ker.1 (Submodule.mem_inf.1 hv).2] using
  congr_arg (fun p : R[X] => aeval f p v) hpq'.symm
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
hpq : IsCoprime p q
⊢ LinearMap.range (↑(aeval f) p) ⊔ LinearMap.range (↑(aeval f) q) = ⊤
[PROOFSTEP]
rw [eq_top_iff]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
hpq : IsCoprime p q
⊢ ⊤ ≤ LinearMap.range (↑(aeval f) p) ⊔ LinearMap.range (↑(aeval f) q)
[PROOFSTEP]
intro v _
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
hpq : IsCoprime p q
v : M
a✝ : v ∈ ⊤
⊢ v ∈ LinearMap.range (↑(aeval f) p) ⊔ LinearMap.range (↑(aeval f) q)
[PROOFSTEP]
rw [Submodule.mem_sup]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
hpq : IsCoprime p q
v : M
a✝ : v ∈ ⊤
⊢ ∃ y, y ∈ LinearMap.range (↑(aeval f) p) ∧ ∃ z, z ∈ LinearMap.range (↑(aeval f) q) ∧ y + z = v
[PROOFSTEP]
rcases hpq with ⟨p', q', hpq'⟩
[GOAL]
case intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
a✝ : v ∈ ⊤
p' q' : R[X]
hpq' : p' * p + q' * q = 1
⊢ ∃ y, y ∈ LinearMap.range (↑(aeval f) p) ∧ ∃ z, z ∈ LinearMap.range (↑(aeval f) q) ∧ y + z = v
[PROOFSTEP]
use aeval f (p * p') v
[GOAL]
case h
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
a✝ : v ∈ ⊤
p' q' : R[X]
hpq' : p' * p + q' * q = 1
⊢ ↑(↑(aeval f) (p * p')) v ∈ LinearMap.range (↑(aeval f) p) ∧
    ∃ z, z ∈ LinearMap.range (↑(aeval f) q) ∧ ↑(↑(aeval f) (p * p')) v + z = v
[PROOFSTEP]
use LinearMap.mem_range.2 ⟨aeval f p' v, by simp only [LinearMap.mul_apply, aeval_mul]⟩
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
a✝ : v ∈ ⊤
p' q' : R[X]
hpq' : p' * p + q' * q = 1
⊢ ↑(↑(aeval f) p) (↑(↑(aeval f) p') v) = ↑(↑(aeval f) (p * p')) v
[PROOFSTEP]
simp only [LinearMap.mul_apply, aeval_mul]
[GOAL]
case right
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
a✝ : v ∈ ⊤
p' q' : R[X]
hpq' : p' * p + q' * q = 1
⊢ ∃ z, z ∈ LinearMap.range (↑(aeval f) q) ∧ ↑(↑(aeval f) (p * p')) v + z = v
[PROOFSTEP]
use aeval f (q * q') v
[GOAL]
case h
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
a✝ : v ∈ ⊤
p' q' : R[X]
hpq' : p' * p + q' * q = 1
⊢ ↑(↑(aeval f) (q * q')) v ∈ LinearMap.range (↑(aeval f) q) ∧ ↑(↑(aeval f) (p * p')) v + ↑(↑(aeval f) (q * q')) v = v
[PROOFSTEP]
use LinearMap.mem_range.2 ⟨aeval f q' v, by simp only [LinearMap.mul_apply, aeval_mul]⟩
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
a✝ : v ∈ ⊤
p' q' : R[X]
hpq' : p' * p + q' * q = 1
⊢ ↑(↑(aeval f) q) (↑(↑(aeval f) q') v) = ↑(↑(aeval f) (q * q')) v
[PROOFSTEP]
simp only [LinearMap.mul_apply, aeval_mul]
[GOAL]
case right
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
a✝ : v ∈ ⊤
p' q' : R[X]
hpq' : p' * p + q' * q = 1
⊢ ↑(↑(aeval f) (p * p')) v + ↑(↑(aeval f) (q * q')) v = v
[PROOFSTEP]
simpa only [mul_comm p p', mul_comm q q', aeval_one, aeval_add] using congr_arg (fun p : R[X] => aeval f p v) hpq'
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
⊢ LinearMap.ker (↑(aeval f) p) ⊔ LinearMap.ker (↑(aeval f) q) ≤ LinearMap.ker (↑(aeval f) (p * q))
[PROOFSTEP]
intro v hv
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) p) ⊔ LinearMap.ker (↑(aeval f) q)
⊢ v ∈ LinearMap.ker (↑(aeval f) (p * q))
[PROOFSTEP]
rcases Submodule.mem_sup.1 hv with ⟨x, hx, y, hy, hxy⟩
[GOAL]
case intro.intro.intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) p) ⊔ LinearMap.ker (↑(aeval f) q)
x : M
hx : x ∈ LinearMap.ker (↑(aeval f) p)
y : M
hy : y ∈ LinearMap.ker (↑(aeval f) q)
hxy : x + y = v
⊢ v ∈ LinearMap.ker (↑(aeval f) (p * q))
[PROOFSTEP]
have h_eval_x : aeval f (p * q) x = 0 := by
  rw [mul_comm, aeval_mul, LinearMap.mul_apply, LinearMap.mem_ker.1 hx, LinearMap.map_zero]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) p) ⊔ LinearMap.ker (↑(aeval f) q)
x : M
hx : x ∈ LinearMap.ker (↑(aeval f) p)
y : M
hy : y ∈ LinearMap.ker (↑(aeval f) q)
hxy : x + y = v
⊢ ↑(↑(aeval f) (p * q)) x = 0
[PROOFSTEP]
rw [mul_comm, aeval_mul, LinearMap.mul_apply, LinearMap.mem_ker.1 hx, LinearMap.map_zero]
[GOAL]
case intro.intro.intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) p) ⊔ LinearMap.ker (↑(aeval f) q)
x : M
hx : x ∈ LinearMap.ker (↑(aeval f) p)
y : M
hy : y ∈ LinearMap.ker (↑(aeval f) q)
hxy : x + y = v
h_eval_x : ↑(↑(aeval f) (p * q)) x = 0
⊢ v ∈ LinearMap.ker (↑(aeval f) (p * q))
[PROOFSTEP]
have h_eval_y : aeval f (p * q) y = 0 := by
  rw [aeval_mul, LinearMap.mul_apply, LinearMap.mem_ker.1 hy, LinearMap.map_zero]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) p) ⊔ LinearMap.ker (↑(aeval f) q)
x : M
hx : x ∈ LinearMap.ker (↑(aeval f) p)
y : M
hy : y ∈ LinearMap.ker (↑(aeval f) q)
hxy : x + y = v
h_eval_x : ↑(↑(aeval f) (p * q)) x = 0
⊢ ↑(↑(aeval f) (p * q)) y = 0
[PROOFSTEP]
rw [aeval_mul, LinearMap.mul_apply, LinearMap.mem_ker.1 hy, LinearMap.map_zero]
[GOAL]
case intro.intro.intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) p) ⊔ LinearMap.ker (↑(aeval f) q)
x : M
hx : x ∈ LinearMap.ker (↑(aeval f) p)
y : M
hy : y ∈ LinearMap.ker (↑(aeval f) q)
hxy : x + y = v
h_eval_x : ↑(↑(aeval f) (p * q)) x = 0
h_eval_y : ↑(↑(aeval f) (p * q)) y = 0
⊢ v ∈ LinearMap.ker (↑(aeval f) (p * q))
[PROOFSTEP]
rw [LinearMap.mem_ker, ← hxy, LinearMap.map_add, h_eval_x, h_eval_y, add_zero]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
hpq : IsCoprime p q
⊢ LinearMap.ker (↑(aeval f) p) ⊔ LinearMap.ker (↑(aeval f) q) = LinearMap.ker (↑(aeval f) (p * q))
[PROOFSTEP]
apply le_antisymm sup_ker_aeval_le_ker_aeval_mul
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
hpq : IsCoprime p q
⊢ LinearMap.ker (↑(aeval f) (p * q)) ≤ LinearMap.ker (↑(aeval f) p) ⊔ LinearMap.ker (↑(aeval f) q)
[PROOFSTEP]
intro v hv
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
hpq : IsCoprime p q
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) (p * q))
⊢ v ∈ LinearMap.ker (↑(aeval f) p) ⊔ LinearMap.ker (↑(aeval f) q)
[PROOFSTEP]
rw [Submodule.mem_sup]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
hpq : IsCoprime p q
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) (p * q))
⊢ ∃ y, y ∈ LinearMap.ker (↑(aeval f) p) ∧ ∃ z, z ∈ LinearMap.ker (↑(aeval f) q) ∧ y + z = v
[PROOFSTEP]
rcases hpq with ⟨p', q', hpq'⟩
[GOAL]
case intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) (p * q))
p' q' : R[X]
hpq' : p' * p + q' * q = 1
⊢ ∃ y, y ∈ LinearMap.ker (↑(aeval f) p) ∧ ∃ z, z ∈ LinearMap.ker (↑(aeval f) q) ∧ y + z = v
[PROOFSTEP]
have h_eval₂_qpp' :=
  calc
    aeval f (q * (p * p')) v = aeval f (p' * (p * q)) v := by
      rw [mul_comm, mul_assoc, mul_comm, mul_assoc, mul_comm q p]
    _ = 0 := by rw [aeval_mul, LinearMap.mul_apply, LinearMap.mem_ker.1 hv, LinearMap.map_zero]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) (p * q))
p' q' : R[X]
hpq' : p' * p + q' * q = 1
⊢ ↑(↑(aeval f) (q * (p * p'))) v = ↑(↑(aeval f) (p' * (p * q))) v
[PROOFSTEP]
rw [mul_comm, mul_assoc, mul_comm, mul_assoc, mul_comm q p]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) (p * q))
p' q' : R[X]
hpq' : p' * p + q' * q = 1
⊢ ↑(↑(aeval f) (p' * (p * q))) v = 0
[PROOFSTEP]
rw [aeval_mul, LinearMap.mul_apply, LinearMap.mem_ker.1 hv, LinearMap.map_zero]
[GOAL]
case intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) (p * q))
p' q' : R[X]
hpq' : p' * p + q' * q = 1
h_eval₂_qpp' : ↑(↑(aeval f) (q * (p * p'))) v = 0
⊢ ∃ y, y ∈ LinearMap.ker (↑(aeval f) p) ∧ ∃ z, z ∈ LinearMap.ker (↑(aeval f) q) ∧ y + z = v
[PROOFSTEP]
have h_eval₂_pqq' :=
  calc
    aeval f (p * (q * q')) v = aeval f (q' * (p * q)) v := by rw [← mul_assoc, mul_comm]
    _ = 0 := by rw [aeval_mul, LinearMap.mul_apply, LinearMap.mem_ker.1 hv, LinearMap.map_zero]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) (p * q))
p' q' : R[X]
hpq' : p' * p + q' * q = 1
h_eval₂_qpp' : ↑(↑(aeval f) (q * (p * p'))) v = 0
⊢ ↑(↑(aeval f) (p * (q * q'))) v = ↑(↑(aeval f) (q' * (p * q))) v
[PROOFSTEP]
rw [← mul_assoc, mul_comm]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) (p * q))
p' q' : R[X]
hpq' : p' * p + q' * q = 1
h_eval₂_qpp' : ↑(↑(aeval f) (q * (p * p'))) v = 0
⊢ ↑(↑(aeval f) (q' * (p * q))) v = 0
[PROOFSTEP]
rw [aeval_mul, LinearMap.mul_apply, LinearMap.mem_ker.1 hv, LinearMap.map_zero]
[GOAL]
case intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) (p * q))
p' q' : R[X]
hpq' : p' * p + q' * q = 1
h_eval₂_qpp' : ↑(↑(aeval f) (q * (p * p'))) v = 0
h_eval₂_pqq' : ↑(↑(aeval f) (p * (q * q'))) v = 0
⊢ ∃ y, y ∈ LinearMap.ker (↑(aeval f) p) ∧ ∃ z, z ∈ LinearMap.ker (↑(aeval f) q) ∧ y + z = v
[PROOFSTEP]
rw [aeval_mul] at h_eval₂_qpp' h_eval₂_pqq'
[GOAL]
case intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) (p * q))
p' q' : R[X]
hpq' : p' * p + q' * q = 1
h_eval₂_qpp' : ↑(↑(aeval f) q * ↑(aeval f) (p * p')) v = 0
h_eval₂_pqq' : ↑(↑(aeval f) p * ↑(aeval f) (q * q')) v = 0
⊢ ∃ y, y ∈ LinearMap.ker (↑(aeval f) p) ∧ ∃ z, z ∈ LinearMap.ker (↑(aeval f) q) ∧ y + z = v
[PROOFSTEP]
refine' ⟨aeval f (q * q') v, LinearMap.mem_ker.1 h_eval₂_pqq', aeval f (p * p') v, LinearMap.mem_ker.1 h_eval₂_qpp', _⟩
[GOAL]
case intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) (p * q))
p' q' : R[X]
hpq' : p' * p + q' * q = 1
h_eval₂_qpp' : ↑(↑(aeval f) q * ↑(aeval f) (p * p')) v = 0
h_eval₂_pqq' : ↑(↑(aeval f) p * ↑(aeval f) (q * q')) v = 0
⊢ ↑(↑(aeval f) (q * q')) v + ↑(↑(aeval f) (p * p')) v = v
[PROOFSTEP]
rw [add_comm, mul_comm p p', mul_comm q q']
[GOAL]
case intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : M →ₗ[R] M
p q : R[X]
v : M
hv : v ∈ LinearMap.ker (↑(aeval f) (p * q))
p' q' : R[X]
hpq' : p' * p + q' * q = 1
h_eval₂_qpp' : ↑(↑(aeval f) q * ↑(aeval f) (p * p')) v = 0
h_eval₂_pqq' : ↑(↑(aeval f) p * ↑(aeval f) (q * q')) v = 0
⊢ ↑(↑(aeval f) (p' * p)) v + ↑(↑(aeval f) (q' * q)) v = v
[PROOFSTEP]
simpa only [map_add, map_mul, aeval_one] using congr_arg (fun p : R[X] => aeval f p v) hpq'
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsNoetherianRing R
⊢ IsNoetherianRing (MvPolynomial (Fin 0) R)
[PROOFSTEP]
apply isNoetherianRing_of_ringEquiv R
[GOAL]
case f
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsNoetherianRing R
⊢ R ≃+* MvPolynomial (Fin 0) R
[PROOFSTEP]
symm
[GOAL]
case f
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : AddCommGroup M
inst✝¹ : Module R M
inst✝ : IsNoetherianRing R
⊢ MvPolynomial (Fin 0) R ≃+* R
[PROOFSTEP]
apply MvPolynomial.isEmptyRingEquiv R (Fin 0)
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Finite σ
inst✝ : IsNoetherianRing R
⊢ IsNoetherianRing (MvPolynomial σ R)
[PROOFSTEP]
cases nonempty_fintype σ
[GOAL]
case intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Finite σ
inst✝ : IsNoetherianRing R
val✝ : Fintype σ
⊢ IsNoetherianRing (MvPolynomial σ R)
[PROOFSTEP]
exact
  @isNoetherianRing_of_ringEquiv (MvPolynomial (Fin (Fintype.card σ)) R) _ _ _
    (renameEquiv R (Fintype.equivFin σ).symm).toRingEquiv isNoetherianRing_fin
[GOAL]
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u
σ : Type v
inst✝² : CommSemiring R
inst✝¹ : Finite σ
inst✝ : NoZeroDivisors R
⊢ NoZeroDivisors (MvPolynomial σ R)
[PROOFSTEP]
cases nonempty_fintype σ
[GOAL]
case intro
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u
σ : Type v
inst✝² : CommSemiring R
inst✝¹ : Finite σ
inst✝ : NoZeroDivisors R
val✝ : Fintype σ
⊢ NoZeroDivisors (MvPolynomial σ R)
[PROOFSTEP]
haveI := noZeroDivisors_fin R (Fintype.card σ)
[GOAL]
case intro
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
R : Type u
σ : Type v
inst✝² : CommSemiring R
inst✝¹ : Finite σ
inst✝ : NoZeroDivisors R
val✝ : Fintype σ
this : NoZeroDivisors (MvPolynomial (Fin (Fintype.card σ)) R)
⊢ NoZeroDivisors (MvPolynomial σ R)
[PROOFSTEP]
exact (renameEquiv R (Fintype.equivFin σ)).injective.noZeroDivisors _ (map_zero _) (map_mul _)
[GOAL]
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
R : Type u
inst✝¹ : CommSemiring R
inst✝ : NoZeroDivisors R
σ : Type v
p q : MvPolynomial σ R
h : p * q = 0
⊢ p = 0 ∨ q = 0
[PROOFSTEP]
obtain ⟨s, p, rfl⟩ := exists_finset_rename p
[GOAL]
case intro.intro
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
R : Type u
inst✝¹ : CommSemiring R
inst✝ : NoZeroDivisors R
σ : Type v
q : MvPolynomial σ R
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
h : ↑(rename Subtype.val) p * q = 0
⊢ ↑(rename Subtype.val) p = 0 ∨ q = 0
[PROOFSTEP]
obtain ⟨t, q, rfl⟩ := exists_finset_rename q
[GOAL]
case intro.intro.intro.intro
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
R : Type u
inst✝¹ : CommSemiring R
inst✝ : NoZeroDivisors R
σ : Type v
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
t : Finset σ
q : MvPolynomial { x // x ∈ t } R
h : ↑(rename Subtype.val) p * ↑(rename Subtype.val) q = 0
⊢ ↑(rename Subtype.val) p = 0 ∨ ↑(rename Subtype.val) q = 0
[PROOFSTEP]
have :
  rename (Subtype.map id (Finset.subset_union_left s t) : { x // x ∈ s } → { x // x ∈ s ∪ t }) p *
      rename (Subtype.map id (Finset.subset_union_right s t) : { x // x ∈ t } → { x // x ∈ s ∪ t }) q =
    0 :=
  by
  apply rename_injective _ Subtype.val_injective
  simpa using h
[GOAL]
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
R : Type u
inst✝¹ : CommSemiring R
inst✝ : NoZeroDivisors R
σ : Type v
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
t : Finset σ
q : MvPolynomial { x // x ∈ t } R
h : ↑(rename Subtype.val) p * ↑(rename Subtype.val) q = 0
⊢ ↑(rename (Subtype.map id (_ : s ⊆ s ∪ t))) p * ↑(rename (Subtype.map id (_ : t ⊆ s ∪ t))) q = 0
[PROOFSTEP]
apply rename_injective _ Subtype.val_injective
[GOAL]
case a
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
R : Type u
inst✝¹ : CommSemiring R
inst✝ : NoZeroDivisors R
σ : Type v
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
t : Finset σ
q : MvPolynomial { x // x ∈ t } R
h : ↑(rename Subtype.val) p * ↑(rename Subtype.val) q = 0
⊢ ↑(rename Subtype.val) (↑(rename (Subtype.map id (_ : s ⊆ s ∪ t))) p * ↑(rename (Subtype.map id (_ : t ⊆ s ∪ t))) q) =
    ↑(rename Subtype.val) 0
[PROOFSTEP]
simpa using h
[GOAL]
case intro.intro.intro.intro
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
R : Type u
inst✝¹ : CommSemiring R
inst✝ : NoZeroDivisors R
σ : Type v
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
t : Finset σ
q : MvPolynomial { x // x ∈ t } R
h : ↑(rename Subtype.val) p * ↑(rename Subtype.val) q = 0
this : ↑(rename (Subtype.map id (_ : s ⊆ s ∪ t))) p * ↑(rename (Subtype.map id (_ : t ⊆ s ∪ t))) q = 0
⊢ ↑(rename Subtype.val) p = 0 ∨ ↑(rename Subtype.val) q = 0
[PROOFSTEP]
letI that := MvPolynomial.noZeroDivisors_of_finite R { x // x ∈ s ∪ t }
[GOAL]
case intro.intro.intro.intro
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
R : Type u
inst✝¹ : CommSemiring R
inst✝ : NoZeroDivisors R
σ : Type v
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
t : Finset σ
q : MvPolynomial { x // x ∈ t } R
h : ↑(rename Subtype.val) p * ↑(rename Subtype.val) q = 0
this : ↑(rename (Subtype.map id (_ : s ⊆ s ∪ t))) p * ↑(rename (Subtype.map id (_ : t ⊆ s ∪ t))) q = 0
that : NoZeroDivisors (MvPolynomial { x // x ∈ s ∪ t } R) := noZeroDivisors_of_finite R { x // x ∈ s ∪ t }
⊢ ↑(rename Subtype.val) p = 0 ∨ ↑(rename Subtype.val) q = 0
[PROOFSTEP]
rw [mul_eq_zero] at this
[GOAL]
case intro.intro.intro.intro
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
R : Type u
inst✝¹ : CommSemiring R
inst✝ : NoZeroDivisors R
σ : Type v
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
t : Finset σ
q : MvPolynomial { x // x ∈ t } R
h : ↑(rename Subtype.val) p * ↑(rename Subtype.val) q = 0
this : ↑(rename (Subtype.map id (_ : s ⊆ s ∪ t))) p = 0 ∨ ↑(rename (Subtype.map id (_ : t ⊆ s ∪ t))) q = 0
that : NoZeroDivisors (MvPolynomial { x // x ∈ s ∪ t } R) := noZeroDivisors_of_finite R { x // x ∈ s ∪ t }
⊢ ↑(rename Subtype.val) p = 0 ∨ ↑(rename Subtype.val) q = 0
[PROOFSTEP]
apply this.imp
[GOAL]
case intro.intro.intro.intro.f
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
R : Type u
inst✝¹ : CommSemiring R
inst✝ : NoZeroDivisors R
σ : Type v
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
t : Finset σ
q : MvPolynomial { x // x ∈ t } R
h : ↑(rename Subtype.val) p * ↑(rename Subtype.val) q = 0
this : ↑(rename (Subtype.map id (_ : s ⊆ s ∪ t))) p = 0 ∨ ↑(rename (Subtype.map id (_ : t ⊆ s ∪ t))) q = 0
that : NoZeroDivisors (MvPolynomial { x // x ∈ s ∪ t } R) := noZeroDivisors_of_finite R { x // x ∈ s ∪ t }
⊢ ↑(rename (Subtype.map id (_ : s ⊆ s ∪ t))) p = 0 → ↑(rename Subtype.val) p = 0
[PROOFSTEP]
intro that
[GOAL]
case intro.intro.intro.intro.g
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
R : Type u
inst✝¹ : CommSemiring R
inst✝ : NoZeroDivisors R
σ : Type v
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
t : Finset σ
q : MvPolynomial { x // x ∈ t } R
h : ↑(rename Subtype.val) p * ↑(rename Subtype.val) q = 0
this : ↑(rename (Subtype.map id (_ : s ⊆ s ∪ t))) p = 0 ∨ ↑(rename (Subtype.map id (_ : t ⊆ s ∪ t))) q = 0
that : NoZeroDivisors (MvPolynomial { x // x ∈ s ∪ t } R) := noZeroDivisors_of_finite R { x // x ∈ s ∪ t }
⊢ ↑(rename (Subtype.map id (_ : t ⊆ s ∪ t))) q = 0 → ↑(rename Subtype.val) q = 0
[PROOFSTEP]
intro that
[GOAL]
case intro.intro.intro.intro.f
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
R : Type u
inst✝¹ : CommSemiring R
inst✝ : NoZeroDivisors R
σ : Type v
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
t : Finset σ
q : MvPolynomial { x // x ∈ t } R
h : ↑(rename Subtype.val) p * ↑(rename Subtype.val) q = 0
this : ↑(rename (Subtype.map id (_ : s ⊆ s ∪ t))) p = 0 ∨ ↑(rename (Subtype.map id (_ : t ⊆ s ∪ t))) q = 0
that✝ : NoZeroDivisors (MvPolynomial { x // x ∈ s ∪ t } R) := noZeroDivisors_of_finite R { x // x ∈ s ∪ t }
that : ↑(rename (Subtype.map id (_ : s ⊆ s ∪ t))) p = 0
⊢ ↑(rename Subtype.val) p = 0
[PROOFSTEP]
simpa using congr_arg (rename Subtype.val) that
[GOAL]
case intro.intro.intro.intro.g
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
R : Type u
inst✝¹ : CommSemiring R
inst✝ : NoZeroDivisors R
σ : Type v
s : Finset σ
p : MvPolynomial { x // x ∈ s } R
t : Finset σ
q : MvPolynomial { x // x ∈ t } R
h : ↑(rename Subtype.val) p * ↑(rename Subtype.val) q = 0
this : ↑(rename (Subtype.map id (_ : s ⊆ s ∪ t))) p = 0 ∨ ↑(rename (Subtype.map id (_ : t ⊆ s ∪ t))) q = 0
that✝ : NoZeroDivisors (MvPolynomial { x // x ∈ s ∪ t } R) := noZeroDivisors_of_finite R { x // x ∈ s ∪ t }
that : ↑(rename (Subtype.map id (_ : t ⊆ s ∪ t))) q = 0
⊢ ↑(rename Subtype.val) q = 0
[PROOFSTEP]
simpa using congr_arg (rename Subtype.val) that
[GOAL]
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
R : Type u
σ : Type v
inst✝¹ : CommRing R
inst✝ : IsDomain R
⊢ IsDomain (MvPolynomial σ R)
[PROOFSTEP]
apply @NoZeroDivisors.to_isDomain (MvPolynomial σ R) _ ?_ _
[GOAL]
R✝ : Type u
S : Type u_1
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
R : Type u
σ : Type v
inst✝¹ : CommRing R
inst✝ : IsDomain R
⊢ Nontrivial (MvPolynomial σ R)
[PROOFSTEP]
apply AddMonoidAlgebra.nontrivial
[GOAL]
R : Type u
S✝ : Type u_1
σ : Type v
M : Type w
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S✝
inst✝³ : AddCommGroup M
inst✝² : Module R M
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Finite σ
ϕ : MvPolynomial σ R →+* S
p : MvPolynomial σ R
⊢ ↑ϕ p = eval₂ (RingHom.comp ϕ C) (fun s => ↑ϕ (X s)) p
[PROOFSTEP]
cases nonempty_fintype σ
[GOAL]
case intro
R : Type u
S✝ : Type u_1
σ : Type v
M : Type w
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S✝
inst✝³ : AddCommGroup M
inst✝² : Module R M
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Finite σ
ϕ : MvPolynomial σ R →+* S
p : MvPolynomial σ R
val✝ : Fintype σ
⊢ ↑ϕ p = eval₂ (RingHom.comp ϕ C) (fun s => ↑ϕ (X s)) p
[PROOFSTEP]
refine' Trans.trans (congr_arg ϕ (MvPolynomial.as_sum p)) _
[GOAL]
case intro
R : Type u
S✝ : Type u_1
σ : Type v
M : Type w
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S✝
inst✝³ : AddCommGroup M
inst✝² : Module R M
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Finite σ
ϕ : MvPolynomial σ R →+* S
p : MvPolynomial σ R
val✝ : Fintype σ
⊢ ↑ϕ (∑ v in support p, ↑(monomial v) (coeff v p)) = eval₂ (RingHom.comp ϕ C) (fun s => ↑ϕ (X s)) p
[PROOFSTEP]
rw [MvPolynomial.eval₂_eq', ϕ.map_sum]
[GOAL]
case intro
R : Type u
S✝ : Type u_1
σ : Type v
M : Type w
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S✝
inst✝³ : AddCommGroup M
inst✝² : Module R M
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Finite σ
ϕ : MvPolynomial σ R →+* S
p : MvPolynomial σ R
val✝ : Fintype σ
⊢ ∑ x in support p, ↑ϕ (↑(monomial x) (coeff x p)) =
    ∑ d in support p, ↑(RingHom.comp ϕ C) (coeff d p) * ∏ i : σ, ↑ϕ (X i) ^ ↑d i
[PROOFSTEP]
congr
[GOAL]
case intro.e_f
R : Type u
S✝ : Type u_1
σ : Type v
M : Type w
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S✝
inst✝³ : AddCommGroup M
inst✝² : Module R M
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Finite σ
ϕ : MvPolynomial σ R →+* S
p : MvPolynomial σ R
val✝ : Fintype σ
⊢ (fun x => ↑ϕ (↑(monomial x) (coeff x p))) = fun d => ↑(RingHom.comp ϕ C) (coeff d p) * ∏ i : σ, ↑ϕ (X i) ^ ↑d i
[PROOFSTEP]
ext
[GOAL]
case intro.e_f.h
R : Type u
S✝ : Type u_1
σ : Type v
M : Type w
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S✝
inst✝³ : AddCommGroup M
inst✝² : Module R M
S : Type u_2
inst✝¹ : CommRing S
inst✝ : Finite σ
ϕ : MvPolynomial σ R →+* S
p : MvPolynomial σ R
val✝ : Fintype σ
x✝ : σ →₀ ℕ
⊢ ↑ϕ (↑(monomial x✝) (coeff x✝ p)) = ↑(RingHom.comp ϕ C) (coeff x✝ p) * ∏ i : σ, ↑ϕ (X i) ^ ↑x✝ i
[PROOFSTEP]
simp only [monomial_eq, ϕ.map_pow, ϕ.map_prod, ϕ.comp_apply, ϕ.map_mul, Finsupp.prod_pow]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal (MvPolynomial σ R)
p : MvPolynomial σ R
hcoe : ∀ (m : σ →₀ ℕ), coeff m p ∈ Ideal.comap C I
⊢ p ∈ I
[PROOFSTEP]
rw [as_sum p]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal (MvPolynomial σ R)
p : MvPolynomial σ R
hcoe : ∀ (m : σ →₀ ℕ), coeff m p ∈ Ideal.comap C I
⊢ ∑ v in support p, ↑(monomial v) (coeff v p) ∈ I
[PROOFSTEP]
suffices ∀ m ∈ p.support, monomial m (MvPolynomial.coeff m p) ∈ I by exact Submodule.sum_mem I this
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal (MvPolynomial σ R)
p : MvPolynomial σ R
hcoe : ∀ (m : σ →₀ ℕ), coeff m p ∈ Ideal.comap C I
this : ∀ (m : σ →₀ ℕ), m ∈ support p → ↑(monomial m) (coeff m p) ∈ I
⊢ ∑ v in support p, ↑(monomial v) (coeff v p) ∈ I
[PROOFSTEP]
exact Submodule.sum_mem I this
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal (MvPolynomial σ R)
p : MvPolynomial σ R
hcoe : ∀ (m : σ →₀ ℕ), coeff m p ∈ Ideal.comap C I
⊢ ∀ (m : σ →₀ ℕ), m ∈ support p → ↑(monomial m) (coeff m p) ∈ I
[PROOFSTEP]
intro m _
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal (MvPolynomial σ R)
p : MvPolynomial σ R
hcoe : ∀ (m : σ →₀ ℕ), coeff m p ∈ Ideal.comap C I
m : σ →₀ ℕ
a✝ : m ∈ support p
⊢ ↑(monomial m) (coeff m p) ∈ I
[PROOFSTEP]
rw [← mul_one (coeff m p), ← C_mul_monomial]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal (MvPolynomial σ R)
p : MvPolynomial σ R
hcoe : ∀ (m : σ →₀ ℕ), coeff m p ∈ Ideal.comap C I
m : σ →₀ ℕ
a✝ : m ∈ support p
⊢ ↑C (coeff m p) * ↑(monomial m) 1 ∈ I
[PROOFSTEP]
suffices C (coeff m p) ∈ I by exact I.mul_mem_right (monomial m 1) this
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal (MvPolynomial σ R)
p : MvPolynomial σ R
hcoe : ∀ (m : σ →₀ ℕ), coeff m p ∈ Ideal.comap C I
m : σ →₀ ℕ
a✝ : m ∈ support p
this : ↑C (coeff m p) ∈ I
⊢ ↑C (coeff m p) * ↑(monomial m) 1 ∈ I
[PROOFSTEP]
exact I.mul_mem_right (monomial m 1) this
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal (MvPolynomial σ R)
p : MvPolynomial σ R
hcoe : ∀ (m : σ →₀ ℕ), coeff m p ∈ Ideal.comap C I
m : σ →₀ ℕ
a✝ : m ∈ support p
⊢ ↑C (coeff m p) ∈ I
[PROOFSTEP]
simpa [Ideal.mem_comap] using hcoe m
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f : MvPolynomial σ R
⊢ f ∈ Ideal.map C I ↔ ∀ (m : σ →₀ ℕ), coeff m f ∈ I
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f : MvPolynomial σ R
⊢ f ∈ Ideal.map C I → ∀ (m : σ →₀ ℕ), coeff m f ∈ I
[PROOFSTEP]
intro hf
[GOAL]
case mp
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f : MvPolynomial σ R
hf : f ∈ Ideal.map C I
⊢ ∀ (m : σ →₀ ℕ), coeff m f ∈ I
[PROOFSTEP]
apply @Submodule.span_induction _ _ _ _ Semiring.toModule f _ _ hf
[GOAL]
case mp.Hs
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f : MvPolynomial σ R
hf : f ∈ Ideal.map C I
⊢ ∀ (x : MvPolynomial σ R), x ∈ ↑C '' ↑I → ∀ (m : σ →₀ ℕ), coeff m x ∈ I
[PROOFSTEP]
intro f hf n
[GOAL]
case mp.Hs
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f✝ : MvPolynomial σ R
hf✝ : f✝ ∈ Ideal.map C I
f : MvPolynomial σ R
hf : f ∈ ↑C '' ↑I
n : σ →₀ ℕ
⊢ coeff n f ∈ I
[PROOFSTEP]
cases' (Set.mem_image _ _ _).mp hf with x hx
[GOAL]
case mp.Hs.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f✝ : MvPolynomial σ R
hf✝ : f✝ ∈ Ideal.map C I
f : MvPolynomial σ R
hf : f ∈ ↑C '' ↑I
n : σ →₀ ℕ
x : R
hx : x ∈ ↑I ∧ ↑C x = f
⊢ coeff n f ∈ I
[PROOFSTEP]
rw [← hx.right, coeff_C]
[GOAL]
case mp.Hs.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f✝ : MvPolynomial σ R
hf✝ : f✝ ∈ Ideal.map C I
f : MvPolynomial σ R
hf : f ∈ ↑C '' ↑I
n : σ →₀ ℕ
x : R
hx : x ∈ ↑I ∧ ↑C x = f
⊢ (if 0 = n then x else 0) ∈ I
[PROOFSTEP]
by_cases h : n = 0
[GOAL]
case pos
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f✝ : MvPolynomial σ R
hf✝ : f✝ ∈ Ideal.map C I
f : MvPolynomial σ R
hf : f ∈ ↑C '' ↑I
n : σ →₀ ℕ
x : R
hx : x ∈ ↑I ∧ ↑C x = f
h : n = 0
⊢ (if 0 = n then x else 0) ∈ I
[PROOFSTEP]
simpa [h] using hx.left
[GOAL]
case neg
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f✝ : MvPolynomial σ R
hf✝ : f✝ ∈ Ideal.map C I
f : MvPolynomial σ R
hf : f ∈ ↑C '' ↑I
n : σ →₀ ℕ
x : R
hx : x ∈ ↑I ∧ ↑C x = f
h : ¬n = 0
⊢ (if 0 = n then x else 0) ∈ I
[PROOFSTEP]
simp [Ne.symm h]
[GOAL]
case mp.H0
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f : MvPolynomial σ R
hf : f ∈ Ideal.map C I
⊢ ∀ (m : σ →₀ ℕ), coeff m 0 ∈ I
[PROOFSTEP]
simp
[GOAL]
case mp.H1
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f : MvPolynomial σ R
hf : f ∈ Ideal.map C I
⊢ ∀ (x y : MvPolynomial σ R),
    (∀ (m : σ →₀ ℕ), coeff m x ∈ I) → (∀ (m : σ →₀ ℕ), coeff m y ∈ I) → ∀ (m : σ →₀ ℕ), coeff m (x + y) ∈ I
[PROOFSTEP]
exact fun f g hf hg n => by simp [I.add_mem (hf n) (hg n)]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f✝ : MvPolynomial σ R
hf✝ : f✝ ∈ Ideal.map C I
f g : MvPolynomial σ R
hf : ∀ (m : σ →₀ ℕ), coeff m f ∈ I
hg : ∀ (m : σ →₀ ℕ), coeff m g ∈ I
n : σ →₀ ℕ
⊢ coeff n (f + g) ∈ I
[PROOFSTEP]
simp [I.add_mem (hf n) (hg n)]
[GOAL]
case mp.H2
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f : MvPolynomial σ R
hf : f ∈ Ideal.map C I
⊢ ∀ (a x : MvPolynomial σ R), (∀ (m : σ →₀ ℕ), coeff m x ∈ I) → ∀ (m : σ →₀ ℕ), coeff m (a • x) ∈ I
[PROOFSTEP]
refine' fun f g hg n => _
[GOAL]
case mp.H2
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f✝ : MvPolynomial σ R
hf : f✝ ∈ Ideal.map C I
f g : MvPolynomial σ R
hg : ∀ (m : σ →₀ ℕ), coeff m g ∈ I
n : σ →₀ ℕ
⊢ coeff n (f • g) ∈ I
[PROOFSTEP]
rw [smul_eq_mul, coeff_mul]
[GOAL]
case mp.H2
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f✝ : MvPolynomial σ R
hf : f✝ ∈ Ideal.map C I
f g : MvPolynomial σ R
hg : ∀ (m : σ →₀ ℕ), coeff m g ∈ I
n : σ →₀ ℕ
⊢ ∑ x in Finsupp.antidiagonal n, coeff x.fst f * coeff x.snd g ∈ I
[PROOFSTEP]
exact I.sum_mem fun c _ => I.mul_mem_left (f.coeff c.fst) (hg c.snd)
[GOAL]
case mpr
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f : MvPolynomial σ R
⊢ (∀ (m : σ →₀ ℕ), coeff m f ∈ I) → f ∈ Ideal.map C I
[PROOFSTEP]
intro hf
[GOAL]
case mpr
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f : MvPolynomial σ R
hf : ∀ (m : σ →₀ ℕ), coeff m f ∈ I
⊢ f ∈ Ideal.map C I
[PROOFSTEP]
rw [as_sum f]
[GOAL]
case mpr
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f : MvPolynomial σ R
hf : ∀ (m : σ →₀ ℕ), coeff m f ∈ I
⊢ ∑ v in support f, ↑(monomial v) (coeff v f) ∈ Ideal.map C I
[PROOFSTEP]
suffices ∀ m ∈ f.support, monomial m (coeff m f) ∈ (Ideal.map C I : Ideal (MvPolynomial σ R)) by
  exact Submodule.sum_mem _ this
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f : MvPolynomial σ R
hf : ∀ (m : σ →₀ ℕ), coeff m f ∈ I
this : ∀ (m : σ →₀ ℕ), m ∈ support f → ↑(monomial m) (coeff m f) ∈ Ideal.map C I
⊢ ∑ v in support f, ↑(monomial v) (coeff v f) ∈ Ideal.map C I
[PROOFSTEP]
exact Submodule.sum_mem _ this
[GOAL]
case mpr
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f : MvPolynomial σ R
hf : ∀ (m : σ →₀ ℕ), coeff m f ∈ I
⊢ ∀ (m : σ →₀ ℕ), m ∈ support f → ↑(monomial m) (coeff m f) ∈ Ideal.map C I
[PROOFSTEP]
intro m _
[GOAL]
case mpr
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f : MvPolynomial σ R
hf : ∀ (m : σ →₀ ℕ), coeff m f ∈ I
m : σ →₀ ℕ
a✝ : m ∈ support f
⊢ ↑(monomial m) (coeff m f) ∈ Ideal.map C I
[PROOFSTEP]
rw [← mul_one (coeff m f), ← C_mul_monomial]
[GOAL]
case mpr
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f : MvPolynomial σ R
hf : ∀ (m : σ →₀ ℕ), coeff m f ∈ I
m : σ →₀ ℕ
a✝ : m ∈ support f
⊢ ↑C (coeff m f) * ↑(monomial m) 1 ∈ Ideal.map C I
[PROOFSTEP]
suffices C (coeff m f) ∈ (Ideal.map C I : Ideal (MvPolynomial σ R)) by exact Ideal.mul_mem_right _ _ this
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f : MvPolynomial σ R
hf : ∀ (m : σ →₀ ℕ), coeff m f ∈ I
m : σ →₀ ℕ
a✝ : m ∈ support f
this : ↑C (coeff m f) ∈ Ideal.map C I
⊢ ↑C (coeff m f) * ↑(monomial m) 1 ∈ Ideal.map C I
[PROOFSTEP]
exact Ideal.mul_mem_right _ _ this
[GOAL]
case mpr
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f : MvPolynomial σ R
hf : ∀ (m : σ →₀ ℕ), coeff m f ∈ I
m : σ →₀ ℕ
a✝ : m ∈ support f
⊢ ↑C (coeff m f) ∈ Ideal.map C I
[PROOFSTEP]
apply Ideal.mem_map_of_mem _
[GOAL]
case mpr
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
I : Ideal R
f : MvPolynomial σ R
hf : ∀ (m : σ →₀ ℕ), coeff m f ∈ I
m : σ →₀ ℕ
a✝ : m ∈ support f
⊢ coeff m f ∈ I
[PROOFSTEP]
exact hf m
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : R →+* S
⊢ RingHom.ker (map f) = Ideal.map C (RingHom.ker f)
[PROOFSTEP]
ext
[GOAL]
case h
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : R →+* S
x✝ : MvPolynomial σ R
⊢ x✝ ∈ RingHom.ker (map f) ↔ x✝ ∈ Ideal.map C (RingHom.ker f)
[PROOFSTEP]
rw [MvPolynomial.mem_map_C_iff, RingHom.mem_ker, MvPolynomial.ext_iff]
[GOAL]
case h
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝³ : CommRing R
inst✝² : CommRing S
inst✝¹ : AddCommGroup M
inst✝ : Module R M
f : R →+* S
x✝ : MvPolynomial σ R
⊢ (∀ (m : σ →₀ ℕ), coeff m (↑(map f) x✝) = coeff m 0) ↔ ∀ (m : σ →₀ ℕ), coeff m x✝ ∈ RingHom.ker f
[PROOFSTEP]
simp_rw [coeff_map, coeff_zero, RingHom.mem_ker]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
D : Type u
inst✝² : CommRing D
inst✝¹ : IsDomain D
inst✝ : UniqueFactorizationMonoid D
⊢ UniqueFactorizationMonoid D[X]
[PROOFSTEP]
haveI : NormalizationMonoid D := Inhabited.default
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
D : Type u
inst✝² : CommRing D
inst✝¹ : IsDomain D
inst✝ : UniqueFactorizationMonoid D
this : NormalizationMonoid D
⊢ UniqueFactorizationMonoid D[X]
[PROOFSTEP]
haveI := toNormalizedGCDMonoid D
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
D : Type u
inst✝² : CommRing D
inst✝¹ : IsDomain D
inst✝ : UniqueFactorizationMonoid D
this✝ : NormalizationMonoid D
this : NormalizedGCDMonoid D
⊢ UniqueFactorizationMonoid D[X]
[PROOFSTEP]
exact ufm_of_gcd_of_wfDvdMonoid
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
D : Type u
inst✝² : CommRing D
inst✝¹ : IsDomain D
inst✝ : UniqueFactorizationMonoid D
d : ℕ
⊢ CancelCommMonoidWithZero (MvPolynomial (Fin d) D)[X]
[PROOFSTEP]
apply IsDomain.toCancelCommMonoidWithZero
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
D : Type u
inst✝³ : CommRing D
inst✝² : IsDomain D
inst✝¹ : UniqueFactorizationMonoid D
d : ℕ
inst✝ : Fintype σ
⊢ UniqueFactorizationMonoid (MvPolynomial (Fin (Fintype.card σ)) D)
[PROOFSTEP]
induction' Fintype.card σ with d hd
[GOAL]
case zero
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
D : Type u
inst✝³ : CommRing D
inst✝² : IsDomain D
inst✝¹ : UniqueFactorizationMonoid D
d : ℕ
inst✝ : Fintype σ
⊢ UniqueFactorizationMonoid (MvPolynomial (Fin Nat.zero) D)
[PROOFSTEP]
apply (isEmptyAlgEquiv D (Fin 0)).toMulEquiv.symm.uniqueFactorizationMonoid
[GOAL]
case zero
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
D : Type u
inst✝³ : CommRing D
inst✝² : IsDomain D
inst✝¹ : UniqueFactorizationMonoid D
d : ℕ
inst✝ : Fintype σ
⊢ UniqueFactorizationMonoid D
[PROOFSTEP]
infer_instance
[GOAL]
case succ
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
D : Type u
inst✝³ : CommRing D
inst✝² : IsDomain D
inst✝¹ : UniqueFactorizationMonoid D
d✝ : ℕ
inst✝ : Fintype σ
d : ℕ
hd : UniqueFactorizationMonoid (MvPolynomial (Fin d) D)
⊢ UniqueFactorizationMonoid (MvPolynomial (Fin (Nat.succ d)) D)
[PROOFSTEP]
rw [Nat.succ_eq_add_one d]
[GOAL]
case succ
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
D : Type u
inst✝³ : CommRing D
inst✝² : IsDomain D
inst✝¹ : UniqueFactorizationMonoid D
d✝ : ℕ
inst✝ : Fintype σ
d : ℕ
hd : UniqueFactorizationMonoid (MvPolynomial (Fin d) D)
⊢ UniqueFactorizationMonoid (MvPolynomial (Fin (d + 1)) D)
[PROOFSTEP]
apply @MulEquiv.uniqueFactorizationMonoid _ _ (_) (_)
[GOAL]
case succ.e
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
D : Type u
inst✝³ : CommRing D
inst✝² : IsDomain D
inst✝¹ : UniqueFactorizationMonoid D
d✝ : ℕ
inst✝ : Fintype σ
d : ℕ
hd : UniqueFactorizationMonoid (MvPolynomial (Fin d) D)
⊢ ?m.1042176 ≃* MvPolynomial (Fin (d + 1)) D
[PROOFSTEP]
exact (finSuccEquiv D d).toMulEquiv.symm
[GOAL]
case succ.hα
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
D : Type u
inst✝³ : CommRing D
inst✝² : IsDomain D
inst✝¹ : UniqueFactorizationMonoid D
d✝ : ℕ
inst✝ : Fintype σ
d : ℕ
hd : UniqueFactorizationMonoid (MvPolynomial (Fin d) D)
⊢ UniqueFactorizationMonoid (MvPolynomial (Fin d) D)[X]
[PROOFSTEP]
apply @Polynomial.uniqueFactorizationMonoid (MvPolynomial (Fin d) D) _ _ ?_
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁷ : CommRing R
inst✝⁶ : CommRing S
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
D : Type u
inst✝³ : CommRing D
inst✝² : IsDomain D
inst✝¹ : UniqueFactorizationMonoid D
d✝ : ℕ
inst✝ : Fintype σ
d : ℕ
hd : UniqueFactorizationMonoid (MvPolynomial (Fin d) D)
⊢ UniqueFactorizationMonoid (MvPolynomial (Fin d) D)
[PROOFSTEP]
assumption
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
D : Type u
inst✝² : CommRing D
inst✝¹ : IsDomain D
inst✝ : UniqueFactorizationMonoid D
d : ℕ
⊢ UniqueFactorizationMonoid (MvPolynomial σ D)
[PROOFSTEP]
rw [iff_exists_prime_factors]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
D : Type u
inst✝² : CommRing D
inst✝¹ : IsDomain D
inst✝ : UniqueFactorizationMonoid D
d : ℕ
⊢ ∀ (a : MvPolynomial σ D), a ≠ 0 → ∃ f, (∀ (b : MvPolynomial σ D), b ∈ f → Prime b) ∧ Associated (Multiset.prod f) a
[PROOFSTEP]
intro a ha
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
D : Type u
inst✝² : CommRing D
inst✝¹ : IsDomain D
inst✝ : UniqueFactorizationMonoid D
d : ℕ
a : MvPolynomial σ D
ha : a ≠ 0
⊢ ∃ f, (∀ (b : MvPolynomial σ D), b ∈ f → Prime b) ∧ Associated (Multiset.prod f) a
[PROOFSTEP]
obtain ⟨s, a', rfl⟩ := exists_finset_rename a
[GOAL]
case intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
D : Type u
inst✝² : CommRing D
inst✝¹ : IsDomain D
inst✝ : UniqueFactorizationMonoid D
d : ℕ
s : Finset σ
a' : MvPolynomial { x // x ∈ s } D
ha : ↑(rename Subtype.val) a' ≠ 0
⊢ ∃ f, (∀ (b : MvPolynomial σ D), b ∈ f → Prime b) ∧ Associated (Multiset.prod f) (↑(rename Subtype.val) a')
[PROOFSTEP]
obtain ⟨w, h, u, hw⟩ :=
  iff_exists_prime_factors.1 (uniqueFactorizationMonoid_of_fintype s) a' fun h => ha <| by simp [h]
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
D : Type u
inst✝² : CommRing D
inst✝¹ : IsDomain D
inst✝ : UniqueFactorizationMonoid D
d : ℕ
s : Finset σ
a' : MvPolynomial { x // x ∈ s } D
ha : ↑(rename Subtype.val) a' ≠ 0
h : a' = 0
⊢ ↑(rename Subtype.val) a' = 0
[PROOFSTEP]
simp [h]
[GOAL]
case intro.intro.intro.intro.intro
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
D : Type u
inst✝² : CommRing D
inst✝¹ : IsDomain D
inst✝ : UniqueFactorizationMonoid D
d : ℕ
s : Finset σ
a' : MvPolynomial { x // x ∈ s } D
ha : ↑(rename Subtype.val) a' ≠ 0
w : Multiset (MvPolynomial { x // x ∈ s } D)
h : ∀ (b : MvPolynomial { x // x ∈ s } D), b ∈ w → Prime b
u : (MvPolynomial { x // x ∈ s } D)ˣ
hw : Multiset.prod w * ↑u = a'
⊢ ∃ f, (∀ (b : MvPolynomial σ D), b ∈ f → Prime b) ∧ Associated (Multiset.prod f) (↑(rename Subtype.val) a')
[PROOFSTEP]
exact
  ⟨w.map (rename (↑)), fun b hb =>
    let ⟨b', hb', he⟩ := Multiset.mem_map.1 hb
    he ▸ (prime_rename_iff ↑s).2 (h b' hb'),
    Units.map (@rename s σ D _ (↑)).toRingHom.toMonoidHom u, by erw [Multiset.prod_hom, ← map_mul, hw]⟩
[GOAL]
R : Type u
S : Type u_1
σ : Type v
M : Type w
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
D : Type u
inst✝² : CommRing D
inst✝¹ : IsDomain D
inst✝ : UniqueFactorizationMonoid D
d : ℕ
s : Finset σ
a' : MvPolynomial { x // x ∈ s } D
ha : ↑(rename Subtype.val) a' ≠ 0
w : Multiset (MvPolynomial { x // x ∈ s } D)
h : ∀ (b : MvPolynomial { x // x ∈ s } D), b ∈ w → Prime b
u : (MvPolynomial { x // x ∈ s } D)ˣ
hw : Multiset.prod w * ↑u = a'
⊢ Multiset.prod (Multiset.map (↑(rename Subtype.val)) w) * ↑(↑(Units.map ↑↑(rename Subtype.val)) u) =
    ↑(rename Subtype.val) a'
[PROOFSTEP]
erw [Multiset.prod_hom, ← map_mul, hw]