import Mathlib set_option autoImplicit false set_option maxHeartbeats 800000 set_option synthInstance.maxHeartbeats 400000 noncomputable section universe u open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TensorProduct noncomputable def kmf2_fiberSpecTensorIso (R S : Type u) [CommRing R] [CommRing S] [Algebra R S] (p : PrimeSpectrum R) : (Spec.map (CommRingCat.ofHom (algebraMap R S))).fiber p ≅ Spec (CommRingCat.of (p.asIdeal.Fiber S)) := pullbackSymmetry _ _ ≪≫ (pullback.congrHom (Scheme.Spec.map_residueFieldIso_inv_eq_fromSpecResidueField (CommRingCat.of R) p).symm rfl ≪≫ asIso (pullback.map _ _ _ _ (Spec.map (Scheme.Spec.residueFieldIso (CommRingCat.of R) p).inv) (𝟙 _) (𝟙 _) (by simp) (by simp))) ≪≫ pullbackSpecIso R p.asIdeal.ResidueField S theorem kmf2_fiberSpecTensorIso_hom_includeRight (R S : Type u) [CommRing R] [CommRing S] [Algebra R S] (p : PrimeSpectrum R) : (kmf2_fiberSpecTensorIso R S p).hom ≫ Spec.map (CommRingCat.ofHom (RingHomClass.toRingHom (Algebra.TensorProduct.includeRight (R := R) (A := p.asIdeal.ResidueField) (B := S)))) = (Spec.map (CommRingCat.ofHom (algebraMap R S))).fiberι p := by simp only [kmf2_fiberSpecTensorIso, Scheme.Hom.fiberι, Iso.trans_hom, asIso_hom, pullback.congrHom_hom, Category.assoc, pullbackSpecIso_hom_snd, pullback.lift_snd, Category.comp_id] exact pullbackSymmetry_hom_comp_snd _ _ theorem kmf2_fiberSpecTensorIso_point_comap (R S : Type u) [CommRing R] [CommRing S] [Algebra R S] (p : PrimeSpectrum R) (w : (Spec.map (CommRingCat.ofHom (algebraMap R S))).fiber p) : (((kmf2_fiberSpecTensorIso R S p).hom w).asIdeal).comap (Algebra.TensorProduct.includeRight (R := R) (A := p.asIdeal.ResidueField) (B := S)).toRingHom = ((Spec.map (CommRingCat.ofHom (algebraMap R S))).fiberι p w).asIdeal := by have h1 : Spec.map (CommRingCat.ofHom (RingHomClass.toRingHom (Algebra.TensorProduct.includeRight (R := R) (A := p.asIdeal.ResidueField) (B := S)))) ((kmf2_fiberSpecTensorIso R S p).hom w) = (Spec.map (CommRingCat.ofHom (algebraMap R S))).fiberι p w := by rw [← Scheme.Hom.comp_apply, kmf2_fiberSpecTensorIso_hom_includeRight] have h2 := congrArg PrimeSpectrum.asIdeal h1 rw [Spec.map_apply, PrimeSpectrum.comap_asIdeal, CommRingCat.hom_ofHom] at h2 exact h2 theorem kmf2_fiberStalk_localizationAtPrime (R S : Type u) [CommRing R] [CommRing S] [Algebra R S] (p : PrimeSpectrum R) (w : (Spec.map (CommRingCat.ofHom (algebraMap R S))).fiber p) : Nonempty (((Spec.map (CommRingCat.ofHom (algebraMap R S))).fiber p).presheaf.stalk w ≃+* Localization.AtPrime ((kmf2_fiberSpecTensorIso R S p).hom w).asIdeal) := ⟨(asIso ((kmf2_fiberSpecTensorIso R S p).hom.stalkMap w)).commRingCatIsoToRingEquiv.symm.trans ((StructureSheaf.stalkIso (p.asIdeal.Fiber S) ((kmf2_fiberSpecTensorIso R S p).hom w)).symm.toRingEquiv)⟩ theorem kmf2_fiberStalkLeg1_affineDatum (R S : Type u) [CommRing R] [CommRing S] [Algebra R S] (x : Spec (CommRingCat.of S)) : ∃ (Q : Ideal ((Spec.map (CommRingCat.ofHom (algebraMap R S)) x).asIdeal.Fiber S)) (_ : Q.IsPrime), Q.comap (Algebra.TensorProduct.includeRight (R := R) (A := (Spec.map (CommRingCat.ofHom (algebraMap R S)) x).asIdeal.ResidueField) (B := S)).toRingHom = x.asIdeal ∧ Nonempty (((Spec.map (CommRingCat.ofHom (algebraMap R S))).fiber (Spec.map (CommRingCat.ofHom (algebraMap R S)) x)).presheaf.stalk ((Spec.map (CommRingCat.ofHom (algebraMap R S))).asFiber x) ≃+* Localization.AtPrime Q) := by refine ⟨((kmf2_fiberSpecTensorIso R S (Spec.map (CommRingCat.ofHom (algebraMap R S)) x)).hom ((Spec.map (CommRingCat.ofHom (algebraMap R S))).asFiber x)).asIdeal, ((kmf2_fiberSpecTensorIso R S (Spec.map (CommRingCat.ofHom (algebraMap R S)) x)).hom ((Spec.map (CommRingCat.ofHom (algebraMap R S))).asFiber x)).2, ?_, ?_⟩ · rw [kmf2_fiberSpecTensorIso_point_comap] rw [Scheme.Hom.fiberι_asFiber] · exact kmf2_fiberStalk_localizationAtPrime R S (Spec.map (CommRingCat.ofHom (algebraMap R S)) x) ((Spec.map (CommRingCat.ofHom (algebraMap R S))).asFiber x) /-- info: 'kmf2_fiberSpecTensorIso' depends on axioms: [propext, Classical.choice, Quot.sound] -/ #guard_msgs (whitespace := lax) in #print axioms kmf2_fiberSpecTensorIso /-- info: 'kmf2_fiberSpecTensorIso_hom_includeRight' depends on axioms: [propext, Classical.choice, Quot.sound] -/ #guard_msgs (whitespace := lax) in #print axioms kmf2_fiberSpecTensorIso_hom_includeRight /-- info: 'kmf2_fiberSpecTensorIso_point_comap' depends on axioms: [propext, Classical.choice, Quot.sound] -/ #guard_msgs (whitespace := lax) in #print axioms kmf2_fiberSpecTensorIso_point_comap /-- info: 'kmf2_fiberStalk_localizationAtPrime' depends on axioms: [propext, Classical.choice, Quot.sound] -/ #guard_msgs (whitespace := lax) in #print axioms kmf2_fiberStalk_localizationAtPrime /-- info: 'kmf2_fiberStalkLeg1_affineDatum' depends on axioms: [propext, Classical.choice, Quot.sound] -/ #guard_msgs (whitespace := lax) in #print axioms kmf2_fiberStalkLeg1_affineDatum end