l3lab/ntp-mathlib huggingface dataset:
theorem isMaximal_iff_eq_vanishingIdeal_singleton (I : Ideal (MvPolynomial σ k)) :
    I.IsMaximal ↔ ∃ x : σ → k, I = vanishingIdeal {x} := by
  cases nonempty_fintype σ
  refine'
    ⟨fun hI => _, fun h =>
      let ⟨x, hx⟩ := h
      hx.symm ▸ MvPolynomial.vanishingIdeal_singleton_isMaximal⟩
  letI : I.IsMaximal := hI
  letI : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
  let ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
  

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 : IsMaximal I
this✝ : IsMaximal I := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := RingHom.comp (Ideal.Quotient.mk I) C
⊢ ∃ x, I = vanishingIdeal {x}

Next tactic:
have hϕ : Function.Bijective ϕ :=
    ⟨quotient_mk_comp_C_injective _ _ I hI.ne_top,
      IsAlgClosed.algebraMap_surjective_of_isIntegral' ϕ
        (MvPolynomial.comp_C_integral_of_surjective_of_jacobson _ Quotient.mk_surjective)⟩
theorem isMaximal_iff_eq_vanishingIdeal_singleton (I : Ideal (MvPolynomial σ k)) :
    I.IsMaximal ↔ ∃ x : σ → k, I = vanishingIdeal {x} := by
  cases nonempty_fintype σ
  refine'
    ⟨fun hI => _, fun h =>
      let ⟨x, hx⟩ := h
      hx.symm ▸ MvPolynomial.vanishingIdeal_singleton_isMaximal⟩
  letI : I.IsMaximal := hI
  letI : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
  let ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
  have hϕ : Function.Bijective ϕ :=
    ⟨quotient_mk_comp_C_injective _ _ I hI.ne_top,
      IsAlgClosed.algebraMap_surjective_of_isIntegral' ϕ
        (MvPolynomial.comp_C_integral_of_surjective_of_jacobson _ Quotient.mk_surjective)⟩
  

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 : IsMaximal I
this✝ : IsMaximal I := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := RingHom.comp (Ideal.Quotient.mk I) C
hϕ : Function.Bijective ⇑ϕ
⊢ ∃ x, I = vanishingIdeal {x}

Next tactic:
obtain ⟨φ, hφ⟩ := Function.Surjective.hasRightInverse hϕ.2
theorem isMaximal_iff_eq_vanishingIdeal_singleton (I : Ideal (MvPolynomial σ k)) :
    I.IsMaximal ↔ ∃ x : σ → k, I = vanishingIdeal {x} := by
  cases nonempty_fintype σ
  refine'
    ⟨fun hI => _, fun h =>
      let ⟨x, hx⟩ := h
      hx.symm ▸ MvPolynomial.vanishingIdeal_singleton_isMaximal⟩
  letI : I.IsMaximal := hI
  letI : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
  let ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
  have hϕ : Function.Bijective ϕ :=
    ⟨quotient_mk_comp_C_injective _ _ I hI.ne_top,
      IsAlgClosed.algebraMap_surjective_of_isIntegral' ϕ
        (MvPolynomial.comp_C_integral_of_surjective_of_jacobson _ Quotient.mk_surjective)⟩
  obtain ⟨φ, hφ⟩ := Function.Surjective.hasRightInverse hϕ.2
  

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 : IsMaximal I
this✝ : IsMaximal I := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := RingHom.comp (Ideal.Quotient.mk I) C
hϕ : Function.Bijective ⇑ϕ
φ : MvPolynomial σ k ⧸ I → k
hφ : Function.RightInverse φ ⇑ϕ
⊢ ∃ x, I = vanishingIdeal {x}

Next tactic:
let x : σ → k := fun s => φ ((Ideal.Quotient.mk I) (X s))
theorem isMaximal_iff_eq_vanishingIdeal_singleton (I : Ideal (MvPolynomial σ k)) :
    I.IsMaximal ↔ ∃ x : σ → k, I = vanishingIdeal {x} := by
  cases nonempty_fintype σ
  refine'
    ⟨fun hI => _, fun h =>
      let ⟨x, hx⟩ := h
      hx.symm ▸ MvPolynomial.vanishingIdeal_singleton_isMaximal⟩
  letI : I.IsMaximal := hI
  letI : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
  let ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
  have hϕ : Function.Bijective ϕ :=
    ⟨quotient_mk_comp_C_injective _ _ I hI.ne_top,
      IsAlgClosed.algebraMap_surjective_of_isIntegral' ϕ
        (MvPolynomial.comp_C_integral_of_surjective_of_jacobson _ Quotient.mk_surjective)⟩
  obtain ⟨φ, hφ⟩ := Function.Surjective.hasRightInverse hϕ.2
  let x : σ → k := fun s => φ ((Ideal.Quotient.mk I) (X s))
  

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 : IsMaximal I
this✝ : IsMaximal I := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := RingHom.comp (Ideal.Quotient.mk I) 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}

Next tactic:
have hx : ∀ s : σ, ϕ (x s) = (Ideal.Quotient.mk I) (X s) := fun s =>
    hφ ((Ideal.Quotient.mk I) (X s))
theorem isMaximal_iff_eq_vanishingIdeal_singleton (I : Ideal (MvPolynomial σ k)) :
    I.IsMaximal ↔ ∃ x : σ → k, I = vanishingIdeal {x} := by
  cases nonempty_fintype σ
  refine'
    ⟨fun hI => _, fun h =>
      let ⟨x, hx⟩ := h
      hx.symm ▸ MvPolynomial.vanishingIdeal_singleton_isMaximal⟩
  letI : I.IsMaximal := hI
  letI : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
  let ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
  have hϕ : Function.Bijective ϕ :=
    ⟨quotient_mk_comp_C_injective _ _ I hI.ne_top,
      IsAlgClosed.algebraMap_surjective_of_isIntegral' ϕ
        (MvPolynomial.comp_C_integral_of_surjective_of_jacobson _ Quotient.mk_surjective)⟩
  obtain ⟨φ, hφ⟩ := Function.Surjective.hasRightInverse hϕ.2
  let x : σ → k := fun s => φ ((Ideal.Quotient.mk I) (X s))
  have hx : ∀ s : σ, ϕ (x s) = (Ideal.Quotient.mk I) (X s) := fun s =>
    hφ ((Ideal.Quotient.mk I) (X s))
  

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 : IsMaximal I
this✝ : IsMaximal I := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := RingHom.comp (Ideal.Quotient.mk I) 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}

Next tactic:
refine' ⟨x, (IsMaximal.eq_of_le (by infer_instance) hI.ne_top _).symm⟩
theorem isMaximal_iff_eq_vanishingIdeal_singleton (I : Ideal (MvPolynomial σ k)) :
    I.IsMaximal ↔ ∃ x : σ → k, I = vanishingIdeal {x} := by
  cases nonempty_fintype σ
  refine'
    ⟨fun hI => _, fun h =>
      let ⟨x, hx⟩ := h
      hx.symm ▸ MvPolynomial.vanishingIdeal_singleton_isMaximal⟩
  letI : I.IsMaximal := hI
  letI : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
  let ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
  have hϕ : Function.Bijective ϕ :=
    ⟨quotient_mk_comp_C_injective _ _ I hI.ne_top,
      IsAlgClosed.algebraMap_surjective_of_isIntegral' ϕ
        (MvPolynomial.comp_C_integral_of_surjective_of_jacobson _ Quotient.mk_surjective)⟩
  obtain ⟨φ, hφ⟩ := Function.Surjective.hasRightInverse hϕ.2
  let x : σ → k := fun s => φ ((Ideal.Quotient.mk I) (X s))
  have hx : ∀ s : σ, ϕ (x s) = (Ideal.Quotient.mk I) (X s) := fun s =>
    hφ ((Ideal.Quotient.mk I) (X s))
  refine' ⟨x, (IsMaximal.eq_of_le (by 

Proof state:
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
val✝ : Fintype σ
hI : IsMaximal I
this✝ : IsMaximal I := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := RingHom.comp (Ideal.Quotient.mk I) 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)
⊢ IsMaximal (vanishingIdeal {x})

Next tactic:
infer_instance
theorem isMaximal_iff_eq_vanishingIdeal_singleton (I : Ideal (MvPolynomial σ k)) :
    I.IsMaximal ↔ ∃ x : σ → k, I = vanishingIdeal {x} := by
  cases nonempty_fintype σ
  refine'
    ⟨fun hI => _, fun h =>
      let ⟨x, hx⟩ := h
      hx.symm ▸ MvPolynomial.vanishingIdeal_singleton_isMaximal⟩
  letI : I.IsMaximal := hI
  letI : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
  let ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
  have hϕ : Function.Bijective ϕ :=
    ⟨quotient_mk_comp_C_injective _ _ I hI.ne_top,
      IsAlgClosed.algebraMap_surjective_of_isIntegral' ϕ
        (MvPolynomial.comp_C_integral_of_surjective_of_jacobson _ Quotient.mk_surjective)⟩
  obtain ⟨φ, hφ⟩ := Function.Surjective.hasRightInverse hϕ.2
  let x : σ → k := fun s => φ ((Ideal.Quotient.mk I) (X s))
  have hx : ∀ s : σ, ϕ (x s) = (Ideal.Quotient.mk I) (X s) := fun s =>
    hφ ((Ideal.Quotient.mk I) (X s))
  refine' ⟨x, (IsMaximal.eq_of_le (by infer_instance) hI.ne_top _).symm⟩
  

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 : IsMaximal I
this✝ : IsMaximal I := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := RingHom.comp (Ideal.Quotient.mk I) 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

Next tactic:
intro p hp
theorem isMaximal_iff_eq_vanishingIdeal_singleton (I : Ideal (MvPolynomial σ k)) :
    I.IsMaximal ↔ ∃ x : σ → k, I = vanishingIdeal {x} := by
  cases nonempty_fintype σ
  refine'
    ⟨fun hI => _, fun h =>
      let ⟨x, hx⟩ := h
      hx.symm ▸ MvPolynomial.vanishingIdeal_singleton_isMaximal⟩
  letI : I.IsMaximal := hI
  letI : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
  let ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
  have hϕ : Function.Bijective ϕ :=
    ⟨quotient_mk_comp_C_injective _ _ I hI.ne_top,
      IsAlgClosed.algebraMap_surjective_of_isIntegral' ϕ
        (MvPolynomial.comp_C_integral_of_surjective_of_jacobson _ Quotient.mk_surjective)⟩
  obtain ⟨φ, hφ⟩ := Function.Surjective.hasRightInverse hϕ.2
  let x : σ → k := fun s => φ ((Ideal.Quotient.mk I) (X s))
  have hx : ∀ s : σ, ϕ (x s) = (Ideal.Quotient.mk I) (X s) := fun s =>
    hφ ((Ideal.Quotient.mk I) (X s))
  refine' ⟨x, (IsMaximal.eq_of_le (by infer_instance) hI.ne_top _).symm⟩
  intro p hp
  

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 : IsMaximal I
this✝ : IsMaximal I := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := RingHom.comp (Ideal.Quotient.mk I) 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

Next tactic:
rw [← Quotient.eq_zero_iff_mem, map_mvPolynomial_eq_eval₂ (Ideal.Quotient.mk I) p, eval₂_eq']
theorem isMaximal_iff_eq_vanishingIdeal_singleton (I : Ideal (MvPolynomial σ k)) :
    I.IsMaximal ↔ ∃ x : σ → k, I = vanishingIdeal {x} := by
  cases nonempty_fintype σ
  refine'
    ⟨fun hI => _, fun h =>
      let ⟨x, hx⟩ := h
      hx.symm ▸ MvPolynomial.vanishingIdeal_singleton_isMaximal⟩
  letI : I.IsMaximal := hI
  letI : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
  let ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
  have hϕ : Function.Bijective ϕ :=
    ⟨quotient_mk_comp_C_injective _ _ I hI.ne_top,
      IsAlgClosed.algebraMap_surjective_of_isIntegral' ϕ
        (MvPolynomial.comp_C_integral_of_surjective_of_jacobson _ Quotient.mk_surjective)⟩
  obtain ⟨φ, hφ⟩ := Function.Surjective.hasRightInverse hϕ.2
  let x : σ → k := fun s => φ ((Ideal.Quotient.mk I) (X s))
  have hx : ∀ s : σ, ϕ (x s) = (Ideal.Quotient.mk I) (X s) := fun s =>
    hφ ((Ideal.Quotient.mk I) (X s))
  refine' ⟨x, (IsMaximal.eq_of_le (by infer_instance) hI.ne_top _).symm⟩
  intro p hp
  rw [← Quotient.eq_zero_iff_mem, map_mvPolynomial_eq_eval₂ (Ideal.Quotient.mk I) p, eval₂_eq']
  

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 : IsMaximal I
this✝ : IsMaximal I := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := RingHom.comp (Ideal.Quotient.mk I) 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}
⊢ (Finset.sum (support p) fun d =>
      (RingHom.comp (Ideal.Quotient.mk I) C) (coeff d p) *
        Finset.prod Finset.univ fun i => (Ideal.Quotient.mk I) (X i) ^ d i) =
    0

Next tactic:
rw [mem_vanishingIdeal_singleton_iff, eval_eq'] at hp
theorem isMaximal_iff_eq_vanishingIdeal_singleton (I : Ideal (MvPolynomial σ k)) :
    I.IsMaximal ↔ ∃ x : σ → k, I = vanishingIdeal {x} := by
  cases nonempty_fintype σ
  refine'
    ⟨fun hI => _, fun h =>
      let ⟨x, hx⟩ := h
      hx.symm ▸ MvPolynomial.vanishingIdeal_singleton_isMaximal⟩
  letI : I.IsMaximal := hI
  letI : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
  let ϕ : k →+* MvPolynomial σ k ⧸ I := (Ideal.Quotient.mk I).comp C
  have hϕ : Function.Bijective ϕ :=
    ⟨quotient_mk_comp_C_injective _ _ I hI.ne_top,
      IsAlgClosed.algebraMap_surjective_of_isIntegral' ϕ
        (MvPolynomial.comp_C_integral_of_surjective_of_jacobson _ Quotient.mk_surjective)⟩
  obtain ⟨φ, hφ⟩ := Function.Surjective.hasRightInverse hϕ.2
  let x : σ → k := fun s => φ ((Ideal.Quotient.mk I) (X s))
  have hx : ∀ s : σ, ϕ (x s) = (Ideal.Quotient.mk I) (X s) := fun s =>
    hφ ((Ideal.Quotient.mk I) (X s))
  refine' ⟨x, (IsMaximal.eq_of_le (by infer_instance) hI.ne_top _).symm⟩
  intro p hp
  rw [← Quotient.eq_zero_iff_mem, map_mvPolynomial_eq_eval₂ (Ideal.Quotient.mk I) p, eval₂_eq']
  rw [mem_vanishingIdeal_singleton_iff, eval_eq'] at hp
  

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 : IsMaximal I
this✝ : IsMaximal I := hI
this : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
ϕ : k →+* MvPolynomial σ k ⧸ I := RingHom.comp (Ideal.Quotient.mk I) 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 : (Finset.sum (support p) fun d => coeff d p * Finset.prod Finset.univ fun i => x i ^ d i) = 0
⊢ (Finset.sum (support p) fun d =>
      (RingHom.comp (Ideal.Quotient.mk I) C) (coeff d p) *
        Finset.prod Finset.univ fun i => (Ideal.Quotient.mk I) (X i) ^ d i) =
    0

Next tactic:
simpa only [ϕ.map_sum, ϕ.map_mul, ϕ.map_prod, ϕ.map_pow, ϕ.map_zero, hx] using congr_arg ϕ hp
/-- Main statement of the Nullstellensatz -/
@[simp]
theorem vanishingIdeal_zeroLocus_eq_radical (I : Ideal (MvPolynomial σ k)) :
    vanishingIdeal (zeroLocus I) = I.radical := by
  

Proof state:
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
⊢ vanishingIdeal (zeroLocus I) = radical I

Next tactic:
rw [I.radical_eq_jacobson]
/-- Main statement of the Nullstellensatz -/
@[simp]
theorem vanishingIdeal_zeroLocus_eq_radical (I : Ideal (MvPolynomial σ k)) :
    vanishingIdeal (zeroLocus I) = I.radical := by
  rw [I.radical_eq_jacobson]
  

Proof state:
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
⊢ vanishingIdeal (zeroLocus I) = jacobson I

Next tactic:
refine' le_antisymm (le_sInf _) fun p hp x hx => _
/-- Main statement of the Nullstellensatz -/
@[simp]
theorem vanishingIdeal_zeroLocus_eq_radical (I : Ideal (MvPolynomial σ k)) :
    vanishingIdeal (zeroLocus I) = I.radical := by
  rw [I.radical_eq_jacobson]
  refine' le_antisymm (le_sInf _) fun p hp x hx => _
  · 

Proof state:
case refine'_1
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
⊢ ∀ b ∈ {J | I ≤ J ∧ IsMaximal J}, vanishingIdeal (zeroLocus I) ≤ b

Next tactic:
rintro J ⟨hJI, hJ⟩
/-- Main statement of the Nullstellensatz -/
@[simp]
theorem vanishingIdeal_zeroLocus_eq_radical (I : Ideal (MvPolynomial σ k)) :
    vanishingIdeal (zeroLocus I) = I.radical := by
  rw [I.radical_eq_jacobson]
  refine' le_antisymm (le_sInf _) fun p hp x hx => _
  · rintro J ⟨hJI, hJ⟩
    

Proof state:
case refine'_1.intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I J : Ideal (MvPolynomial σ k)
hJI : I ≤ J
hJ : IsMaximal J
⊢ vanishingIdeal (zeroLocus I) ≤ J

Next tactic:
obtain ⟨x, hx⟩ := (isMaximal_iff_eq_vanishingIdeal_singleton J).1 hJ
/-- Main statement of the Nullstellensatz -/
@[simp]
theorem vanishingIdeal_zeroLocus_eq_radical (I : Ideal (MvPolynomial σ k)) :
    vanishingIdeal (zeroLocus I) = I.radical := by
  rw [I.radical_eq_jacobson]
  refine' le_antisymm (le_sInf _) fun p hp x hx => _
  · rintro J ⟨hJI, hJ⟩
    obtain ⟨x, hx⟩ := (isMaximal_iff_eq_vanishingIdeal_singleton J).1 hJ
    

Proof state:
case refine'_1.intro.intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I J : Ideal (MvPolynomial σ k)
hJI : I ≤ J
hJ : IsMaximal J
x : σ → k
hx : J = vanishingIdeal {x}
⊢ vanishingIdeal (zeroLocus I) ≤ J

Next tactic:
refine' hx.symm ▸ vanishingIdeal_anti_mono fun y hy p hp => _
/-- Main statement of the Nullstellensatz -/
@[simp]
theorem vanishingIdeal_zeroLocus_eq_radical (I : Ideal (MvPolynomial σ k)) :
    vanishingIdeal (zeroLocus I) = I.radical := by
  rw [I.radical_eq_jacobson]
  refine' le_antisymm (le_sInf _) fun p hp x hx => _
  · rintro J ⟨hJI, hJ⟩
    obtain ⟨x, hx⟩ := (isMaximal_iff_eq_vanishingIdeal_singleton J).1 hJ
    refine' hx.symm ▸ vanishingIdeal_anti_mono fun y hy p hp => _
    

Proof state:
case refine'_1.intro.intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I J : Ideal (MvPolynomial σ k)
hJI : I ≤ J
hJ : IsMaximal J
x : σ → k
hx : J = vanishingIdeal {x}
y : σ → k
hy : y ∈ {x}
p : MvPolynomial σ k
hp : p ∈ I
⊢ (eval y) p = 0

Next tactic:
rw [← mem_vanishingIdeal_singleton_iff, Set.mem_singleton_iff.1 hy, ← hx]
/-- Main statement of the Nullstellensatz -/
@[simp]
theorem vanishingIdeal_zeroLocus_eq_radical (I : Ideal (MvPolynomial σ k)) :
    vanishingIdeal (zeroLocus I) = I.radical := by
  rw [I.radical_eq_jacobson]
  refine' le_antisymm (le_sInf _) fun p hp x hx => _
  · rintro J ⟨hJI, hJ⟩
    obtain ⟨x, hx⟩ := (isMaximal_iff_eq_vanishingIdeal_singleton J).1 hJ
    refine' hx.symm ▸ vanishingIdeal_anti_mono fun y hy p hp => _
    rw [← mem_vanishingIdeal_singleton_iff, Set.mem_singleton_iff.1 hy, ← hx]
    

Proof state:
case refine'_1.intro.intro
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I J : Ideal (MvPolynomial σ k)
hJI : I ≤ J
hJ : IsMaximal J
x : σ → k
hx : J = vanishingIdeal {x}
y : σ → k
hy : y ∈ {x}
p : MvPolynomial σ k
hp : p ∈ I
⊢ p ∈ J

Next tactic:
refine' hJI hp
/-- Main statement of the Nullstellensatz -/
@[simp]
theorem vanishingIdeal_zeroLocus_eq_radical (I : Ideal (MvPolynomial σ k)) :
    vanishingIdeal (zeroLocus I) = I.radical := by
  rw [I.radical_eq_jacobson]
  refine' le_antisymm (le_sInf _) fun p hp x hx => _
  · rintro J ⟨hJI, hJ⟩
    obtain ⟨x, hx⟩ := (isMaximal_iff_eq_vanishingIdeal_singleton J).1 hJ
    refine' hx.symm ▸ vanishingIdeal_anti_mono fun y hy p hp => _
    rw [← mem_vanishingIdeal_singleton_iff, Set.mem_singleton_iff.1 hy, ← hx]
    refine' hJI hp
  · 

Proof state:
case refine'_2
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
p : MvPolynomial σ k
hp : p ∈ jacobson I
x : σ → k
hx : x ∈ zeroLocus I
⊢ (eval x) p = 0

Next tactic:
rw [← mem_vanishingIdeal_singleton_iff x p]
/-- Main statement of the Nullstellensatz -/
@[simp]
theorem vanishingIdeal_zeroLocus_eq_radical (I : Ideal (MvPolynomial σ k)) :
    vanishingIdeal (zeroLocus I) = I.radical := by
  rw [I.radical_eq_jacobson]
  refine' le_antisymm (le_sInf _) fun p hp x hx => _
  · rintro J ⟨hJI, hJ⟩
    obtain ⟨x, hx⟩ := (isMaximal_iff_eq_vanishingIdeal_singleton J).1 hJ
    refine' hx.symm ▸ vanishingIdeal_anti_mono fun y hy p hp => _
    rw [← mem_vanishingIdeal_singleton_iff, Set.mem_singleton_iff.1 hy, ← hx]
    refine' hJI hp
  · rw [← mem_vanishingIdeal_singleton_iff x p]
    

Proof state:
case refine'_2
k : Type u_1
inst✝² : Field k
σ : Type u_2
inst✝¹ : IsAlgClosed k
inst✝ : Finite σ
I : Ideal (MvPolynomial σ k)
p : MvPolynomial σ k
hp : p ∈ jacobson I
x : σ → k
hx : x ∈ zeroLocus I
⊢ p ∈ vanishingIdeal {x}

Next tactic:
refine' (mem_sInf.mp hp)
      ⟨le_trans (le_vanishingIdeal_zeroLocus I) (vanishingIdeal_anti_mono fun y hy => hy.symm ▸ hx),
        MvPolynomial.vanishingIdeal_singleton_isMaximal⟩
instance : SetLike (NonUnitalSubring R) R
    where
  coe s := s.carrier
  coe_injective' p q h := by 

Proof state:
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocRing R
inst✝¹ : NonUnitalNonAssocRing S
inst✝ : NonUnitalNonAssocRing T
p q : NonUnitalSubring R
h : (fun s => s.carrier) p = (fun s => s.carrier) q
⊢ p = q

Next tactic:
cases p
instance : SetLike (NonUnitalSubring R) R
    where
  coe s := s.carrier
  coe_injective' p q h := by cases p; 

Proof state:
case mk
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocRing R
inst✝¹ : NonUnitalNonAssocRing S
inst✝ : NonUnitalNonAssocRing T
q : NonUnitalSubring R
toNonUnitalSubsemiring✝ : NonUnitalSubsemiring R
neg_mem'✝ : ∀ {x : R}, x ∈ toNonUnitalSubsemiring✝.carrier → -x ∈ toNonUnitalSubsemiring✝.carrier
h :
  (fun s => s.carrier) { toNonUnitalSubsemiring := toNonUnitalSubsemiring✝, neg_mem' := neg_mem'✝ } =
    (fun s => s.carrier) q
⊢ { toNonUnitalSubsemiring := toNonUnitalSubsemiring✝, neg_mem' := neg_mem'✝ } = q

Next tactic:
cases q
instance : SetLike (NonUnitalSubring R) R
    where
  coe s := s.carrier
  coe_injective' p q h := by cases p; cases q; 

Proof state:
case mk.mk
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocRing R
inst✝¹ : NonUnitalNonAssocRing S
inst✝ : NonUnitalNonAssocRing T
toNonUnitalSubsemiring✝¹ : NonUnitalSubsemiring R
neg_mem'✝¹ : ∀ {x : R}, x ∈ toNonUnitalSubsemiring✝¹.carrier → -x ∈ toNonUnitalSubsemiring✝¹.carrier
toNonUnitalSubsemiring✝ : NonUnitalSubsemiring R
neg_mem'✝ : ∀ {x : R}, x ∈ toNonUnitalSubsemiring✝.carrier → -x ∈ toNonUnitalSubsemiring✝.carrier
h :
  (fun s => s.carrier) { toNonUnitalSubsemiring := toNonUnitalSubsemiring✝¹, neg_mem' := neg_mem'✝¹ } =
    (fun s => s.carrier) { toNonUnitalSubsemiring := toNonUnitalSubsemiring✝, neg_mem' := neg_mem'✝ }
⊢ { toNonUnitalSubsemiring := toNonUnitalSubsemiring✝¹, neg_mem' := neg_mem'✝¹ } =
    { toNonUnitalSubsemiring := toNonUnitalSubsemiring✝, neg_mem' := neg_mem'✝ }

Next tactic:
congr
instance : SetLike (NonUnitalSubring R) R
    where
  coe s := s.carrier
  coe_injective' p q h := by cases p; cases q; congr; 

Proof state:
case mk.mk.e_toNonUnitalSubsemiring
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocRing R
inst✝¹ : NonUnitalNonAssocRing S
inst✝ : NonUnitalNonAssocRing T
toNonUnitalSubsemiring✝¹ : NonUnitalSubsemiring R
neg_mem'✝¹ : ∀ {x : R}, x ∈ toNonUnitalSubsemiring✝¹.carrier → -x ∈ toNonUnitalSubsemiring✝¹.carrier
toNonUnitalSubsemiring✝ : NonUnitalSubsemiring R
neg_mem'✝ : ∀ {x : R}, x ∈ toNonUnitalSubsemiring✝.carrier → -x ∈ toNonUnitalSubsemiring✝.carrier
h :
  (fun s => s.carrier) { toNonUnitalSubsemiring := toNonUnitalSubsemiring✝¹, neg_mem' := neg_mem'✝¹ } =
    (fun s => s.carrier) { toNonUnitalSubsemiring := toNonUnitalSubsemiring✝, neg_mem' := neg_mem'✝ }
⊢ toNonUnitalSubsemiring✝¹ = toNonUnitalSubsemiring✝

Next tactic:
exact SetLike.coe_injective h