[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
⊢ FinitePresentation R A → FiniteType R A
[PROOFSTEP]
rintro ⟨n, f, hf⟩
[GOAL]
case intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
⊢ FiniteType R A
[PROOFSTEP]
apply FiniteType.iff_quotient_mvPolynomial''.2
[GOAL]
case intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
⊢ ∃ n f, Surjective ↑f
[PROOFSTEP]
exact ⟨n, f, hf.1⟩
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsNoetherianRing R
⊢ FiniteType R A ↔ FinitePresentation R A
[PROOFSTEP]
refine' ⟨fun h => _, Algebra.FiniteType.of_finitePresentation⟩
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsNoetherianRing R
h : FiniteType R A
⊢ FinitePresentation R A
[PROOFSTEP]
obtain ⟨n, f, hf⟩ := Algebra.FiniteType.iff_quotient_mvPolynomial''.1 h
[GOAL]
case intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsNoetherianRing R
h : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
⊢ FinitePresentation R A
[PROOFSTEP]
refine' ⟨n, f, hf, _⟩
[GOAL]
case intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsNoetherianRing R
h : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
have hnoet : IsNoetherianRing (MvPolynomial (Fin n) R) := by
  infer_instance
    -- Porting note: rewrote code to help typeclass inference
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsNoetherianRing R
h : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
⊢ IsNoetherianRing (MvPolynomial (Fin n) R)
[PROOFSTEP]
infer_instance
  -- Porting note: rewrote code to help typeclass inference
[GOAL]
case intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsNoetherianRing R
h : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
hnoet : IsNoetherianRing (MvPolynomial (Fin n) R)
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
rw [isNoetherianRing_iff] at hnoet
[GOAL]
case intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsNoetherianRing R
h : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
hnoet : IsNoetherian (MvPolynomial (Fin n) R) (MvPolynomial (Fin n) R)
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
letI : Module (MvPolynomial (Fin n) R) (MvPolynomial (Fin n) R) := Semiring.toModule
[GOAL]
case intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsNoetherianRing R
h : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
hnoet : IsNoetherian (MvPolynomial (Fin n) R) (MvPolynomial (Fin n) R)
this : Module (MvPolynomial (Fin n) R) (MvPolynomial (Fin n) R) := Semiring.toModule
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
have := hnoet.noetherian (RingHom.ker f.toRingHom)
[GOAL]
case intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
inst✝ : IsNoetherianRing R
h : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
hnoet : IsNoetherian (MvPolynomial (Fin n) R) (MvPolynomial (Fin n) R)
this✝ : Module (MvPolynomial (Fin n) R) (MvPolynomial (Fin n) R) := Semiring.toModule
this : Submodule.FG (RingHom.ker ↑f)
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
convert this
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
hfp : FinitePresentation R A
e : A ≃ₐ[R] B
⊢ FinitePresentation R B
[PROOFSTEP]
obtain ⟨n, f, hf⟩ := hfp
[GOAL]
case intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
e : A ≃ₐ[R] B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
⊢ FinitePresentation R B
[PROOFSTEP]
use n, AlgHom.comp (↑e) f
[GOAL]
case h
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
e : A ≃ₐ[R] B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
⊢ Surjective ↑(AlgHom.comp (↑e) f) ∧ Ideal.FG (RingHom.ker ↑(AlgHom.comp (↑e) f))
[PROOFSTEP]
constructor
[GOAL]
case h.left
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
e : A ≃ₐ[R] B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
⊢ Surjective ↑(AlgHom.comp (↑e) f)
[PROOFSTEP]
rw [AlgHom.coe_comp]
[GOAL]
case h.left
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
e : A ≃ₐ[R] B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
⊢ Surjective (↑↑e ∘ ↑f)
[PROOFSTEP]
exact Function.Surjective.comp e.surjective hf.1
[GOAL]
case h.right
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
e : A ≃ₐ[R] B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
⊢ Ideal.FG (RingHom.ker ↑(AlgHom.comp (↑e) f))
[PROOFSTEP]
suffices hker : (RingHom.ker (AlgHom.comp (e : A →ₐ[R] B) f).toRingHom) = RingHom.ker f.toRingHom
[GOAL]
case h.right
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
e : A ≃ₐ[R] B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
hker : RingHom.ker ↑(AlgHom.comp (↑e) f) = RingHom.ker ↑f
⊢ Ideal.FG (RingHom.ker ↑(AlgHom.comp (↑e) f))
[PROOFSTEP]
rw [hker]
[GOAL]
case h.right
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
e : A ≃ₐ[R] B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
hker : RingHom.ker ↑(AlgHom.comp (↑e) f) = RingHom.ker ↑f
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
exact hf.2
[GOAL]
case hker
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
e : A ≃ₐ[R] B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
⊢ RingHom.ker ↑(AlgHom.comp (↑e) f) = RingHom.ker ↑f
[PROOFSTEP]
have hco : (AlgHom.comp (e : A →ₐ[R] B) f).toRingHom = RingHom.comp (e.toRingEquiv : A ≃+* B) f.toRingHom :=
  by
  have h : (AlgHom.comp (e : A →ₐ[R] B) f).toRingHom = e.toAlgHom.toRingHom.comp f.toRingHom := rfl
  have h1 : ↑e.toRingEquiv = e.toAlgHom.toRingHom := rfl
  rw [h, h1]
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
e : A ≃ₐ[R] B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
⊢ ↑(AlgHom.comp (↑e) f) = RingHom.comp ↑(AlgEquiv.toRingEquiv e) ↑f
[PROOFSTEP]
have h : (AlgHom.comp (e : A →ₐ[R] B) f).toRingHom = e.toAlgHom.toRingHom.comp f.toRingHom := rfl
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
e : A ≃ₐ[R] B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
h : ↑(AlgHom.comp (↑e) f) = RingHom.comp ↑↑e ↑f
⊢ ↑(AlgHom.comp (↑e) f) = RingHom.comp ↑(AlgEquiv.toRingEquiv e) ↑f
[PROOFSTEP]
have h1 : ↑e.toRingEquiv = e.toAlgHom.toRingHom := rfl
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
e : A ≃ₐ[R] B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
h : ↑(AlgHom.comp (↑e) f) = RingHom.comp ↑↑e ↑f
h1 : ↑(AlgEquiv.toRingEquiv e) = ↑↑e
⊢ ↑(AlgHom.comp (↑e) f) = RingHom.comp ↑(AlgEquiv.toRingEquiv e) ↑f
[PROOFSTEP]
rw [h, h1]
[GOAL]
case hker
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
e : A ≃ₐ[R] B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
hco : ↑(AlgHom.comp (↑e) f) = RingHom.comp ↑(AlgEquiv.toRingEquiv e) ↑f
⊢ RingHom.ker ↑(AlgHom.comp (↑e) f) = RingHom.ker ↑f
[PROOFSTEP]
rw [RingHom.ker_eq_comap_bot, hco, ← Ideal.comap_comap, ← RingHom.ker_eq_comap_bot,
  RingHom.ker_coe_equiv (AlgEquiv.toRingEquiv e), RingHom.ker_eq_comap_bot]
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
ι : Type u_2
inst✝ : Finite ι
⊢ FinitePresentation R (MvPolynomial ι R)
[PROOFSTEP]
cases nonempty_fintype ι
[GOAL]
case intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
ι : Type u_2
inst✝ : Finite ι
val✝ : Fintype ι
⊢ FinitePresentation R (MvPolynomial ι R)
[PROOFSTEP]
let eqv := (MvPolynomial.renameEquiv R <| Fintype.equivFin ι).symm
[GOAL]
case intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
ι : Type u_2
inst✝ : Finite ι
val✝ : Fintype ι
eqv : MvPolynomial (Fin (Fintype.card ι)) R ≃ₐ[R] MvPolynomial ι R :=
  AlgEquiv.symm (MvPolynomial.renameEquiv R (Fintype.equivFin ι))
⊢ FinitePresentation R (MvPolynomial ι R)
[PROOFSTEP]
exact
  ⟨Fintype.card ι, eqv, eqv.surjective, ((RingHom.injective_iff_ker_eq_bot _).1 eqv.injective).symm ▸ Submodule.fg_bot⟩
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
I : Ideal A
h : Ideal.FG I
hfp : FinitePresentation R A
⊢ FinitePresentation R (A ⧸ I)
[PROOFSTEP]
obtain ⟨n, f, hf⟩ := hfp
[GOAL]
case intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
I : Ideal A
h : Ideal.FG I
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
⊢ FinitePresentation R (A ⧸ I)
[PROOFSTEP]
refine' ⟨n, (Ideal.Quotient.mkₐ R I).comp f, _, _⟩
[GOAL]
case intro.intro.refine'_1
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
I : Ideal A
h : Ideal.FG I
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
⊢ Surjective ↑(AlgHom.comp (Ideal.Quotient.mkₐ R I) f)
[PROOFSTEP]
exact (Ideal.Quotient.mkₐ_surjective R I).comp hf.1
[GOAL]
case intro.intro.refine'_2
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
I : Ideal A
h : Ideal.FG I
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
⊢ Ideal.FG (RingHom.ker ↑(AlgHom.comp (Ideal.Quotient.mkₐ R I) f))
[PROOFSTEP]
refine' Ideal.fg_ker_comp _ _ hf.2 _ hf.1
[GOAL]
case intro.intro.refine'_2
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
I : Ideal A
h : Ideal.FG I
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
⊢ Ideal.FG (RingHom.ker ↑(Ideal.Quotient.mkₐ R I))
[PROOFSTEP]
simp [h]
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
⊢ FinitePresentation R A ↔ ∃ n I x, Ideal.FG I
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
⊢ FinitePresentation R A → ∃ n I x, Ideal.FG I
[PROOFSTEP]
rintro ⟨n, f, hf⟩
[GOAL]
case mp.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
⊢ ∃ n I x, Ideal.FG I
[PROOFSTEP]
exact ⟨n, RingHom.ker f.toRingHom, Ideal.quotientKerAlgEquivOfSurjective hf.1, hf.2⟩
[GOAL]
case mpr
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
⊢ (∃ n I x, Ideal.FG I) → FinitePresentation R A
[PROOFSTEP]
rintro ⟨n, I, e, hfg⟩
[GOAL]
case mpr.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
I : Ideal (MvPolynomial (Fin n) R)
e : (MvPolynomial (Fin n) R ⧸ I) ≃ₐ[R] A
hfg : Ideal.FG I
⊢ FinitePresentation R A
[PROOFSTEP]
exact equiv ((FinitePresentation.mvPolynomial R _).quotient hfg) e
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
⊢ FinitePresentation R A ↔ ∃ ι x f, Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
⊢ FinitePresentation R A → ∃ ι x f, Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
rintro ⟨n, f, hfs, hfk⟩
[GOAL]
case mp.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hfs : Surjective ↑f
hfk : Ideal.FG (RingHom.ker ↑f)
⊢ ∃ ι x f, Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
set ulift_var := MvPolynomial.renameEquiv R Equiv.ulift
[GOAL]
case mp.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hfs : Surjective ↑f
hfk : Ideal.FG (RingHom.ker ↑f)
ulift_var : MvPolynomial (ULift ?m.48050) R ≃ₐ[R] MvPolynomial ?m.48050 R := MvPolynomial.renameEquiv R Equiv.ulift
⊢ ∃ ι x f, Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
refine'
  ⟨ULift (Fin n), inferInstance, f.comp ulift_var.toAlgHom, hfs.comp ulift_var.surjective,
    Ideal.fg_ker_comp _ _ _ hfk ulift_var.surjective⟩
[GOAL]
case mp.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hfs : Surjective ↑f
hfk : Ideal.FG (RingHom.ker ↑f)
ulift_var : MvPolynomial (ULift (Fin n)) R ≃ₐ[R] MvPolynomial (Fin n) R := MvPolynomial.renameEquiv R Equiv.ulift
⊢ Ideal.FG (RingHom.ker ↑↑ulift_var)
[PROOFSTEP]
erw [RingHom.ker_coe_equiv ulift_var.toRingEquiv]
[GOAL]
case mp.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hfs : Surjective ↑f
hfk : Ideal.FG (RingHom.ker ↑f)
ulift_var : MvPolynomial (ULift (Fin n)) R ≃ₐ[R] MvPolynomial (Fin n) R := MvPolynomial.renameEquiv R Equiv.ulift
⊢ Ideal.FG ⊥
[PROOFSTEP]
exact Submodule.fg_bot
[GOAL]
case mpr
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
⊢ (∃ ι x f, Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)) → FinitePresentation R A
[PROOFSTEP]
rintro ⟨ι, hfintype, f, hf⟩
[GOAL]
case mpr.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
ι : Type u_1
hfintype : Fintype ι
f : MvPolynomial ι R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
⊢ FinitePresentation R A
[PROOFSTEP]
have equiv := MvPolynomial.renameEquiv R (Fintype.equivFin ι)
[GOAL]
case mpr.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
ι : Type u_1
hfintype : Fintype ι
f : MvPolynomial ι R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
equiv : MvPolynomial ι R ≃ₐ[R] MvPolynomial (Fin (Fintype.card ι)) R
⊢ FinitePresentation R A
[PROOFSTEP]
refine'
  ⟨Fintype.card ι, f.comp equiv.symm, hf.1.comp (AlgEquiv.symm equiv).surjective,
    Ideal.fg_ker_comp _ f _ hf.2 equiv.symm.surjective⟩
[GOAL]
case mpr.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
ι : Type u_1
hfintype : Fintype ι
f : MvPolynomial ι R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
equiv : MvPolynomial ι R ≃ₐ[R] MvPolynomial (Fin (Fintype.card ι)) R
⊢ Ideal.FG (RingHom.ker ↑↑(AlgEquiv.symm equiv))
[PROOFSTEP]
erw [RingHom.ker_coe_equiv equiv.symm.toRingEquiv]
[GOAL]
case mpr.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
ι : Type u_1
hfintype : Fintype ι
f : MvPolynomial ι R →ₐ[R] A
hf : Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
equiv : MvPolynomial ι R ≃ₐ[R] MvPolynomial (Fin (Fintype.card ι)) R
⊢ Ideal.FG ⊥
[PROOFSTEP]
exact Submodule.fg_bot
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
hfp : FinitePresentation R A
ι : Type v
inst✝ : Finite ι
⊢ FinitePresentation R (MvPolynomial ι A)
[PROOFSTEP]
rw [iff_quotient_mvPolynomial'] at hfp ⊢
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
hfp : ∃ ι x f, Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
ι : Type v
inst✝ : Finite ι
⊢ ∃ ι_1 x f, Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
classical
  -- Porting note : use the same universe level
obtain ⟨(ι' : Type v), _, f, hf_surj, hf_ker⟩ := hfp
let g := (MvPolynomial.mapAlgHom f).comp (MvPolynomial.sumAlgEquiv R ι ι').toAlgHom
cases nonempty_fintype (Sum ι ι')
refine
  ⟨Sum ι ι', by infer_instance, g, (MvPolynomial.map_surjective f.toRingHom hf_surj).comp (AlgEquiv.surjective _),
    Ideal.fg_ker_comp _ _ ?_ ?_ (AlgEquiv.surjective _)⟩
· erw [RingHom.ker_coe_equiv (MvPolynomial.sumAlgEquiv R ι ι').toRingEquiv]
  exact Submodule.fg_bot
· rw [AlgHom.toRingHom_eq_coe, MvPolynomial.mapAlgHom_coe_ringHom, MvPolynomial.ker_map]
  exact hf_ker.map MvPolynomial.C
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
hfp : ∃ ι x f, Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
ι : Type v
inst✝ : Finite ι
⊢ ∃ ι_1 x f, Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
obtain ⟨(ι' : Type v), _, f, hf_surj, hf_ker⟩ := hfp
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
ι : Type v
inst✝ : Finite ι
ι' : Type v
w✝ : Fintype ι'
f : MvPolynomial ι' R →ₐ[R] A
hf_surj : Surjective ↑f
hf_ker : Ideal.FG (RingHom.ker ↑f)
⊢ ∃ ι_1 x f, Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
let g := (MvPolynomial.mapAlgHom f).comp (MvPolynomial.sumAlgEquiv R ι ι').toAlgHom
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
ι : Type v
inst✝ : Finite ι
ι' : Type v
w✝ : Fintype ι'
f : MvPolynomial ι' R →ₐ[R] A
hf_surj : Surjective ↑f
hf_ker : Ideal.FG (RingHom.ker ↑f)
g : MvPolynomial (ι ⊕ ι') R →ₐ[R] MvPolynomial ι A :=
  AlgHom.comp (MvPolynomial.mapAlgHom f) ↑(MvPolynomial.sumAlgEquiv R ι ι')
⊢ ∃ ι_1 x f, Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
cases nonempty_fintype (Sum ι ι')
[GOAL]
case intro.intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
ι : Type v
inst✝ : Finite ι
ι' : Type v
w✝ : Fintype ι'
f : MvPolynomial ι' R →ₐ[R] A
hf_surj : Surjective ↑f
hf_ker : Ideal.FG (RingHom.ker ↑f)
g : MvPolynomial (ι ⊕ ι') R →ₐ[R] MvPolynomial ι A :=
  AlgHom.comp (MvPolynomial.mapAlgHom f) ↑(MvPolynomial.sumAlgEquiv R ι ι')
val✝ : Fintype (ι ⊕ ι')
⊢ ∃ ι_1 x f, Surjective ↑f ∧ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
refine
  ⟨Sum ι ι', by infer_instance, g, (MvPolynomial.map_surjective f.toRingHom hf_surj).comp (AlgEquiv.surjective _),
    Ideal.fg_ker_comp _ _ ?_ ?_ (AlgEquiv.surjective _)⟩
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
ι : Type v
inst✝ : Finite ι
ι' : Type v
w✝ : Fintype ι'
f : MvPolynomial ι' R →ₐ[R] A
hf_surj : Surjective ↑f
hf_ker : Ideal.FG (RingHom.ker ↑f)
g : MvPolynomial (ι ⊕ ι') R →ₐ[R] MvPolynomial ι A :=
  AlgHom.comp (MvPolynomial.mapAlgHom f) ↑(MvPolynomial.sumAlgEquiv R ι ι')
val✝ : Fintype (ι ⊕ ι')
⊢ Fintype (ι ⊕ ι')
[PROOFSTEP]
infer_instance
[GOAL]
case intro.intro.intro.intro.intro.refine_1
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
ι : Type v
inst✝ : Finite ι
ι' : Type v
w✝ : Fintype ι'
f : MvPolynomial ι' R →ₐ[R] A
hf_surj : Surjective ↑f
hf_ker : Ideal.FG (RingHom.ker ↑f)
g : MvPolynomial (ι ⊕ ι') R →ₐ[R] MvPolynomial ι A :=
  AlgHom.comp (MvPolynomial.mapAlgHom f) ↑(MvPolynomial.sumAlgEquiv R ι ι')
val✝ : Fintype (ι ⊕ ι')
⊢ Ideal.FG (RingHom.ker ↑↑(MvPolynomial.sumAlgEquiv R ι ι'))
[PROOFSTEP]
erw [RingHom.ker_coe_equiv (MvPolynomial.sumAlgEquiv R ι ι').toRingEquiv]
[GOAL]
case intro.intro.intro.intro.intro.refine_1
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
ι : Type v
inst✝ : Finite ι
ι' : Type v
w✝ : Fintype ι'
f : MvPolynomial ι' R →ₐ[R] A
hf_surj : Surjective ↑f
hf_ker : Ideal.FG (RingHom.ker ↑f)
g : MvPolynomial (ι ⊕ ι') R →ₐ[R] MvPolynomial ι A :=
  AlgHom.comp (MvPolynomial.mapAlgHom f) ↑(MvPolynomial.sumAlgEquiv R ι ι')
val✝ : Fintype (ι ⊕ ι')
⊢ Ideal.FG ⊥
[PROOFSTEP]
exact Submodule.fg_bot
[GOAL]
case intro.intro.intro.intro.intro.refine_2
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
ι : Type v
inst✝ : Finite ι
ι' : Type v
w✝ : Fintype ι'
f : MvPolynomial ι' R →ₐ[R] A
hf_surj : Surjective ↑f
hf_ker : Ideal.FG (RingHom.ker ↑f)
g : MvPolynomial (ι ⊕ ι') R →ₐ[R] MvPolynomial ι A :=
  AlgHom.comp (MvPolynomial.mapAlgHom f) ↑(MvPolynomial.sumAlgEquiv R ι ι')
val✝ : Fintype (ι ⊕ ι')
⊢ Ideal.FG (RingHom.ker ↑(MvPolynomial.mapAlgHom f))
[PROOFSTEP]
rw [AlgHom.toRingHom_eq_coe, MvPolynomial.mapAlgHom_coe_ringHom, MvPolynomial.ker_map]
[GOAL]
case intro.intro.intro.intro.intro.refine_2
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁵ : CommRing R
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing B
inst✝¹ : Algebra R B
ι : Type v
inst✝ : Finite ι
ι' : Type v
w✝ : Fintype ι'
f : MvPolynomial ι' R →ₐ[R] A
hf_surj : Surjective ↑f
hf_ker : Ideal.FG (RingHom.ker ↑f)
g : MvPolynomial (ι ⊕ ι') R →ₐ[R] MvPolynomial ι A :=
  AlgHom.comp (MvPolynomial.mapAlgHom f) ↑(MvPolynomial.sumAlgEquiv R ι ι')
val✝ : Fintype (ι ⊕ ι')
⊢ Ideal.FG (Ideal.map MvPolynomial.C (RingHom.ker ↑f))
[PROOFSTEP]
exact hf_ker.map MvPolynomial.C
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hfpA : FinitePresentation R A
hfpB : FinitePresentation A B
⊢ FinitePresentation R B
[PROOFSTEP]
obtain ⟨n, I, e, hfg⟩ := iff.1 hfpB
[GOAL]
case intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hfpA : FinitePresentation R A
hfpB : FinitePresentation A B
n : ℕ
I : Ideal (MvPolynomial (Fin n) A)
e : (MvPolynomial (Fin n) A ⧸ I) ≃ₐ[A] B
hfg : Ideal.FG I
⊢ FinitePresentation R B
[PROOFSTEP]
exact equiv ((mvPolynomial_of_finitePresentation hfpA _).quotient hfg) (e.restrictScalars R)
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRB : FinitePresentation R B
hRA : FiniteType R A
⊢ FinitePresentation A B
[PROOFSTEP]
classical
obtain ⟨n, f, hf, s, hs⟩ := hRB
letI RX := MvPolynomial (Fin n) R
letI AX := MvPolynomial (Fin n) A
refine' ⟨n, MvPolynomial.aeval (f ∘ X), _, _⟩
· rw [← Algebra.range_top_iff_surjective, ← Algebra.adjoin_range_eq_range_aeval, Set.range_comp f MvPolynomial.X,
    eq_top_iff, ← @adjoin_adjoin_of_tower R A B, adjoin_image, adjoin_range_X, Algebra.map_top,
    (Algebra.range_top_iff_surjective _).mpr hf]
  exact fun {x} => subset_adjoin ⟨⟩
· obtain ⟨t, ht⟩ := hRA.out
  have := fun i : t => hf (algebraMap A B i)
  choose t' ht' using this
  have ht'' : Algebra.adjoin R (algebraMap A AX '' t ∪ Set.range (X : _ → AX)) = ⊤ :=
    by
    rw [adjoin_union_eq_adjoin_adjoin, ←
      Subalgebra.restrictScalars_top R (A := AX) (S := { x // x ∈ adjoin R ((algebraMap A AX) '' t) })]
    refine congrArg (Subalgebra.restrictScalars R) ?_
    congr 1
    rw [adjoin_algebraMap, ht]
    apply Subalgebra.restrictScalars_injective R
    rw [← adjoin_restrictScalars, adjoin_range_X, Subalgebra.restrictScalars_top, Subalgebra.restrictScalars_top]
  letI g : t → AX := fun x => MvPolynomial.C (x : A) - map (algebraMap R A) (t' x)
  refine' ⟨s.image (map (algebraMap R A)) ∪ t.attach.image g, _⟩
  rw [Finset.coe_union, Finset.coe_image, Finset.coe_image, Finset.attach_eq_univ, Finset.coe_univ, Set.image_univ]
  let s₀ := (MvPolynomial.map (algebraMap R A)) '' s ∪ Set.range g
  let I := RingHom.ker (MvPolynomial.aeval (R := A) (f ∘ MvPolynomial.X))
  change Ideal.span s₀ = I
  have leI :
    Ideal.span ((MvPolynomial.map (algebraMap R A)) '' s ∪ Set.range g) ≤
      RingHom.ker (MvPolynomial.aeval (R := A) (f ∘ MvPolynomial.X)) :=
    by
    rw [Ideal.span_le]
    rintro _ (⟨x, hx, rfl⟩ | ⟨⟨x, hx⟩, rfl⟩) <;> erw [RingHom.mem_ker]
    · rw [MvPolynomial.aeval_map_algebraMap (R := R) (A := A), ← aeval_unique]
      have := Ideal.subset_span hx
      rwa [hs] at this
    ·
      rw [map_sub, MvPolynomial.aeval_map_algebraMap, ← aeval_unique, MvPolynomial.aeval_C, ht', Subtype.coe_mk,
        sub_self]
  apply leI.antisymm
  intro x hx
  rw [RingHom.mem_ker] at hx
  let s₀ := (MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
  change x ∈ Ideal.span s₀
  have : x ∈ (MvPolynomial.map (algebraMap R A) : _ →+* AX).range.toAddSubmonoid ⊔ (Ideal.span s₀).toAddSubmonoid :=
    by
    have : x ∈ (⊤ : Subalgebra R AX) := trivial
    rw [← ht''] at this
    refine adjoin_induction this ?_ ?_ ?_ ?_
    · rintro _ (⟨x, hx, rfl⟩ | ⟨i, rfl⟩)
      · rw [algebraMap_eq, ← sub_add_cancel (MvPolynomial.C x) (map (algebraMap R A) (t' ⟨x, hx⟩)), add_comm]
        apply AddSubmonoid.add_mem_sup
        · exact Set.mem_range_self _
        · apply Ideal.subset_span
          apply Set.mem_union_right
          exact Set.mem_range_self _
      · apply AddSubmonoid.mem_sup_left
        exact ⟨X i, map_X _ _⟩
    · intro r
      apply AddSubmonoid.mem_sup_left
      exact ⟨C r, map_C _ _⟩
    · intro _ _ h₁ h₂
      exact add_mem h₁ h₂
    · intro x₁ x₂ h₁ h₂
      obtain ⟨_, ⟨p₁, rfl⟩, q₁, hq₁, rfl⟩ := AddSubmonoid.mem_sup.mp h₁
      obtain ⟨_, ⟨p₂, rfl⟩, q₂, hq₂, rfl⟩ := AddSubmonoid.mem_sup.mp h₂
      rw [add_mul, mul_add, add_assoc, ← map_mul]
      apply AddSubmonoid.add_mem_sup
      · exact Set.mem_range_self _
      · refine' add_mem (Ideal.mul_mem_left _ _ hq₂) (Ideal.mul_mem_right _ _ hq₁)
  obtain ⟨_, ⟨p, rfl⟩, q, hq, rfl⟩ := AddSubmonoid.mem_sup.mp this
  rw [map_add, aeval_map_algebraMap, ← aeval_unique, show MvPolynomial.aeval (f ∘ X) q = 0 from leI hq, add_zero] at hx
  suffices Ideal.span (s : Set RX) ≤ (Ideal.span s₀).comap (MvPolynomial.map <| algebraMap R A)
    by
    refine' add_mem _ hq
    rw [hs] at this
    exact this hx
  rw [Ideal.span_le]
  intro x hx
  apply Ideal.subset_span
  apply Set.mem_union_left
  exact Set.mem_image_of_mem _ hx
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRB : FinitePresentation R B
hRA : FiniteType R A
⊢ FinitePresentation A B
[PROOFSTEP]
obtain ⟨n, f, hf, s, hs⟩ := hRB
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
⊢ FinitePresentation A B
[PROOFSTEP]
letI RX := MvPolynomial (Fin n) R
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
⊢ FinitePresentation A B
[PROOFSTEP]
letI AX := MvPolynomial (Fin n) A
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
⊢ FinitePresentation A B
[PROOFSTEP]
refine' ⟨n, MvPolynomial.aeval (f ∘ X), _, _⟩
[GOAL]
case intro.intro.intro.intro.refine'_1
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
⊢ Surjective ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
[PROOFSTEP]
rw [← Algebra.range_top_iff_surjective, ← Algebra.adjoin_range_eq_range_aeval, Set.range_comp f MvPolynomial.X,
  eq_top_iff, ← @adjoin_adjoin_of_tower R A B, adjoin_image, adjoin_range_X, Algebra.map_top,
  (Algebra.range_top_iff_surjective _).mpr hf]
[GOAL]
case intro.intro.intro.intro.refine'_1
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
⊢ ∀ (x : B), x ∈ adjoin A ↑⊤
[PROOFSTEP]
exact fun {x} => subset_adjoin ⟨⟩
[GOAL]
case intro.intro.intro.intro.refine'_2
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
⊢ Ideal.FG (RingHom.ker ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)))
[PROOFSTEP]
obtain ⟨t, ht⟩ := hRA.out
[GOAL]
case intro.intro.intro.intro.refine'_2.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
⊢ Ideal.FG (RingHom.ker ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)))
[PROOFSTEP]
have := fun i : t => hf (algebraMap A B i)
[GOAL]
case intro.intro.intro.intro.refine'_2.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
this : ∀ (i : { x // x ∈ t }), ∃ a, ↑f a = ↑(algebraMap A B) ↑i
⊢ Ideal.FG (RingHom.ker ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)))
[PROOFSTEP]
choose t' ht' using this
[GOAL]
case intro.intro.intro.intro.refine'_2.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
⊢ Ideal.FG (RingHom.ker ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)))
[PROOFSTEP]
have ht'' : Algebra.adjoin R (algebraMap A AX '' t ∪ Set.range (X : _ → AX)) = ⊤ :=
  by
  rw [adjoin_union_eq_adjoin_adjoin, ←
    Subalgebra.restrictScalars_top R (A := AX) (S := { x // x ∈ adjoin R ((algebraMap A AX) '' t) })]
  refine congrArg (Subalgebra.restrictScalars R) ?_
  congr 1
  rw [adjoin_algebraMap, ht]
  apply Subalgebra.restrictScalars_injective R
  rw [← adjoin_restrictScalars, adjoin_range_X, Subalgebra.restrictScalars_top, Subalgebra.restrictScalars_top]
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
⊢ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
[PROOFSTEP]
rw [adjoin_union_eq_adjoin_adjoin, ←
  Subalgebra.restrictScalars_top R (A := AX) (S := { x // x ∈ adjoin R ((algebraMap A AX) '' t) })]
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
⊢ Subalgebra.restrictScalars R (adjoin { x // x ∈ adjoin R (↑(algebraMap A AX) '' ↑t) } (Set.range MvPolynomial.X)) =
    Subalgebra.restrictScalars R ⊤
[PROOFSTEP]
refine congrArg (Subalgebra.restrictScalars R) ?_
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
⊢ adjoin { x // x ∈ adjoin R (↑(algebraMap A AX) '' ↑t) } (Set.range MvPolynomial.X) = ⊤
[PROOFSTEP]
congr 1
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
⊢ adjoin { x // x ∈ adjoin R (↑(algebraMap A AX) '' ↑t) } (Set.range MvPolynomial.X) = ⊤
[PROOFSTEP]
rw [adjoin_algebraMap, ht]
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
⊢ adjoin { x // x ∈ Subalgebra.map (IsScalarTower.toAlgHom R A AX) ⊤ } (Set.range MvPolynomial.X) = ⊤
[PROOFSTEP]
apply Subalgebra.restrictScalars_injective R
[GOAL]
case a
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
⊢ Subalgebra.restrictScalars R
      (adjoin { x // x ∈ Subalgebra.map (IsScalarTower.toAlgHom R A AX) ⊤ } (Set.range MvPolynomial.X)) =
    Subalgebra.restrictScalars R ⊤
[PROOFSTEP]
rw [← adjoin_restrictScalars, adjoin_range_X, Subalgebra.restrictScalars_top, Subalgebra.restrictScalars_top]
[GOAL]
case intro.intro.intro.intro.refine'_2.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
⊢ Ideal.FG (RingHom.ker ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)))
[PROOFSTEP]
letI g : t → AX := fun x => MvPolynomial.C (x : A) - map (algebraMap R A) (t' x)
[GOAL]
case intro.intro.intro.intro.refine'_2.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
⊢ Ideal.FG (RingHom.ker ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)))
[PROOFSTEP]
refine' ⟨s.image (map (algebraMap R A)) ∪ t.attach.image g, _⟩
[GOAL]
case intro.intro.intro.intro.refine'_2.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
⊢ Ideal.span ↑(Finset.image (↑(MvPolynomial.map (algebraMap R A))) s ∪ Finset.image g (Finset.attach t)) =
    RingHom.ker ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
[PROOFSTEP]
rw [Finset.coe_union, Finset.coe_image, Finset.coe_image, Finset.attach_eq_univ, Finset.coe_univ, Set.image_univ]
[GOAL]
case intro.intro.intro.intro.refine'_2.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
⊢ Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) =
    RingHom.ker ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
[PROOFSTEP]
let s₀ := (MvPolynomial.map (algebraMap R A)) '' s ∪ Set.range g
[GOAL]
case intro.intro.intro.intro.refine'_2.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
⊢ Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) =
    RingHom.ker ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
[PROOFSTEP]
let I := RingHom.ker (MvPolynomial.aeval (R := A) (f ∘ MvPolynomial.X))
[GOAL]
case intro.intro.intro.intro.refine'_2.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
⊢ Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) =
    RingHom.ker ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
[PROOFSTEP]
change Ideal.span s₀ = I
[GOAL]
case intro.intro.intro.intro.refine'_2.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
⊢ Ideal.span s₀ = I
[PROOFSTEP]
have leI :
  Ideal.span ((MvPolynomial.map (algebraMap R A)) '' s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (R := A) (f ∘ MvPolynomial.X)) :=
  by
  rw [Ideal.span_le]
  rintro _ (⟨x, hx, rfl⟩ | ⟨⟨x, hx⟩, rfl⟩) <;> erw [RingHom.mem_ker]
  · rw [MvPolynomial.aeval_map_algebraMap (R := R) (A := A), ← aeval_unique]
    have := Ideal.subset_span hx
    rwa [hs] at this
  · rw [map_sub, MvPolynomial.aeval_map_algebraMap, ← aeval_unique, MvPolynomial.aeval_C, ht', Subtype.coe_mk, sub_self]
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
⊢ Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
[PROOFSTEP]
rw [Ideal.span_le]
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
⊢ ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g ⊆ ↑(RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X)))
[PROOFSTEP]
rintro _ (⟨x, hx, rfl⟩ | ⟨⟨x, hx⟩, rfl⟩)
[GOAL]
case inl.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) R
hx : x ∈ ↑s
⊢ ↑(MvPolynomial.map (algebraMap R A)) x ∈ ↑(RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X)))
[PROOFSTEP]
erw [RingHom.mem_ker]
[GOAL]
case inr.intro.mk
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : A
hx : x ∈ t
⊢ g { val := x, property := hx } ∈ ↑(RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X)))
[PROOFSTEP]
erw [RingHom.mem_ker]
[GOAL]
case inl.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) R
hx : x ∈ ↑s
⊢ ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) (↑(MvPolynomial.map (algebraMap R A)) x) = 0
[PROOFSTEP]
rw [MvPolynomial.aeval_map_algebraMap (R := R) (A := A), ← aeval_unique]
[GOAL]
case inl.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) R
hx : x ∈ ↑s
⊢ ↑f x = 0
[PROOFSTEP]
have := Ideal.subset_span hx
[GOAL]
case inl.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) R
hx : x ∈ ↑s
this : x ∈ ↑(Ideal.span ↑s)
⊢ ↑f x = 0
[PROOFSTEP]
rwa [hs] at this
[GOAL]
case inr.intro.mk
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : A
hx : x ∈ t
⊢ ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) (g { val := x, property := hx }) = 0
[PROOFSTEP]
rw [map_sub, MvPolynomial.aeval_map_algebraMap, ← aeval_unique, MvPolynomial.aeval_C, ht', Subtype.coe_mk, sub_self]
[GOAL]
case intro.intro.intro.intro.refine'_2.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
⊢ Ideal.span s₀ = I
[PROOFSTEP]
apply leI.antisymm
[GOAL]
case intro.intro.intro.intro.refine'_2.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
⊢ RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) ≤
    Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g)
[PROOFSTEP]
intro x hx
[GOAL]
case intro.intro.intro.intro.refine'_2.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : x ∈ RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
⊢ x ∈ Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g)
[PROOFSTEP]
rw [RingHom.mem_ker] at hx
[GOAL]
case intro.intro.intro.intro.refine'_2.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
⊢ x ∈ Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g)
[PROOFSTEP]
let s₀ := (MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
[GOAL]
case intro.intro.intro.intro.refine'_2.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
⊢ x ∈ Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g)
[PROOFSTEP]
change x ∈ Ideal.span s₀
[GOAL]
case intro.intro.intro.intro.refine'_2.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
⊢ x ∈ Ideal.span s₀
[PROOFSTEP]
have : x ∈ (MvPolynomial.map (algebraMap R A) : _ →+* AX).range.toAddSubmonoid ⊔ (Ideal.span s₀).toAddSubmonoid :=
  by
  have : x ∈ (⊤ : Subalgebra R AX) := trivial
  rw [← ht''] at this
  refine adjoin_induction this ?_ ?_ ?_ ?_
  · rintro _ (⟨x, hx, rfl⟩ | ⟨i, rfl⟩)
    · rw [algebraMap_eq, ← sub_add_cancel (MvPolynomial.C x) (map (algebraMap R A) (t' ⟨x, hx⟩)), add_comm]
      apply AddSubmonoid.add_mem_sup
      · exact Set.mem_range_self _
      · apply Ideal.subset_span
        apply Set.mem_union_right
        exact Set.mem_range_self _
    · apply AddSubmonoid.mem_sup_left
      exact ⟨X i, map_X _ _⟩
  · intro r
    apply AddSubmonoid.mem_sup_left
    exact ⟨C r, map_C _ _⟩
  · intro _ _ h₁ h₂
    exact add_mem h₁ h₂
  · intro x₁ x₂ h₁ h₂
    obtain ⟨_, ⟨p₁, rfl⟩, q₁, hq₁, rfl⟩ := AddSubmonoid.mem_sup.mp h₁
    obtain ⟨_, ⟨p₂, rfl⟩, q₂, hq₂, rfl⟩ := AddSubmonoid.mem_sup.mp h₂
    rw [add_mul, mul_add, add_assoc, ← map_mul]
    apply AddSubmonoid.add_mem_sup
    · exact Set.mem_range_self _
    · refine' add_mem (Ideal.mul_mem_left _ _ hq₂) (Ideal.mul_mem_right _ _ hq₁)
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
⊢ x ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
[PROOFSTEP]
have : x ∈ (⊤ : Subalgebra R AX) := trivial
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x ∈ ⊤
⊢ x ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
[PROOFSTEP]
rw [← ht''] at this
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
⊢ x ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
[PROOFSTEP]
refine adjoin_induction this ?_ ?_ ?_ ?_
[GOAL]
case refine_1
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
⊢ ∀ (x : MvPolynomial (Fin n) A),
    x ∈ ↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X →
      x ∈
        Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
          (Ideal.span s₀).toAddSubmonoid
[PROOFSTEP]
rintro _ (⟨x, hx, rfl⟩ | ⟨i, rfl⟩)
[GOAL]
case refine_1.inl.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x✝ : MvPolynomial (Fin n) A
hx✝ : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x✝ = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x✝ ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
x : A
hx : x ∈ ↑t
⊢ ↑(algebraMap A AX) x ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
[PROOFSTEP]
rw [algebraMap_eq, ← sub_add_cancel (MvPolynomial.C x) (map (algebraMap R A) (t' ⟨x, hx⟩)), add_comm]
[GOAL]
case refine_1.inl.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x✝ : MvPolynomial (Fin n) A
hx✝ : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x✝ = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x✝ ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
x : A
hx : x ∈ ↑t
⊢ ↑(MvPolynomial.map (algebraMap R A)) (t' { val := x, property := hx }) +
      (↑MvPolynomial.C x - ↑(MvPolynomial.map (algebraMap R A)) (t' { val := x, property := hx })) ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
[PROOFSTEP]
apply AddSubmonoid.add_mem_sup
[GOAL]
case refine_1.inl.intro.intro.hx
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x✝ : MvPolynomial (Fin n) A
hx✝ : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x✝ = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x✝ ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
x : A
hx : x ∈ ↑t
⊢ ↑(MvPolynomial.map (algebraMap R A)) (t' { val := x, property := hx }) ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring
[PROOFSTEP]
exact Set.mem_range_self _
[GOAL]
case refine_1.inl.intro.intro.hy
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x✝ : MvPolynomial (Fin n) A
hx✝ : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x✝ = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x✝ ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
x : A
hx : x ∈ ↑t
⊢ ↑MvPolynomial.C x - ↑(MvPolynomial.map (algebraMap R A)) (t' { val := x, property := hx }) ∈
    (Ideal.span s₀).toAddSubmonoid
[PROOFSTEP]
apply Ideal.subset_span
[GOAL]
case refine_1.inl.intro.intro.hy.a
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x✝ : MvPolynomial (Fin n) A
hx✝ : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x✝ = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x✝ ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
x : A
hx : x ∈ ↑t
⊢ ↑MvPolynomial.C x - ↑(MvPolynomial.map (algebraMap R A)) (t' { val := x, property := hx }) ∈ s₀
[PROOFSTEP]
apply Set.mem_union_right
[GOAL]
case refine_1.inl.intro.intro.hy.a.a
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x✝ : MvPolynomial (Fin n) A
hx✝ : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x✝ = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x✝ ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
x : A
hx : x ∈ ↑t
⊢ ↑MvPolynomial.C x - ↑(MvPolynomial.map (algebraMap R A)) (t' { val := x, property := hx }) ∈ Set.range g
[PROOFSTEP]
exact Set.mem_range_self _
[GOAL]
case refine_1.inr.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
i : Fin n
⊢ MvPolynomial.X i ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
[PROOFSTEP]
apply AddSubmonoid.mem_sup_left
[GOAL]
case refine_1.inr.intro.a
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
i : Fin n
⊢ MvPolynomial.X i ∈ Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring
[PROOFSTEP]
exact ⟨X i, map_X _ _⟩
[GOAL]
case refine_2
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
⊢ ∀ (r : R),
    ↑(algebraMap R (MvPolynomial (Fin n) A)) r ∈
      Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
        (Ideal.span s₀).toAddSubmonoid
[PROOFSTEP]
intro r
[GOAL]
case refine_2
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
r : R
⊢ ↑(algebraMap R (MvPolynomial (Fin n) A)) r ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
[PROOFSTEP]
apply AddSubmonoid.mem_sup_left
[GOAL]
case refine_2.a
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
r : R
⊢ ↑(algebraMap R (MvPolynomial (Fin n) A)) r ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring
[PROOFSTEP]
exact ⟨C r, map_C _ _⟩
[GOAL]
case refine_3
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
⊢ ∀ (x y : MvPolynomial (Fin n) A),
    x ∈
        Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
          (Ideal.span s₀).toAddSubmonoid →
      y ∈
          Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
            (Ideal.span s₀).toAddSubmonoid →
        x + y ∈
          Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
            (Ideal.span s₀).toAddSubmonoid
[PROOFSTEP]
intro _ _ h₁ h₂
[GOAL]
case refine_3
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
x✝ y✝ : MvPolynomial (Fin n) A
h₁ :
  x✝ ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
h₂ :
  y✝ ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
⊢ x✝ + y✝ ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
[PROOFSTEP]
exact add_mem h₁ h₂
[GOAL]
case refine_4
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
⊢ ∀ (x y : MvPolynomial (Fin n) A),
    x ∈
        Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
          (Ideal.span s₀).toAddSubmonoid →
      y ∈
          Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
            (Ideal.span s₀).toAddSubmonoid →
        x * y ∈
          Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
            (Ideal.span s₀).toAddSubmonoid
[PROOFSTEP]
intro x₁ x₂ h₁ h₂
[GOAL]
case refine_4
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
x₁ x₂ : MvPolynomial (Fin n) A
h₁ :
  x₁ ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
h₂ :
  x₂ ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
⊢ x₁ * x₂ ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
[PROOFSTEP]
obtain ⟨_, ⟨p₁, rfl⟩, q₁, hq₁, rfl⟩ := AddSubmonoid.mem_sup.mp h₁
[GOAL]
case refine_4.intro.intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
x₂ : MvPolynomial (Fin n) A
h₂ :
  x₂ ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
p₁ : MvPolynomial (Fin n) R
q₁ : MvPolynomial (Fin n) A
hq₁ : q₁ ∈ (Ideal.span s₀).toAddSubmonoid
h₁ :
  ↑(MvPolynomial.map (algebraMap R A)) p₁ + q₁ ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
⊢ (↑(MvPolynomial.map (algebraMap R A)) p₁ + q₁) * x₂ ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
[PROOFSTEP]
obtain ⟨_, ⟨p₂, rfl⟩, q₂, hq₂, rfl⟩ := AddSubmonoid.mem_sup.mp h₂
[GOAL]
case refine_4.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
p₁ : MvPolynomial (Fin n) R
q₁ : MvPolynomial (Fin n) A
hq₁ : q₁ ∈ (Ideal.span s₀).toAddSubmonoid
h₁ :
  ↑(MvPolynomial.map (algebraMap R A)) p₁ + q₁ ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
p₂ : MvPolynomial (Fin n) R
q₂ : MvPolynomial (Fin n) A
hq₂ : q₂ ∈ (Ideal.span s₀).toAddSubmonoid
h₂ :
  ↑(MvPolynomial.map (algebraMap R A)) p₂ + q₂ ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
⊢ (↑(MvPolynomial.map (algebraMap R A)) p₁ + q₁) * (↑(MvPolynomial.map (algebraMap R A)) p₂ + q₂) ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
[PROOFSTEP]
rw [add_mul, mul_add, add_assoc, ← map_mul]
[GOAL]
case refine_4.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
p₁ : MvPolynomial (Fin n) R
q₁ : MvPolynomial (Fin n) A
hq₁ : q₁ ∈ (Ideal.span s₀).toAddSubmonoid
h₁ :
  ↑(MvPolynomial.map (algebraMap R A)) p₁ + q₁ ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
p₂ : MvPolynomial (Fin n) R
q₂ : MvPolynomial (Fin n) A
hq₂ : q₂ ∈ (Ideal.span s₀).toAddSubmonoid
h₂ :
  ↑(MvPolynomial.map (algebraMap R A)) p₂ + q₂ ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
⊢ ↑(MvPolynomial.map (algebraMap R A)) (p₁ * p₂) +
      (↑(MvPolynomial.map (algebraMap R A)) p₁ * q₂ + q₁ * (↑(MvPolynomial.map (algebraMap R A)) p₂ + q₂)) ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
[PROOFSTEP]
apply AddSubmonoid.add_mem_sup
[GOAL]
case refine_4.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro.hx
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
p₁ : MvPolynomial (Fin n) R
q₁ : MvPolynomial (Fin n) A
hq₁ : q₁ ∈ (Ideal.span s₀).toAddSubmonoid
h₁ :
  ↑(MvPolynomial.map (algebraMap R A)) p₁ + q₁ ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
p₂ : MvPolynomial (Fin n) R
q₂ : MvPolynomial (Fin n) A
hq₂ : q₂ ∈ (Ideal.span s₀).toAddSubmonoid
h₂ :
  ↑(MvPolynomial.map (algebraMap R A)) p₂ + q₂ ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
⊢ ↑(MvPolynomial.map (algebraMap R A)) (p₁ * p₂) ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring
[PROOFSTEP]
exact Set.mem_range_self _
[GOAL]
case refine_4.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro.hy
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this : x ∈ adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X)
p₁ : MvPolynomial (Fin n) R
q₁ : MvPolynomial (Fin n) A
hq₁ : q₁ ∈ (Ideal.span s₀).toAddSubmonoid
h₁ :
  ↑(MvPolynomial.map (algebraMap R A)) p₁ + q₁ ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
p₂ : MvPolynomial (Fin n) R
q₂ : MvPolynomial (Fin n) A
hq₂ : q₂ ∈ (Ideal.span s₀).toAddSubmonoid
h₂ :
  ↑(MvPolynomial.map (algebraMap R A)) p₂ + q₂ ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
⊢ ↑(MvPolynomial.map (algebraMap R A)) p₁ * q₂ + q₁ * (↑(MvPolynomial.map (algebraMap R A)) p₂ + q₂) ∈
    (Ideal.span s₀).toAddSubmonoid
[PROOFSTEP]
refine' add_mem (Ideal.mul_mem_left _ _ hq₂) (Ideal.mul_mem_right _ _ hq₁)
[GOAL]
case intro.intro.intro.intro.refine'_2.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
x : MvPolynomial (Fin n) A
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) x = 0
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
this :
  x ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
⊢ x ∈ Ideal.span s₀
[PROOFSTEP]
obtain ⟨_, ⟨p, rfl⟩, q, hq, rfl⟩ := AddSubmonoid.mem_sup.mp this
[GOAL]
case intro.intro.intro.intro.refine'_2.intro.intro.intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
p : MvPolynomial (Fin n) R
q : MvPolynomial (Fin n) A
hq : q ∈ (Ideal.span s₀).toAddSubmonoid
hx : ↑(MvPolynomial.aeval (↑f ∘ MvPolynomial.X)) (↑(MvPolynomial.map (algebraMap R A)) p + q) = 0
this :
  ↑(MvPolynomial.map (algebraMap R A)) p + q ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
⊢ ↑(MvPolynomial.map (algebraMap R A)) p + q ∈ Ideal.span s₀
[PROOFSTEP]
rw [map_add, aeval_map_algebraMap, ← aeval_unique, show MvPolynomial.aeval (f ∘ X) q = 0 from leI hq, add_zero] at hx
[GOAL]
case intro.intro.intro.intro.refine'_2.intro.intro.intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
p : MvPolynomial (Fin n) R
q : MvPolynomial (Fin n) A
hq : q ∈ (Ideal.span s₀).toAddSubmonoid
hx : ↑f p = 0
this :
  ↑(MvPolynomial.map (algebraMap R A)) p + q ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
⊢ ↑(MvPolynomial.map (algebraMap R A)) p + q ∈ Ideal.span s₀
[PROOFSTEP]
suffices Ideal.span (s : Set RX) ≤ (Ideal.span s₀).comap (MvPolynomial.map <| algebraMap R A)
  by
  refine' add_mem _ hq
  rw [hs] at this
  exact this hx
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
p : MvPolynomial (Fin n) R
q : MvPolynomial (Fin n) A
hq : q ∈ (Ideal.span s₀).toAddSubmonoid
hx : ↑f p = 0
this✝ :
  ↑(MvPolynomial.map (algebraMap R A)) p + q ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
this : Ideal.span ↑s ≤ Ideal.comap (MvPolynomial.map (algebraMap R A)) (Ideal.span s₀)
⊢ ↑(MvPolynomial.map (algebraMap R A)) p + q ∈ Ideal.span s₀
[PROOFSTEP]
refine' add_mem _ hq
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
p : MvPolynomial (Fin n) R
q : MvPolynomial (Fin n) A
hq : q ∈ (Ideal.span s₀).toAddSubmonoid
hx : ↑f p = 0
this✝ :
  ↑(MvPolynomial.map (algebraMap R A)) p + q ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
this : Ideal.span ↑s ≤ Ideal.comap (MvPolynomial.map (algebraMap R A)) (Ideal.span s₀)
⊢ ↑(MvPolynomial.map (algebraMap R A)) p ∈ Ideal.span s₀
[PROOFSTEP]
rw [hs] at this
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
p : MvPolynomial (Fin n) R
q : MvPolynomial (Fin n) A
hq : q ∈ (Ideal.span s₀).toAddSubmonoid
hx : ↑f p = 0
this✝ :
  ↑(MvPolynomial.map (algebraMap R A)) p + q ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
this : RingHom.ker ↑f ≤ Ideal.comap (MvPolynomial.map (algebraMap R A)) (Ideal.span s₀)
⊢ ↑(MvPolynomial.map (algebraMap R A)) p ∈ Ideal.span s₀
[PROOFSTEP]
exact this hx
[GOAL]
case intro.intro.intro.intro.refine'_2.intro.intro.intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
p : MvPolynomial (Fin n) R
q : MvPolynomial (Fin n) A
hq : q ∈ (Ideal.span s₀).toAddSubmonoid
hx : ↑f p = 0
this :
  ↑(MvPolynomial.map (algebraMap R A)) p + q ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
⊢ Ideal.span ↑s ≤ Ideal.comap (MvPolynomial.map (algebraMap R A)) (Ideal.span s₀)
[PROOFSTEP]
rw [Ideal.span_le]
[GOAL]
case intro.intro.intro.intro.refine'_2.intro.intro.intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
p : MvPolynomial (Fin n) R
q : MvPolynomial (Fin n) A
hq : q ∈ (Ideal.span s₀).toAddSubmonoid
hx : ↑f p = 0
this :
  ↑(MvPolynomial.map (algebraMap R A)) p + q ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
⊢ ↑s ⊆ ↑(Ideal.comap (MvPolynomial.map (algebraMap R A)) (Ideal.span s₀))
[PROOFSTEP]
intro x hx
[GOAL]
case intro.intro.intro.intro.refine'_2.intro.intro.intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
p : MvPolynomial (Fin n) R
q : MvPolynomial (Fin n) A
hq : q ∈ (Ideal.span s₀).toAddSubmonoid
hx✝ : ↑f p = 0
this :
  ↑(MvPolynomial.map (algebraMap R A)) p + q ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
x : MvPolynomial (Fin n) R
hx : x ∈ ↑s
⊢ x ∈ ↑(Ideal.comap (MvPolynomial.map (algebraMap R A)) (Ideal.span s₀))
[PROOFSTEP]
apply Ideal.subset_span
[GOAL]
case intro.intro.intro.intro.refine'_2.intro.intro.intro.intro.intro.intro.a
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
p : MvPolynomial (Fin n) R
q : MvPolynomial (Fin n) A
hq : q ∈ (Ideal.span s₀).toAddSubmonoid
hx✝ : ↑f p = 0
this :
  ↑(MvPolynomial.map (algebraMap R A)) p + q ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
x : MvPolynomial (Fin n) R
hx : x ∈ ↑s
⊢ ↑(MvPolynomial.map (algebraMap R A)) x ∈ s₀
[PROOFSTEP]
apply Set.mem_union_left
[GOAL]
case intro.intro.intro.intro.refine'_2.intro.intro.intro.intro.intro.intro.a.a
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
hRA : FiniteType R A
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] B
hf : Surjective ↑f
s : Finset (MvPolynomial (Fin n) R)
hs : Ideal.span ↑s = RingHom.ker ↑f
RX : Type w₁ := MvPolynomial (Fin n) R
AX : Type w₂ := MvPolynomial (Fin n) A
t : Finset A
ht : adjoin R ↑t = ⊤
t' : { x // x ∈ t } → MvPolynomial (Fin n) R
ht' : ∀ (i : { x // x ∈ t }), ↑f (t' i) = ↑(algebraMap A B) ↑i
ht'' : adjoin R (↑(algebraMap A AX) '' ↑t ∪ Set.range MvPolynomial.X) = ⊤
g : { x // x ∈ t } → AX := fun x => ↑MvPolynomial.C ↑x - ↑(MvPolynomial.map (algebraMap R A)) (t' x)
s₀✝ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
I : Ideal (MvPolynomial (Fin n) A) := RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
leI :
  Ideal.span (↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g) ≤
    RingHom.ker (MvPolynomial.aeval (↑f ∘ MvPolynomial.X))
s₀ : Set (MvPolynomial (Fin n) A) := ↑(MvPolynomial.map (algebraMap R A)) '' ↑s ∪ Set.range g
p : MvPolynomial (Fin n) R
q : MvPolynomial (Fin n) A
hq : q ∈ (Ideal.span s₀).toAddSubmonoid
hx✝ : ↑f p = 0
this :
  ↑(MvPolynomial.map (algebraMap R A)) p + q ∈
    Subsemiring.toAddSubmonoid (RingHom.range (MvPolynomial.map (algebraMap R A))).toSubsemiring ⊔
      (Ideal.span s₀).toAddSubmonoid
x : MvPolynomial (Fin n) R
hx : x ∈ ↑s
⊢ ↑(MvPolynomial.map (algebraMap R A)) x ∈ ↑(MvPolynomial.map (algebraMap R A)) '' ↑s
[PROOFSTEP]
exact Set.mem_image_of_mem _ hx
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
hfp : FinitePresentation R A
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
classical
obtain ⟨m, f', hf', s, hs⟩ := hfp
let RXn := MvPolynomial (Fin n) R
let RXm := MvPolynomial (Fin m) R
have := fun i : Fin n => hf' (f <| X i)
choose g hg using this
have := fun i : Fin m => hf (f' <| X i)
choose h hh using this
let aeval_h : RXm →ₐ[R] RXn := aeval h
let g' : Fin n → RXn := fun i => X i - aeval_h (g i)
refine' ⟨Finset.univ.image g' ∪ s.image aeval_h, _⟩
simp only [Finset.coe_image, Finset.coe_union, Finset.coe_univ, Set.image_univ]
have hh' : ∀ x, f (aeval_h x) = f' x := by
  intro x
  rw [← f.coe_toRingHom, map_aeval]
  simp_rw [AlgHom.coe_toRingHom, hh]
  rw [AlgHom.comp_algebraMap, ← aeval_eq_eval₂Hom,
    -- Porting note: added line below← funext fun i => Function.comp_apply (f := ↑f') (g := MvPolynomial.X), ←
    aeval_unique]
let s' := Set.range g' ∪ aeval_h '' s
have leI : Ideal.span s' ≤ RingHom.ker f.toRingHom :=
  by
  rw [Ideal.span_le]
  rintro _ (⟨i, rfl⟩ | ⟨x, hx, rfl⟩)
  · change f (g' i) = 0
    rw [map_sub, ← hg, hh', sub_self]
  · change f (aeval_h x) = 0
    rw [hh']
    change x ∈ RingHom.ker f'.toRingHom
    rw [← hs]
    exact Ideal.subset_span hx
apply leI.antisymm
intro x hx
have : x ∈ aeval_h.range.toAddSubmonoid ⊔ (Ideal.span s').toAddSubmonoid :=
  by
  have : x ∈ adjoin R (Set.range X : Set RXn) := by
    rw [adjoin_range_X]
    trivial
  refine adjoin_induction this ?_ ?_ ?_ ?_
  · rintro _ ⟨i, rfl⟩
    rw [← sub_add_cancel (X i) (aeval h (g i)), add_comm]
    apply AddSubmonoid.add_mem_sup
    · exact Set.mem_range_self _
    · apply Submodule.subset_span
      apply Set.mem_union_left
      exact Set.mem_range_self _
  · intro r
    apply AddSubmonoid.mem_sup_left
    exact ⟨C r, aeval_C _ _⟩
  · intro _ _ h₁ h₂
    exact add_mem h₁ h₂
  · intro p₁ p₂ h₁ h₂
    obtain ⟨_, ⟨x₁, rfl⟩, y₁, hy₁, rfl⟩ := AddSubmonoid.mem_sup.mp h₁
    obtain ⟨_, ⟨x₂, rfl⟩, y₂, hy₂, rfl⟩ := AddSubmonoid.mem_sup.mp h₂
    rw [mul_add, add_mul, add_assoc, ← map_mul]
    apply AddSubmonoid.add_mem_sup
    · exact Set.mem_range_self _
    · exact add_mem (Ideal.mul_mem_right _ _ hy₁) (Ideal.mul_mem_left _ _ hy₂)
obtain ⟨_, ⟨x, rfl⟩, y, hy, rfl⟩ := AddSubmonoid.mem_sup.mp this
refine' add_mem _ hy
simp only [RingHom.mem_ker, AlgHom.toRingHom_eq_coe, AlgHom.coe_toRingHom, map_add, show f y = 0 from leI hy, add_zero,
  hh'] at hx
suffices Ideal.span (s : Set RXm) ≤ (Ideal.span s').comap aeval_h
  by
  apply this
  rwa [hs]
rw [Ideal.span_le]
intro x hx
apply Submodule.subset_span
apply Set.mem_union_right
exact Set.mem_image_of_mem _ hx
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
hfp : FinitePresentation R A
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
obtain ⟨m, f', hf', s, hs⟩ := hfp
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
let RXn := MvPolynomial (Fin n) R
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
let RXm := MvPolynomial (Fin m) R
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
have := fun i : Fin n => hf' (f <| X i)
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
this : ∀ (i : Fin n), ∃ a, ↑f' a = ↑f (MvPolynomial.X i)
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
choose g hg using this
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
have := fun i : Fin m => hf (f' <| X i)
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
this : ∀ (i : Fin m), ∃ a, ↑f a = ↑f' (MvPolynomial.X i)
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
choose h hh using this
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
let aeval_h : RXm →ₐ[R] RXn := aeval h
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
let g' : Fin n → RXn := fun i => X i - aeval_h (g i)
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
refine' ⟨Finset.univ.image g' ∪ s.image aeval_h, _⟩
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
⊢ Ideal.span ↑(Finset.image g' Finset.univ ∪ Finset.image (↑aeval_h) s) = RingHom.ker ↑f
[PROOFSTEP]
simp only [Finset.coe_image, Finset.coe_union, Finset.coe_univ, Set.image_univ]
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
⊢ Ideal.span ((Set.range fun i => MvPolynomial.X i - ↑(MvPolynomial.aeval h) (g i)) ∪ ↑(MvPolynomial.aeval h) '' ↑s) =
    RingHom.ker ↑f
[PROOFSTEP]
have hh' : ∀ x, f (aeval_h x) = f' x := by
  intro x
  rw [← f.coe_toRingHom, map_aeval]
  simp_rw [AlgHom.coe_toRingHom, hh]
  rw [AlgHom.comp_algebraMap, ← aeval_eq_eval₂Hom,
    -- Porting note: added line below← funext fun i => Function.comp_apply (f := ↑f') (g := MvPolynomial.X), ←
    aeval_unique]
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
⊢ ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
[PROOFSTEP]
intro x
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
x : RXm
⊢ ↑f (↑aeval_h x) = ↑f' x
[PROOFSTEP]
rw [← f.coe_toRingHom, map_aeval]
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
x : RXm
⊢ ↑(eval₂Hom (RingHom.comp (↑f) (algebraMap R (MvPolynomial (Fin n) R))) fun i => ↑↑f (h i)) x = ↑f' x
[PROOFSTEP]
simp_rw [AlgHom.coe_toRingHom, hh]
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
x : RXm
⊢ ↑(eval₂Hom (RingHom.comp (↑f) (algebraMap R (MvPolynomial (Fin n) R))) fun i => ↑f' (MvPolynomial.X i)) x = ↑f' x
[PROOFSTEP]
rw [AlgHom.comp_algebraMap, ← aeval_eq_eval₂Hom,
  -- Porting note: added line below← funext fun i => Function.comp_apply (f := ↑f') (g := MvPolynomial.X), ←
  aeval_unique]
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
⊢ Ideal.span ((Set.range fun i => MvPolynomial.X i - ↑(MvPolynomial.aeval h) (g i)) ∪ ↑(MvPolynomial.aeval h) '' ↑s) =
    RingHom.ker ↑f
[PROOFSTEP]
let s' := Set.range g' ∪ aeval_h '' s
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
⊢ Ideal.span ((Set.range fun i => MvPolynomial.X i - ↑(MvPolynomial.aeval h) (g i)) ∪ ↑(MvPolynomial.aeval h) '' ↑s) =
    RingHom.ker ↑f
[PROOFSTEP]
have leI : Ideal.span s' ≤ RingHom.ker f.toRingHom :=
  by
  rw [Ideal.span_le]
  rintro _ (⟨i, rfl⟩ | ⟨x, hx, rfl⟩)
  · change f (g' i) = 0
    rw [map_sub, ← hg, hh', sub_self]
  · change f (aeval_h x) = 0
    rw [hh']
    change x ∈ RingHom.ker f'.toRingHom
    rw [← hs]
    exact Ideal.subset_span hx
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
⊢ Ideal.span s' ≤ RingHom.ker ↑f
[PROOFSTEP]
rw [Ideal.span_le]
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
⊢ s' ⊆ ↑(RingHom.ker ↑f)
[PROOFSTEP]
rintro _ (⟨i, rfl⟩ | ⟨x, hx, rfl⟩)
[GOAL]
case inl.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
i : Fin n
⊢ g' i ∈ ↑(RingHom.ker ↑f)
[PROOFSTEP]
change f (g' i) = 0
[GOAL]
case inl.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
i : Fin n
⊢ ↑f (g' i) = 0
[PROOFSTEP]
rw [map_sub, ← hg, hh', sub_self]
[GOAL]
case inr.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
x : RXm
hx : x ∈ ↑s
⊢ ↑aeval_h x ∈ ↑(RingHom.ker ↑f)
[PROOFSTEP]
change f (aeval_h x) = 0
[GOAL]
case inr.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
x : RXm
hx : x ∈ ↑s
⊢ ↑f (↑aeval_h x) = 0
[PROOFSTEP]
rw [hh']
[GOAL]
case inr.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
x : RXm
hx : x ∈ ↑s
⊢ ↑f' x = 0
[PROOFSTEP]
change x ∈ RingHom.ker f'.toRingHom
[GOAL]
case inr.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
x : RXm
hx : x ∈ ↑s
⊢ x ∈ RingHom.ker ↑f'
[PROOFSTEP]
rw [← hs]
[GOAL]
case inr.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
x : RXm
hx : x ∈ ↑s
⊢ x ∈ Ideal.span ↑s
[PROOFSTEP]
exact Ideal.subset_span hx
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
⊢ Ideal.span ((Set.range fun i => MvPolynomial.X i - ↑(MvPolynomial.aeval h) (g i)) ∪ ↑(MvPolynomial.aeval h) '' ↑s) =
    RingHom.ker ↑f
[PROOFSTEP]
apply leI.antisymm
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
⊢ RingHom.ker ↑f ≤ Ideal.span s'
[PROOFSTEP]
intro x hx
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
⊢ x ∈ Ideal.span s'
[PROOFSTEP]
have : x ∈ aeval_h.range.toAddSubmonoid ⊔ (Ideal.span s').toAddSubmonoid :=
  by
  have : x ∈ adjoin R (Set.range X : Set RXn) := by
    rw [adjoin_range_X]
    trivial
  refine adjoin_induction this ?_ ?_ ?_ ?_
  · rintro _ ⟨i, rfl⟩
    rw [← sub_add_cancel (X i) (aeval h (g i)), add_comm]
    apply AddSubmonoid.add_mem_sup
    · exact Set.mem_range_self _
    · apply Submodule.subset_span
      apply Set.mem_union_left
      exact Set.mem_range_self _
  · intro r
    apply AddSubmonoid.mem_sup_left
    exact ⟨C r, aeval_C _ _⟩
  · intro _ _ h₁ h₂
    exact add_mem h₁ h₂
  · intro p₁ p₂ h₁ h₂
    obtain ⟨_, ⟨x₁, rfl⟩, y₁, hy₁, rfl⟩ := AddSubmonoid.mem_sup.mp h₁
    obtain ⟨_, ⟨x₂, rfl⟩, y₂, hy₂, rfl⟩ := AddSubmonoid.mem_sup.mp h₂
    rw [mul_add, add_mul, add_assoc, ← map_mul]
    apply AddSubmonoid.add_mem_sup
    · exact Set.mem_range_self _
    · exact add_mem (Ideal.mul_mem_right _ _ hy₁) (Ideal.mul_mem_left _ _ hy₂)
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
⊢ x ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
[PROOFSTEP]
have : x ∈ adjoin R (Set.range X : Set RXn) := by
  rw [adjoin_range_X]
  trivial
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
⊢ x ∈ adjoin R (Set.range MvPolynomial.X)
[PROOFSTEP]
rw [adjoin_range_X]
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
⊢ x ∈ ⊤
[PROOFSTEP]
trivial
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
⊢ x ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
[PROOFSTEP]
refine adjoin_induction this ?_ ?_ ?_ ?_
[GOAL]
case refine_1
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
⊢ ∀ (x : RXn),
    x ∈ Set.range MvPolynomial.X → x ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
[PROOFSTEP]
rintro _ ⟨i, rfl⟩
[GOAL]
case refine_1.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
i : Fin n
⊢ MvPolynomial.X i ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
[PROOFSTEP]
rw [← sub_add_cancel (X i) (aeval h (g i)), add_comm]
[GOAL]
case refine_1.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
i : Fin n
⊢ ↑(MvPolynomial.aeval h) (g i) + (MvPolynomial.X i - ↑(MvPolynomial.aeval h) (g i)) ∈
    Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
[PROOFSTEP]
apply AddSubmonoid.add_mem_sup
[GOAL]
case refine_1.intro.hx
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
i : Fin n
⊢ ↑(MvPolynomial.aeval h) (g i) ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h)
[PROOFSTEP]
exact Set.mem_range_self _
[GOAL]
case refine_1.intro.hy
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
i : Fin n
⊢ MvPolynomial.X i - ↑(MvPolynomial.aeval h) (g i) ∈ (Ideal.span s').toAddSubmonoid
[PROOFSTEP]
apply Submodule.subset_span
[GOAL]
case refine_1.intro.hy.a
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
i : Fin n
⊢ MvPolynomial.X i - ↑(MvPolynomial.aeval h) (g i) ∈ s'
[PROOFSTEP]
apply Set.mem_union_left
[GOAL]
case refine_1.intro.hy.a.a
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
i : Fin n
⊢ MvPolynomial.X i - ↑(MvPolynomial.aeval h) (g i) ∈ Set.range g'
[PROOFSTEP]
exact Set.mem_range_self _
[GOAL]
case refine_2
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
⊢ ∀ (r : R), ↑(algebraMap R RXn) r ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
[PROOFSTEP]
intro r
[GOAL]
case refine_2
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
r : R
⊢ ↑(algebraMap R RXn) r ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
[PROOFSTEP]
apply AddSubmonoid.mem_sup_left
[GOAL]
case refine_2.a
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
r : R
⊢ ↑(algebraMap R RXn) r ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h)
[PROOFSTEP]
exact ⟨C r, aeval_C _ _⟩
[GOAL]
case refine_3
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
⊢ ∀ (x y : RXn),
    x ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid →
      y ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid →
        x + y ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
[PROOFSTEP]
intro _ _ h₁ h₂
[GOAL]
case refine_3
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
x✝ y✝ : RXn
h₁ : x✝ ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
h₂ : y✝ ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
⊢ x✝ + y✝ ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
[PROOFSTEP]
exact add_mem h₁ h₂
[GOAL]
case refine_4
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
⊢ ∀ (x y : RXn),
    x ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid →
      y ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid →
        x * y ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
[PROOFSTEP]
intro p₁ p₂ h₁ h₂
[GOAL]
case refine_4
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
p₁ p₂ : RXn
h₁ : p₁ ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
h₂ : p₂ ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
⊢ p₁ * p₂ ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
[PROOFSTEP]
obtain ⟨_, ⟨x₁, rfl⟩, y₁, hy₁, rfl⟩ := AddSubmonoid.mem_sup.mp h₁
[GOAL]
case refine_4.intro.intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
p₂ : RXn
h₂ : p₂ ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
x₁ : RXm
y₁ : RXn
hy₁ : y₁ ∈ (Ideal.span s').toAddSubmonoid
h₁ : ↑↑aeval_h x₁ + y₁ ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
⊢ (↑↑aeval_h x₁ + y₁) * p₂ ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
[PROOFSTEP]
obtain ⟨_, ⟨x₂, rfl⟩, y₂, hy₂, rfl⟩ := AddSubmonoid.mem_sup.mp h₂
[GOAL]
case refine_4.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
x₁ : RXm
y₁ : RXn
hy₁ : y₁ ∈ (Ideal.span s').toAddSubmonoid
h₁ : ↑↑aeval_h x₁ + y₁ ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
x₂ : RXm
y₂ : RXn
hy₂ : y₂ ∈ (Ideal.span s').toAddSubmonoid
h₂ : ↑↑aeval_h x₂ + y₂ ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
⊢ (↑↑aeval_h x₁ + y₁) * (↑↑aeval_h x₂ + y₂) ∈
    Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
[PROOFSTEP]
rw [mul_add, add_mul, add_assoc, ← map_mul]
[GOAL]
case refine_4.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
x₁ : RXm
y₁ : RXn
hy₁ : y₁ ∈ (Ideal.span s').toAddSubmonoid
h₁ : ↑↑aeval_h x₁ + y₁ ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
x₂ : RXm
y₂ : RXn
hy₂ : y₂ ∈ (Ideal.span s').toAddSubmonoid
h₂ : ↑↑aeval_h x₂ + y₂ ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
⊢ ↑↑aeval_h (x₁ * x₂) + (y₁ * ↑↑aeval_h x₂ + (↑↑aeval_h x₁ + y₁) * y₂) ∈
    Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
[PROOFSTEP]
apply AddSubmonoid.add_mem_sup
[GOAL]
case refine_4.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro.hx
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
x₁ : RXm
y₁ : RXn
hy₁ : y₁ ∈ (Ideal.span s').toAddSubmonoid
h₁ : ↑↑aeval_h x₁ + y₁ ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
x₂ : RXm
y₂ : RXn
hy₂ : y₂ ∈ (Ideal.span s').toAddSubmonoid
h₂ : ↑↑aeval_h x₂ + y₂ ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
⊢ ↑↑aeval_h (x₁ * x₂) ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h)
[PROOFSTEP]
exact Set.mem_range_self _
[GOAL]
case refine_4.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro.hy
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ adjoin R (Set.range MvPolynomial.X)
x₁ : RXm
y₁ : RXn
hy₁ : y₁ ∈ (Ideal.span s').toAddSubmonoid
h₁ : ↑↑aeval_h x₁ + y₁ ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
x₂ : RXm
y₂ : RXn
hy₂ : y₂ ∈ (Ideal.span s').toAddSubmonoid
h₂ : ↑↑aeval_h x₂ + y₂ ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
⊢ y₁ * ↑↑aeval_h x₂ + (↑↑aeval_h x₁ + y₁) * y₂ ∈ (Ideal.span s').toAddSubmonoid
[PROOFSTEP]
exact add_mem (Ideal.mul_mem_right _ _ hy₁) (Ideal.mul_mem_left _ _ hy₂)
[GOAL]
case intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXn
hx : x ∈ RingHom.ker ↑f
this : x ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
⊢ x ∈ Ideal.span s'
[PROOFSTEP]
obtain ⟨_, ⟨x, rfl⟩, y, hy, rfl⟩ := AddSubmonoid.mem_sup.mp this
[GOAL]
case intro.intro.intro.intro.intro.intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXm
y : RXn
hy : y ∈ (Ideal.span s').toAddSubmonoid
hx : ↑↑aeval_h x + y ∈ RingHom.ker ↑f
this : ↑↑aeval_h x + y ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
⊢ ↑↑aeval_h x + y ∈ Ideal.span s'
[PROOFSTEP]
refine' add_mem _ hy
[GOAL]
case intro.intro.intro.intro.intro.intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXm
y : RXn
hy : y ∈ (Ideal.span s').toAddSubmonoid
hx : ↑↑aeval_h x + y ∈ RingHom.ker ↑f
this : ↑↑aeval_h x + y ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
⊢ ↑↑aeval_h x ∈ Ideal.span s'
[PROOFSTEP]
simp only [RingHom.mem_ker, AlgHom.toRingHom_eq_coe, AlgHom.coe_toRingHom, map_add, show f y = 0 from leI hy, add_zero,
  hh'] at hx
[GOAL]
case intro.intro.intro.intro.intro.intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXm
y : RXn
hy : y ∈ (Ideal.span s').toAddSubmonoid
this : ↑↑aeval_h x + y ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
hx : ↑f' x = 0
⊢ ↑↑aeval_h x ∈ Ideal.span s'
[PROOFSTEP]
suffices Ideal.span (s : Set RXm) ≤ (Ideal.span s').comap aeval_h
  by
  apply this
  rwa [hs]
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXm
y : RXn
hy : y ∈ (Ideal.span s').toAddSubmonoid
this✝ : ↑↑aeval_h x + y ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
hx : ↑f' x = 0
this : Ideal.span ↑s ≤ Ideal.comap aeval_h (Ideal.span s')
⊢ ↑↑aeval_h x ∈ Ideal.span s'
[PROOFSTEP]
apply this
[GOAL]
case a
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXm
y : RXn
hy : y ∈ (Ideal.span s').toAddSubmonoid
this✝ : ↑↑aeval_h x + y ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
hx : ↑f' x = 0
this : Ideal.span ↑s ≤ Ideal.comap aeval_h (Ideal.span s')
⊢ x ∈ Ideal.span ↑s
[PROOFSTEP]
rwa [hs]
[GOAL]
case intro.intro.intro.intro.intro.intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXm
y : RXn
hy : y ∈ (Ideal.span s').toAddSubmonoid
this : ↑↑aeval_h x + y ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
hx : ↑f' x = 0
⊢ Ideal.span ↑s ≤ Ideal.comap aeval_h (Ideal.span s')
[PROOFSTEP]
rw [Ideal.span_le]
[GOAL]
case intro.intro.intro.intro.intro.intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x : RXm
y : RXn
hy : y ∈ (Ideal.span s').toAddSubmonoid
this : ↑↑aeval_h x + y ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
hx : ↑f' x = 0
⊢ ↑s ⊆ ↑(Ideal.comap aeval_h (Ideal.span s'))
[PROOFSTEP]
intro x hx
[GOAL]
case intro.intro.intro.intro.intro.intro.intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x✝ : RXm
y : RXn
hy : y ∈ (Ideal.span s').toAddSubmonoid
this : ↑↑aeval_h x✝ + y ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
hx✝ : ↑f' x✝ = 0
x : MvPolynomial (Fin m) R
hx : x ∈ ↑s
⊢ x ∈ ↑(Ideal.comap aeval_h (Ideal.span s'))
[PROOFSTEP]
apply Submodule.subset_span
[GOAL]
case intro.intro.intro.intro.intro.intro.intro.intro.intro.a
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x✝ : RXm
y : RXn
hy : y ∈ (Ideal.span s').toAddSubmonoid
this : ↑↑aeval_h x✝ + y ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
hx✝ : ↑f' x✝ = 0
x : MvPolynomial (Fin m) R
hx : x ∈ ↑s
⊢ ↑aeval_h x ∈ s'
[PROOFSTEP]
apply Set.mem_union_right
[GOAL]
case intro.intro.intro.intro.intro.intro.intro.intro.intro.a.a
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
n : ℕ
f : MvPolynomial (Fin n) R →ₐ[R] A
hf : Surjective ↑f
m : ℕ
f' : MvPolynomial (Fin m) R →ₐ[R] A
hf' : Surjective ↑f'
s : Finset (MvPolynomial (Fin m) R)
hs : Ideal.span ↑s = RingHom.ker ↑f'
RXn : Type w₁ := MvPolynomial (Fin n) R
RXm : Type w₁ := MvPolynomial (Fin m) R
g : Fin n → MvPolynomial (Fin m) R
hg : ∀ (i : Fin n), ↑f' (g i) = ↑f (MvPolynomial.X i)
h : Fin m → MvPolynomial (Fin n) R
hh : ∀ (i : Fin m), ↑f (h i) = ↑f' (MvPolynomial.X i)
aeval_h : RXm →ₐ[R] RXn := MvPolynomial.aeval h
g' : Fin n → RXn := fun i => MvPolynomial.X i - ↑aeval_h (g i)
hh' : ∀ (x : RXm), ↑f (↑aeval_h x) = ↑f' x
s' : Set RXn := Set.range g' ∪ ↑aeval_h '' ↑s
leI : Ideal.span s' ≤ RingHom.ker ↑f
x✝ : RXm
y : RXn
hy : y ∈ (Ideal.span s').toAddSubmonoid
this : ↑↑aeval_h x✝ + y ∈ Subalgebra.toAddSubmonoid (AlgHom.range aeval_h) ⊔ (Ideal.span s').toAddSubmonoid
hx✝ : ↑f' x✝ = 0
x : MvPolynomial (Fin m) R
hx : x ∈ ↑s
⊢ ↑aeval_h x ∈ ↑aeval_h '' ↑s
[PROOFSTEP]
exact Set.mem_image_of_mem _ hx
[GOAL]
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
f : A →ₐ[R] B
hf : Surjective ↑f
hRA : FinitePresentation R A
hRB : FinitePresentation R B
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
obtain ⟨n, g, hg, _⟩ := hRA
[GOAL]
case intro.intro.intro
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
f : A →ₐ[R] B
hf : Surjective ↑f
hRB : FinitePresentation R B
n : ℕ
g : MvPolynomial (Fin n) R →ₐ[R] A
hg : Surjective ↑g
right✝ : Ideal.FG (RingHom.ker ↑g)
⊢ Ideal.FG (RingHom.ker ↑f)
[PROOFSTEP]
convert (ker_fg_of_mvPolynomial (f.comp g) (hf.comp hg) hRB).map g.toRingHom
[GOAL]
case h.e'_3
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
f : A →ₐ[R] B
hf : Surjective ↑f
hRB : FinitePresentation R B
n : ℕ
g : MvPolynomial (Fin n) R →ₐ[R] A
hg : Surjective ↑g
right✝ : Ideal.FG (RingHom.ker ↑g)
⊢ RingHom.ker ↑f = Ideal.map (↑g) (RingHom.ker ↑(AlgHom.comp f g))
[PROOFSTEP]
simp_rw [RingHom.ker_eq_comap_bot, AlgHom.toRingHom_eq_coe, AlgHom.comp_toRingHom]
[GOAL]
case h.e'_3
R : Type w₁
A : Type w₂
B : Type w₃
inst✝⁴ : CommRing R
inst✝³ : CommRing A
inst✝² : Algebra R A
inst✝¹ : CommRing B
inst✝ : Algebra R B
f : A →ₐ[R] B
hf : Surjective ↑f
hRB : FinitePresentation R B
n : ℕ
g : MvPolynomial (Fin n) R →ₐ[R] A
hg : Surjective ↑g
right✝ : Ideal.FG (RingHom.ker ↑g)
⊢ Ideal.comap ↑f ⊥ = Ideal.map (↑g) (Ideal.comap (RingHom.comp ↑f ↑g) ⊥)
[PROOFSTEP]
rw [← Ideal.comap_comap, Ideal.map_comap_of_surjective (g : MvPolynomial (Fin n) R →+* A) hg]
[GOAL]
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
f : A →+* B
hf : Surjective ↑f
hker : Ideal.FG (ker f)
⊢ FinitePresentation f
[PROOFSTEP]
rw [← f.comp_id]
[GOAL]
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
f : A →+* B
hf : Surjective ↑f
hker : Ideal.FG (ker f)
⊢ FinitePresentation (comp f (RingHom.id A))
[PROOFSTEP]
exact (id A).comp_surjective hf hker
[GOAL]
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
g : B →+* C
f : A →+* B
hg : FinitePresentation g
hf : FinitePresentation f
ins1 : Algebra A B := toAlgebra f
ins2 : Algebra B C := toAlgebra g
ins3 : Algebra A C := toAlgebra (RingHom.comp g f)
a : A
b : B
c : C
⊢ (a • b) • c = a • b • c
[PROOFSTEP]
simp [Algebra.smul_def, mul_assoc]
[GOAL]
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
g : B →+* C
f : A →+* B
hg : FinitePresentation g
hf : FinitePresentation f
ins1 : Algebra A B := toAlgebra f
ins2 : Algebra B C := toAlgebra g
ins3 : Algebra A C := toAlgebra (RingHom.comp g f)
a : A
b : B
c : C
⊢ ↑(algebraMap B C) (↑(algebraMap A B) a) * (↑(algebraMap B C) b * c) = ↑(algebraMap A C) a * (↑(algebraMap B C) b * c)
[PROOFSTEP]
rfl
[GOAL]
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
f : A →+* B
g : B →+* C
hg : FinitePresentation (RingHom.comp g f)
hf : FiniteType f
ins1 : Algebra A B := toAlgebra f
ins2 : Algebra B C := toAlgebra g
ins3 : Algebra A C := toAlgebra (RingHom.comp g f)
a : A
b : B
c : C
⊢ (a • b) • c = a • b • c
[PROOFSTEP]
simp [Algebra.smul_def, mul_assoc]
[GOAL]
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
f : A →+* B
g : B →+* C
hg : FinitePresentation (RingHom.comp g f)
hf : FiniteType f
ins1 : Algebra A B := toAlgebra f
ins2 : Algebra B C := toAlgebra g
ins3 : Algebra A C := toAlgebra (RingHom.comp g f)
a : A
b : B
c : C
⊢ ↑(algebraMap B C) (↑(algebraMap A B) a) * (↑(algebraMap B C) b * c) = ↑(algebraMap A C) a * (↑(algebraMap B C) b * c)
[PROOFSTEP]
rfl
[GOAL]
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : CommRing C
inst✝² : Algebra R A
inst✝¹ : Algebra R B
inst✝ : Algebra R C
f : A →ₐ[R] B
hf : Surjective ↑f
hker : Ideal.FG (RingHom.ker ↑f)
⊢ FinitePresentation f
[PROOFSTEP]
convert RingHom.FinitePresentation.of_surjective f hf hker