[GOAL]
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
r : S
hr : r ∈ I
p : R[X]
hp : eval₂ f r p ∈ I
⊢ coeff p 0 ∈ comap f I
[PROOFSTEP]
rw [← p.divX_mul_X_add, eval₂_add, eval₂_C, eval₂_mul, eval₂_X] at hp
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
r : S
hr : r ∈ I
p : R[X]
hp : eval₂ f r (divX p) * r + ↑f (coeff p 0) ∈ I
⊢ coeff p 0 ∈ comap f I
[PROOFSTEP]
refine' mem_comap.mpr ((I.add_mem_iff_right _).mp hp)
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
r : S
hr : r ∈ I
p : R[X]
hp : eval₂ f r (divX p) * r + ↑f (coeff p 0) ∈ I
⊢ eval₂ f r (divX p) * r ∈ I
[PROOFSTEP]
exact I.mul_mem_left _ hr
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
r : S
r_non_zero_divisor : ∀ {x : S}, x * r = 0 → x = 0
hr : r ∈ I
p : R[X]
⊢ p ≠ 0 → eval₂ f r p = 0 → ∃ i, coeff p i ≠ 0 ∧ coeff p i ∈ comap f I
[PROOFSTEP]
refine' p.recOnHorner _ _ _
[GOAL]
case refine'_1
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
r : S
r_non_zero_divisor : ∀ {x : S}, x * r = 0 → x = 0
hr : r ∈ I
p : R[X]
⊢ 0 ≠ 0 → eval₂ f r 0 = 0 → ∃ i, coeff 0 i ≠ 0 ∧ coeff 0 i ∈ comap f I
[PROOFSTEP]
intro h
[GOAL]
case refine'_1
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
r : S
r_non_zero_divisor : ∀ {x : S}, x * r = 0 → x = 0
hr : r ∈ I
p : R[X]
h : 0 ≠ 0
⊢ eval₂ f r 0 = 0 → ∃ i, coeff 0 i ≠ 0 ∧ coeff 0 i ∈ comap f I
[PROOFSTEP]
contradiction
[GOAL]
case refine'_2
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
r : S
r_non_zero_divisor : ∀ {x : S}, x * r = 0 → x = 0
hr : r ∈ I
p : R[X]
⊢ ∀ (p : R[X]) (a : R),
    coeff p 0 = 0 →
      a ≠ 0 →
        (p ≠ 0 → eval₂ f r p = 0 → ∃ i, coeff p i ≠ 0 ∧ coeff p i ∈ comap f I) →
          p + ↑C a ≠ 0 → eval₂ f r (p + ↑C a) = 0 → ∃ i, coeff (p + ↑C a) i ≠ 0 ∧ coeff (p + ↑C a) i ∈ comap f I
[PROOFSTEP]
intro p a coeff_eq_zero a_ne_zero _ _ hp
[GOAL]
case refine'_2
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
r : S
r_non_zero_divisor : ∀ {x : S}, x * r = 0 → x = 0
hr : r ∈ I
p✝ p : R[X]
a : R
coeff_eq_zero : coeff p 0 = 0
a_ne_zero : a ≠ 0
a✝ : p ≠ 0 → eval₂ f r p = 0 → ∃ i, coeff p i ≠ 0 ∧ coeff p i ∈ comap f I
x✝ : p + ↑C a ≠ 0
hp : eval₂ f r (p + ↑C a) = 0
⊢ ∃ i, coeff (p + ↑C a) i ≠ 0 ∧ coeff (p + ↑C a) i ∈ comap f I
[PROOFSTEP]
refine' ⟨0, _, coeff_zero_mem_comap_of_root_mem hr hp⟩
[GOAL]
case refine'_2
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
r : S
r_non_zero_divisor : ∀ {x : S}, x * r = 0 → x = 0
hr : r ∈ I
p✝ p : R[X]
a : R
coeff_eq_zero : coeff p 0 = 0
a_ne_zero : a ≠ 0
a✝ : p ≠ 0 → eval₂ f r p = 0 → ∃ i, coeff p i ≠ 0 ∧ coeff p i ∈ comap f I
x✝ : p + ↑C a ≠ 0
hp : eval₂ f r (p + ↑C a) = 0
⊢ coeff (p + ↑C a) 0 ≠ 0
[PROOFSTEP]
simp [coeff_eq_zero, a_ne_zero]
[GOAL]
case refine'_3
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
r : S
r_non_zero_divisor : ∀ {x : S}, x * r = 0 → x = 0
hr : r ∈ I
p : R[X]
⊢ ∀ (p : R[X]),
    p ≠ 0 →
      (p ≠ 0 → eval₂ f r p = 0 → ∃ i, coeff p i ≠ 0 ∧ coeff p i ∈ comap f I) →
        p * X ≠ 0 → eval₂ f r (p * X) = 0 → ∃ i, coeff (p * X) i ≠ 0 ∧ coeff (p * X) i ∈ comap f I
[PROOFSTEP]
intro p p_nonzero ih _ hp
[GOAL]
case refine'_3
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
r : S
r_non_zero_divisor : ∀ {x : S}, x * r = 0 → x = 0
hr : r ∈ I
p✝ p : R[X]
p_nonzero : p ≠ 0
ih : p ≠ 0 → eval₂ f r p = 0 → ∃ i, coeff p i ≠ 0 ∧ coeff p i ∈ comap f I
x✝ : p * X ≠ 0
hp : eval₂ f r (p * X) = 0
⊢ ∃ i, coeff (p * X) i ≠ 0 ∧ coeff (p * X) i ∈ comap f I
[PROOFSTEP]
rw [eval₂_mul, eval₂_X] at hp
[GOAL]
case refine'_3
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
r : S
r_non_zero_divisor : ∀ {x : S}, x * r = 0 → x = 0
hr : r ∈ I
p✝ p : R[X]
p_nonzero : p ≠ 0
ih : p ≠ 0 → eval₂ f r p = 0 → ∃ i, coeff p i ≠ 0 ∧ coeff p i ∈ comap f I
x✝ : p * X ≠ 0
hp : eval₂ f r p * r = 0
⊢ ∃ i, coeff (p * X) i ≠ 0 ∧ coeff (p * X) i ∈ comap f I
[PROOFSTEP]
obtain ⟨i, hi, mem⟩ := ih p_nonzero (r_non_zero_divisor hp)
[GOAL]
case refine'_3.intro.intro
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
r : S
r_non_zero_divisor : ∀ {x : S}, x * r = 0 → x = 0
hr : r ∈ I
p✝ p : R[X]
p_nonzero : p ≠ 0
ih : p ≠ 0 → eval₂ f r p = 0 → ∃ i, coeff p i ≠ 0 ∧ coeff p i ∈ comap f I
x✝ : p * X ≠ 0
hp : eval₂ f r p * r = 0
i : ℕ
hi : coeff p i ≠ 0
mem : coeff p i ∈ comap f I
⊢ ∃ i, coeff (p * X) i ≠ 0 ∧ coeff (p * X) i ∈ comap f I
[PROOFSTEP]
refine' ⟨i + 1, _, _⟩
[GOAL]
case refine'_3.intro.intro.refine'_1
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
r : S
r_non_zero_divisor : ∀ {x : S}, x * r = 0 → x = 0
hr : r ∈ I
p✝ p : R[X]
p_nonzero : p ≠ 0
ih : p ≠ 0 → eval₂ f r p = 0 → ∃ i, coeff p i ≠ 0 ∧ coeff p i ∈ comap f I
x✝ : p * X ≠ 0
hp : eval₂ f r p * r = 0
i : ℕ
hi : coeff p i ≠ 0
mem : coeff p i ∈ comap f I
⊢ coeff (p * X) (i + 1) ≠ 0
[PROOFSTEP]
simp [hi, mem]
[GOAL]
case refine'_3.intro.intro.refine'_2
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
r : S
r_non_zero_divisor : ∀ {x : S}, x * r = 0 → x = 0
hr : r ∈ I
p✝ p : R[X]
p_nonzero : p ≠ 0
ih : p ≠ 0 → eval₂ f r p = 0 → ∃ i, coeff p i ≠ 0 ∧ coeff p i ∈ comap f I
x✝ : p * X ≠ 0
hp : eval₂ f r p * r = 0
i : ℕ
hi : coeff p i ≠ 0
mem : coeff p i ∈ comap f I
⊢ coeff (p * X) (i + 1) ∈ comap f I
[PROOFSTEP]
simpa [hi] using mem
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
⊢ Function.Injective
    ↑(quotientMap (map (mapRingHom (Quotient.mk (comap C P))) P) (mapRingHom (Quotient.mk (comap C P)))
        (_ : P ≤ comap (mapRingHom (Quotient.mk (comap C P))) (map (mapRingHom (Quotient.mk (comap C P))) P)))
[PROOFSTEP]
refine' quotientMap_injective' (le_of_eq _)
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
⊢ comap (mapRingHom (Quotient.mk (comap C P))) (map (mapRingHom (Quotient.mk (comap C P))) P) = P
[PROOFSTEP]
rw [comap_map_of_surjective (mapRingHom (Ideal.Quotient.mk (P.comap (C : R →+* R[X]))))
    (map_surjective (Ideal.Quotient.mk (P.comap (C : R →+* R[X]))) Ideal.Quotient.mk_surjective)]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
⊢ P ⊔ comap (mapRingHom (Quotient.mk (comap C P))) ⊥ = P
[PROOFSTEP]
refine' le_antisymm (sup_le le_rfl _) (le_sup_of_le_left le_rfl)
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
⊢ comap (mapRingHom (Quotient.mk (comap C P))) ⊥ ≤ P
[PROOFSTEP]
refine' fun p hp => polynomial_mem_ideal_of_coeff_mem_ideal P p fun n => Ideal.Quotient.eq_zero_iff_mem.mp _
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
p : R[X]
hp : p ∈ comap (mapRingHom (Quotient.mk (comap C P))) ⊥
n : ℕ
⊢ ↑(Quotient.mk (comap C P)) (coeff p n) = 0
[PROOFSTEP]
simpa only [coeff_map, coe_mapRingHom] using ext_iff.mp (Ideal.mem_bot.mp (mem_comap.mp hp)) n
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
⊢ RingHom.comp (RingHom.comp (Quotient.mk (map (mapRingHom (Quotient.mk (comap C P))) P)) C) (Quotient.mk (comap C P)) =
    RingHom.comp
      (quotientMap (map (mapRingHom (Quotient.mk (comap C P))) P) (mapRingHom (Quotient.mk (comap C P)))
        (_ : P ≤ comap (mapRingHom (Quotient.mk (comap C P))) (map (mapRingHom (Quotient.mk (comap C P))) P)))
      (RingHom.comp (Quotient.mk P) C)
[PROOFSTEP]
refine' RingHom.ext fun x => _
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
x : R
⊢ ↑(RingHom.comp (RingHom.comp (Quotient.mk (map (mapRingHom (Quotient.mk (comap C P))) P)) C)
          (Quotient.mk (comap C P)))
      x =
    ↑(RingHom.comp
          (quotientMap (map (mapRingHom (Quotient.mk (comap C P))) P) (mapRingHom (Quotient.mk (comap C P)))
            (_ : P ≤ comap (mapRingHom (Quotient.mk (comap C P))) (map (mapRingHom (Quotient.mk (comap C P))) P)))
          (RingHom.comp (Quotient.mk P) C))
      x
[PROOFSTEP]
repeat' rw [RingHom.coe_comp, Function.comp_apply]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
x : R
⊢ ↑(RingHom.comp (RingHom.comp (Quotient.mk (map (mapRingHom (Quotient.mk (comap C P))) P)) C)
          (Quotient.mk (comap C P)))
      x =
    ↑(RingHom.comp
          (quotientMap (map (mapRingHom (Quotient.mk (comap C P))) P) (mapRingHom (Quotient.mk (comap C P)))
            (_ : P ≤ comap (mapRingHom (Quotient.mk (comap C P))) (map (mapRingHom (Quotient.mk (comap C P))) P)))
          (RingHom.comp (Quotient.mk P) C))
      x
[PROOFSTEP]
rw [RingHom.coe_comp, Function.comp_apply]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
x : R
⊢ ↑(RingHom.comp (Quotient.mk (map (mapRingHom (Quotient.mk (comap C P))) P)) C) (↑(Quotient.mk (comap C P)) x) =
    ↑(RingHom.comp
          (quotientMap (map (mapRingHom (Quotient.mk (comap C P))) P) (mapRingHom (Quotient.mk (comap C P)))
            (_ : P ≤ comap (mapRingHom (Quotient.mk (comap C P))) (map (mapRingHom (Quotient.mk (comap C P))) P)))
          (RingHom.comp (Quotient.mk P) C))
      x
[PROOFSTEP]
rw [RingHom.coe_comp, Function.comp_apply]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
x : R
⊢ ↑(Quotient.mk (map (mapRingHom (Quotient.mk (comap C P))) P)) (↑C (↑(Quotient.mk (comap C P)) x)) =
    ↑(RingHom.comp
          (quotientMap (map (mapRingHom (Quotient.mk (comap C P))) P) (mapRingHom (Quotient.mk (comap C P)))
            (_ : P ≤ comap (mapRingHom (Quotient.mk (comap C P))) (map (mapRingHom (Quotient.mk (comap C P))) P)))
          (RingHom.comp (Quotient.mk P) C))
      x
[PROOFSTEP]
rw [RingHom.coe_comp, Function.comp_apply]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
x : R
⊢ ↑(Quotient.mk (map (mapRingHom (Quotient.mk (comap C P))) P)) (↑C (↑(Quotient.mk (comap C P)) x)) =
    ↑(quotientMap (map (mapRingHom (Quotient.mk (comap C P))) P) (mapRingHom (Quotient.mk (comap C P)))
          (_ : P ≤ comap (mapRingHom (Quotient.mk (comap C P))) (map (mapRingHom (Quotient.mk (comap C P))) P)))
      (↑(RingHom.comp (Quotient.mk P) C) x)
[PROOFSTEP]
rw [RingHom.coe_comp, Function.comp_apply]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
x : R
⊢ ↑(Quotient.mk (map (mapRingHom (Quotient.mk (comap C P))) P)) (↑C (↑(Quotient.mk (comap C P)) x)) =
    ↑(quotientMap (map (mapRingHom (Quotient.mk (comap C P))) P) (mapRingHom (Quotient.mk (comap C P)))
          (_ : P ≤ comap (mapRingHom (Quotient.mk (comap C P))) (map (mapRingHom (Quotient.mk (comap C P))) P)))
      (↑(Quotient.mk P) (↑C x))
[PROOFSTEP]
rw [RingHom.coe_comp, Function.comp_apply]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
x : R
⊢ ↑(Quotient.mk (map (mapRingHom (Quotient.mk (comap C P))) P)) (↑C (↑(Quotient.mk (comap C P)) x)) =
    ↑(quotientMap (map (mapRingHom (Quotient.mk (comap C P))) P) (mapRingHom (Quotient.mk (comap C P)))
          (_ : P ≤ comap (mapRingHom (Quotient.mk (comap C P))) (map (mapRingHom (Quotient.mk (comap C P))) P)))
      (↑(Quotient.mk P) (↑C x))
[PROOFSTEP]
rw [quotientMap_mk, coe_mapRingHom, map_C]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
Pb : P ≠ ⊥
hP : ∀ (x : R), ↑C x ∈ P → x = 0
⊢ ∃ p, p ∈ P ∧ Polynomial.map (Quotient.mk (comap C P)) p ≠ 0
[PROOFSTEP]
obtain ⟨m, hm⟩ := Submodule.nonzero_mem_of_bot_lt (bot_lt_iff_ne_bot.mpr Pb)
[GOAL]
case intro
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
Pb : P ≠ ⊥
hP : ∀ (x : R), ↑C x ∈ P → x = 0
m : { x // x ∈ P }
hm : m ≠ 0
⊢ ∃ p, p ∈ P ∧ Polynomial.map (Quotient.mk (comap C P)) p ≠ 0
[PROOFSTEP]
refine' ⟨m, Submodule.coe_mem m, fun pp0 => hm (Submodule.coe_eq_zero.mp _)⟩
[GOAL]
case intro
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
Pb : P ≠ ⊥
hP : ∀ (x : R), ↑C x ∈ P → x = 0
m : { x // x ∈ P }
hm : m ≠ 0
pp0 : Polynomial.map (Quotient.mk (comap C P)) ↑m = 0
⊢ ↑m = 0
[PROOFSTEP]
refine' (injective_iff_map_eq_zero (Polynomial.mapRingHom (Ideal.Quotient.mk (P.comap (C : R →+* R[X]))))).mp _ _ pp0
[GOAL]
case intro
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
Pb : P ≠ ⊥
hP : ∀ (x : R), ↑C x ∈ P → x = 0
m : { x // x ∈ P }
hm : m ≠ 0
pp0 : Polynomial.map (Quotient.mk (comap C P)) ↑m = 0
⊢ Function.Injective ↑(mapRingHom (Quotient.mk (comap C P)))
[PROOFSTEP]
refine' map_injective _ ((Ideal.Quotient.mk (P.comap C)).injective_iff_ker_eq_bot.mpr _)
[GOAL]
case intro
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
Pb : P ≠ ⊥
hP : ∀ (x : R), ↑C x ∈ P → x = 0
m : { x // x ∈ P }
hm : m ≠ 0
pp0 : Polynomial.map (Quotient.mk (comap C P)) ↑m = 0
⊢ RingHom.ker (Quotient.mk (comap C P)) = ⊥
[PROOFSTEP]
rw [mk_ker]
[GOAL]
case intro
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : CommRing S
f : R →+* S
I J : Ideal S
P : Ideal R[X]
Pb : P ≠ ⊥
hP : ∀ (x : R), ↑C x ∈ P → x = 0
m : { x // x ∈ P }
hm : m ≠ 0
pp0 : Polynomial.map (Quotient.mk (comap C P)) ↑m = 0
⊢ comap C P = ⊥
[PROOFSTEP]
exact (Submodule.eq_bot_iff _).mpr fun x hx => hP x (mem_comap.mp hx)
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
p : Ideal R
P : Ideal S
inst✝² : Algebra R S
inst✝¹ : Algebra (R ⧸ p) (S ⧸ P)
inst✝ : IsScalarTower R (R ⧸ p) (S ⧸ P)
h : Function.Injective ↑(algebraMap (R ⧸ p) (S ⧸ P))
⊢ comap (algebraMap R S) P = p
[PROOFSTEP]
ext x
[GOAL]
case h
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
p : Ideal R
P : Ideal S
inst✝² : Algebra R S
inst✝¹ : Algebra (R ⧸ p) (S ⧸ P)
inst✝ : IsScalarTower R (R ⧸ p) (S ⧸ P)
h : Function.Injective ↑(algebraMap (R ⧸ p) (S ⧸ P))
x : R
⊢ x ∈ comap (algebraMap R S) P ↔ x ∈ p
[PROOFSTEP]
constructor
[GOAL]
case h.mp
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
p : Ideal R
P : Ideal S
inst✝² : Algebra R S
inst✝¹ : Algebra (R ⧸ p) (S ⧸ P)
inst✝ : IsScalarTower R (R ⧸ p) (S ⧸ P)
h : Function.Injective ↑(algebraMap (R ⧸ p) (S ⧸ P))
x : R
⊢ x ∈ comap (algebraMap R S) P → x ∈ p
[PROOFSTEP]
rw [mem_comap, ← Quotient.eq_zero_iff_mem, ← Quotient.eq_zero_iff_mem, Quotient.mk_algebraMap,
  IsScalarTower.algebraMap_apply R (R ⧸ p) (S ⧸ P), Quotient.algebraMap_eq]
[GOAL]
case h.mpr
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
p : Ideal R
P : Ideal S
inst✝² : Algebra R S
inst✝¹ : Algebra (R ⧸ p) (S ⧸ P)
inst✝ : IsScalarTower R (R ⧸ p) (S ⧸ P)
h : Function.Injective ↑(algebraMap (R ⧸ p) (S ⧸ P))
x : R
⊢ x ∈ p → x ∈ comap (algebraMap R S) P
[PROOFSTEP]
rw [mem_comap, ← Quotient.eq_zero_iff_mem, ← Quotient.eq_zero_iff_mem, Quotient.mk_algebraMap,
  IsScalarTower.algebraMap_apply R (R ⧸ p) (S ⧸ P), Quotient.algebraMap_eq]
[GOAL]
case h.mp
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
p : Ideal R
P : Ideal S
inst✝² : Algebra R S
inst✝¹ : Algebra (R ⧸ p) (S ⧸ P)
inst✝ : IsScalarTower R (R ⧸ p) (S ⧸ P)
h : Function.Injective ↑(algebraMap (R ⧸ p) (S ⧸ P))
x : R
⊢ ↑(algebraMap (R ⧸ p) (S ⧸ P)) (↑(Quotient.mk p) x) = 0 → ↑(Quotient.mk p) x = 0
[PROOFSTEP]
intro hx
[GOAL]
case h.mp
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
p : Ideal R
P : Ideal S
inst✝² : Algebra R S
inst✝¹ : Algebra (R ⧸ p) (S ⧸ P)
inst✝ : IsScalarTower R (R ⧸ p) (S ⧸ P)
h : Function.Injective ↑(algebraMap (R ⧸ p) (S ⧸ P))
x : R
hx : ↑(algebraMap (R ⧸ p) (S ⧸ P)) (↑(Quotient.mk p) x) = 0
⊢ ↑(Quotient.mk p) x = 0
[PROOFSTEP]
exact (injective_iff_map_eq_zero (algebraMap (R ⧸ p) (S ⧸ P))).mp h _ hx
[GOAL]
case h.mpr
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
p : Ideal R
P : Ideal S
inst✝² : Algebra R S
inst✝¹ : Algebra (R ⧸ p) (S ⧸ P)
inst✝ : IsScalarTower R (R ⧸ p) (S ⧸ P)
h : Function.Injective ↑(algebraMap (R ⧸ p) (S ⧸ P))
x : R
⊢ ↑(Quotient.mk p) x = 0 → ↑(algebraMap (R ⧸ p) (S ⧸ P)) (↑(Quotient.mk p) x) = 0
[PROOFSTEP]
intro hx
[GOAL]
case h.mpr
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
p : Ideal R
P : Ideal S
inst✝² : Algebra R S
inst✝¹ : Algebra (R ⧸ p) (S ⧸ P)
inst✝ : IsScalarTower R (R ⧸ p) (S ⧸ P)
h : Function.Injective ↑(algebraMap (R ⧸ p) (S ⧸ P))
x : R
hx : ↑(Quotient.mk p) x = 0
⊢ ↑(algebraMap (R ⧸ p) (S ⧸ P)) (↑(Quotient.mk p) x) = 0
[PROOFSTEP]
rw [hx, RingHom.map_zero]
[GOAL]
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
p : Ideal R
P : Ideal S
inst✝ : Algebra R S
x : R
⊢ ↑(algebraMap R (S ⧸ map (algebraMap R S) p)) x =
    ↑(algebraMap (R ⧸ p) (S ⧸ map (algebraMap R S) p)) (↑(algebraMap R (R ⧸ p)) x)
[PROOFSTEP]
rw [Quotient.algebraMap_eq, Quotient.algebraMap_quotient_map_quotient, Quotient.mk_algebraMap]
[GOAL]
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
hr : r ∈ ↑J \ ↑I
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
⊢ ∃ i, coeff p i ∈ ↑(comap f J) \ ↑(comap f I)
[PROOFSTEP]
obtain ⟨hrJ, hrI⟩ := hr
[GOAL]
case intro
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
⊢ ∃ i, coeff p i ∈ ↑(comap f J) \ ↑(comap f I)
[PROOFSTEP]
have rbar_ne_zero : Ideal.Quotient.mk I r ≠ 0 := mt (Quotient.mk_eq_zero I).mp hrI
[GOAL]
case intro
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
⊢ ∃ i, coeff p i ∈ ↑(comap f J) \ ↑(comap f I)
[PROOFSTEP]
have rbar_mem_J : Ideal.Quotient.mk I r ∈ J.map (Ideal.Quotient.mk I) := mem_map_of_mem _ hrJ
[GOAL]
case intro
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
⊢ ∃ i, coeff p i ∈ ↑(comap f J) \ ↑(comap f I)
[PROOFSTEP]
have quotient_f : ∀ x ∈ I.comap f, (Ideal.Quotient.mk I).comp f x = 0 := by simp [Quotient.eq_zero_iff_mem]
[GOAL]
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
⊢ ∀ (x : R), x ∈ comap f I → ↑(RingHom.comp (Quotient.mk I) f) x = 0
[PROOFSTEP]
simp [Quotient.eq_zero_iff_mem]
[GOAL]
case intro
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
quotient_f : ∀ (x : R), x ∈ comap f I → ↑(RingHom.comp (Quotient.mk I) f) x = 0
⊢ ∃ i, coeff p i ∈ ↑(comap f J) \ ↑(comap f I)
[PROOFSTEP]
have rbar_root :
  (p.map (Ideal.Quotient.mk (I.comap f))).eval₂ (Quotient.lift (I.comap f) _ quotient_f) (Ideal.Quotient.mk I r) = 0 :=
  by
  convert Quotient.eq_zero_iff_mem.mpr hpI
  exact _root_.trans (eval₂_map _ _ _) (hom_eval₂ p f (Ideal.Quotient.mk I) r).symm
[GOAL]
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
quotient_f : ∀ (x : R), x ∈ comap f I → ↑(RingHom.comp (Quotient.mk I) f) x = 0
⊢ eval₂ (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (↑(Quotient.mk I) r)
      (Polynomial.map (Quotient.mk (comap f I)) p) =
    0
[PROOFSTEP]
convert Quotient.eq_zero_iff_mem.mpr hpI
[GOAL]
case h.e'_2
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
quotient_f : ∀ (x : R), x ∈ comap f I → ↑(RingHom.comp (Quotient.mk I) f) x = 0
⊢ eval₂ (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (↑(Quotient.mk I) r)
      (Polynomial.map (Quotient.mk (comap f I)) p) =
    ↑(Quotient.mk I) (eval₂ f r p)
[PROOFSTEP]
exact _root_.trans (eval₂_map _ _ _) (hom_eval₂ p f (Ideal.Quotient.mk I) r).symm
[GOAL]
case intro
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
quotient_f : ∀ (x : R), x ∈ comap f I → ↑(RingHom.comp (Quotient.mk I) f) x = 0
rbar_root :
  eval₂ (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (↑(Quotient.mk I) r)
      (Polynomial.map (Quotient.mk (comap f I)) p) =
    0
⊢ ∃ i, coeff p i ∈ ↑(comap f J) \ ↑(comap f I)
[PROOFSTEP]
obtain ⟨i, ne_zero, mem⟩ := exists_coeff_ne_zero_mem_comap_of_root_mem rbar_ne_zero rbar_mem_J p_ne_zero rbar_root
[GOAL]
case intro.intro.intro
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
quotient_f : ∀ (x : R), x ∈ comap f I → ↑(RingHom.comp (Quotient.mk I) f) x = 0
rbar_root :
  eval₂ (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (↑(Quotient.mk I) r)
      (Polynomial.map (Quotient.mk (comap f I)) p) =
    0
i : ℕ
ne_zero : coeff (Polynomial.map (Quotient.mk (comap f I)) p) i ≠ 0
mem :
  coeff (Polynomial.map (Quotient.mk (comap f I)) p) i ∈
    comap (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (map (Quotient.mk I) J)
⊢ ∃ i, coeff p i ∈ ↑(comap f J) \ ↑(comap f I)
[PROOFSTEP]
rw [coeff_map] at ne_zero mem
[GOAL]
case intro.intro.intro
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
quotient_f : ∀ (x : R), x ∈ comap f I → ↑(RingHom.comp (Quotient.mk I) f) x = 0
rbar_root :
  eval₂ (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (↑(Quotient.mk I) r)
      (Polynomial.map (Quotient.mk (comap f I)) p) =
    0
i : ℕ
ne_zero : ↑(Quotient.mk (comap f I)) (coeff p i) ≠ 0
mem :
  ↑(Quotient.mk (comap f I)) (coeff p i) ∈
    comap (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (map (Quotient.mk I) J)
⊢ ∃ i, coeff p i ∈ ↑(comap f J) \ ↑(comap f I)
[PROOFSTEP]
refine' ⟨i, (mem_quotient_iff_mem hIJ).mp _, mt _ ne_zero⟩
[GOAL]
case intro.intro.intro.refine'_1
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
quotient_f : ∀ (x : R), x ∈ comap f I → ↑(RingHom.comp (Quotient.mk I) f) x = 0
rbar_root :
  eval₂ (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (↑(Quotient.mk I) r)
      (Polynomial.map (Quotient.mk (comap f I)) p) =
    0
i : ℕ
ne_zero : ↑(Quotient.mk (comap f I)) (coeff p i) ≠ 0
mem :
  ↑(Quotient.mk (comap f I)) (coeff p i) ∈
    comap (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (map (Quotient.mk I) J)
⊢ ↑(Quotient.mk I) (↑f (coeff p i)) ∈ map (Quotient.mk I) J
[PROOFSTEP]
simpa using mem
[GOAL]
case intro.intro.intro.refine'_2
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
quotient_f : ∀ (x : R), x ∈ comap f I → ↑(RingHom.comp (Quotient.mk I) f) x = 0
rbar_root :
  eval₂ (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (↑(Quotient.mk I) r)
      (Polynomial.map (Quotient.mk (comap f I)) p) =
    0
i : ℕ
ne_zero : ↑(Quotient.mk (comap f I)) (coeff p i) ≠ 0
mem :
  ↑(Quotient.mk (comap f I)) (coeff p i) ∈
    comap (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (map (Quotient.mk I) J)
⊢ coeff p i ∈ ↑(comap f I) → ↑(Quotient.mk (comap f I)) (coeff p i) = 0
[PROOFSTEP]
simp [Quotient.eq_zero_iff_mem]
[GOAL]
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : Algebra R S
hI : IsPrime I
hIJ : I ≤ J
x : S
mem : x ∈ ↑J \ ↑I
integral : IsIntegral R x
⊢ comap (algebraMap R S) I < comap (algebraMap R S) J
[PROOFSTEP]
obtain ⟨p, p_monic, hpx⟩ := integral
[GOAL]
case intro.intro
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : Algebra R S
hI : IsPrime I
hIJ : I ≤ J
x : S
mem : x ∈ ↑J \ ↑I
p : R[X]
p_monic : Monic p
hpx : eval₂ (algebraMap R S) x p = 0
⊢ comap (algebraMap R S) I < comap (algebraMap R S) J
[PROOFSTEP]
refine' comap_lt_comap_of_root_mem_sdiff hIJ mem _ _
[GOAL]
case intro.intro.refine'_1
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : Algebra R S
hI : IsPrime I
hIJ : I ≤ J
x : S
mem : x ∈ ↑J \ ↑I
p : R[X]
p_monic : Monic p
hpx : eval₂ (algebraMap R S) x p = 0
⊢ R[X]
case intro.intro.refine'_2
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : Algebra R S
hI : IsPrime I
hIJ : I ≤ J
x : S
mem : x ∈ ↑J \ ↑I
p : R[X]
p_monic : Monic p
hpx : eval₂ (algebraMap R S) x p = 0
⊢ Polynomial.map (Quotient.mk (comap (algebraMap R S) I)) ?intro.intro.refine'_1 ≠ 0
case intro.intro.refine'_3
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : Algebra R S
hI : IsPrime I
hIJ : I ≤ J
x : S
mem : x ∈ ↑J \ ↑I
p : R[X]
p_monic : Monic p
hpx : eval₂ (algebraMap R S) x p = 0
⊢ eval₂ (algebraMap R S) x ?intro.intro.refine'_1 ∈ I
[PROOFSTEP]
swap
[GOAL]
case intro.intro.refine'_2
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : Algebra R S
hI : IsPrime I
hIJ : I ≤ J
x : S
mem : x ∈ ↑J \ ↑I
p : R[X]
p_monic : Monic p
hpx : eval₂ (algebraMap R S) x p = 0
⊢ Polynomial.map (Quotient.mk (comap (algebraMap R S) I)) ?intro.intro.refine'_1 ≠ 0
[PROOFSTEP]
apply map_monic_ne_zero p_monic
[GOAL]
case intro.intro.refine'_3
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : Algebra R S
hI : IsPrime I
hIJ : I ≤ J
x : S
mem : x ∈ ↑J \ ↑I
p : R[X]
p_monic : Monic p
hpx : eval₂ (algebraMap R S) x p = 0
⊢ eval₂ (algebraMap R S) x p ∈ I
[PROOFSTEP]
convert I.zero_mem
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
inst✝² : Algebra R S
inst✝¹ : Nontrivial R
inst✝ : IsDomain S
hRS : Algebra.IsIntegral R S
hI : comap (algebraMap R S) I = ⊥
⊢ I = ⊥
[PROOFSTEP]
refine' eq_bot_iff.2 fun x hx => _
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
inst✝² : Algebra R S
inst✝¹ : Nontrivial R
inst✝ : IsDomain S
hRS : Algebra.IsIntegral R S
hI : comap (algebraMap R S) I = ⊥
x : S
hx : x ∈ I
⊢ x ∈ ⊥
[PROOFSTEP]
by_cases hx0 : x = 0
[GOAL]
case pos
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
inst✝² : Algebra R S
inst✝¹ : Nontrivial R
inst✝ : IsDomain S
hRS : Algebra.IsIntegral R S
hI : comap (algebraMap R S) I = ⊥
x : S
hx : x ∈ I
hx0 : x = 0
⊢ x ∈ ⊥
[PROOFSTEP]
exact hx0.symm ▸ Ideal.zero_mem ⊥
[GOAL]
case neg
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
inst✝² : Algebra R S
inst✝¹ : Nontrivial R
inst✝ : IsDomain S
hRS : Algebra.IsIntegral R S
hI : comap (algebraMap R S) I = ⊥
x : S
hx : x ∈ I
hx0 : ¬x = 0
⊢ x ∈ ⊥
[PROOFSTEP]
exact absurd hI (comap_ne_bot_of_integral_mem hx0 hx (hRS x))
[GOAL]
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝ : Algebra R S
hRS : Algebra.IsIntegral R S
I : Ideal S
hI : IsMaximal I
⊢ IsMaximal (comap (algebraMap R S) I)
[PROOFSTEP]
refine' Ideal.Quotient.maximal_of_isField _ _
[GOAL]
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝ : Algebra R S
hRS : Algebra.IsIntegral R S
I : Ideal S
hI : IsMaximal I
⊢ IsField (R ⧸ comap (algebraMap R S) I)
[PROOFSTEP]
haveI : IsPrime (I.comap (algebraMap R S)) := comap_isPrime _ _
[GOAL]
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝ : Algebra R S
hRS : Algebra.IsIntegral R S
I : Ideal S
hI : IsMaximal I
this : IsPrime (comap (algebraMap R S) I)
⊢ IsField (R ⧸ comap (algebraMap R S) I)
[PROOFSTEP]
exact
  isField_of_isIntegral_of_isField (isIntegral_quotient_of_isIntegral hRS) algebraMap_quotient_injective
    (by rwa [← Quotient.maximal_ideal_iff_isField_quotient])
[GOAL]
R : Type u_1
inst✝² : CommRing R
S : Type u_2
inst✝¹ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝ : Algebra R S
hRS : Algebra.IsIntegral R S
I : Ideal S
hI : IsMaximal I
this : IsPrime (comap (algebraMap R S) I)
⊢ IsField (S ⧸ I)
[PROOFSTEP]
rwa [← Quotient.maximal_ideal_iff_isField_quotient]
[GOAL]
R : Type u_1
inst✝⁹ : CommRing R
S : Type u_2
inst✝⁸ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝⁷ : Algebra R S
A : Type u_3
inst✝⁶ : CommRing A
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra A S
inst✝³ : IsScalarTower R A S
inst✝² : IsIntegralClosure A R S
inst✝¹ : IsDomain A
inst✝ : Nontrivial R
I : Ideal A
⊢ comap (algebraMap R A) I = ⊥ → I = ⊥
[PROOFSTEP]
contrapose
[GOAL]
R : Type u_1
inst✝⁹ : CommRing R
S : Type u_2
inst✝⁸ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝⁷ : Algebra R S
A : Type u_3
inst✝⁶ : CommRing A
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra A S
inst✝³ : IsScalarTower R A S
inst✝² : IsIntegralClosure A R S
inst✝¹ : IsDomain A
inst✝ : Nontrivial R
I : Ideal A
⊢ ¬I = ⊥ → ¬comap (algebraMap R A) I = ⊥
[PROOFSTEP]
exact (IsIntegralClosure.comap_ne_bot S)
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
inst✝² : Algebra R S
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
[PROOFSTEP]
have hP0 : (0 : S) ∉ Algebra.algebraMapSubmonoid S P.primeCompl :=
  by
  rintro ⟨x, ⟨hx, x0⟩⟩
  exact absurd (hP x0) hx
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
inst✝² : Algebra R S
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
⊢ ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
[PROOFSTEP]
rintro ⟨x, ⟨hx, x0⟩⟩
[GOAL]
case intro.intro
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
inst✝² : Algebra R S
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
x : R
hx : x ∈ ↑(primeCompl P)
x0 : ↑(algebraMap R S) x = 0
⊢ False
[PROOFSTEP]
exact absurd (hP x0) hx
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
inst✝² : Algebra R S
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
[PROOFSTEP]
let Rₚ := Localization P.primeCompl
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
inst✝² : Algebra R S
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
[PROOFSTEP]
let Sₚ := Localization (Algebra.algebraMapSubmonoid S P.primeCompl)
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
inst✝² : Algebra R S
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
[PROOFSTEP]
letI : IsDomain (Localization (Algebra.algebraMapSubmonoid S P.primeCompl)) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
inst✝² : Algebra R S
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
this : IsDomain (Localization (Algebra.algebraMapSubmonoid S (primeCompl P))) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
[PROOFSTEP]
obtain ⟨Qₚ : Ideal Sₚ, Qₚ_maximal⟩ := exists_maximal Sₚ
[GOAL]
case intro
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
inst✝² : Algebra R S
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
this : IsDomain (Localization (Algebra.algebraMapSubmonoid S (primeCompl P))) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
Qₚ : Ideal Sₚ
Qₚ_maximal : IsMaximal Qₚ
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
[PROOFSTEP]
haveI Qₚ_max : IsMaximal (comap _ Qₚ) :=
  @isMaximal_comap_of_isIntegral_of_isMaximal Rₚ _ Sₚ _ (localizationAlgebra P.primeCompl S) (isIntegral_localization H)
    _ Qₚ_maximal
[GOAL]
case intro
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
inst✝² : Algebra R S
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
this : IsDomain (Localization (Algebra.algebraMapSubmonoid S (primeCompl P))) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
Qₚ : Ideal Sₚ
Qₚ_maximal : IsMaximal Qₚ
Qₚ_max : IsMaximal (comap (algebraMap Rₚ Sₚ) Qₚ)
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
[PROOFSTEP]
refine' ⟨comap (algebraMap S Sₚ) Qₚ, ⟨comap_isPrime _ Qₚ, _⟩⟩
[GOAL]
case intro
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
inst✝² : Algebra R S
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
this : IsDomain (Localization (Algebra.algebraMapSubmonoid S (primeCompl P))) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
Qₚ : Ideal Sₚ
Qₚ_maximal : IsMaximal Qₚ
Qₚ_max : IsMaximal (comap (algebraMap Rₚ Sₚ) Qₚ)
⊢ comap (algebraMap R S) (comap (algebraMap S Sₚ) Qₚ) = P
[PROOFSTEP]
convert Localization.AtPrime.comap_maximalIdeal (I := P)
[GOAL]
case h.e'_2
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
inst✝² : Algebra R S
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
this : IsDomain (Localization (Algebra.algebraMapSubmonoid S (primeCompl P))) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
Qₚ : Ideal Sₚ
Qₚ_maximal : IsMaximal Qₚ
Qₚ_max : IsMaximal (comap (algebraMap Rₚ Sₚ) Qₚ)
⊢ comap (algebraMap R S) (comap (algebraMap S Sₚ) Qₚ) =
    comap (algebraMap R (Localization.AtPrime P)) (LocalRing.maximalIdeal (Localization (primeCompl P)))
[PROOFSTEP]
rw [comap_comap, ← LocalRing.eq_maximalIdeal Qₚ_max, ←
  @IsLocalization.map_comp (P := S) (Q := Sₚ) (g := algebraMap R S) (M := P.primeCompl) (T :=
    Algebra.algebraMapSubmonoid S P.primeCompl) (S := Rₚ) _ _ _ _ _ _
    (fun p hp => Algebra.mem_algebraMapSubmonoid_of_mem ⟨p, hp⟩) _ _]
[GOAL]
case h.e'_2
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I J : Ideal S
inst✝² : Algebra R S
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
this : IsDomain (Localization (Algebra.algebraMapSubmonoid S (primeCompl P))) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
Qₚ : Ideal Sₚ
Qₚ_maximal : IsMaximal Qₚ
Qₚ_max : IsMaximal (comap (algebraMap Rₚ Sₚ) Qₚ)
⊢ comap
      (RingHom.comp
        (IsLocalization.map Sₚ (algebraMap R S)
          (_ :
            ∀ (p : R) (hp : p ∈ primeCompl P),
              ↑(algebraMap R S) ↑{ val := p, property := hp } ∈ Algebra.algebraMapSubmonoid S (primeCompl P)))
        (algebraMap R Rₚ))
      Qₚ =
    comap (algebraMap R (Localization.AtPrime P)) (comap (algebraMap Rₚ Sₚ) Qₚ)
[PROOFSTEP]
rfl
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
⊢ ∃ Q, Q ≥ I ∧ IsPrime Q ∧ comap (algebraMap R S) Q = P
[PROOFSTEP]
obtain ⟨Q' : Ideal (S ⧸ I), ⟨Q'_prime, hQ'⟩⟩ :=
  @exists_ideal_over_prime_of_is_integral' (R ⧸ I.comap (algebraMap R S)) _ (S ⧸ I) _ Ideal.quotientAlgebra _
    (isIntegral_quotient_of_isIntegral H) (map (Ideal.Quotient.mk (I.comap (algebraMap R S))) P)
    (map_isPrime_of_surjective Quotient.mk_surjective (by simp [hIP]))
    (le_trans (le_of_eq ((RingHom.injective_iff_ker_eq_bot _).1 algebraMap_quotient_injective)) bot_le)
[GOAL]
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
⊢ RingHom.ker (Quotient.mk (comap (algebraMap R S) I)) ≤ P
[PROOFSTEP]
simp [hIP]
[GOAL]
case intro.intro
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
Q' : Ideal (S ⧸ I)
Q'_prime : IsPrime Q'
hQ' : comap (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) Q' = map (Quotient.mk (comap (algebraMap R S) I)) P
⊢ ∃ Q, Q ≥ I ∧ IsPrime Q ∧ comap (algebraMap R S) Q = P
[PROOFSTEP]
haveI := Q'_prime
[GOAL]
case intro.intro
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
Q' : Ideal (S ⧸ I)
Q'_prime : IsPrime Q'
hQ' : comap (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) Q' = map (Quotient.mk (comap (algebraMap R S) I)) P
this : IsPrime Q'
⊢ ∃ Q, Q ≥ I ∧ IsPrime Q ∧ comap (algebraMap R S) Q = P
[PROOFSTEP]
refine' ⟨Q'.comap _, le_trans (le_of_eq mk_ker.symm) (ker_le_comap _), ⟨comap_isPrime _ Q', _⟩⟩
[GOAL]
case intro.intro
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
Q' : Ideal (S ⧸ I)
Q'_prime : IsPrime Q'
hQ' : comap (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) Q' = map (Quotient.mk (comap (algebraMap R S) I)) P
this : IsPrime Q'
⊢ comap (algebraMap R S) (comap (Quotient.mk I) Q') = P
[PROOFSTEP]
rw [comap_comap]
[GOAL]
case intro.intro
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
Q' : Ideal (S ⧸ I)
Q'_prime : IsPrime Q'
hQ' : comap (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) Q' = map (Quotient.mk (comap (algebraMap R S) I)) P
this : IsPrime Q'
⊢ comap (RingHom.comp (Quotient.mk I) (algebraMap R S)) Q' = P
[PROOFSTEP]
refine' _root_.trans _ (_root_.trans (congr_arg (comap (Ideal.Quotient.mk (comap (algebraMap R S) I))) hQ') _)
[GOAL]
case intro.intro.refine'_1
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
Q' : Ideal (S ⧸ I)
Q'_prime : IsPrime Q'
hQ' : comap (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) Q' = map (Quotient.mk (comap (algebraMap R S) I)) P
this : IsPrime Q'
⊢ comap (RingHom.comp (Quotient.mk I) (algebraMap R S)) Q' =
    comap (Quotient.mk (comap (algebraMap R S) I)) (comap (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) Q')
[PROOFSTEP]
rw [comap_comap]
[GOAL]
case intro.intro.refine'_1
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
Q' : Ideal (S ⧸ I)
Q'_prime : IsPrime Q'
hQ' : comap (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) Q' = map (Quotient.mk (comap (algebraMap R S) I)) P
this : IsPrime Q'
⊢ comap (RingHom.comp (Quotient.mk I) (algebraMap R S)) Q' =
    comap (RingHom.comp (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) (Quotient.mk (comap (algebraMap R S) I))) Q'
[PROOFSTEP]
exact congr_arg (comap . Q') (RingHom.ext fun r => rfl)
[GOAL]
case intro.intro.refine'_2
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
Q' : Ideal (S ⧸ I)
Q'_prime : IsPrime Q'
hQ' : comap (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) Q' = map (Quotient.mk (comap (algebraMap R S) I)) P
this : IsPrime Q'
⊢ comap (Quotient.mk (comap (algebraMap R S) I)) (map (Quotient.mk (comap (algebraMap R S) I)) P) = P
[PROOFSTEP]
refine' _root_.trans (comap_map_of_surjective _ Quotient.mk_surjective _) (sup_eq_left.2 _)
[GOAL]
case intro.intro.refine'_2
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
Q' : Ideal (S ⧸ I)
Q'_prime : IsPrime Q'
hQ' : comap (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) Q' = map (Quotient.mk (comap (algebraMap R S) I)) P
this : IsPrime Q'
⊢ comap (Quotient.mk (comap (algebraMap R S) I)) ⊥ ≤ P
[PROOFSTEP]
simpa [← RingHom.ker_eq_comap_bot] using hIP
[GOAL]
R : Type u_1
inst✝³ : CommRing R
S : Type u_2
inst✝² : CommRing S
f : R →+* S
I J : Ideal S
inst✝¹ : Algebra R S
inst✝ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
P_max : IsMaximal P
hP : RingHom.ker (algebraMap R S) ≤ P
⊢ ∃ Q, IsMaximal Q ∧ comap (algebraMap R S) Q = P
[PROOFSTEP]
obtain ⟨Q, ⟨Q_prime, hQ⟩⟩ := exists_ideal_over_prime_of_is_integral' H P hP
[GOAL]
case intro.intro
R : Type u_1
inst✝³ : CommRing R
S : Type u_2
inst✝² : CommRing S
f : R →+* S
I J : Ideal S
inst✝¹ : Algebra R S
inst✝ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
P_max : IsMaximal P
hP : RingHom.ker (algebraMap R S) ≤ P
Q : Ideal S
Q_prime : IsPrime Q
hQ : comap (algebraMap R S) Q = P
⊢ ∃ Q, IsMaximal Q ∧ comap (algebraMap R S) Q = P
[PROOFSTEP]
haveI : Q.IsPrime := Q_prime
[GOAL]
case intro.intro
R : Type u_1
inst✝³ : CommRing R
S : Type u_2
inst✝² : CommRing S
f : R →+* S
I J : Ideal S
inst✝¹ : Algebra R S
inst✝ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
P_max : IsMaximal P
hP : RingHom.ker (algebraMap R S) ≤ P
Q : Ideal S
Q_prime : IsPrime Q
hQ : comap (algebraMap R S) Q = P
this : IsPrime Q
⊢ ∃ Q, IsMaximal Q ∧ comap (algebraMap R S) Q = P
[PROOFSTEP]
exact ⟨Q, isMaximal_of_isIntegral_of_isMaximal_comap H _ (hQ.symm ▸ P_max), hQ⟩


[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : SemilatticeSup M
w : σ → M
p : MvPolynomial σ R
⊢ weightedTotalDegree' w p = ⊥ ↔ p = 0
[PROOFSTEP]
simp only [weightedTotalDegree', Finset.sup_eq_bot_iff, mem_support_iff, WithBot.coe_ne_bot, MvPolynomial.eq_zero_iff]
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : SemilatticeSup M
w : σ → M
p : MvPolynomial σ R
⊢ (∀ (s : σ →₀ ℕ), coeff s p ≠ 0 → False) ↔ ∀ (d : σ →₀ ℕ), coeff d p = 0
[PROOFSTEP]
exact forall_congr' fun _ => Classical.not_not
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : SemilatticeSup M
w : σ → M
⊢ weightedTotalDegree' w 0 = ⊥
[PROOFSTEP]
simp only [weightedTotalDegree', support_zero, Finset.sup_empty]
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
hp : p ≠ 0
⊢ weightedTotalDegree' w p = ↑(weightedTotalDegree w p)
[PROOFSTEP]
rw [Ne.def, ← weightedTotalDegree'_eq_bot_iff w p, ← Ne.def, WithBot.ne_bot_iff_exists] at hp
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
hp : ∃ a, ↑a = weightedTotalDegree' w p
⊢ weightedTotalDegree' w p = ↑(weightedTotalDegree w p)
[PROOFSTEP]
obtain ⟨m, hm⟩ := hp
[GOAL]
case intro
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
m : M
hm : ↑m = weightedTotalDegree' w p
⊢ weightedTotalDegree' w p = ↑(weightedTotalDegree w p)
[PROOFSTEP]
apply le_antisymm
[GOAL]
case intro.a
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
m : M
hm : ↑m = weightedTotalDegree' w p
⊢ weightedTotalDegree' w p ≤ ↑(weightedTotalDegree w p)
[PROOFSTEP]
simp only [weightedTotalDegree, weightedTotalDegree', Finset.sup_le_iff, WithBot.coe_le_coe]
[GOAL]
case intro.a
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
m : M
hm : ↑m = weightedTotalDegree' w p
⊢ ∀ (b : σ →₀ ℕ), b ∈ support p → ↑(weightedDegree' w) b ≤ sup (support p) fun s => ↑(weightedDegree' w) s
[PROOFSTEP]
intro b
[GOAL]
case intro.a
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
m : M
hm : ↑m = weightedTotalDegree' w p
b : σ →₀ ℕ
⊢ b ∈ support p → ↑(weightedDegree' w) b ≤ sup (support p) fun s => ↑(weightedDegree' w) s
[PROOFSTEP]
exact Finset.le_sup
[GOAL]
case intro.a
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
m : M
hm : ↑m = weightedTotalDegree' w p
⊢ ↑(weightedTotalDegree w p) ≤ weightedTotalDegree' w p
[PROOFSTEP]
simp only [weightedTotalDegree]
[GOAL]
case intro.a
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
m : M
hm : ↑m = weightedTotalDegree' w p
⊢ ↑(sup (support p) fun s => ↑(weightedDegree' w) s) ≤ weightedTotalDegree' w p
[PROOFSTEP]
have hm' : weightedTotalDegree' w p ≤ m := le_of_eq hm.symm
[GOAL]
case intro.a
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
m : M
hm : ↑m = weightedTotalDegree' w p
hm' : weightedTotalDegree' w p ≤ ↑m
⊢ ↑(sup (support p) fun s => ↑(weightedDegree' w) s) ≤ weightedTotalDegree' w p
[PROOFSTEP]
rw [← hm]
[GOAL]
case intro.a
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
m : M
hm : ↑m = weightedTotalDegree' w p
hm' : weightedTotalDegree' w p ≤ ↑m
⊢ ↑(sup (support p) fun s => ↑(weightedDegree' w) s) ≤ ↑m
[PROOFSTEP]
simpa [weightedTotalDegree'] using hm'
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
⊢ weightedTotalDegree w 0 = ⊥
[PROOFSTEP]
simp only [weightedTotalDegree, support_zero, Finset.sup_empty]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
a b : MvPolynomial σ R
ha : a ∈ {x | IsWeightedHomogeneous w x m}
hb : b ∈ {x | IsWeightedHomogeneous w x m}
c : σ →₀ ℕ
hc : coeff c (a + b) ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
rw [coeff_add] at hc
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
a b : MvPolynomial σ R
ha : a ∈ {x | IsWeightedHomogeneous w x m}
hb : b ∈ {x | IsWeightedHomogeneous w x m}
c : σ →₀ ℕ
hc : coeff c a + coeff c b ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
obtain h | h : coeff c a ≠ 0 ∨ coeff c b ≠ 0 := by
  contrapose! hc
  simp only [hc, add_zero]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
a b : MvPolynomial σ R
ha : a ∈ {x | IsWeightedHomogeneous w x m}
hb : b ∈ {x | IsWeightedHomogeneous w x m}
c : σ →₀ ℕ
hc : coeff c a + coeff c b ≠ 0
⊢ coeff c a ≠ 0 ∨ coeff c b ≠ 0
[PROOFSTEP]
contrapose! hc
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
a b : MvPolynomial σ R
ha : a ∈ {x | IsWeightedHomogeneous w x m}
hb : b ∈ {x | IsWeightedHomogeneous w x m}
c : σ →₀ ℕ
hc : coeff c a = 0 ∧ coeff c b = 0
⊢ coeff c a + coeff c b = 0
[PROOFSTEP]
simp only [hc, add_zero]
[GOAL]
case inl
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
a b : MvPolynomial σ R
ha : a ∈ {x | IsWeightedHomogeneous w x m}
hb : b ∈ {x | IsWeightedHomogeneous w x m}
c : σ →₀ ℕ
hc : coeff c a + coeff c b ≠ 0
h : coeff c a ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
exact ha h
[GOAL]
case inr
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
a b : MvPolynomial σ R
ha : a ∈ {x | IsWeightedHomogeneous w x m}
hb : b ∈ {x | IsWeightedHomogeneous w x m}
c : σ →₀ ℕ
hc : coeff c a + coeff c b ≠ 0
h : coeff c b ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
exact hb h
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
r : R
a : MvPolynomial σ R
ha :
  a ∈
    {
          toAddSubsemigroup :=
            { carrier := {x | IsWeightedHomogeneous w x m},
              add_mem' :=
                (_ :
                  ∀ {a b : MvPolynomial σ R},
                    a ∈ {x | IsWeightedHomogeneous w x m} →
                      b ∈ {x | IsWeightedHomogeneous w x m} →
                        ∀ (c : σ →₀ ℕ), coeff c (a + b) ≠ 0 → ↑(weightedDegree' w) c = m) },
          zero_mem' := (_ : ∀ (d : σ →₀ ℕ), coeff d 0 ≠ 0 → ↑(weightedDegree' w) d = m) }.toAddSubsemigroup.carrier
c : σ →₀ ℕ
hc : coeff c (r • a) ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
rw [coeff_smul] at hc
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
r : R
a : MvPolynomial σ R
ha :
  a ∈
    {
          toAddSubsemigroup :=
            { carrier := {x | IsWeightedHomogeneous w x m},
              add_mem' :=
                (_ :
                  ∀ {a b : MvPolynomial σ R},
                    a ∈ {x | IsWeightedHomogeneous w x m} →
                      b ∈ {x | IsWeightedHomogeneous w x m} →
                        ∀ (c : σ →₀ ℕ), coeff c (a + b) ≠ 0 → ↑(weightedDegree' w) c = m) },
          zero_mem' := (_ : ∀ (d : σ →₀ ℕ), coeff d 0 ≠ 0 → ↑(weightedDegree' w) d = m) }.toAddSubsemigroup.carrier
c : σ →₀ ℕ
hc : r • coeff c a ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
exact ha (right_ne_zero_of_mul hc)
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
⊢ weightedHomogeneousSubmodule R w m = supported R R {d | ↑(weightedDegree' w) d = m}
[PROOFSTEP]
ext x
[GOAL]
case h
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
x : MvPolynomial σ R
⊢ x ∈ weightedHomogeneousSubmodule R w m ↔ x ∈ supported R R {d | ↑(weightedDegree' w) d = m}
[PROOFSTEP]
rw [mem_supported, Set.subset_def]
[GOAL]
case h
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
x : MvPolynomial σ R
⊢ x ∈ weightedHomogeneousSubmodule R w m ↔ ∀ (x_1 : σ →₀ ℕ), x_1 ∈ ↑x.support → x_1 ∈ {d | ↑(weightedDegree' w) d = m}
[PROOFSTEP]
simp only [Finsupp.mem_support_iff, mem_coe]
[GOAL]
case h
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
x : MvPolynomial σ R
⊢ x ∈ weightedHomogeneousSubmodule R w m ↔ ∀ (x_1 : σ →₀ ℕ), ↑x x_1 ≠ 0 → x_1 ∈ {d | ↑(weightedDegree' w) d = m}
[PROOFSTEP]
rfl
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
⊢ weightedHomogeneousSubmodule R w m * weightedHomogeneousSubmodule R w n ≤ weightedHomogeneousSubmodule R w (m + n)
[PROOFSTEP]
classical
rw [Submodule.mul_le]
intro φ hφ ψ hψ c hc
rw [coeff_mul] at hc
obtain ⟨⟨d, e⟩, hde, H⟩ := Finset.exists_ne_zero_of_sum_ne_zero hc
have aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0 := by
  contrapose! H
  by_cases h : coeff d φ = 0 <;> simp_all only [Ne.def, not_false_iff, zero_mul, mul_zero]
rw [← Finsupp.mem_antidiagonal.mp hde, ← hφ aux.1, ← hψ aux.2, map_add]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
⊢ weightedHomogeneousSubmodule R w m * weightedHomogeneousSubmodule R w n ≤ weightedHomogeneousSubmodule R w (m + n)
[PROOFSTEP]
rw [Submodule.mul_le]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
⊢ ∀ (m_1 : MvPolynomial σ R),
    m_1 ∈ weightedHomogeneousSubmodule R w m →
      ∀ (n_1 : MvPolynomial σ R),
        n_1 ∈ weightedHomogeneousSubmodule R w n → m_1 * n_1 ∈ weightedHomogeneousSubmodule R w (m + n)
[PROOFSTEP]
intro φ hφ ψ hψ c hc
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
φ : MvPolynomial σ R
hφ : φ ∈ weightedHomogeneousSubmodule R w m
ψ : MvPolynomial σ R
hψ : ψ ∈ weightedHomogeneousSubmodule R w n
c : σ →₀ ℕ
hc : coeff c (φ * ψ) ≠ 0
⊢ ↑(weightedDegree' w) c = m + n
[PROOFSTEP]
rw [coeff_mul] at hc
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
φ : MvPolynomial σ R
hφ : φ ∈ weightedHomogeneousSubmodule R w m
ψ : MvPolynomial σ R
hψ : ψ ∈ weightedHomogeneousSubmodule R w n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
⊢ ↑(weightedDegree' w) c = m + n
[PROOFSTEP]
obtain ⟨⟨d, e⟩, hde, H⟩ := Finset.exists_ne_zero_of_sum_ne_zero hc
[GOAL]
case intro.mk.intro
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
φ : MvPolynomial σ R
hφ : φ ∈ weightedHomogeneousSubmodule R w m
ψ : MvPolynomial σ R
hψ : ψ ∈ weightedHomogeneousSubmodule R w n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ antidiagonal c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
⊢ ↑(weightedDegree' w) c = m + n
[PROOFSTEP]
have aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0 := by
  contrapose! H
  by_cases h : coeff d φ = 0 <;> simp_all only [Ne.def, not_false_iff, zero_mul, mul_zero]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
φ : MvPolynomial σ R
hφ : φ ∈ weightedHomogeneousSubmodule R w m
ψ : MvPolynomial σ R
hψ : ψ ∈ weightedHomogeneousSubmodule R w n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ antidiagonal c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
⊢ coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
[PROOFSTEP]
contrapose! H
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
φ : MvPolynomial σ R
hφ : φ ∈ weightedHomogeneousSubmodule R w m
ψ : MvPolynomial σ R
hψ : ψ ∈ weightedHomogeneousSubmodule R w n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ antidiagonal c
H : coeff d φ ≠ 0 → coeff e ψ = 0
⊢ coeff d φ * coeff e ψ = 0
[PROOFSTEP]
by_cases h : coeff d φ = 0
[GOAL]
case pos
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
φ : MvPolynomial σ R
hφ : φ ∈ weightedHomogeneousSubmodule R w m
ψ : MvPolynomial σ R
hψ : ψ ∈ weightedHomogeneousSubmodule R w n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ antidiagonal c
H : coeff d φ ≠ 0 → coeff e ψ = 0
h : coeff d φ = 0
⊢ coeff d φ * coeff e ψ = 0
[PROOFSTEP]
simp_all only [Ne.def, not_false_iff, zero_mul, mul_zero]
[GOAL]
case neg
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
φ : MvPolynomial σ R
hφ : φ ∈ weightedHomogeneousSubmodule R w m
ψ : MvPolynomial σ R
hψ : ψ ∈ weightedHomogeneousSubmodule R w n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ antidiagonal c
H : coeff d φ ≠ 0 → coeff e ψ = 0
h : ¬coeff d φ = 0
⊢ coeff d φ * coeff e ψ = 0
[PROOFSTEP]
simp_all only [Ne.def, not_false_iff, zero_mul, mul_zero]
[GOAL]
case intro.mk.intro
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
φ : MvPolynomial σ R
hφ : φ ∈ weightedHomogeneousSubmodule R w m
ψ : MvPolynomial σ R
hψ : ψ ∈ weightedHomogeneousSubmodule R w n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ antidiagonal c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
⊢ ↑(weightedDegree' w) c = m + n
[PROOFSTEP]
rw [← Finsupp.mem_antidiagonal.mp hde, ← hφ aux.1, ← hψ aux.2, map_add]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
d : σ →₀ ℕ
r : R
m : M
hm : ↑(weightedDegree' w) d = m
⊢ IsWeightedHomogeneous w (↑(monomial d) r) m
[PROOFSTEP]
classical
intro c hc
rw [coeff_monomial] at hc
split_ifs at hc  with h
· subst c
  exact hm
· contradiction
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
d : σ →₀ ℕ
r : R
m : M
hm : ↑(weightedDegree' w) d = m
⊢ IsWeightedHomogeneous w (↑(monomial d) r) m
[PROOFSTEP]
intro c hc
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
d : σ →₀ ℕ
r : R
m : M
hm : ↑(weightedDegree' w) d = m
c : σ →₀ ℕ
hc : coeff c (↑(monomial d) r) ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
rw [coeff_monomial] at hc
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
d : σ →₀ ℕ
r : R
m : M
hm : ↑(weightedDegree' w) d = m
c : σ →₀ ℕ
hc✝ : coeff c (↑(monomial d) r) ≠ 0
hc : (if d = c then r else 0) ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
split_ifs at hc  with h
[GOAL]
case pos
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
d : σ →₀ ℕ
r : R
m : M
hm : ↑(weightedDegree' w) d = m
c : σ →₀ ℕ
hc✝ : coeff c (↑(monomial d) r) ≠ 0
h : d = c
hc : r ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
subst c
[GOAL]
case pos
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
d : σ →₀ ℕ
r : R
m : M
hm : ↑(weightedDegree' w) d = m
hc✝ : r ≠ 0
hc : coeff d (↑(monomial d) r) ≠ 0
⊢ ↑(weightedDegree' w) d = m
[PROOFSTEP]
exact hm
[GOAL]
case neg
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
d : σ →₀ ℕ
r : R
m : M
hm : ↑(weightedDegree' w) d = m
c : σ →₀ ℕ
hc✝ : coeff c (↑(monomial d) r) ≠ 0
h : ¬d = c
hc : 0 ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
contradiction
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
hp : weightedTotalDegree w p = ⊥
⊢ IsWeightedHomogeneous w p ⊥
[PROOFSTEP]
intro d hd
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
hp : weightedTotalDegree w p = ⊥
d : σ →₀ ℕ
hd : coeff d p ≠ 0
⊢ ↑(weightedDegree' w) d = ⊥
[PROOFSTEP]
have h := weightedTotalDegree_coe w p (MvPolynomial.ne_zero_iff.mpr ⟨d, hd⟩)
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
hp : weightedTotalDegree w p = ⊥
d : σ →₀ ℕ
hd : coeff d p ≠ 0
h : weightedTotalDegree' w p = ↑(weightedTotalDegree w p)
⊢ ↑(weightedDegree' w) d = ⊥
[PROOFSTEP]
simp only [weightedTotalDegree', hp] at h
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
hp : weightedTotalDegree w p = ⊥
d : σ →₀ ℕ
hd : coeff d p ≠ 0
h : (sup (support p) fun s => ↑(↑(weightedDegree' w) s)) = ↑⊥
⊢ ↑(weightedDegree' w) d = ⊥
[PROOFSTEP]
rw [eq_bot_iff, ← WithBot.coe_le_coe, ← h]
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
hp : weightedTotalDegree w p = ⊥
d : σ →₀ ℕ
hd : coeff d p ≠ 0
h : (sup (support p) fun s => ↑(↑(weightedDegree' w) s)) = ↑⊥
⊢ ↑(↑(weightedDegree' w) d) ≤ sup (support p) fun s => ↑(↑(weightedDegree' w) s)
[PROOFSTEP]
apply Finset.le_sup (mem_support_iff.mpr hd)
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
i : σ
⊢ IsWeightedHomogeneous w (X i) (w i)
[PROOFSTEP]
apply isWeightedHomogeneous_monomial
[GOAL]
case hm
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
i : σ
⊢ ↑(weightedDegree' w) (Finsupp.single i 1) = w i
[PROOFSTEP]
simp only [weightedDegree', LinearMap.toAddMonoidHom_coe, total_single, one_nsmul]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
d : σ →₀ ℕ
hd : ↑(weightedDegree' w) d ≠ n
⊢ coeff d φ = 0
[PROOFSTEP]
have aux := mt (@hφ d) hd
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
d : σ →₀ ℕ
hd : ↑(weightedDegree' w) d ≠ n
aux : ¬coeff d φ ≠ 0
⊢ coeff d φ = 0
[PROOFSTEP]
rwa [Classical.not_not] at aux
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
w : σ → M
hφ : φ ≠ 0
hm : IsWeightedHomogeneous w φ m
hn : IsWeightedHomogeneous w φ n
⊢ m = n
[PROOFSTEP]
obtain ⟨d, hd⟩ : ∃ d, coeff d φ ≠ 0 := exists_coeff_ne_zero hφ
[GOAL]
case intro
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
w : σ → M
hφ : φ ≠ 0
hm : IsWeightedHomogeneous w φ m
hn : IsWeightedHomogeneous w φ n
d : σ →₀ ℕ
hd : coeff d φ ≠ 0
⊢ m = n
[PROOFSTEP]
rw [← hm hd, ← hn hd]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ✝ ψ : MvPolynomial σ R
m n✝ : M
ι : Type u_4
s : Finset ι
φ : ι → MvPolynomial σ R
n : ι → M
w : σ → M
⊢ (∀ (i : ι), i ∈ s → IsWeightedHomogeneous w (φ i) (n i)) → IsWeightedHomogeneous w (∏ i in s, φ i) (∑ i in s, n i)
[PROOFSTEP]
classical
refine Finset.induction_on s ?_ ?_
· intro
  simp only [isWeightedHomogeneous_one, Finset.sum_empty, Finset.prod_empty]
· intro i s his IH h
  simp only [his, Finset.prod_insert, Finset.sum_insert, not_false_iff]
  apply (h i (Finset.mem_insert_self _ _)).mul (IH _)
  intro j hjs
  exact h j (Finset.mem_insert_of_mem hjs)
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ✝ ψ : MvPolynomial σ R
m n✝ : M
ι : Type u_4
s : Finset ι
φ : ι → MvPolynomial σ R
n : ι → M
w : σ → M
⊢ (∀ (i : ι), i ∈ s → IsWeightedHomogeneous w (φ i) (n i)) → IsWeightedHomogeneous w (∏ i in s, φ i) (∑ i in s, n i)
[PROOFSTEP]
refine Finset.induction_on s ?_ ?_
[GOAL]
case refine_1
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ✝ ψ : MvPolynomial σ R
m n✝ : M
ι : Type u_4
s : Finset ι
φ : ι → MvPolynomial σ R
n : ι → M
w : σ → M
⊢ (∀ (i : ι), i ∈ ∅ → IsWeightedHomogeneous w (φ i) (n i)) → IsWeightedHomogeneous w (∏ i in ∅, φ i) (∑ i in ∅, n i)
[PROOFSTEP]
intro
[GOAL]
case refine_1
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ✝ ψ : MvPolynomial σ R
m n✝ : M
ι : Type u_4
s : Finset ι
φ : ι → MvPolynomial σ R
n : ι → M
w : σ → M
a✝ : ∀ (i : ι), i ∈ ∅ → IsWeightedHomogeneous w (φ i) (n i)
⊢ IsWeightedHomogeneous w (∏ i in ∅, φ i) (∑ i in ∅, n i)
[PROOFSTEP]
simp only [isWeightedHomogeneous_one, Finset.sum_empty, Finset.prod_empty]
[GOAL]
case refine_2
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ✝ ψ : MvPolynomial σ R
m n✝ : M
ι : Type u_4
s : Finset ι
φ : ι → MvPolynomial σ R
n : ι → M
w : σ → M
⊢ ∀ ⦃a : ι⦄ {s : Finset ι},
    ¬a ∈ s →
      ((∀ (i : ι), i ∈ s → IsWeightedHomogeneous w (φ i) (n i)) →
          IsWeightedHomogeneous w (∏ i in s, φ i) (∑ i in s, n i)) →
        (∀ (i : ι), i ∈ insert a s → IsWeightedHomogeneous w (φ i) (n i)) →
          IsWeightedHomogeneous w (∏ i in insert a s, φ i) (∑ i in insert a s, n i)
[PROOFSTEP]
intro i s his IH h
[GOAL]
case refine_2
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ✝ ψ : MvPolynomial σ R
m n✝ : M
ι : Type u_4
s✝ : Finset ι
φ : ι → MvPolynomial σ R
n : ι → M
w : σ → M
i : ι
s : Finset ι
his : ¬i ∈ s
IH : (∀ (i : ι), i ∈ s → IsWeightedHomogeneous w (φ i) (n i)) → IsWeightedHomogeneous w (∏ i in s, φ i) (∑ i in s, n i)
h : ∀ (i_1 : ι), i_1 ∈ insert i s → IsWeightedHomogeneous w (φ i_1) (n i_1)
⊢ IsWeightedHomogeneous w (∏ i in insert i s, φ i) (∑ i in insert i s, n i)
[PROOFSTEP]
simp only [his, Finset.prod_insert, Finset.sum_insert, not_false_iff]
[GOAL]
case refine_2
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ✝ ψ : MvPolynomial σ R
m n✝ : M
ι : Type u_4
s✝ : Finset ι
φ : ι → MvPolynomial σ R
n : ι → M
w : σ → M
i : ι
s : Finset ι
his : ¬i ∈ s
IH : (∀ (i : ι), i ∈ s → IsWeightedHomogeneous w (φ i) (n i)) → IsWeightedHomogeneous w (∏ i in s, φ i) (∑ i in s, n i)
h : ∀ (i_1 : ι), i_1 ∈ insert i s → IsWeightedHomogeneous w (φ i_1) (n i_1)
⊢ IsWeightedHomogeneous w (φ i * ∏ i in s, φ i) (n i + ∑ i in s, n i)
[PROOFSTEP]
apply (h i (Finset.mem_insert_self _ _)).mul (IH _)
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ✝ ψ : MvPolynomial σ R
m n✝ : M
ι : Type u_4
s✝ : Finset ι
φ : ι → MvPolynomial σ R
n : ι → M
w : σ → M
i : ι
s : Finset ι
his : ¬i ∈ s
IH : (∀ (i : ι), i ∈ s → IsWeightedHomogeneous w (φ i) (n i)) → IsWeightedHomogeneous w (∏ i in s, φ i) (∑ i in s, n i)
h : ∀ (i_1 : ι), i_1 ∈ insert i s → IsWeightedHomogeneous w (φ i_1) (n i_1)
⊢ ∀ (i : ι), i ∈ s → IsWeightedHomogeneous w (φ i) (n i)
[PROOFSTEP]
intro j hjs
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ✝ ψ : MvPolynomial σ R
m n✝ : M
ι : Type u_4
s✝ : Finset ι
φ : ι → MvPolynomial σ R
n : ι → M
w : σ → M
i : ι
s : Finset ι
his : ¬i ∈ s
IH : (∀ (i : ι), i ∈ s → IsWeightedHomogeneous w (φ i) (n i)) → IsWeightedHomogeneous w (∏ i in s, φ i) (∑ i in s, n i)
h : ∀ (i_1 : ι), i_1 ∈ insert i s → IsWeightedHomogeneous w (φ i_1) (n i_1)
j : ι
hjs : j ∈ s
⊢ IsWeightedHomogeneous w (φ j) (n j)
[PROOFSTEP]
exact h j (Finset.mem_insert_of_mem hjs)
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
inst✝ : SemilatticeSup M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
h : φ ≠ 0
⊢ weightedTotalDegree' w φ = ↑n
[PROOFSTEP]
simp only [weightedTotalDegree']
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
inst✝ : SemilatticeSup M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
h : φ ≠ 0
⊢ (sup (support φ) fun s => ↑(↑(weightedDegree' w) s)) = ↑n
[PROOFSTEP]
apply le_antisymm
[GOAL]
case a
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
inst✝ : SemilatticeSup M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
h : φ ≠ 0
⊢ (sup (support φ) fun s => ↑(↑(weightedDegree' w) s)) ≤ ↑n
[PROOFSTEP]
simp only [Finset.sup_le_iff, mem_support_iff, WithBot.coe_le_coe]
[GOAL]
case a
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
inst✝ : SemilatticeSup M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
h : φ ≠ 0
⊢ ∀ (b : σ →₀ ℕ), coeff b φ ≠ 0 → ↑(weightedDegree' w) b ≤ n
[PROOFSTEP]
exact fun d hd => le_of_eq (hφ hd)
[GOAL]
case a
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
inst✝ : SemilatticeSup M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
h : φ ≠ 0
⊢ ↑n ≤ sup (support φ) fun s => ↑(↑(weightedDegree' w) s)
[PROOFSTEP]
obtain ⟨d, hd⟩ : ∃ d, coeff d φ ≠ 0 := exists_coeff_ne_zero h
[GOAL]
case a.intro
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
inst✝ : SemilatticeSup M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
h : φ ≠ 0
d : σ →₀ ℕ
hd : coeff d φ ≠ 0
⊢ ↑n ≤ sup (support φ) fun s => ↑(↑(weightedDegree' w) s)
[PROOFSTEP]
simp only [← hφ hd, Finsupp.sum]
[GOAL]
case a.intro
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
inst✝ : SemilatticeSup M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
h : φ ≠ 0
d : σ →₀ ℕ
hd : coeff d φ ≠ 0
⊢ ↑(↑(weightedDegree' w) d) ≤ sup (support φ) fun s => ↑(↑(weightedDegree' w) s)
[PROOFSTEP]
replace hd := Finsupp.mem_support_iff.mpr hd
[GOAL]
case a.intro
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
inst✝ : SemilatticeSup M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
h : φ ≠ 0
d : σ →₀ ℕ
hd : d ∈ φ.support
⊢ ↑(↑(weightedDegree' w) d) ≤ sup (support φ) fun s => ↑(↑(weightedDegree' w) s)
[PROOFSTEP]
apply Finset.le_sup hd
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
⊢ IsWeightedHomogeneous w (↑(weightedHomogeneousComponent w n) φ) n
[PROOFSTEP]
classical
intro d hd
contrapose! hd
rw [coeff_weightedHomogeneousComponent, if_neg hd]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
⊢ IsWeightedHomogeneous w (↑(weightedHomogeneousComponent w n) φ) n
[PROOFSTEP]
intro d hd
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hd : coeff d (↑(weightedHomogeneousComponent w n) φ) ≠ 0
⊢ ↑(weightedDegree' w) d = n
[PROOFSTEP]
contrapose! hd
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hd : ↑(weightedDegree' w) d ≠ n
⊢ coeff d (↑(weightedHomogeneousComponent w n) φ) = 0
[PROOFSTEP]
rw [coeff_weightedHomogeneousComponent, if_neg hd]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
n : M
r : R
⊢ ↑(weightedHomogeneousComponent w n) (↑C r * φ) = ↑C r * ↑(weightedHomogeneousComponent w n) φ
[PROOFSTEP]
simp only [C_mul', LinearMap.map_smul]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
h : ∀ (d : σ →₀ ℕ), d ∈ support φ → ↑(weightedDegree' w) d ≠ n
⊢ ↑(weightedHomogeneousComponent w n) φ = 0
[PROOFSTEP]
classical
rw [weightedHomogeneousComponent_apply, sum_eq_zero]
intro d hd; rw [mem_filter] at hd
exfalso; exact h _ hd.1 hd.2
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
h : ∀ (d : σ →₀ ℕ), d ∈ support φ → ↑(weightedDegree' w) d ≠ n
⊢ ↑(weightedHomogeneousComponent w n) φ = 0
[PROOFSTEP]
rw [weightedHomogeneousComponent_apply, sum_eq_zero]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
h : ∀ (d : σ →₀ ℕ), d ∈ support φ → ↑(weightedDegree' w) d ≠ n
⊢ ∀ (x : σ →₀ ℕ), x ∈ Finset.filter (fun d => ↑(weightedDegree' w) d = n) (support φ) → ↑(monomial x) (coeff x φ) = 0
[PROOFSTEP]
intro d hd
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
h : ∀ (d : σ →₀ ℕ), d ∈ support φ → ↑(weightedDegree' w) d ≠ n
d : σ →₀ ℕ
hd : d ∈ Finset.filter (fun d => ↑(weightedDegree' w) d = n) (support φ)
⊢ ↑(monomial d) (coeff d φ) = 0
[PROOFSTEP]
rw [mem_filter] at hd
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
h : ∀ (d : σ →₀ ℕ), d ∈ support φ → ↑(weightedDegree' w) d ≠ n
d : σ →₀ ℕ
hd : d ∈ support φ ∧ ↑(weightedDegree' w) d = n
⊢ ↑(monomial d) (coeff d φ) = 0
[PROOFSTEP]
exfalso
[GOAL]
case h
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
h : ∀ (d : σ →₀ ℕ), d ∈ support φ → ↑(weightedDegree' w) d ≠ n
d : σ →₀ ℕ
hd : d ∈ support φ ∧ ↑(weightedDegree' w) d = n
⊢ False
[PROOFSTEP]
exact h _ hd.1 hd.2
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
h : weightedTotalDegree w φ < n
⊢ ↑(weightedHomogeneousComponent w n) φ = 0
[PROOFSTEP]
classical
rw [weightedHomogeneousComponent_apply, sum_eq_zero]
intro d hd
rw [Finset.mem_filter] at hd
exfalso
apply lt_irrefl n
nth_rw 1 [← hd.2]
exact lt_of_le_of_lt (le_weightedTotalDegree w hd.1) h
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
h : weightedTotalDegree w φ < n
⊢ ↑(weightedHomogeneousComponent w n) φ = 0
[PROOFSTEP]
rw [weightedHomogeneousComponent_apply, sum_eq_zero]
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
h : weightedTotalDegree w φ < n
⊢ ∀ (x : σ →₀ ℕ), x ∈ Finset.filter (fun d => ↑(weightedDegree' w) d = n) (support φ) → ↑(monomial x) (coeff x φ) = 0
[PROOFSTEP]
intro d hd
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
h : weightedTotalDegree w φ < n
d : σ →₀ ℕ
hd : d ∈ Finset.filter (fun d => ↑(weightedDegree' w) d = n) (support φ)
⊢ ↑(monomial d) (coeff d φ) = 0
[PROOFSTEP]
rw [Finset.mem_filter] at hd
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
h : weightedTotalDegree w φ < n
d : σ →₀ ℕ
hd : d ∈ support φ ∧ ↑(weightedDegree' w) d = n
⊢ ↑(monomial d) (coeff d φ) = 0
[PROOFSTEP]
exfalso
[GOAL]
case h
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
h : weightedTotalDegree w φ < n
d : σ →₀ ℕ
hd : d ∈ support φ ∧ ↑(weightedDegree' w) d = n
⊢ False
[PROOFSTEP]
apply lt_irrefl n
[GOAL]
case h
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
h : weightedTotalDegree w φ < n
d : σ →₀ ℕ
hd : d ∈ support φ ∧ ↑(weightedDegree' w) d = n
⊢ n < n
[PROOFSTEP]
nth_rw 1 [← hd.2]
[GOAL]
case h
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
h : weightedTotalDegree w φ < n
d : σ →₀ ℕ
hd : d ∈ support φ ∧ ↑(weightedDegree' w) d = n
⊢ ↑(weightedDegree' w) d < n
[PROOFSTEP]
exact lt_of_le_of_lt (le_weightedTotalDegree w hd.1) h
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
⊢ Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ)
[PROOFSTEP]
suffices (Function.support fun m => weightedHomogeneousComponent w m φ) ⊆ (fun d => weightedDegree' w d) '' φ.support by
  exact Finite.subset ((fun d : σ →₀ ℕ => (weightedDegree' w) d) '' ↑(support φ)).toFinite this
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
this :
  (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ) ⊆ (fun d => ↑(weightedDegree' w) d) '' ↑(support φ)
⊢ Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ)
[PROOFSTEP]
exact Finite.subset ((fun d : σ →₀ ℕ => (weightedDegree' w) d) '' ↑(support φ)).toFinite this
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
⊢ (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ) ⊆ (fun d => ↑(weightedDegree' w) d) '' ↑(support φ)
[PROOFSTEP]
intro m hm
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
m : M
hm : m ∈ Function.support fun m => ↑(weightedHomogeneousComponent w m) φ
⊢ m ∈ (fun d => ↑(weightedDegree' w) d) '' ↑(support φ)
[PROOFSTEP]
by_contra hm'
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
m : M
hm : m ∈ Function.support fun m => ↑(weightedHomogeneousComponent w m) φ
hm' : ¬m ∈ (fun d => ↑(weightedDegree' w) d) '' ↑(support φ)
⊢ False
[PROOFSTEP]
apply hm
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
m : M
hm : m ∈ Function.support fun m => ↑(weightedHomogeneousComponent w m) φ
hm' : ¬m ∈ (fun d => ↑(weightedDegree' w) d) '' ↑(support φ)
⊢ (fun m => ↑(weightedHomogeneousComponent w m) φ) m = 0
[PROOFSTEP]
simp only [mem_support, Ne.def] at hm
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
m : M
hm' : ¬m ∈ (fun d => ↑(weightedDegree' w) d) '' ↑(support φ)
hm : ¬↑(weightedHomogeneousComponent w m) φ = 0
⊢ (fun m => ↑(weightedHomogeneousComponent w m) φ) m = 0
[PROOFSTEP]
simp only [Set.mem_image, not_exists, not_and] at hm'
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
m : M
hm : ¬↑(weightedHomogeneousComponent w m) φ = 0
hm' : ∀ (x : σ →₀ ℕ), x ∈ ↑(support φ) → ¬↑(weightedDegree' w) x = m
⊢ (fun m => ↑(weightedHomogeneousComponent w m) φ) m = 0
[PROOFSTEP]
exact weightedHomogeneousComponent_eq_zero' m φ hm'
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
⊢ ∑ᶠ (m : M), ↑(weightedHomogeneousComponent w m) φ = φ
[PROOFSTEP]
classical
rw [finsum_eq_sum _ (weightedHomogeneousComponent_finsupp φ)]
ext1 d
simp only [coeff_sum, coeff_weightedHomogeneousComponent]
rw [Finset.sum_eq_single (weightedDegree' w d)]
· rw [if_pos rfl]
· intro m _ hm'
  rw [if_neg hm'.symm]
· intro hm
  rw [if_pos rfl]
  simp only [Finite.mem_toFinset, mem_support, Ne.def, Classical.not_not] at hm
  have := coeff_weightedHomogeneousComponent (w := w) (weightedDegree' w d) φ d
  rw [hm, if_pos rfl, coeff_zero] at this
  exact this.symm
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
⊢ ∑ᶠ (m : M), ↑(weightedHomogeneousComponent w m) φ = φ
[PROOFSTEP]
rw [finsum_eq_sum _ (weightedHomogeneousComponent_finsupp φ)]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
⊢ ∑ i in Finite.toFinset (_ : Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ)),
      ↑(weightedHomogeneousComponent w i) φ =
    φ
[PROOFSTEP]
ext1 d
[GOAL]
case a
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ coeff d
      (∑ i in Finite.toFinset (_ : Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ)),
        ↑(weightedHomogeneousComponent w i) φ) =
    coeff d φ
[PROOFSTEP]
simp only [coeff_sum, coeff_weightedHomogeneousComponent]
[GOAL]
case a
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ (∑ x in Finite.toFinset (_ : Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ)),
      if ↑(weightedDegree' w) d = x then coeff d φ else 0) =
    coeff d φ
[PROOFSTEP]
rw [Finset.sum_eq_single (weightedDegree' w d)]
[GOAL]
case a
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ (if ↑(weightedDegree' w) d = ↑(weightedDegree' w) d then coeff d φ else 0) = coeff d φ
[PROOFSTEP]
rw [if_pos rfl]
[GOAL]
case a.h₀
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ ∀ (b : (fun x => M) d),
    b ∈ Finite.toFinset (_ : Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ)) →
      b ≠ ↑(weightedDegree' w) d → (if ↑(weightedDegree' w) d = b then coeff d φ else 0) = 0
[PROOFSTEP]
intro m _ hm'
[GOAL]
case a.h₀
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
m : M
a✝ : m ∈ Finite.toFinset (_ : Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ))
hm' : m ≠ ↑(weightedDegree' w) d
⊢ (if ↑(weightedDegree' w) d = m then coeff d φ else 0) = 0
[PROOFSTEP]
rw [if_neg hm'.symm]
[GOAL]
case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ ¬↑(weightedDegree' w) d ∈
        Finite.toFinset (_ : Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ)) →
    (if ↑(weightedDegree' w) d = ↑(weightedDegree' w) d then coeff d φ else 0) = 0
[PROOFSTEP]
intro hm
[GOAL]
case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm :
  ¬↑(weightedDegree' w) d ∈
      Finite.toFinset (_ : Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ))
⊢ (if ↑(weightedDegree' w) d = ↑(weightedDegree' w) d then coeff d φ else 0) = 0
[PROOFSTEP]
rw [if_pos rfl]
[GOAL]
case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm :
  ¬↑(weightedDegree' w) d ∈
      Finite.toFinset (_ : Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ))
⊢ coeff d φ = 0
[PROOFSTEP]
simp only [Finite.mem_toFinset, mem_support, Ne.def, Classical.not_not] at hm
[GOAL]
case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm : ↑(weightedHomogeneousComponent w (↑(weightedDegree' w) d)) φ = 0
⊢ coeff d φ = 0
[PROOFSTEP]
have := coeff_weightedHomogeneousComponent (w := w) (weightedDegree' w d) φ d
[GOAL]
case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm : ↑(weightedHomogeneousComponent w (↑(weightedDegree' w) d)) φ = 0
this :
  coeff d (↑(weightedHomogeneousComponent w (↑(weightedDegree' w) d)) φ) =
    if ↑(weightedDegree' w) d = ↑(weightedDegree' w) d then coeff d φ else 0
⊢ coeff d φ = 0
[PROOFSTEP]
rw [hm, if_pos rfl, coeff_zero] at this
[GOAL]
case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm : ↑(weightedHomogeneousComponent w (↑(weightedDegree' w) d)) φ = 0
this : 0 = coeff d φ
⊢ coeff d φ = 0
[PROOFSTEP]
exact this.symm
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : p ∈ weightedHomogeneousSubmodule R w n
⊢ ↑(weightedHomogeneousComponent w m) p = if m = n then p else 0
[PROOFSTEP]
simp only [mem_weightedHomogeneousSubmodule] at h
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
⊢ ↑(weightedHomogeneousComponent w m) p = if m = n then p else 0
[PROOFSTEP]
ext x
[GOAL]
case a
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
⊢ coeff x (↑(weightedHomogeneousComponent w m) p) = coeff x (if m = n then p else 0)
[PROOFSTEP]
rw [coeff_weightedHomogeneousComponent]
[GOAL]
case a
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
⊢ (if ↑(weightedDegree' w) x = m then coeff x p else 0) = coeff x (if m = n then p else 0)
[PROOFSTEP]
by_cases zero_coeff : coeff x p = 0
[GOAL]
case pos
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
⊢ (if ↑(weightedDegree' w) x = m then coeff x p else 0) = coeff x (if m = n then p else 0)
[PROOFSTEP]
split_ifs
[GOAL]
case pos
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ↑(weightedDegree' w) x = m
h✝ : m = n
⊢ coeff x p = coeff x p
case neg
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ↑(weightedDegree' w) x = m
h✝ : ¬m = n
⊢ coeff x p = coeff x 0
case pos
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ¬↑(weightedDegree' w) x = m
h✝ : m = n
⊢ 0 = coeff x p
case neg
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ¬↑(weightedDegree' w) x = m
h✝ : ¬m = n
⊢ 0 = coeff x 0
[PROOFSTEP]
all_goals simp only [zero_coeff, coeff_zero]
[GOAL]
case pos
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ↑(weightedDegree' w) x = m
h✝ : m = n
⊢ coeff x p = coeff x p
[PROOFSTEP]
simp only [zero_coeff, coeff_zero]
[GOAL]
case neg
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ↑(weightedDegree' w) x = m
h✝ : ¬m = n
⊢ coeff x p = coeff x 0
[PROOFSTEP]
simp only [zero_coeff, coeff_zero]
[GOAL]
case pos
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ¬↑(weightedDegree' w) x = m
h✝ : m = n
⊢ 0 = coeff x p
[PROOFSTEP]
simp only [zero_coeff, coeff_zero]
[GOAL]
case neg
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ¬↑(weightedDegree' w) x = m
h✝ : ¬m = n
⊢ 0 = coeff x 0
[PROOFSTEP]
simp only [zero_coeff, coeff_zero]
[GOAL]
case neg
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : ¬coeff x p = 0
⊢ (if ↑(weightedDegree' w) x = m then coeff x p else 0) = coeff x (if m = n then p else 0)
[PROOFSTEP]
rw [h zero_coeff]
[GOAL]
case neg
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : ¬coeff x p = 0
⊢ (if n = m then coeff x p else 0) = coeff x (if m = n then p else 0)
[PROOFSTEP]
simp only [show n = m ↔ m = n from eq_comm]
[GOAL]
case neg
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : ¬coeff x p = 0
⊢ (if m = n then coeff x p else 0) = coeff x (if m = n then p else 0)
[PROOFSTEP]
split_ifs with h1
[GOAL]
case pos
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : ¬coeff x p = 0
h1 : m = n
⊢ coeff x p = coeff x p
[PROOFSTEP]
rfl
[GOAL]
case neg
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : ¬coeff x p = 0
h1 : ¬m = n
⊢ 0 = coeff x 0
[PROOFSTEP]
simp only [coeff_zero]
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : CanonicallyOrderedAddMonoid M
w : σ → M
φ : MvPolynomial σ R
inst✝ : NoZeroSMulDivisors ℕ M
hw : ∀ (i : σ), w i ≠ 0
⊢ ↑(weightedHomogeneousComponent w 0) φ = ↑C (coeff 0 φ)
[PROOFSTEP]
classical
ext1 d
rcases Classical.em (d = 0) with (rfl | hd)
· simp only [coeff_weightedHomogeneousComponent, if_pos, map_zero, coeff_zero_C]
· rw [coeff_weightedHomogeneousComponent, if_neg, coeff_C, if_neg (Ne.symm hd)]
  simp only [weightedDegree', LinearMap.toAddMonoidHom_coe, Finsupp.total_apply, Finsupp.sum, sum_eq_zero_iff,
    Finsupp.mem_support_iff, Ne.def, smul_eq_zero, not_forall, not_or, and_self_left, exists_prop]
  simp only [FunLike.ext_iff, Finsupp.coe_zero, Pi.zero_apply, not_forall] at hd
  obtain ⟨i, hi⟩ := hd
  exact ⟨i, hi, hw i⟩
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : CanonicallyOrderedAddMonoid M
w : σ → M
φ : MvPolynomial σ R
inst✝ : NoZeroSMulDivisors ℕ M
hw : ∀ (i : σ), w i ≠ 0
⊢ ↑(weightedHomogeneousComponent w 0) φ = ↑C (coeff 0 φ)
[PROOFSTEP]
ext1 d
[GOAL]
case a
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : CanonicallyOrderedAddMonoid M
w : σ → M
φ : MvPolynomial σ R
inst✝ : NoZeroSMulDivisors ℕ M
hw : ∀ (i : σ), w i ≠ 0
d : σ →₀ ℕ
⊢ coeff d (↑(weightedHomogeneousComponent w 0) φ) = coeff d (↑C (coeff 0 φ))
[PROOFSTEP]
rcases Classical.em (d = 0) with (rfl | hd)
[GOAL]
case a.inl
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : CanonicallyOrderedAddMonoid M
w : σ → M
φ : MvPolynomial σ R
inst✝ : NoZeroSMulDivisors ℕ M
hw : ∀ (i : σ), w i ≠ 0
⊢ coeff 0 (↑(weightedHomogeneousComponent w 0) φ) = coeff 0 (↑C (coeff 0 φ))
[PROOFSTEP]
simp only [coeff_weightedHomogeneousComponent, if_pos, map_zero, coeff_zero_C]
[GOAL]
case a.inr
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : CanonicallyOrderedAddMonoid M
w : σ → M
φ : MvPolynomial σ R
inst✝ : NoZeroSMulDivisors ℕ M
hw : ∀ (i : σ), w i ≠ 0
d : σ →₀ ℕ
hd : ¬d = 0
⊢ coeff d (↑(weightedHomogeneousComponent w 0) φ) = coeff d (↑C (coeff 0 φ))
[PROOFSTEP]
rw [coeff_weightedHomogeneousComponent, if_neg, coeff_C, if_neg (Ne.symm hd)]
[GOAL]
case a.inr.hnc
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : CanonicallyOrderedAddMonoid M
w : σ → M
φ : MvPolynomial σ R
inst✝ : NoZeroSMulDivisors ℕ M
hw : ∀ (i : σ), w i ≠ 0
d : σ →₀ ℕ
hd : ¬d = 0
⊢ ¬↑(weightedDegree' w) d = 0
[PROOFSTEP]
simp only [weightedDegree', LinearMap.toAddMonoidHom_coe, Finsupp.total_apply, Finsupp.sum, sum_eq_zero_iff,
  Finsupp.mem_support_iff, Ne.def, smul_eq_zero, not_forall, not_or, and_self_left, exists_prop]
[GOAL]
case a.inr.hnc
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : CanonicallyOrderedAddMonoid M
w : σ → M
φ : MvPolynomial σ R
inst✝ : NoZeroSMulDivisors ℕ M
hw : ∀ (i : σ), w i ≠ 0
d : σ →₀ ℕ
hd : ¬d = 0
⊢ ∃ x, ¬↑d x = 0 ∧ ¬w x = 0
[PROOFSTEP]
simp only [FunLike.ext_iff, Finsupp.coe_zero, Pi.zero_apply, not_forall] at hd
[GOAL]
case a.inr.hnc
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : CanonicallyOrderedAddMonoid M
w : σ → M
φ : MvPolynomial σ R
inst✝ : NoZeroSMulDivisors ℕ M
hw : ∀ (i : σ), w i ≠ 0
d : σ →₀ ℕ
hd : ∃ x, ¬↑d x = 0
⊢ ∃ x, ¬↑d x = 0 ∧ ¬w x = 0
[PROOFSTEP]
obtain ⟨i, hi⟩ := hd
[GOAL]
case a.inr.hnc.intro
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : CanonicallyOrderedAddMonoid M
w : σ → M
φ : MvPolynomial σ R
inst✝ : NoZeroSMulDivisors ℕ M
hw : ∀ (i : σ), w i ≠ 0
d : σ →₀ ℕ
i : σ
hi : ¬↑d i = 0
⊢ ∃ x, ¬↑d x = 0 ∧ ¬w x = 0
[PROOFSTEP]
exact ⟨i, hi, hw i⟩