import Mathlib import Definitions.Def_AlgebraicGeometry_NeronModelPropertyBundleCarrier import Definitions.Def_AlgebraicGeometry_TwoAffineOpenCover set_option autoImplicit false noncomputable section universe u open scoped TensorProduct open CategoryTheory CategoryTheory.Limits NeronModelInfra namespace AlgebraicGeometry.SmoothProperCurve structure FiniteMapData {R : Type u} [CommRing R] {C : Scheme.{u}} (c : C โŸถ Spec (CommRingCat.of R)) (ฮต : SchemeHomOver (๐Ÿ™ (Spec (CommRingCat.of R))) c) where U : C.Opens V : C.Opens f : ฮ“(C, U) g : ฮ“(C, V) m : โ„• isAffineOpen_U : IsAffineOpen U isAffineOpen_V : IsAffineOpen V sup_eq_top : U โŠ” V = โŠค mem_U_iff : โˆ€ x : C, x โˆˆ U โ†” x โˆ‰ Set.range ฮต.1.base inf_eq_basicOpen : U โŠ“ V = C.basicOpen f inf_eq_basicOpen_g : U โŠ“ V = C.basicOpen g res_f_mul_res_g : (C.presheaf.map (homOfLE (inf_le_left : U โŠ“ V โ‰ค U)).op).hom f * (C.presheaf.map (homOfLE (inf_le_right : U โŠ“ V โ‰ค V)).op).hom g = 1 finite_f : letI := Scheme.TwoAffineOpenCover.algebraOfHom c U (Polynomial.aeval f : Polynomial R โ†’โ‚[R] ฮ“(C, U)).toRingHom.Finite finite_g : letI := Scheme.TwoAffineOpenCover.algebraOfHom c V (Polynomial.aeval g : Polynomial R โ†’โ‚[R] ฮ“(C, V)).toRingHom.Finite levelSet_free : โˆ€ (S : Type u) [CommRing S] [Algebra R S] [IsLocalRing S] (s : S), letI := Scheme.TwoAffineOpenCover.algebraOfHom c U Module.Finite S (S โŠ—[R] ฮ“(C, U) โงธ Ideal.span {(1 : S) โŠ—โ‚œ[R] f - s โŠ—โ‚œ[R] (1 : ฮ“(C, U))}) โˆง Module.Free S (S โŠ—[R] ฮ“(C, U) โงธ Ideal.span {(1 : S) โŠ—โ‚œ[R] f - s โŠ—โ‚œ[R] (1 : ฮ“(C, U))}) โˆง Module.finrank S (S โŠ—[R] ฮ“(C, U) โงธ Ideal.span {(1 : S) โŠ—โ‚œ[R] f - s โŠ—โ‚œ[R] (1 : ฮ“(C, U))}) = m namespace FiniteMapData variable {R : Type u} [CommRing R] {C : Scheme.{u}} {c : C โŸถ Spec (CommRingCat.of R)} {ฮต : SchemeHomOver (๐Ÿ™ (Spec (CommRingCat.of R))) c} (๐”‰ : FiniteMapData c ฮต) theorem range_subset_V : Set.range ฮต.1.base โІ (๐”‰.V : Set C) := by rintro x โŸจy, rflโŸฉ have hx : ฮต.1.base y โˆˆ (โŠค : C.Opens) := trivial rw [โ† ๐”‰.sup_eq_top, TopologicalSpace.Opens.mem_sup] at hx rcases hx with h | h ยท exact absurd โŸจy, rflโŸฉ ((๐”‰.mem_U_iff _).mp h) ยท exact h theorem coe_U_eq_compl : (๐”‰.U : Set C) = (Set.range ฮต.1.base)แถœ := Set.ext fun x => ๐”‰.mem_U_iff x theorem isAffineOpen_inf : IsAffineOpen (๐”‰.U โŠ“ ๐”‰.V) := by rw [๐”‰.inf_eq_basicOpen]; exact ๐”‰.isAffineOpen_U.basicOpen _ theorem basicOpen_f_eq_basicOpen_g : C.basicOpen ๐”‰.f = C.basicOpen ๐”‰.g := by rw [โ† ๐”‰.inf_eq_basicOpen, ๐”‰.inf_eq_basicOpen_g] def twoAffineOpenCover : C.TwoAffineOpenCover where U0 := ๐”‰.V U1 := ๐”‰.U isAffineOpen_U0 := ๐”‰.isAffineOpen_V isAffineOpen_U1 := ๐”‰.isAffineOpen_U sup_eq_top := by rw [sup_comm, ๐”‰.sup_eq_top] isAffineOpen_inf := by rw [inf_comm]; exact ๐”‰.isAffineOpen_inf @[simp] theorem twoAffineOpenCover_U0 : ๐”‰.twoAffineOpenCover.U0 = ๐”‰.V := rfl @[simp] theorem twoAffineOpenCover_U1 : ๐”‰.twoAffineOpenCover.U1 = ๐”‰.U := rfl theorem range_subset_twoAffineOpenCover_U0 : Set.range ฮต.1.base โІ (๐”‰.twoAffineOpenCover.U0 : Set C) := ๐”‰.range_subset_V theorem twoAffineOpenCover_U1_eq_compl : (๐”‰.twoAffineOpenCover.U1 : Set C) = (Set.range ฮต.1.base)แถœ := ๐”‰.coe_U_eq_compl theorem moduleFinite_U : letI := Scheme.TwoAffineOpenCover.algebraOfHom c ๐”‰.U letI : Algebra (Polynomial R) ฮ“(C, ๐”‰.U) := (Polynomial.aeval ๐”‰.f : Polynomial R โ†’โ‚[R] ฮ“(C, ๐”‰.U)).toRingHom.toAlgebra Module.Finite (Polynomial R) ฮ“(C, ๐”‰.U) := ๐”‰.finite_f theorem moduleFinite_V : letI := Scheme.TwoAffineOpenCover.algebraOfHom c ๐”‰.V letI : Algebra (Polynomial R) ฮ“(C, ๐”‰.V) := (Polynomial.aeval ๐”‰.g : Polynomial R โ†’โ‚[R] ฮ“(C, ๐”‰.V)).toRingHom.toAlgebra Module.Finite (Polynomial R) ฮ“(C, ๐”‰.V) := ๐”‰.finite_g theorem levelSet_finite (S : Type u) [CommRing S] [Algebra R S] [IsLocalRing S] (s : S) : letI := Scheme.TwoAffineOpenCover.algebraOfHom c ๐”‰.U Module.Finite S (S โŠ—[R] ฮ“(C, ๐”‰.U) โงธ Ideal.span {(1 : S) โŠ—โ‚œ[R] ๐”‰.f - s โŠ—โ‚œ[R] (1 : ฮ“(C, ๐”‰.U))}) := (๐”‰.levelSet_free S s).1 theorem levelSet_finrank_eq (S : Type u) [CommRing S] [Algebra R S] [IsLocalRing S] (s : S) : letI := Scheme.TwoAffineOpenCover.algebraOfHom c ๐”‰.U Module.finrank S (S โŠ—[R] ฮ“(C, ๐”‰.U) โงธ Ideal.span {(1 : S) โŠ—โ‚œ[R] ๐”‰.f - s โŠ—โ‚œ[R] (1 : ฮ“(C, ๐”‰.U))}) = ๐”‰.m := (๐”‰.levelSet_free S s).2.2 def LevelSetsGenericallyEtale : Prop := โˆƒ D : Polynomial R, (โˆƒ i, IsUnit (D.coeff i)) โˆง โˆ€ (S : Type u) [CommRing S] [Algebra R S] [IsLocalRing S] [IsLocalHom (algebraMap R S)] (s : S), IsUnit (Polynomial.aeval s D) โ†’ letI := Scheme.TwoAffineOpenCover.algebraOfHom c ๐”‰.U Algebra.Etale S (S โŠ—[R] ฮ“(C, ๐”‰.U) โงธ Ideal.span {(1 : S) โŠ—โ‚œ[R] ๐”‰.f - s โŠ—โ‚œ[R] (1 : ฮ“(C, ๐”‰.U))}) end FiniteMapData end AlgebraicGeometry.SmoothProperCurve end