Module

PullbackOfPointModuleIsoFoldrPowRamificationIndex.lean

Nyll.AlgebraicCurves.Models.Ramification.PullbackOfPointModuleIsoFoldrPowRamificationIndex
7 declarations indexed from sourceView source ↗

Curve Model nonempty pullback of Point module iso foldr pow ramification Index Along of

point Equiv Place comp eq restrict Along

Declarations

AlgebraicCurves.Models.Proofs.PointModuleRamificationPullback.CNM17.ker_comap_of_isIso
Source context 19 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
open _root_.AlgebraicCurve (
  isCurveOver_of_ringEquiv_functionField_of_isIntegral_of_smoothOfRelativeDimension_one)
open AlgebraicGeometry.Scheme.IdealSheafData (topModuleIso)
namespace AlgebraicCurves.Models.Proofs.PointModuleRamificationPullback
attribute [-instance]
  instIsPrimeCenter
  instIsFractionRingIntegralClosureAt
  instIsTorsionFreeSubtypeMemValuationSubringToValuationSubringIntegralClosureAt
  instIsDedekindDomainIntegralClosureAt
  instFiniteSubtypeMemValuationSubringToValuationSubringIntegralClosureAt
  instIsRankOneDiscreteWithZeroMultiplicativeIntAdicValuation
  instIsTrivialOnWithZeroMultiplicativeIntAdicValuation
attribute [-instance]
  instNontrivialInftyValueGroup
attribute [-simp] AlgebraicCurve.Place.placeOfPrime_toValuationSubring
  AlgebraicCurve.Place.mem_fiberOver AlgebraicCurve.Place.fiberEquiv_symm_apply
  AlgebraicCurve.Place.fiberEquiv_apply AlgebraicCurve.Place.centerHeightOneSpectrum_asIdeal
  AlgebraicCurve.Place.congrEquiv_symm_apply
  AlgebraicCurve.RationalFunctionField.heightOneSpectrumOfIrreducible_asIdeal
  AlgebraicCurve.Place.congrRingEquiv_toValuationSubring AlgebraicCurve.Place.congrEquiv_apply
  AlgebraicCurve.Place.coe_comapSymmRingEquiv_apply
  AlgebraicCurve.RationalFunctionField.deg_placeOfPoint
attribute [-simp] AlgebraicCurve.RationalFunctionField.placeInfty_toValuationSubring
  AlgebraicCurve.RationalFunctionField.placeEquivOption_placeInfty
  AlgebraicCurve.RationalFunctionField.placeEquivOption_symm_some
  AlgebraicCurve.RationalFunctionField.placeEquivOption_placeOfPoint
  AlgebraicCurve.RationalFunctionField.placeEquivOption_symm_none
universe u v
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.CategoryTheory.MonoidalCategory
open _root_.AlgebraicGeometry
open _root_.AlgebraicCurve
noncomputable section
namespace CNM17
section IsoTransport
variable {X Y W : Scheme.{u}}
theorem ker_comap_of_isIso (i : W ⟶ Y) [IsClosedImmersion i] (g : X ⟶ Y) [IsIso g] :
    i.ker.comap g = (i ≫ inv g).ker
AlgebraicCurves.Models.Proofs.PointModuleRamificationPullback.CNM17.comap_mul_of_isIso
Source context 19 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
open _root_.AlgebraicCurve (
  isCurveOver_of_ringEquiv_functionField_of_isIntegral_of_smoothOfRelativeDimension_one)
open AlgebraicGeometry.Scheme.IdealSheafData (topModuleIso)
namespace AlgebraicCurves.Models.Proofs.PointModuleRamificationPullback
attribute [-instance]
  instIsPrimeCenter
  instIsFractionRingIntegralClosureAt
  instIsTorsionFreeSubtypeMemValuationSubringToValuationSubringIntegralClosureAt
  instIsDedekindDomainIntegralClosureAt
  instFiniteSubtypeMemValuationSubringToValuationSubringIntegralClosureAt
  instIsRankOneDiscreteWithZeroMultiplicativeIntAdicValuation
  instIsTrivialOnWithZeroMultiplicativeIntAdicValuation
attribute [-instance]
  instNontrivialInftyValueGroup
attribute [-simp] AlgebraicCurve.Place.placeOfPrime_toValuationSubring
  AlgebraicCurve.Place.mem_fiberOver AlgebraicCurve.Place.fiberEquiv_symm_apply
  AlgebraicCurve.Place.fiberEquiv_apply AlgebraicCurve.Place.centerHeightOneSpectrum_asIdeal
  AlgebraicCurve.Place.congrEquiv_symm_apply
  AlgebraicCurve.RationalFunctionField.heightOneSpectrumOfIrreducible_asIdeal
  AlgebraicCurve.Place.congrRingEquiv_toValuationSubring AlgebraicCurve.Place.congrEquiv_apply
  AlgebraicCurve.Place.coe_comapSymmRingEquiv_apply
  AlgebraicCurve.RationalFunctionField.deg_placeOfPoint
attribute [-simp] AlgebraicCurve.RationalFunctionField.placeInfty_toValuationSubring
  AlgebraicCurve.RationalFunctionField.placeEquivOption_placeInfty
  AlgebraicCurve.RationalFunctionField.placeEquivOption_symm_some
  AlgebraicCurve.RationalFunctionField.placeEquivOption_placeOfPoint
  AlgebraicCurve.RationalFunctionField.placeEquivOption_symm_none
universe u v
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.CategoryTheory.MonoidalCategory
open _root_.AlgebraicGeometry
open _root_.AlgebraicCurve
noncomputable section
namespace CNM17
section IsoTransport
variable {X Y W : Scheme.{u}}
theorem comap_mul_of_isIso (I J : Y.IdealSheafData) (g : X ⟶ Y) [IsIso g] :
    (I * J).comap g = I.comap g * J.comap g
AlgebraicCurves.Models.Proofs.PointModuleRamificationPullback.CNM17.comapMonoidHom

Pullback of ideal sheaves along an isomorphism, preserving products and the unit ideal.

Source context 19 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
open _root_.AlgebraicCurve (
  isCurveOver_of_ringEquiv_functionField_of_isIntegral_of_smoothOfRelativeDimension_one)
open AlgebraicGeometry.Scheme.IdealSheafData (topModuleIso)
namespace AlgebraicCurves.Models.Proofs.PointModuleRamificationPullback
attribute [-instance]
  instIsPrimeCenter
  instIsFractionRingIntegralClosureAt
  instIsTorsionFreeSubtypeMemValuationSubringToValuationSubringIntegralClosureAt
  instIsDedekindDomainIntegralClosureAt
  instFiniteSubtypeMemValuationSubringToValuationSubringIntegralClosureAt
  instIsRankOneDiscreteWithZeroMultiplicativeIntAdicValuation
  instIsTrivialOnWithZeroMultiplicativeIntAdicValuation
attribute [-instance]
  instNontrivialInftyValueGroup
attribute [-simp] AlgebraicCurve.Place.placeOfPrime_toValuationSubring
  AlgebraicCurve.Place.mem_fiberOver AlgebraicCurve.Place.fiberEquiv_symm_apply
  AlgebraicCurve.Place.fiberEquiv_apply AlgebraicCurve.Place.centerHeightOneSpectrum_asIdeal
  AlgebraicCurve.Place.congrEquiv_symm_apply
  AlgebraicCurve.RationalFunctionField.heightOneSpectrumOfIrreducible_asIdeal
  AlgebraicCurve.Place.congrRingEquiv_toValuationSubring AlgebraicCurve.Place.congrEquiv_apply
  AlgebraicCurve.Place.coe_comapSymmRingEquiv_apply
  AlgebraicCurve.RationalFunctionField.deg_placeOfPoint
attribute [-simp] AlgebraicCurve.RationalFunctionField.placeInfty_toValuationSubring
  AlgebraicCurve.RationalFunctionField.placeEquivOption_placeInfty
  AlgebraicCurve.RationalFunctionField.placeEquivOption_symm_some
  AlgebraicCurve.RationalFunctionField.placeEquivOption_placeOfPoint
  AlgebraicCurve.RationalFunctionField.placeEquivOption_symm_none
universe u v
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.CategoryTheory.MonoidalCategory
open _root_.AlgebraicGeometry
open _root_.AlgebraicCurve
noncomputable section
namespace CNM17
section IsoTransport
variable {X Y W : Scheme.{u}}
def comapMonoidHom (g : X ⟶ Y) [IsIso g] : Y.IdealSheafData →* X.IdealSheafData where
  toFun I := I.comap g
  map_one' := Scheme.IdealSheafData.comap_top g
  map_mul' I J := comap_mul_of_isIso I J g
AlgebraicCurves.Models.Proofs.PointModuleRamificationPullback.CNM17.comapMonoidHom_apply
Source context 19 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
open _root_.AlgebraicCurve (
  isCurveOver_of_ringEquiv_functionField_of_isIntegral_of_smoothOfRelativeDimension_one)
open AlgebraicGeometry.Scheme.IdealSheafData (topModuleIso)
namespace AlgebraicCurves.Models.Proofs.PointModuleRamificationPullback
attribute [-instance]
  instIsPrimeCenter
  instIsFractionRingIntegralClosureAt
  instIsTorsionFreeSubtypeMemValuationSubringToValuationSubringIntegralClosureAt
  instIsDedekindDomainIntegralClosureAt
  instFiniteSubtypeMemValuationSubringToValuationSubringIntegralClosureAt
  instIsRankOneDiscreteWithZeroMultiplicativeIntAdicValuation
  instIsTrivialOnWithZeroMultiplicativeIntAdicValuation
attribute [-instance]
  instNontrivialInftyValueGroup
attribute [-simp] AlgebraicCurve.Place.placeOfPrime_toValuationSubring
  AlgebraicCurve.Place.mem_fiberOver AlgebraicCurve.Place.fiberEquiv_symm_apply
  AlgebraicCurve.Place.fiberEquiv_apply AlgebraicCurve.Place.centerHeightOneSpectrum_asIdeal
  AlgebraicCurve.Place.congrEquiv_symm_apply
  AlgebraicCurve.RationalFunctionField.heightOneSpectrumOfIrreducible_asIdeal
  AlgebraicCurve.Place.congrRingEquiv_toValuationSubring AlgebraicCurve.Place.congrEquiv_apply
  AlgebraicCurve.Place.coe_comapSymmRingEquiv_apply
  AlgebraicCurve.RationalFunctionField.deg_placeOfPoint
attribute [-simp] AlgebraicCurve.RationalFunctionField.placeInfty_toValuationSubring
  AlgebraicCurve.RationalFunctionField.placeEquivOption_placeInfty
  AlgebraicCurve.RationalFunctionField.placeEquivOption_symm_some
  AlgebraicCurve.RationalFunctionField.placeEquivOption_placeOfPoint
  AlgebraicCurve.RationalFunctionField.placeEquivOption_symm_none
universe u v
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.CategoryTheory.MonoidalCategory
open _root_.AlgebraicGeometry
open _root_.AlgebraicCurve
noncomputable section
namespace CNM17
section IsoTransport
variable {X Y W : Scheme.{u}}
theorem comapMonoidHom_apply (g : X ⟶ Y) [IsIso g] (I : Y.IdealSheafData) : comapMonoidHom g I =
  I.comap g
AlgebraicCurves.Models.Proofs.PointModuleRamificationPullback.CNM17.isInvertible_listProd
Source context 19 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
open _root_.AlgebraicCurve (
  isCurveOver_of_ringEquiv_functionField_of_isIntegral_of_smoothOfRelativeDimension_one)
open AlgebraicGeometry.Scheme.IdealSheafData (topModuleIso)
namespace AlgebraicCurves.Models.Proofs.PointModuleRamificationPullback
attribute [-instance]
  instIsPrimeCenter
  instIsFractionRingIntegralClosureAt
  instIsTorsionFreeSubtypeMemValuationSubringToValuationSubringIntegralClosureAt
  instIsDedekindDomainIntegralClosureAt
  instFiniteSubtypeMemValuationSubringToValuationSubringIntegralClosureAt
  instIsRankOneDiscreteWithZeroMultiplicativeIntAdicValuation
  instIsTrivialOnWithZeroMultiplicativeIntAdicValuation
attribute [-instance]
  instNontrivialInftyValueGroup
attribute [-simp] AlgebraicCurve.Place.placeOfPrime_toValuationSubring
  AlgebraicCurve.Place.mem_fiberOver AlgebraicCurve.Place.fiberEquiv_symm_apply
  AlgebraicCurve.Place.fiberEquiv_apply AlgebraicCurve.Place.centerHeightOneSpectrum_asIdeal
  AlgebraicCurve.Place.congrEquiv_symm_apply
  AlgebraicCurve.RationalFunctionField.heightOneSpectrumOfIrreducible_asIdeal
  AlgebraicCurve.Place.congrRingEquiv_toValuationSubring AlgebraicCurve.Place.congrEquiv_apply
  AlgebraicCurve.Place.coe_comapSymmRingEquiv_apply
  AlgebraicCurve.RationalFunctionField.deg_placeOfPoint
attribute [-simp] AlgebraicCurve.RationalFunctionField.placeInfty_toValuationSubring
  AlgebraicCurve.RationalFunctionField.placeEquivOption_placeInfty
  AlgebraicCurve.RationalFunctionField.placeEquivOption_symm_some
  AlgebraicCurve.RationalFunctionField.placeEquivOption_placeOfPoint
  AlgebraicCurve.RationalFunctionField.placeEquivOption_symm_none
universe u v
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.CategoryTheory.MonoidalCategory
open _root_.AlgebraicGeometry
open _root_.AlgebraicCurve
noncomputable section
namespace CNM17
section prodmod
variable {X : Scheme.{u}} {ι : Type*}
theorem isInvertible_listProd (J : ι → X.IdealSheafData) (hJ : ∀ i, (J i).IsInvertible) :
    ∀ l : List ι, ((l.map J).prod).IsInvertible
  | [] => by
    rw [List.map_nil, List.prod_nil, Scheme.IdealSheafData.one_eq_top]
    exact Scheme.IdealSheafData.isInvertible_top
  | (i :: l) => by
    rw [List.map_cons, List.prod_cons]
    exact (hJ i).mul (isInvertible_listProd J hJ l)
AlgebraicCurves.Models.Proofs.PointModuleRamificationPullback.CNM17.nonempty_listProd_module_iso_foldr
Source context 19 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
open _root_.AlgebraicCurve (
  isCurveOver_of_ringEquiv_functionField_of_isIntegral_of_smoothOfRelativeDimension_one)
open AlgebraicGeometry.Scheme.IdealSheafData (topModuleIso)
namespace AlgebraicCurves.Models.Proofs.PointModuleRamificationPullback
attribute [-instance]
  instIsPrimeCenter
  instIsFractionRingIntegralClosureAt
  instIsTorsionFreeSubtypeMemValuationSubringToValuationSubringIntegralClosureAt
  instIsDedekindDomainIntegralClosureAt
  instFiniteSubtypeMemValuationSubringToValuationSubringIntegralClosureAt
  instIsRankOneDiscreteWithZeroMultiplicativeIntAdicValuation
  instIsTrivialOnWithZeroMultiplicativeIntAdicValuation
attribute [-instance]
  instNontrivialInftyValueGroup
attribute [-simp] AlgebraicCurve.Place.placeOfPrime_toValuationSubring
  AlgebraicCurve.Place.mem_fiberOver AlgebraicCurve.Place.fiberEquiv_symm_apply
  AlgebraicCurve.Place.fiberEquiv_apply AlgebraicCurve.Place.centerHeightOneSpectrum_asIdeal
  AlgebraicCurve.Place.congrEquiv_symm_apply
  AlgebraicCurve.RationalFunctionField.heightOneSpectrumOfIrreducible_asIdeal
  AlgebraicCurve.Place.congrRingEquiv_toValuationSubring AlgebraicCurve.Place.congrEquiv_apply
  AlgebraicCurve.Place.coe_comapSymmRingEquiv_apply
  AlgebraicCurve.RationalFunctionField.deg_placeOfPoint
attribute [-simp] AlgebraicCurve.RationalFunctionField.placeInfty_toValuationSubring
  AlgebraicCurve.RationalFunctionField.placeEquivOption_placeInfty
  AlgebraicCurve.RationalFunctionField.placeEquivOption_symm_some
  AlgebraicCurve.RationalFunctionField.placeEquivOption_placeOfPoint
  AlgebraicCurve.RationalFunctionField.placeEquivOption_symm_none
universe u v
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.CategoryTheory.MonoidalCategory
open _root_.AlgebraicGeometry
open _root_.AlgebraicCurve
noncomputable section
namespace CNM17
section prodmod
variable {X : Scheme.{u}} {ι : Type*}
theorem nonempty_listProd_module_iso_foldr (J : ι → X.IdealSheafData) (hJ : ∀ i, (J
  i).IsInvertible) :
    ∀ l : List ι, Nonempty (((l.map J).prod).module ≅ l.foldr (fun i N => (J i).module ⊗ N) (𝟙_
      X.Modules))
  | [] => by
    rw [List.map_nil, List.prod_nil, Scheme.IdealSheafData.one_eq_top]
    exact ⟨topModuleIso⟩
  | (i :: l) => by
    obtain ⟨e⟩ := nonempty_listProd_module_iso_foldr J hJ l
    obtain ⟨m⟩ := (hJ i).nonempty_mul_module_iso_tensor (isInvertible_listProd J hJ l)
    rw [List.map_cons, List.prod_cons, List.foldr_cons]
    exact ⟨m ≪≫ whiskerLeftIso _ e⟩
AlgebraicCurve.CurveModel.pullback_pointModule_iso_ramification_of_pointEquivPlace_comp_eq_restrictAlong
Source context 13 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
open _root_.AlgebraicCurve (
  isCurveOver_of_ringEquiv_functionField_of_isIntegral_of_smoothOfRelativeDimension_one)
open AlgebraicGeometry.Scheme.IdealSheafData (topModuleIso)
namespace AlgebraicCurve.CurveModel
open _root_.AlgebraicCurves.Models.Proofs.PointModuleRamificationPullback
universe u v
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.CategoryTheory.MonoidalCategory
open _root_.AlgebraicGeometry
open _root_.AlgebraicCurve
open _root_.AlgebraicCurves.Models.Proofs.PointModuleRamificationPullback.CNM17 in
theorem pullback_pointModule_iso_ramification_of_pointEquivPlace_comp_eq_restrictAlong
    {k : Type u} [Field k] [IsAlgClosed k]
    {F : Type v} [Field F] [Algebra k F] [HasPrincipalDivisors k F] {F' : Type v} [Field F']
      [Algebra k F'] [HasPrincipalDivisors k F']
    (M : CurveModel k F) (M' : CurveModel k F')
    (φ : F →ₐ[k] F') (hφ : φ.toRingHom.IsIntegral)
    (g : M'.C ⟶ M.C) (hg : g ≫ M.toBase = M'.toBase)
    (hgφ : ∀ x' : {q : Spec (CommRingCat.of k) ⟶ M'.C // q ≫ M'.toBase = 𝟙 _},
      M.pointEquivPlace ⟨x'.1 ≫ g,
        by rw [Category.assoc, hg]; exact x'.2⟩ = (M'.pointEquivPlace x').restrictAlong φ hφ)
    (gk : pullback M'.toBase (𝟙 (Spec (CommRingCat.of k))) ⟶ pullback M.toBase (𝟙 (Spec
      (CommRingCat.of k))))
    (hgk₁ : gk ≫ pullback.fst _ _ = pullback.fst _ _ ≫ g) (hgk₂ : gk ≫ pullback.snd _ _ =
      pullback.snd _ _)
    (x : {q : Spec (CommRingCat.of k) ⟶ M.C // q ≫ M.toBase = 𝟙 _}) :
    Nonempty ((Scheme.Modules.pullback gk).obj (RelEffCartierDiv.ofPoint M.toBase x.1 x.2).I.module
      ≅
      ((Place.fiberAlong φ hφ (M.pointEquivPlace x)).toList.foldr
        (fun W N => ((RelEffCartierDiv.ofPoint M'.toBase (M'.pointEquivPlace.symm W).1
          (M'.pointEquivPlace.symm W).2).I ^
          (Place.ramificationIndexAlong φ W)).module ⊗ N)
        (𝟙_ (pullback M'.toBase (𝟙 (Spec (CommRingCat.of k)))).Modules))) := by
  classical
  let := algebraAlong φ
  have := isScalarTower_along φ
  have := isIntegral_along φ hφ
  have : IsCurveOver k F :=
    isCurveOver_of_ringEquiv_functionField_of_isIntegral_of_smoothOfRelativeDimension_one
      M.toBase M.ffEquiv M.ffEquiv_algebraMap
  have : IsCurveOver k F' :=
    isCurveOver_of_ringEquiv_functionField_of_isIntegral_of_smoothOfRelativeDimension_one
      M'.toBase M'.ffEquiv M'.ffEquiv_algebraMap
  have hess : ∀ {L : Type v} [Field L] [Algebra k L] (N : CurveModel k L), Algebra.EssFiniteType k
    L := by
    intro L _ _ N
    let algKC : Algebra k N.C.functionField := N.functionFieldAlgebra
    have h1 : Algebra.EssFiniteType k N.C.functionField :=
      AlgebraicCurve.essFiniteType_functionField N.toBase
    exact (Algebra.EssFiniteType.iff_of_algEquiv (N.ffAlgEquiv.symm : N.C.functionField ≃ₐ[k]
      L)).mp h1
  have : Algebra.EssFiniteType k F := hess M
  have : Algebra.EssFiniteType k F' := hess M'
  obtain ⟨hfin, hflat, hlfp, -⟩ :=
    AlgebraicCurve.CurveModel.finite_flat_surjective_of_pointEquivPlace_comp_eq_restrictAlong
      M M' φ hφ g hg hgφ
  have := hfin; have := hflat; have := hlfp
  have hplace : ∀ (y : {q : Spec (CommRingCat.of k) ⟶ M'.C // q ≫ M'.toBase = 𝟙 _})
      (x₀ : {q : Spec (CommRingCat.of k) ⟶ M.C // q ≫ M.toBase = 𝟙 _}),
      y.1 ≫ g = x₀.1 → (M'.pointEquivPlace y).restrict F = M.pointEquivPlace x₀ := by
    intro y x₀ h
    have hx : (⟨y.1 ≫ g, by rw [Category.assoc, hg]; exact y.2⟩ :
        {q : Spec (CommRingCat.of k) ⟶ M.C // q ≫ M.toBase = 𝟙 _}) = x₀ :=
      Subtype.ext h
    have := hgφ y
    rw [hx] at this
    rw [this]
    rfl
  have hker := AlgebraicCurve.CurveModel.ker_comap_eq_prod_ker_pow_ramificationIndex M M' g hg
    hplace x
  have hci : ∀ {C : Scheme.{u}} (c : C ⟶ Spec (CommRingCat.of k)) [IsSeparated c] (z : {q : Spec
    (CommRingCat.of k) ⟶ C // q ≫ c = 𝟙 _}),
      IsClosedImmersion z.1 := by
    intro C c _ z
    have : IsClosedImmersion (z.1 ≫ c) := by rw [z.2]; infer_instance
    exact .of_comp z.1 c
  have : IsClosedImmersion x.1 := hci M.toBase x
  have : ∀ w, IsClosedImmersion (M'.pointEquivPlace.symm w).1 := fun w => hci M'.toBase _
  let pr : pullback M.toBase (𝟙 (Spec (CommRingCat.of k))) ⟶ M.C := pullback.fst _ _
  let pr' : pullback M'.toBase (𝟙 (Spec (CommRingCat.of k))) ⟶ M'.C := pullback.fst _ _
  have hgk_transport : gk = pr' ≫ g ≫ inv pr := by
    apply pullback.hom_ext
    · change gk ≫ pr = (pr' ≫ g ≫ inv pr) ≫ pr
      simpa only [Category.assoc, IsIso.inv_hom_id, Category.comp_id] using hgk₁
    · have hpr_snd : inv pr ≫ pullback.snd M.toBase (𝟙 (Spec (CommRingCat.of k))) =
          M.toBase := by
        rw [IsIso.inv_comp_eq]
        simpa only [Category.comp_id] using
          (pullback.condition (f := M.toBase) (g := 𝟙 (Spec (CommRingCat.of k)))).symm
      rw [hgk₂, Category.assoc, Category.assoc, hpr_snd, hg]
      simpa only [Category.comp_id] using
        (pullback.condition (f := M'.toBase) (g := 𝟙 (Spec (CommRingCat.of k)))).symm
  have hgr : graphOver M.toBase x.1 x.2 = x.1 ≫ inv pr := by
    rw [IsIso.eq_comp_inv, graphOver_fst]
  have hgr' : ∀ w, graphOver M'.toBase (M'.pointEquivPlace.symm w).1 (M'.pointEquivPlace.symm w).2
    = (M'.pointEquivPlace.symm w).1 ≫ inv pr' :=
    fun w => by rw [IsIso.eq_comp_inv, graphOver_fst]
  have hpoint_comap :
      (RelEffCartierDiv.ofPoint M.toBase x.1 x.2).I.comap (inv pr) = x.1.ker := by
    rw [RelEffCartierDiv.ofPoint_I, hgr, ← ker_comap_of_isIso x.1 pr,
      ← Scheme.IdealSheafData.comap_comp, IsIso.inv_hom_id, Scheme.IdealSheafData.comap_id]
  have hcomap : (RelEffCartierDiv.ofPoint M.toBase x.1 x.2).I.comap gk =
      ∏ w ∈ (M.pointEquivPlace x).fiber F',
        (RelEffCartierDiv.ofPoint M'.toBase (M'.pointEquivPlace.symm w).1 (M'.pointEquivPlace.symm
          w).2).I ^ (w.ramificationIndex F) := by
    rw [hgk_transport, ← Category.assoc, Scheme.IdealSheafData.comap_comp, hpoint_comap,
      Scheme.IdealSheafData.comap_comp, hker, ← comapMonoidHom_apply, map_prod]
    refine Finset.prod_congr rfl fun w _ => ?_
    rw [map_pow, comapMonoidHom_apply, ker_comap_of_isIso, RelEffCartierDiv.ofPoint_I, hgr' w]
  have : SmoothOfRelativeDimension 1 (pullback.snd M.toBase (𝟙 (Spec (CommRingCat.of k)))) :=
    (smoothOfRelativeDimension_isStableUnderBaseChange (n := 1)).of_isPullback
      (IsPullback.of_hasPullback M.toBase (𝟙 (Spec (CommRingCat.of k)))) inferInstance
  have : SmoothOfRelativeDimension 1 (pullback.snd M'.toBase (𝟙 (Spec (CommRingCat.of k)))) :=
    (smoothOfRelativeDimension_isStableUnderBaseChange (n := 1)).of_isPullback
      (IsPullback.of_hasPullback M'.toBase (𝟙 (Spec (CommRingCat.of k)))) inferInstance
  have hIinv : (RelEffCartierDiv.ofPoint M.toBase x.1 x.2).I.IsInvertible :=
    Scheme.Hom.isInvertible_ker_of_comp_eq_id (p := pullback.snd M.toBase (𝟙 _)) (graphOver
      M.toBase x.1 x.2) (graphOver_snd _ _ _)
  let J : Place k F' → (pullback M'.toBase (𝟙 (Spec (CommRingCat.of k)))).IdealSheafData := fun w =>
    (RelEffCartierDiv.ofPoint M'.toBase (M'.pointEquivPlace.symm w).1 (M'.pointEquivPlace.symm
      w).2).I ^ (w.ramificationIndex F)
  have hJinv : ∀ w, (J w).IsInvertible := fun w =>
    (Scheme.Hom.isInvertible_ker_of_comp_eq_id (p := pullback.snd M'.toBase (𝟙 _))
      (graphOver M'.toBase (M'.pointEquivPlace.symm w).1 (M'.pointEquivPlace.symm w).2)
        (graphOver_snd _ _ _)).pow _
  have hprod : ∏ w ∈ (M.pointEquivPlace x).fiber F', J w = (((M.pointEquivPlace x).fiber
    F').toList.map J).prod :=
    (Finset.prod_map_toList _ J).symm
  have hIcinv : ((RelEffCartierDiv.ofPoint M.toBase x.1 x.2).I.comap gk).IsInvertible := by
    rw [hcomap]
    change (∏ w ∈ (M.pointEquivPlace x).fiber F', J w).IsInvertible
    rw [hprod]
    exact isInvertible_listProd J hJinv _
  have := hIinv.isIso_pullbackModuleComparison gk hIcinv
  let i₁ := asIso ((RelEffCartierDiv.ofPoint M.toBase x.1 x.2).I.pullbackModuleComparison gk)
  have i₂ : ((RelEffCartierDiv.ofPoint M.toBase x.1 x.2).I.comap gk).module ≅ ((((M.pointEquivPlace
    x).fiber F').toList.map J).prod).module :=
    eqToIso
      (by rw [hcomap]; change (∏ w ∈ (M.pointEquivPlace x).fiber F', J w).module = _; rw [hprod])
  obtain ⟨i₃⟩ := nonempty_listProd_module_iso_foldr J hJinv ((M.pointEquivPlace x).fiber F').toList
  exact ⟨i₁ ≪≫ i₂ ≪≫ i₃⟩