l3lab/ntp-mathlib huggingface dataset:
/-- Supremum of `s i`, `i : ι`, is equal to the supremum over `t : Finset ι` of suprema
`⨆ i ∈ t, s i`. This version assumes `ι` is a `Type*`. See `iSup_eq_iSup_finset'` for a version
that works for `ι : Sort*`. -/
theorem iSup_eq_iSup_finset (s : ι → α) : ⨆ i, s i = ⨆ t : Finset ι, ⨆ i ∈ t, s i := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
ι' : Sort u_7
inst✝ : CompleteLattice α
s : ι → α
⊢ ⨆ i, s i = ⨆ t, ⨆ i ∈ t, s i

Next tactic:
classical
  refine le_antisymm ?_ ?_
  · exact iSup_le fun b => le_iSup_of_le {b} <| le_iSup_of_le b <| le_iSup_of_le (by simp) <| le_rfl
  · exact iSup_le fun t => iSup_le fun b => iSup_le fun _ => le_iSup _ _
/-- Supremum of `s i`, `i : ι`, is equal to the supremum over `t : Finset ι` of suprema
`⨆ i ∈ t, s i`. This version assumes `ι` is a `Type*`. See `iSup_eq_iSup_finset'` for a version
that works for `ι : Sort*`. -/
theorem iSup_eq_iSup_finset (s : ι → α) : ⨆ i, s i = ⨆ t : Finset ι, ⨆ i ∈ t, s i := by
  classical
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
ι' : Sort u_7
inst✝ : CompleteLattice α
s : ι → α
⊢ ⨆ i, s i = ⨆ t, ⨆ i ∈ t, s i

Next tactic:
refine le_antisymm ?_ ?_
/-- Supremum of `s i`, `i : ι`, is equal to the supremum over `t : Finset ι` of suprema
`⨆ i ∈ t, s i`. This version assumes `ι` is a `Type*`. See `iSup_eq_iSup_finset'` for a version
that works for `ι : Sort*`. -/
theorem iSup_eq_iSup_finset (s : ι → α) : ⨆ i, s i = ⨆ t : Finset ι, ⨆ i ∈ t, s i := by
  classical
  refine le_antisymm ?_ ?_
  · 

Proof state:
case refine_1
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
ι' : Sort u_7
inst✝ : CompleteLattice α
s : ι → α
⊢ ⨆ i, s i ≤ ⨆ t, ⨆ i ∈ t, s i

Next tactic:
exact iSup_le fun b => le_iSup_of_le {b} <| le_iSup_of_le b <| le_iSup_of_le (by simp) <| le_rfl
/-- Supremum of `s i`, `i : ι`, is equal to the supremum over `t : Finset ι` of suprema
`⨆ i ∈ t, s i`. This version assumes `ι` is a `Type*`. See `iSup_eq_iSup_finset'` for a version
that works for `ι : Sort*`. -/
theorem iSup_eq_iSup_finset (s : ι → α) : ⨆ i, s i = ⨆ t : Finset ι, ⨆ i ∈ t, s i := by
  classical
  refine le_antisymm ?_ ?_
  · exact iSup_le fun b => le_iSup_of_le {b} <| le_iSup_of_le b <| le_iSup_of_le (by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
ι' : Sort u_7
inst✝ : CompleteLattice α
s : ι → α
b : ι
⊢ b ∈ {b}

Next tactic:
simp
/-- Supremum of `s i`, `i : ι`, is equal to the supremum over `t : Finset ι` of suprema
`⨆ i ∈ t, s i`. This version assumes `ι` is a `Type*`. See `iSup_eq_iSup_finset'` for a version
that works for `ι : Sort*`. -/
theorem iSup_eq_iSup_finset (s : ι → α) : ⨆ i, s i = ⨆ t : Finset ι, ⨆ i ∈ t, s i := by
  classical
  refine le_antisymm ?_ ?_
  · exact iSup_le fun b => le_iSup_of_le {b} <| le_iSup_of_le b <| le_iSup_of_le (by simp) <| le_rfl
  · 

Proof state:
case refine_2
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
ι' : Sort u_7
inst✝ : CompleteLattice α
s : ι → α
⊢ ⨆ t, ⨆ i ∈ t, s i ≤ ⨆ i, s i

Next tactic:
exact iSup_le fun t => iSup_le fun b => iSup_le fun _ => le_iSup _ _
/-- Supremum of `s i`, `i : ι`, is equal to the supremum over `t : Finset ι` of suprema
`⨆ i ∈ t, s i`. This version works for `ι : Sort*`. See `iSup_eq_iSup_finset` for a version
that assumes `ι : Type*` but has no `PLift`s. -/
theorem iSup_eq_iSup_finset' (s : ι' → α) :
    ⨆ i, s i = ⨆ t : Finset (PLift ι'), ⨆ i ∈ t, s (PLift.down i) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
ι' : Sort u_7
inst✝ : CompleteLattice α
s : ι' → α
⊢ ⨆ i, s i = ⨆ t, ⨆ i ∈ t, s i.down

Next tactic:
rw [← iSup_eq_iSup_finset, ← Equiv.plift.surjective.iSup_comp]
/-- Supremum of `s i`, `i : ι`, is equal to the supremum over `t : Finset ι` of suprema
`⨆ i ∈ t, s i`. This version works for `ι : Sort*`. See `iSup_eq_iSup_finset` for a version
that assumes `ι : Type*` but has no `PLift`s. -/
theorem iSup_eq_iSup_finset' (s : ι' → α) :
    ⨆ i, s i = ⨆ t : Finset (PLift ι'), ⨆ i ∈ t, s (PLift.down i) := by
  rw [← iSup_eq_iSup_finset, ← Equiv.plift.surjective.iSup_comp]; 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
ι' : Sort u_7
inst✝ : CompleteLattice α
s : ι' → α
⊢ ⨆ x, s (Equiv.plift x) = ⨆ i, s i.down

Next tactic:
rfl
theorem iSup_singleton (a : α) (s : α → β) : ⨆ x ∈ ({a} : Finset α), s x = s a := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : CompleteLattice β
a : α
s : α → β
⊢ ⨆ x ∈ {a}, s x = s a

Next tactic:
simp
theorem iInf_singleton (a : α) (s : α → β) : ⨅ x ∈ ({a} : Finset α), s x = s a := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : CompleteLattice β
a : α
s : α → β
⊢ ⨅ x ∈ {a}, s x = s a

Next tactic:
simp
theorem iSup_option_toFinset (o : Option α) (f : α → β) : ⨆ x ∈ o.toFinset, f x = ⨆ x ∈ o, f x :=
  by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝ : CompleteLattice β
o : Option α
f : α → β
⊢ ⨆ x ∈ Option.toFinset o, f x = ⨆ x ∈ o, f x

Next tactic:
simp
theorem iSup_union {f : α → β} {s t : Finset α} :
    ⨆ x ∈ s ∪ t, f x = (⨆ x ∈ s, f x) ⊔ ⨆ x ∈ t, f x := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝¹ : CompleteLattice β
inst✝ : DecidableEq α
f : α → β
s t : Finset α
⊢ ⨆ x ∈ s ∪ t, f x = (⨆ x ∈ s, f x) ⊔ ⨆ x ∈ t, f x

Next tactic:
simp [iSup_or, iSup_sup_eq]
theorem iSup_insert (a : α) (s : Finset α) (t : α → β) :
    ⨆ x ∈ insert a s, t x = t a ⊔ ⨆ x ∈ s, t x := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝¹ : CompleteLattice β
inst✝ : DecidableEq α
a : α
s : Finset α
t : α → β
⊢ ⨆ x ∈ insert a s, t x = t a ⊔ ⨆ x ∈ s, t x

Next tactic:
rw [insert_eq]
theorem iSup_insert (a : α) (s : Finset α) (t : α → β) :
    ⨆ x ∈ insert a s, t x = t a ⊔ ⨆ x ∈ s, t x := by
  rw [insert_eq]
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝¹ : CompleteLattice β
inst✝ : DecidableEq α
a : α
s : Finset α
t : α → β
⊢ ⨆ x ∈ {a} ∪ s, t x = t a ⊔ ⨆ x ∈ s, t x

Next tactic:
simp only [iSup_union, Finset.iSup_singleton]
theorem iSup_finset_image {f : γ → α} {g : α → β} {s : Finset γ} :
    ⨆ x ∈ s.image f, g x = ⨆ y ∈ s, g (f y) := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝¹ : CompleteLattice β
inst✝ : DecidableEq α
f : γ → α
g : α → β
s : Finset γ
⊢ ⨆ x ∈ image f s, g x = ⨆ y ∈ s, g (f y)

Next tactic:
rw [← iSup_coe, coe_image, iSup_image, iSup_coe]
theorem iInf_finset_image {f : γ → α} {g : α → β} {s : Finset γ} :
    ⨅ x ∈ s.image f, g x = ⨅ y ∈ s, g (f y) := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝¹ : CompleteLattice β
inst✝ : DecidableEq α
f : γ → α
g : α → β
s : Finset γ
⊢ ⨅ x ∈ image f s, g x = ⨅ y ∈ s, g (f y)

Next tactic:
rw [← iInf_coe, coe_image, iInf_image, iInf_coe]
theorem iSup_insert_update {x : α} {t : Finset α} (f : α → β) {s : β} (hx : x ∉ t) :
    ⨆ i ∈ insert x t, Function.update f x s i = s ⊔ ⨆ i ∈ t, f i := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝¹ : CompleteLattice β
inst✝ : DecidableEq α
x : α
t : Finset α
f : α → β
s : β
hx : x ∉ t
⊢ ⨆ i ∈ insert x t, update f x s i = s ⊔ ⨆ i ∈ t, f i

Next tactic:
simp only [Finset.iSup_insert, update_same]
theorem iSup_insert_update {x : α} {t : Finset α} (f : α → β) {s : β} (hx : x ∉ t) :
    ⨆ i ∈ insert x t, Function.update f x s i = s ⊔ ⨆ i ∈ t, f i := by
  simp only [Finset.iSup_insert, update_same]
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝¹ : CompleteLattice β
inst✝ : DecidableEq α
x : α
t : Finset α
f : α → β
s : β
hx : x ∉ t
⊢ s ⊔ ⨆ x_1 ∈ t, update f x s x_1 = s ⊔ ⨆ i ∈ t, f i

Next tactic:
rcongr (i hi)
theorem iSup_insert_update {x : α} {t : Finset α} (f : α → β) {s : β} (hx : x ∉ t) :
    ⨆ i ∈ insert x t, Function.update f x s i = s ⊔ ⨆ i ∈ t, f i := by
  simp only [Finset.iSup_insert, update_same]
  rcongr (i hi); 

Proof state:
case e_a.e_s.h.e_s.h
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝¹ : CompleteLattice β
inst✝ : DecidableEq α
x : α
t : Finset α
f : α → β
s : β
hx : x ∉ t
i : α
hi : i ∈ t
⊢ update f x s i = f i

Next tactic:
apply update_noteq
theorem iSup_insert_update {x : α} {t : Finset α} (f : α → β) {s : β} (hx : x ∉ t) :
    ⨆ i ∈ insert x t, Function.update f x s i = s ⊔ ⨆ i ∈ t, f i := by
  simp only [Finset.iSup_insert, update_same]
  rcongr (i hi); apply update_noteq; 

Proof state:
case e_a.e_s.h.e_s.h.h
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝¹ : CompleteLattice β
inst✝ : DecidableEq α
x : α
t : Finset α
f : α → β
s : β
hx : x ∉ t
i : α
hi : i ∈ t
⊢ i ≠ x

Next tactic:
rintro rfl
theorem iSup_insert_update {x : α} {t : Finset α} (f : α → β) {s : β} (hx : x ∉ t) :
    ⨆ i ∈ insert x t, Function.update f x s i = s ⊔ ⨆ i ∈ t, f i := by
  simp only [Finset.iSup_insert, update_same]
  rcongr (i hi); apply update_noteq; rintro rfl; 

Proof state:
case e_a.e_s.h.e_s.h.h
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝¹ : CompleteLattice β
inst✝ : DecidableEq α
t : Finset α
f : α → β
s : β
i : α
hi : i ∈ t
hx : i ∉ t
⊢ False

Next tactic:
exact hx hi
theorem iSup_biUnion (s : Finset γ) (t : γ → Finset α) (f : α → β) :
    ⨆ y ∈ s.biUnion t, f y = ⨆ (x ∈ s) (y ∈ t x), f y := by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
inst✝¹ : CompleteLattice β
inst✝ : DecidableEq α
s : Finset γ
t : γ → Finset α
f : α → β
⊢ ⨆ y ∈ Finset.biUnion s t, f y = ⨆ x ∈ s, ⨆ y ∈ t x, f y

Next tactic:
simp [@iSup_comm _ α, iSup_and]
theorem subset_set_biUnion_of_mem {s : Finset α} {f : α → Set β} {x : α} (h : x ∈ s) :
    f x ⊆ ⋃ y ∈ s, f y :=
  show f x ≤ ⨆ y ∈ s, f y from le_iSup_of_le x <| by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
ι : Type u_5
κ : Type u_6
s : Finset α
f : α → Set β
x : α
h : x ∈ s
⊢ f x ≤ ⨆ (_ : x ∈ s), f x

Next tactic:
simp only [h, iSup_pos, le_refl]
/-- Ideal of polynomials with common zeroes at all elements of a set -/
def vanishingIdeal (V : Set (σ → k)) : Ideal (MvPolynomial σ k) where
  carrier := {p | ∀ x ∈ V, eval x p = 0}
  zero_mem' x _ := RingHom.map_zero _
  add_mem' {p q} hp hq x hx := by 

Proof state:
k : Type u_1
inst✝ : Field k
σ : Type u_2
V : Set (σ → k)
p q : MvPolynomial σ k
hp : p ∈ {p | ∀ x ∈ V, (eval x) p = 0}
hq : q ∈ {p | ∀ x ∈ V, (eval x) p = 0}
x : σ → k
hx : x ∈ V
⊢ (eval x) (p + q) = 0

Next tactic:
simp only [hq x hx, hp x hx, add_zero, RingHom.map_add]
/-- Ideal of polynomials with common zeroes at all elements of a set -/
def vanishingIdeal (V : Set (σ → k)) : Ideal (MvPolynomial σ k) where
  carrier := {p | ∀ x ∈ V, eval x p = 0}
  zero_mem' x _ := RingHom.map_zero _
  add_mem' {p q} hp hq x hx := by simp only [hq x hx, hp x hx, add_zero, RingHom.map_add]
  smul_mem' p q hq x hx := by
    

Proof state:
k : Type u_1
inst✝ : Field k
σ : Type u_2
V : Set (σ → k)
p q : MvPolynomial σ k
hq :
  q ∈
    {
          toAddSubsemigroup :=
            { carrier := {p | ∀ x ∈ V, (eval x) p = 0},
              add_mem' :=
                (_ :
                  ∀ {p q : MvPolynomial σ k},
                    p ∈ {p | ∀ x ∈ V, (eval x) p = 0} →
                      q ∈ {p | ∀ x ∈ V, (eval x) p = 0} → ∀ x ∈ V, (eval x) (p + q) = 0) },
          zero_mem' := (_ : ∀ x ∈ V, (eval x) 0 = 0) }.toAddSubsemigroup.carrier
x : σ → k
hx : x ∈ V
⊢ (eval x) (p • q) = 0

Next tactic:
simp only [hq x hx, Algebra.id.smul_eq_mul, mul_zero, RingHom.map_mul]
instance vanishingIdeal_singleton_isMaximal {x : σ → k} :
    (vanishingIdeal {x} : Ideal (MvPolynomial σ k)).IsMaximal := by
  

Proof state:
k : Type u_1
inst✝ : Field k
σ : Type u_2
x : σ → k
⊢ IsMaximal (vanishingIdeal {x})

Next tactic:
have : MvPolynomial σ k ⧸ vanishingIdeal {x} ≃+* k :=
    RingEquiv.ofBijective
      (Ideal.Quotient.lift _ (eval x) fun p h => (mem_vanishingIdeal_singleton_iff x p).mp h)
      (by
        refine'
          ⟨(injective_iff_map_eq_zero _).mpr fun p hp => _, fun z =>
            ⟨(Ideal.Quotient.mk (vanishingIdeal {x} : Ideal (MvPolynomial σ k))) (C z), by simp⟩⟩
        obtain ⟨q, rfl⟩ := Quotient.mk_surjective p
        rwa [Ideal.Quotient.lift_mk, ← mem_vanishingIdeal_singleton_iff,
          ← Quotient.eq_zero_iff_mem] at hp)
instance vanishingIdeal_singleton_isMaximal {x : σ → k} :
    (vanishingIdeal {x} : Ideal (MvPolynomial σ k)).IsMaximal := by
  have : MvPolynomial σ k ⧸ vanishingIdeal {x} ≃+* k :=
    RingEquiv.ofBijective
      (Ideal.Quotient.lift _ (eval x) fun p h => (mem_vanishingIdeal_singleton_iff x p).mp h)
      (by
        

Proof state:
k : Type u_1
inst✝ : Field k
σ : Type u_2
x : σ → k
⊢ Function.Bijective ⇑(Ideal.Quotient.lift (vanishingIdeal {x}) (eval x) (_ : ∀ p ∈ vanishingIdeal {x}, (eval x) p = 0))

Next tactic:
refine'
          ⟨(injective_iff_map_eq_zero _).mpr fun p hp => _, fun z =>
            ⟨(Ideal.Quotient.mk (vanishingIdeal {x} : Ideal (MvPolynomial σ k))) (C z), by simp⟩⟩
instance vanishingIdeal_singleton_isMaximal {x : σ → k} :
    (vanishingIdeal {x} : Ideal (MvPolynomial σ k)).IsMaximal := by
  have : MvPolynomial σ k ⧸ vanishingIdeal {x} ≃+* k :=
    RingEquiv.ofBijective
      (Ideal.Quotient.lift _ (eval x) fun p h => (mem_vanishingIdeal_singleton_iff x p).mp h)
      (by
        refine'
          ⟨(injective_iff_map_eq_zero _).mpr fun p hp => _, fun z =>
            ⟨(Ideal.Quotient.mk (vanishingIdeal {x} : Ideal (MvPolynomial σ k))) (C z), by 

Proof state:
k : Type u_1
inst✝ : Field k
σ : Type u_2
x : σ → k
z : k
⊢ (Ideal.Quotient.lift (vanishingIdeal {x}) (eval x) (_ : ∀ p ∈ vanishingIdeal {x}, (eval x) p = 0))
      ((Ideal.Quotient.mk (vanishingIdeal {x})) (C z)) =
    z

Next tactic:
simp
instance vanishingIdeal_singleton_isMaximal {x : σ → k} :
    (vanishingIdeal {x} : Ideal (MvPolynomial σ k)).IsMaximal := by
  have : MvPolynomial σ k ⧸ vanishingIdeal {x} ≃+* k :=
    RingEquiv.ofBijective
      (Ideal.Quotient.lift _ (eval x) fun p h => (mem_vanishingIdeal_singleton_iff x p).mp h)
      (by
        refine'
          ⟨(injective_iff_map_eq_zero _).mpr fun p hp => _, fun z =>
            ⟨(Ideal.Quotient.mk (vanishingIdeal {x} : Ideal (MvPolynomial σ k))) (C z), by simp⟩⟩
        

Proof state:
k : Type u_1
inst✝ : Field k
σ : Type u_2
x : σ → k
p : MvPolynomial σ k ⧸ vanishingIdeal {x}
hp : (Ideal.Quotient.lift (vanishingIdeal {x}) (eval x) (_ : ∀ p ∈ vanishingIdeal {x}, (eval x) p = 0)) p = 0
⊢ p = 0

Next tactic:
obtain ⟨q, rfl⟩ := Quotient.mk_surjective p
instance vanishingIdeal_singleton_isMaximal {x : σ → k} :
    (vanishingIdeal {x} : Ideal (MvPolynomial σ k)).IsMaximal := by
  have : MvPolynomial σ k ⧸ vanishingIdeal {x} ≃+* k :=
    RingEquiv.ofBijective
      (Ideal.Quotient.lift _ (eval x) fun p h => (mem_vanishingIdeal_singleton_iff x p).mp h)
      (by
        refine'
          ⟨(injective_iff_map_eq_zero _).mpr fun p hp => _, fun z =>
            ⟨(Ideal.Quotient.mk (vanishingIdeal {x} : Ideal (MvPolynomial σ k))) (C z), by simp⟩⟩
        obtain ⟨q, rfl⟩ := Quotient.mk_surjective p
        

Proof state:
case intro
k : Type u_1
inst✝ : Field k
σ : Type u_2
x : σ → k
q : MvPolynomial σ k
hp :
  (Ideal.Quotient.lift (vanishingIdeal {x}) (eval x) (_ : ∀ p ∈ vanishingIdeal {x}, (eval x) p = 0))
      ((Ideal.Quotient.mk (vanishingIdeal {x})) q) =
    0
⊢ (Ideal.Quotient.mk (vanishingIdeal {x})) q = 0

Next tactic:
rwa [Ideal.Quotient.lift_mk, ← mem_vanishingIdeal_singleton_iff,
          ← Quotient.eq_zero_iff_mem] at hp
instance vanishingIdeal_singleton_isMaximal {x : σ → k} :
    (vanishingIdeal {x} : Ideal (MvPolynomial σ k)).IsMaximal := by
  have : MvPolynomial σ k ⧸ vanishingIdeal {x} ≃+* k :=
    RingEquiv.ofBijective
      (Ideal.Quotient.lift _ (eval x) fun p h => (mem_vanishingIdeal_singleton_iff x p).mp h)
      (by
        refine'
          ⟨(injective_iff_map_eq_zero _).mpr fun p hp => _, fun z =>
            ⟨(Ideal.Quotient.mk (vanishingIdeal {x} : Ideal (MvPolynomial σ k))) (C z), by simp⟩⟩
        obtain ⟨q, rfl⟩ := Quotient.mk_surjective p
        rwa [Ideal.Quotient.lift_mk, ← mem_vanishingIdeal_singleton_iff,
          ← Quotient.eq_zero_iff_mem] at hp)
  

Proof state:
k : Type u_1
inst✝ : Field k
σ : Type u_2
x : σ → k
this : MvPolynomial σ k ⧸ vanishingIdeal {x} ≃+* k
⊢ IsMaximal (vanishingIdeal {x})

Next tactic:
rw [← bot_quotient_isMaximal_iff, RingEquiv.bot_maximal_iff this]
instance vanishingIdeal_singleton_isMaximal {x : σ → k} :
    (vanishingIdeal {x} : Ideal (MvPolynomial σ k)).IsMaximal := by
  have : MvPolynomial σ k ⧸ vanishingIdeal {x} ≃+* k :=
    RingEquiv.ofBijective
      (Ideal.Quotient.lift _ (eval x) fun p h => (mem_vanishingIdeal_singleton_iff x p).mp h)
      (by
        refine'
          ⟨(injective_iff_map_eq_zero _).mpr fun p hp => _, fun z =>
            ⟨(Ideal.Quotient.mk (vanishingIdeal {x} : Ideal (MvPolynomial σ k))) (C z), by simp⟩⟩
        obtain ⟨q, rfl⟩ := Quotient.mk_surjective p
        rwa [Ideal.Quotient.lift_mk, ← mem_vanishingIdeal_singleton_iff,
          ← Quotient.eq_zero_iff_mem] at hp)
  rw [← bot_quotient_isMaximal_iff, RingEquiv.bot_maximal_iff this]
  

Proof state:
k : Type u_1
inst✝ : Field k
σ : Type u_2
x : σ → k
this : MvPolynomial σ k ⧸ vanishingIdeal {x} ≃+* k
⊢ IsMaximal ⊥

Next tactic:
exact bot_isMaximal
theorem radical_le_vanishingIdeal_zeroLocus (I : Ideal (MvPolynomial σ k)) :
    I.radical ≤ vanishingIdeal (zeroLocus I) := by
  

Proof state:
k : Type u_1
inst✝ : Field k
σ : Type u_2
I : Ideal (MvPolynomial σ k)
⊢ radical I ≤ vanishingIdeal (zeroLocus I)

Next tactic:
intro p hp x hx
theorem radical_le_vanishingIdeal_zeroLocus (I : Ideal (MvPolynomial σ k)) :
    I.radical ≤ vanishingIdeal (zeroLocus I) := by
  intro p hp x hx
  

Proof state:
k : Type u_1
inst✝ : Field k
σ : Type u_2
I : Ideal (MvPolynomial σ k)
p : MvPolynomial σ k
hp : p ∈ radical I
x : σ → k
hx : x ∈ zeroLocus I
⊢ (eval x) p = 0

Next tactic:
rw [← mem_vanishingIdeal_singleton_iff]
theorem radical_le_vanishingIdeal_zeroLocus (I : Ideal (MvPolynomial σ k)) :
    I.radical ≤ vanishingIdeal (zeroLocus I) := by
  intro p hp x hx
  rw [← mem_vanishingIdeal_singleton_iff]
  

Proof state:
k : Type u_1
inst✝ : Field k
σ : Type u_2
I : Ideal (MvPolynomial σ k)
p : MvPolynomial σ k
hp : p ∈ radical I
x : σ → k
hx : x ∈ zeroLocus I
⊢ p ∈ vanishingIdeal {x}

Next tactic:
rw [radical_eq_sInf] at hp
theorem radical_le_vanishingIdeal_zeroLocus (I : Ideal (MvPolynomial σ k)) :
    I.radical ≤ vanishingIdeal (zeroLocus I) := by
  intro p hp x hx
  rw [← mem_vanishingIdeal_singleton_iff]
  rw [radical_eq_sInf] at hp
  

Proof state:
k : Type u_1
inst✝ : Field k
σ : Type u_2
I : Ideal (MvPolynomial σ k)
p : MvPolynomial σ k
hp : p ∈ sInf {J | I ≤ J ∧ IsPrime J}
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),
        IsMaximal.isPrime' _⟩
/-- The point in the prime spectrum associated to a given point -/
def pointToPoint (x : σ → k) : PrimeSpectrum (MvPolynomial σ k) :=
  ⟨(vanishingIdeal {x} : Ideal (MvPolynomial σ k)), by 

Proof state:
k : Type u_1
inst✝ : Field k
σ : Type u_2
x : σ → k
⊢ IsPrime (vanishingIdeal {x})

Next tactic:
infer_instance
@[simp]
theorem vanishingIdeal_pointToPoint (V : Set (σ → k)) :
    PrimeSpectrum.vanishingIdeal (pointToPoint '' V) = MvPolynomial.vanishingIdeal V :=
  le_antisymm
    (fun p hp x hx =>
      (((PrimeSpectrum.mem_vanishingIdeal _ _).1 hp) ⟨vanishingIdeal {x}, by 

Proof state:
k : Type u_1
inst✝ : Field k
σ : Type u_2
V : Set (σ → k)
p : MvPolynomial σ k
hp : p ∈ PrimeSpectrum.vanishingIdeal (pointToPoint '' V)
x : σ → k
hx : x ∈ V
⊢ IsPrime (vanishingIdeal {x})

Next tactic:
infer_instance
@[simp]
theorem vanishingIdeal_pointToPoint (V : Set (σ → k)) :
    PrimeSpectrum.vanishingIdeal (pointToPoint '' V) = MvPolynomial.vanishingIdeal V :=
  le_antisymm
    (fun p hp x hx =>
      (((PrimeSpectrum.mem_vanishingIdeal _ _).1 hp) ⟨vanishingIdeal {x}, by infer_instance⟩ <| by
          

Proof state:
k : Type u_1
inst✝ : Field k
σ : Type u_2
V : Set (σ → k)
p : MvPolynomial σ k
hp : p ∈ PrimeSpectrum.vanishingIdeal (pointToPoint '' V)
x : σ → k
hx : x ∈ V
⊢ { asIdeal := vanishingIdeal {x}, IsPrime := (_ : IsPrime (vanishingIdeal {x})) } ∈ pointToPoint '' V

Next tactic:
exact ⟨x, ⟨hx, rfl⟩⟩
theorem isMaximal_iff_eq_vanishingIdeal_singleton (I : Ideal (MvPolynomial σ k)) :
    I.IsMaximal ↔ ∃ x : σ → k, I = vanishingIdeal {x} := by
  

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

Next tactic:
cases nonempty_fintype σ
theorem isMaximal_iff_eq_vanishingIdeal_singleton (I : Ideal (MvPolynomial σ k)) :
    I.IsMaximal ↔ ∃ x : σ → k, I = vanishingIdeal {x} := by
  cases nonempty_fintype σ
  

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 σ
⊢ IsMaximal I ↔ ∃ x, I = vanishingIdeal {x}

Next tactic:
refine'
    ⟨fun hI => _, fun h =>
      let ⟨x, hx⟩ := h
      hx.symm ▸ MvPolynomial.vanishingIdeal_singleton_isMaximal⟩
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⟩
  

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
⊢ ∃ x, I = vanishingIdeal {x}

Next tactic:
letI : I.IsMaximal := hI
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
  

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
⊢ ∃ x, I = vanishingIdeal {x}

Next tactic:
letI : Field (MvPolynomial σ k ⧸ I) := Quotient.field I
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
  

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
⊢ ∃ x, I = vanishingIdeal {x}

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