-- Mathlib/RingTheory/Nullstellensatz.lean
theorem isMaximal_iff_eq_vanishingIdeal_singleton (I : Ideal (MvPolynomial σ k)) :
    I.IsMaximal ↔ ∃ x : σ → k, I = vanishingIdeal {x}

Proof state:
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
⊢ I.IsMaximal ↔ ∃ x, I = vanishingIdeal {x}

Tactic:
cases nonempty_fintype σ

Result:
case intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
val✝ : Fintype σ
⊢ I.IsMaximal ↔ ∃ x, I = vanishingIdeal {x}

Proof state:
case intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
val✝ : Fintype σ
hI : I.IsMaximal
this : I.IsMaximal := hI
⊢ ∃ x, I = vanishingIdeal {x}

Tactic:
letI : Field (MvPolynomial σ k ⧸ I) := Quotient.field I

Result:
case intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
val✝ : Fintype σ
hI : I.IsMaximal
this✝ : I.IsMaximal := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
⊢ ∃ x, I = vanishingIdeal {x}

Proof state:
case intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
val✝ : Fintype σ
⊢ I.IsMaximal ↔ ∃ x, I = vanishingIdeal {x}

Tactic:
refine
  ⟨fun hI => ?_, fun h =>
    let ⟨x, hx⟩ := h
    hx.symm ▸ MvPolynomial.vanishingIdeal_singleton_isMaximal⟩

Result:
case intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
val✝ : Fintype σ
hI : I.IsMaximal
⊢ ∃ x, I = vanishingIdeal {x}

Proof state:
case intro.intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
val✝ : Fintype σ
hI : I.IsMaximal
this✝ : I.IsMaximal := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
hϕ : Function.Bijective ⇑ϕ
φ : MvPolynomial σ k ⧸ I → k
hφ : Function.RightInverse φ ⇑ϕ
x : σ → k := fun s => φ ((Ideal.Quotient.mk I) (X s))
hx : ∀ (s : σ), ϕ (x s) = (Ideal.Quotient.mk I) (X s)
p : MvPolynomial σ k
hp : p ∈ vanishingIdeal {x}
⊢ ∑ d ∈ p.support, ((Ideal.Quotient.mk I).comp C) (coeff d p) * ∏ i : σ, (Ideal.Quotient.mk I) (X i) ^ d i = 0

Tactic:
rw [mem_vanishingIdeal_singleton_iff, eval_eq'] at hp

Result:
case intro.intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
val✝ : Fintype σ
hI : I.IsMaximal
this✝ : I.IsMaximal := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
hϕ : Function.Bijective ⇑ϕ
φ : MvPolynomial σ k ⧸ I → k
hφ : Function.RightInverse φ ⇑ϕ
x : σ → k := fun s => φ ((Ideal.Quotient.mk I) (X s))
hx : ∀ (s : σ), ϕ (x s) = (Ideal.Quotient.mk I) (X s)
p : MvPolynomial σ k
hp : ∑ d ∈ p.support, coeff d p * ∏ i : σ, x i ^ d i = 0
⊢ ∑ d ∈ p.support, ((Ideal.Quotient.mk I).comp C) (coeff d p) * ∏ i : σ, (Ideal.Quotient.mk I) (X i) ^ d i = 0

Proof state:
case intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
val✝ : Fintype σ
hI : I.IsMaximal
this✝ : I.IsMaximal := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
⊢ ∃ x, I = vanishingIdeal {x}

Tactic:
let ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C

Result:
case intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
val✝ : Fintype σ
hI : I.IsMaximal
this✝ : I.IsMaximal := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
⊢ ∃ x, I = vanishingIdeal {x}

Proof state:
case intro.intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
val✝ : Fintype σ
hI : I.IsMaximal
this✝ : I.IsMaximal := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
hϕ : Function.Bijective ⇑ϕ
φ : MvPolynomial σ k ⧸ I → k
hφ : Function.RightInverse φ ⇑ϕ
x : σ → k := fun s => φ ((Ideal.Quotient.mk I) (X s))
hx : ∀ (s : σ), ϕ (x s) = (Ideal.Quotient.mk I) (X s)
⊢ ∃ x, I = vanishingIdeal {x}

Tactic:
refine ⟨x, (IsMaximal.eq_of_le (by infer_instance) hI.ne_top ?_).symm⟩

Result:
case intro.intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
val✝ : Fintype σ
hI : I.IsMaximal
this✝ : I.IsMaximal := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
hϕ : Function.Bijective ⇑ϕ
φ : MvPolynomial σ k ⧸ I → k
hφ : Function.RightInverse φ ⇑ϕ
x : σ → k := fun s => φ ((Ideal.Quotient.mk I) (X s))
hx : ∀ (s : σ), ϕ (x s) = (Ideal.Quotient.mk I) (X s)
⊢ vanishingIdeal {x} ≤ I

Proof state:
case intro.intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
val✝ : Fintype σ
hI : I.IsMaximal
this✝ : I.IsMaximal := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
hϕ : Function.Bijective ⇑ϕ
φ : MvPolynomial σ k ⧸ I → k
hφ : Function.RightInverse φ ⇑ϕ
⊢ ∃ x, I = vanishingIdeal {x}

Tactic:
let x : σ → k := fun s => φ ((Ideal.Quotient.mk I) (X s))

Result:
case intro.intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
val✝ : Fintype σ
hI : I.IsMaximal
this✝ : I.IsMaximal := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
hϕ : Function.Bijective ⇑ϕ
φ : MvPolynomial σ k ⧸ I → k
hφ : Function.RightInverse φ ⇑ϕ
x : σ → k := fun s => φ ((Ideal.Quotient.mk I) (X s))
⊢ ∃ x, I = vanishingIdeal {x}

Proof state:
case intro.intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
val✝ : Fintype σ
hI : I.IsMaximal
this✝ : I.IsMaximal := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
hϕ : Function.Bijective ⇑ϕ
φ : MvPolynomial σ k ⧸ I → k
hφ : Function.RightInverse φ ⇑ϕ
x : σ → k := fun s => φ ((Ideal.Quotient.mk I) (X s))
hx : ∀ (s : σ), ϕ (x s) = (Ideal.Quotient.mk I) (X s)
⊢ vanishingIdeal {x} ≤ I

Tactic:
intro p hp

Result:
case intro.intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
val✝ : Fintype σ
hI : I.IsMaximal
this✝ : I.IsMaximal := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
hϕ : Function.Bijective ⇑ϕ
φ : MvPolynomial σ k ⧸ I → k
hφ : Function.RightInverse φ ⇑ϕ
x : σ → k := fun s => φ ((Ideal.Quotient.mk I) (X s))
hx : ∀ (s : σ), ϕ (x s) = (Ideal.Quotient.mk I) (X s)
p : MvPolynomial σ k
hp : p ∈ vanishingIdeal {x}
⊢ p ∈ I