import Mathlib.RingTheory.Ideal.Quotient.Operations import Mathlib.RingTheory.Ideal.Maximal import Mathlib.Algebra.Algebra.Subalgebra.Lattice /-! # Algebra Rational Point Ideal -/ namespace OAI.AlgebraicGeometry.AbelianModuli.HilbertConstruction.Generated.AlgebraRationalPointIdeal noncomputable section /-! In an algebra generated by specified coordinates, the differences between those coordinates and their values at a rational point generate the point's entire maximal ideal. This also separates it from arbitrary prime ideals, with no closed-point assumption on the other prime. -/ universe u v w variable {K : Type u} [CommRing K] {B : Type v} [CommRing B] [Algebra K B] variable {ι : Type w} theorem generatedAlgebra_rationalPoint_kernel (v : ι → B) (hv : Algebra.adjoin K (Set.range v) = ⊤) (φ : B →ₐ[K] K) : RingHom.ker φ.toRingHom = Ideal.span (Set.range fun i => v i - algebraMap K B (φ (v i))) := by let I : Ideal B := Ideal.span (Set.range fun i => v i - algebraMap K B (φ (v i))) let q := Ideal.Quotient.mkₐ K I have hq : q = (Algebra.ofId K (B ⧸ I)).comp φ := by apply AlgHom.ext_of_adjoin_eq_top hv rintro _ ⟨i, rfl⟩ have hz : q (v i - algebraMap K B (φ (v i))) = 0 := Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.subset_span ⟨i, rfl⟩) rw [map_sub, q.commutes] at hz exact sub_eq_zero.mp hz apply le_antisymm · intro b hb apply Ideal.Quotient.eq_zero_iff_mem.mp change q b = 0 rw [hq] change algebraMap K (B ⧸ I) (φ b) = 0 rw [show φ b = 0 from hb, map_zero] · apply Ideal.span_le.mpr rintro _ ⟨i, rfl⟩ change φ (v i - algebraMap K B (φ (v i))) = 0 simp only [map_sub, φ.commutes, Algebra.algebraMap_self, RingHom.id_apply, sub_self] theorem rationalPoint_kernel_isMaximal {F : Type u} [Field F] {A : Type v} [CommRing A] [Algebra F A] (φ : A →ₐ[F] F) : (RingHom.ker φ.toRingHom).IsMaximal := by apply RingHom.ker_isMaximal_of_surjective intro a exact ⟨algebraMap F A a, φ.commutes a⟩ theorem generatedAlgebra_prime_eq_rationalPoint {F : Type u} [Field F] {A : Type v} [CommRing A] [Algebra F A] (v : ι → A) (hv : Algebra.adjoin F (Set.range v) = ⊤) (φ : A →ₐ[F] F) (P : Ideal A) [P.IsPrime] (hP : ∀ i, v i - algebraMap F A (φ (v i)) ∈ P) : P = RingHom.ker φ.toRingHom := by apply Eq.symm apply (rationalPoint_kernel_isMaximal φ).eq_of_le (Ideal.IsPrime.ne_top (inferInstance : P.IsPrime)) rw [generatedAlgebra_rationalPoint_kernel v hv φ] exact Ideal.span_le.mpr (by rintro _ ⟨i, rfl⟩; exact hP i) end end OAI.AlgebraicGeometry.AbelianModuli.HilbertConstruction.Generated.AlgebraRationalPointIdeal