Download lean/OAI/NumberTheory/PiExponent/Ampleness/AffineFunctionFieldCompatibility.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
map_units b := isUnit_iff_ne_zero.mpr (by
intro h
exact (mem_nonZeroDivisors_iff_ne_zero.mp b.2) (hB (by simpa using h)))
surj z :=by
obtain ⟨⟨a, s⟩, hs⟩ :=IsLocalization.surj (nonZeroDivisors A) z
havehn : algebraMap AB s ≠0:=by
intro he
havehe' : algebraMap AE s = 0:=by
rw [IsScalarTower.algebraMap_apply ABE, he, map_zero]
exact (mem_nonZeroDivisors_iff_ne_zero.mp s.2)
((IsFractionRing.injective AE) (by simp at he'))
refine ⟨⟨algebraMap AB a, ⟨algebraMap AB s, mem_nonZeroDivisors_iff_ne_zero.mpr hn⟩⟩, ?_⟩
simpa only [←IsScalarTower.algebraMap_apply ABE] using hs
exists_of_eq {a b} h := ⟨1, by simpa using hB h⟩
@[simp]theoremaffineFunctionFieldEquiv_toStalk (a : A) :
affineFunctionFieldEquiv AE (StructureSheaf.toStalk A
(genericPoint (Spec (.of A))) a) = algebraMap AE a :=by
proof · 6
lines
let : AlgebraA (Spec (.of A)).functionField :=AlgebraicGeometry.instAlgebraCarrierFunctionFieldSpec (.of A)
let : IsFractionRingA (Spec (.of A)).functionField :=
functionField_isFractionRing_of_affine (.of A)
exact (IsLocalization.algEquiv (nonZeroDivisors A)
(Spec (.of A)).functionField E).commutes a
theoremaffineFunctionFieldEquiv_stalk (q : PrimeSpectrumA)
[Algebra (Localization.AtPrime q.asIdeal) E]
[IsScalarTowerA (Localization.AtPrime q.asIdeal) E]
(a : (Spec (.of A)).presheaf.stalk q) :
affineFunctionFieldEquiv AE
((Spec (.of A)).presheaf.stalkSpecializes (genericPoint_specializes q) a) =
algebraMap (Localization.AtPrime q.asIdeal) E ((Spec.stalkIso (.of A) q).hom a) :=by
proof · 26
lines
let : AlgebraA ((Spec (.of A)).presheaf.stalk q) :=StructureSheaf.stalkAlgebra A q
let : IsLocalization.AtPrime ((Spec (.of A)).presheaf.stalk q) q.asIdeal :=StructureSheaf.IsLocalization.to_stalk A q
haveheq : (affineFunctionFieldEquiv AE).toRingHom.comp
((Spec (.of A)).presheaf.stalkSpecializes (genericPoint_specializes q)).hom =
(algebraMap (Localization.AtPrime q.asIdeal) E).comp
(Spec.stalkIso (.of A) q).hom.hom :=by
apply IsLocalization.ringHom_ext q.asIdeal.primeCompl
apply RingHom.ext
intro b
change affineFunctionFieldEquiv AE
((Spec (.of A)).presheaf.stalkSpecializes (genericPoint_specializes q)
(StructureSheaf.toStalk A q b)) =
algebraMap (Localization.AtPrime q.asIdeal) E
((Spec.stalkIso (.of A) q).hom (StructureSheaf.toStalk A q b))
havehs : (Spec (.of A)).presheaf.stalkSpecializes (genericPoint_specializes q)
(StructureSheaf.toStalk A q b) =
StructureSheaf.toStalk A (genericPoint (Spec (.of A))) b :=by
exact congrArg (fun h => h b)
(StructureSheaf.toStalk_stalkSpecializes (R:=A) (genericPoint_specializes q))
haveht : (Spec.stalkIso (.of A) q).hom (StructureSheaf.toStalk A q b) =
algebraMap A (Localization.AtPrime q.asIdeal) b :=
(StructureSheaf.stalkIso A q).symm.commutes b
rw [hs, ht, affineFunctionFieldEquiv_toStalk]
exact IsScalarTower.algebraMap_apply A (Localization.AtPrime q.asIdeal) E b
exact RingHom.congr_fun heq a
let : AlgebraA (Spec (.of A)).functionField :=AlgebraicGeometry.instAlgebraCarrierFunctionFieldSpec (.of A)
let : IsFractionRingA (Spec (.of A)).functionField :=
functionField_isFractionRing_of_affine (.of A)
apply IsLocalization.ringHom_ext (nonZeroDivisors A)
apply RingHom.ext
intro a
change affineFunctionFieldEquiv BE
(functionFieldRestriction (Spec.map (CommRingCat.ofHom (algebraMap AB)))
(StructureSheaf.toStalk A (genericPoint (Spec (.of A))) a)) =
affineFunctionFieldEquiv AE
(StructureSheaf.toStalk A (genericPoint (Spec (.of A))) a)
have h := congrArg (fun h => h a)
(functionFieldRestriction_toStalk (CommRingCat.ofHom (algebraMap AB)))
change functionFieldRestriction (Spec.map (CommRingCat.ofHom (algebraMap AB)))
(StructureSheaf.toStalk A (genericPoint (Spec (.of A))) a) =
StructureSheaf.toStalk B (genericPoint (Spec (.of B))) (algebraMap AB a) at h
rw [h, affineFunctionFieldEquiv_toStalk, affineFunctionFieldEquiv_toStalk]
exact (IsScalarTower.algebraMap_apply ABE a).symm