Theorem: ax_grothendieck_of_locally_finite
File: Mathlib/FieldTheory/AxGrothendieck.lean

tactic: classical
  intro v
  cases nonempty_fintype ι
  
  let s : Finset R :=
    (Finset.biUnion (univ : Finset ι) fun i => (ps i).support.image fun x => coeff x (ps i)) ∪
      (univ : Finset ι).image v
  have hv : ∀ i, v i ∈ Algebra.adjoin K (s : Set R) := fun j =>
    Algebra.subset_adjoin (mem_union_right _ (mem_image.2 ⟨j, mem_univ _, rfl⟩))
  have hs₁ : ∀ (i : ι) (k : ι →₀ ℕ),
      k ∈ (ps i).support → coeff k (ps i) ∈ Algebra.adjoin K (s : Set R) :=
    fun i k hk => Algebra.subset_adjoin
      (mem_union_left _ (mem_biUnion.2 ⟨i, mem_univ _, mem_image_of_mem _ hk⟩))
  letI := isNoetherian_adjoin_finset s fun x _ => Algebra.IsIntegral.isIntegral (R := K) x
  letI := Module.IsNoetherian.finite K (Algebra.adjoin K (s : Set R))
  letI : Finite (Algebra.adjoin K (s : Set R)) :=
    FiniteDimensional.finite_of_finite K (Algebra.adjoin K (s : Set R))
  let res : (ι → Algebra.adjoin K (s : Set R)) → ι → Algebra.adjoin K (s : Set R) := fun x i =>
    ⟨eval (fun j : ι => (x j : R)) (ps i), eval_mem (hs₁ _) fun i => (x i).2⟩
  have hres_inj : Injective res := by
    intro x y hxy
    ext i
    simp only [Subtype.ext_iff, funext_iff] at hxy
    exact congr_fun (hinj (funext hxy)) i
  have hres_surj : Surjective res := Finite.injective_iff_surjective.1 hres_inj
  cases' hres_surj fun i => ⟨v i, hv i⟩ with w hw
  use fun i => w i
  simpa only [Subtype.ext_iff, funext_iff] using hw
state_before: ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
⊢ Surjective fun v i => (MvPolynomial.eval v) (ps i)
state_after: no goals

tactic: intro v
state_before: ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
⊢ Surjective fun v i => (MvPolynomial.eval v) (ps i)
state_after: ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v

tactic: cases nonempty_fintype ι
state_before: ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v
state_after: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v

tactic: let s : Finset R :=
  (Finset.biUnion (univ : Finset ι) fun i => (ps i).support.image fun x => coeff x (ps i)) ∪
    (univ : Finset ι).image v
state_before: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v
state_after: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v

tactic: have hv : ∀ i, v i ∈ Algebra.adjoin K (s : Set R) := fun j =>
  Algebra.subset_adjoin (mem_union_right _ (mem_image.2 ⟨j, mem_univ _, rfl⟩))
state_before: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v
state_after: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v

tactic: have hs₁ : ∀ (i : ι) (k : ι →₀ ℕ),
    k ∈ (ps i).support → coeff k (ps i) ∈ Algebra.adjoin K (s : Set R) :=
  fun i k hk => Algebra.subset_adjoin
    (mem_union_left _ (mem_biUnion.2 ⟨i, mem_univ _, mem_image_of_mem _ hk⟩))
state_before: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v
state_after: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v

tactic: letI := isNoetherian_adjoin_finset s fun x _ => Algebra.IsIntegral.isIntegral (R := K) x
state_before: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v
state_after: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v

tactic: letI := Module.IsNoetherian.finite K (Algebra.adjoin K (s : Set R))
state_before: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v
state_after: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v

tactic: letI : Finite (Algebra.adjoin K (s : Set R)) :=
  FiniteDimensional.finite_of_finite K (Algebra.adjoin K (s : Set R))
state_before: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v
state_after: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v

tactic: let res : (ι → Algebra.adjoin K (s : Set R)) → ι → Algebra.adjoin K (s : Set R) := fun x i =>
  ⟨eval (fun j : ι => (x j : R)) (ps i), eval_mem (hs₁ _) fun i => (x i).2⟩
state_before: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v
state_after: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
res : (ι → ↥(Algebra.adjoin K ↑s)) → ι → ↥(Algebra.adjoin K ↑s) :=
  fun x i => ⟨(MvPolynomial.eval fun j => ↑(x j)) (ps i), ⋯⟩
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v

tactic: have hres_inj : Injective res := by
  intro x y hxy
  ext i
  simp only [Subtype.ext_iff, funext_iff] at hxy
  exact congr_fun (hinj (funext hxy)) i
state_before: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
res : (ι → ↥(Algebra.adjoin K ↑s)) → ι → ↥(Algebra.adjoin K ↑s) :=
  fun x i => ⟨(MvPolynomial.eval fun j => ↑(x j)) (ps i), ⋯⟩
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v
state_after: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
res : (ι → ↥(Algebra.adjoin K ↑s)) → ι → ↥(Algebra.adjoin K ↑s) :=
  fun x i => ⟨(MvPolynomial.eval fun j => ↑(x j)) (ps i), ⋯⟩
hres_inj : Injective res
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v

tactic: have hres_surj : Surjective res := Finite.injective_iff_surjective.1 hres_inj
state_before: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
res : (ι → ↥(Algebra.adjoin K ↑s)) → ι → ↥(Algebra.adjoin K ↑s) :=
  fun x i => ⟨(MvPolynomial.eval fun j => ↑(x j)) (ps i), ⋯⟩
hres_inj : Injective res
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v
state_after: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
res : (ι → ↥(Algebra.adjoin K ↑s)) → ι → ↥(Algebra.adjoin K ↑s) :=
  fun x i => ⟨(MvPolynomial.eval fun j => ↑(x j)) (ps i), ⋯⟩
hres_inj : Injective res
hres_surj : Surjective res
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v

tactic: cases' hres_surj fun i => ⟨v i, hv i⟩ with w hw
state_before: case intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
res : (ι → ↥(Algebra.adjoin K ↑s)) → ι → ↥(Algebra.adjoin K ↑s) :=
  fun x i => ⟨(MvPolynomial.eval fun j => ↑(x j)) (ps i), ⋯⟩
hres_inj : Injective res
hres_surj : Surjective res
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v
state_after: case intro.intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
res : (ι → ↥(Algebra.adjoin K ↑s)) → ι → ↥(Algebra.adjoin K ↑s) :=
  fun x i => ⟨(MvPolynomial.eval fun j => ↑(x j)) (ps i), ⋯⟩
hres_inj : Injective res
hres_surj : Surjective res
w : ι → ↥(Algebra.adjoin K ↑s)
hw : res w = fun i => ⟨v i, ⋯⟩
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v

tactic: use fun i => w i
state_before: case intro.intro
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
res : (ι → ↥(Algebra.adjoin K ↑s)) → ι → ↥(Algebra.adjoin K ↑s) :=
  fun x i => ⟨(MvPolynomial.eval fun j => ↑(x j)) (ps i), ⋯⟩
hres_inj : Injective res
hres_surj : Surjective res
w : ι → ↥(Algebra.adjoin K ↑s)
hw : res w = fun i => ⟨v i, ⋯⟩
⊢ ∃ a, (fun v i => (MvPolynomial.eval v) (ps i)) a = v
state_after: case h
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
res : (ι → ↥(Algebra.adjoin K ↑s)) → ι → ↥(Algebra.adjoin K ↑s) :=
  fun x i => ⟨(MvPolynomial.eval fun j => ↑(x j)) (ps i), ⋯⟩
hres_inj : Injective res
hres_surj : Surjective res
w : ι → ↥(Algebra.adjoin K ↑s)
hw : res w = fun i => ⟨v i, ⋯⟩
⊢ ((fun v i => (MvPolynomial.eval v) (ps i)) fun i => ↑(w i)) = v

tactic: simpa only [Subtype.ext_iff, funext_iff] using hw
state_before: case h
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
res : (ι → ↥(Algebra.adjoin K ↑s)) → ι → ↥(Algebra.adjoin K ↑s) :=
  fun x i => ⟨(MvPolynomial.eval fun j => ↑(x j)) (ps i), ⋯⟩
hres_inj : Injective res
hres_surj : Surjective res
w : ι → ↥(Algebra.adjoin K ↑s)
hw : res w = fun i => ⟨v i, ⋯⟩
⊢ ((fun v i => (MvPolynomial.eval v) (ps i)) fun i => ↑(w i)) = v
state_after: no goals

tactic: intro x y hxy
state_before: ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
res : (ι → ↥(Algebra.adjoin K ↑s)) → ι → ↥(Algebra.adjoin K ↑s) :=
  fun x i => ⟨(MvPolynomial.eval fun j => ↑(x j)) (ps i), ⋯⟩
⊢ Injective res
state_after: ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
res : (ι → ↥(Algebra.adjoin K ↑s)) → ι → ↥(Algebra.adjoin K ↑s) :=
  fun x i => ⟨(MvPolynomial.eval fun j => ↑(x j)) (ps i), ⋯⟩
x y : ι → ↥(Algebra.adjoin K ↑s)
hxy : res x = res y
⊢ x = y

tactic: ext i
state_before: ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
res : (ι → ↥(Algebra.adjoin K ↑s)) → ι → ↥(Algebra.adjoin K ↑s) :=
  fun x i => ⟨(MvPolynomial.eval fun j => ↑(x j)) (ps i), ⋯⟩
x y : ι → ↥(Algebra.adjoin K ↑s)
hxy : res x = res y
⊢ x = y
state_after: case h.a
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
res : (ι → ↥(Algebra.adjoin K ↑s)) → ι → ↥(Algebra.adjoin K ↑s) :=
  fun x i => ⟨(MvPolynomial.eval fun j => ↑(x j)) (ps i), ⋯⟩
x y : ι → ↥(Algebra.adjoin K ↑s)
hxy : res x = res y
i : ι
⊢ ↑(x i) = ↑(y i)

tactic: simp only [Subtype.ext_iff, funext_iff] at hxy
state_before: case h.a
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
res : (ι → ↥(Algebra.adjoin K ↑s)) → ι → ↥(Algebra.adjoin K ↑s) :=
  fun x i => ⟨(MvPolynomial.eval fun j => ↑(x j)) (ps i), ⋯⟩
x y : ι → ↥(Algebra.adjoin K ↑s)
hxy : res x = res y
i : ι
⊢ ↑(x i) = ↑(y i)
state_after: case h.a
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
res : (ι → ↥(Algebra.adjoin K ↑s)) → ι → ↥(Algebra.adjoin K ↑s) :=
  fun x i => ⟨(MvPolynomial.eval fun j => ↑(x j)) (ps i), ⋯⟩
x y : ι → ↥(Algebra.adjoin K ↑s)
i : ι
hxy : ∀ (a : ι), (MvPolynomial.eval fun j => ↑(x j)) (ps a) = (MvPolynomial.eval fun j => ↑(y j)) (ps a)
⊢ ↑(x i) = ↑(y i)

tactic: exact congr_fun (hinj (funext hxy)) i
state_before: case h.a
ι : Type u_1
K : Type u_2
R : Type u_3
inst✝⁵ : Field K
inst✝⁴ : Finite K
inst✝³ : CommRing R
inst✝² : Finite ι
inst✝¹ : Algebra K R
inst✝ : Algebra.IsAlgebraic K R
ps : ι → MvPolynomial ι R
hinj : Injective fun v i => (MvPolynomial.eval v) (ps i)
v : ι → R
val✝ : Fintype ι
s : Finset R := (univ.biUnion fun i => image (fun x => coeff x (ps i)) (ps i).support) ∪ image v univ
hv : ∀ (i : ι), v i ∈ Algebra.adjoin K ↑s
hs₁ : ∀ (i : ι), ∀ k ∈ (ps i).support, coeff k (ps i) ∈ Algebra.adjoin K ↑s
this✝¹ : IsNoetherian K ↥(Algebra.adjoin K ↑s) :=
  isNoetherian_adjoin_finset s fun x x_1 => Algebra.IsIntegral.isIntegral x
this✝ : Module.Finite K ↥(Algebra.adjoin K ↑s) := Module.IsNoetherian.finite K ↥(Algebra.adjoin K ↑s)
this : Finite ↥(Algebra.adjoin K ↑s) := FiniteDimensional.finite_of_finite K ↥(Algebra.adjoin K ↑s)
res : (ι → ↥(Algebra.adjoin K ↑s)) → ι → ↥(Algebra.adjoin K ↑s) :=
  fun x i => ⟨(MvPolynomial.eval fun j => ↑(x j)) (ps i), ⋯⟩
x y : ι → ↥(Algebra.adjoin K ↑s)
i : ι
hxy : ∀ (a : ι), (MvPolynomial.eval fun j => ↑(x j)) (ps a) = (MvPolynomial.eval fun j => ↑(y j)) (ps a)
⊢ ↑(x i) = ↑(y i)
state_after: no goals