| 
 | 1 | +/-  | 
 | 2 | +Copyright (c) 2025 Christian Merten. All rights reserved.  | 
 | 3 | +Released under Apache 2.0 license as described in the file LICENSE.  | 
 | 4 | +Authors: Christian Merten  | 
 | 5 | +-/  | 
 | 6 | +import Mathlib.Algebra.Module.FinitePresentation  | 
 | 7 | +import Mathlib.RingTheory.AdjoinRoot  | 
 | 8 | + | 
 | 9 | +/-!  | 
 | 10 | +# Finitely presented algebras and finitely presented modules  | 
 | 11 | +
  | 
 | 12 | +In this file we establish relations between finitely presented as an algebra and  | 
 | 13 | +finitely presented as a module.  | 
 | 14 | +
  | 
 | 15 | +## Main results:  | 
 | 16 | +
  | 
 | 17 | +- `Algebra.FinitePresentation.of_finitePresentation`: If `S` is finitely presented as a  | 
 | 18 | +  module over `R`, then it is finitely presented as an algebra over `R`.  | 
 | 19 | +- `Module.FinitePresentation.of_finite_of_finitePresentation`: If `S` is finite as a module over `R`  | 
 | 20 | +  and finitely presented as an algebra over `R`, then it is finitely presented as a module over `R`.  | 
 | 21 | +
  | 
 | 22 | +## References  | 
 | 23 | +
  | 
 | 24 | +- [Grothendieck, EGA IV₁ 1.4.7][ega-iv-1]  | 
 | 25 | +-/  | 
 | 26 | + | 
 | 27 | +universe u  | 
 | 28 | + | 
 | 29 | +variable (R : Type u) (S : Type*) [CommRing R] [CommRing S] [Algebra R S]  | 
 | 30 | + | 
 | 31 | +/-- EGA IV₁, 1.4.7.1 -/  | 
 | 32 | +lemma Module.Finite.exists_free_surjective [Module.Finite R S] :  | 
 | 33 | +    ∃ (S' : Type u) (_ : CommRing S') (_ : Algebra R S') (_ : Module.Finite R S')  | 
 | 34 | +      (_ : Module.Free R S') (_ : Algebra.FinitePresentation R S')  | 
 | 35 | +      (f : S' →ₐ[R] S), Function.Surjective f := by  | 
 | 36 | +  classical  | 
 | 37 | +  obtain ⟨s, hs⟩ : (⊤ : Submodule R S).FG := Module.finite_def.mp inferInstance  | 
 | 38 | +  suffices h : ∃ (S' : Type u) (_ : CommRing S') (_ : Algebra R S') (_ : Module.Finite R S')  | 
 | 39 | +      (_ : Module.Free R S') (_ : Algebra.FinitePresentation R S')  | 
 | 40 | +      (f : S' →ₐ[R] S), (s : Set S) ⊆ AlgHom.range f by  | 
 | 41 | +    obtain ⟨S', _, _, _, _, _, f, hsf⟩ := h  | 
 | 42 | +    have hf : Function.Surjective f := by  | 
 | 43 | +      have := (Submodule.span_le (p := LinearMap.range f.toLinearMap)).mpr hsf  | 
 | 44 | +      rwa [hs, top_le_iff, LinearMap.range_eq_top] at this  | 
 | 45 | +    use S', ‹_›, ‹_›, ‹_›, ‹_›, ‹_›, f  | 
 | 46 | +  clear hs  | 
 | 47 | +  induction s using Finset.induction with  | 
 | 48 | +  | empty =>  | 
 | 49 | +    exact ⟨R, _, _, inferInstance, inferInstance, inferInstance, Algebra.ofId R S, by simp⟩  | 
 | 50 | +  | insert a s has IH =>  | 
 | 51 | +    obtain ⟨S', _, _, _, _, _, f, hsf⟩ := IH  | 
 | 52 | +    have ha := Algebra.IsIntegral.isIntegral (R := R) a  | 
 | 53 | +    have := ((minpoly.monic ha).map (algebraMap R S')).finite_adjoinRoot  | 
 | 54 | +    have := ((minpoly.monic ha).map (algebraMap R S')).free_adjoinRoot  | 
 | 55 | +    algebraize [f.toRingHom]  | 
 | 56 | +    refine ⟨AdjoinRoot ((minpoly R a).map (algebraMap R S')), inferInstance, inferInstance,  | 
 | 57 | +      .trans S' _, .trans (S := S'), .trans _ S' _,  | 
 | 58 | +      (AdjoinRoot.liftAlgHom _ (Algebra.ofId _ _) a  | 
 | 59 | +        (by simp [← Polynomial.aeval_def])).restrictScalars R, ?_⟩  | 
 | 60 | +    simp only [Finset.coe_insert, AlgHom.coe_range, AlgHom.coe_restrictScalars',  | 
 | 61 | +      Set.insert_subset_iff, Set.mem_range]  | 
 | 62 | +    exact ⟨⟨.root _, by simp⟩, hsf.trans fun y ⟨x, hx⟩ ↦ ⟨.of _ x, by simpa⟩⟩  | 
 | 63 | + | 
 | 64 | +/-- If `S` is finitely presented as a module over `R`, it is finitely  | 
 | 65 | +presented as an algebra over `R`. -/  | 
 | 66 | +instance Algebra.FinitePresentation.of_finitePresentation  | 
 | 67 | +    [Module.FinitePresentation R S] : Algebra.FinitePresentation R S := by  | 
 | 68 | +  obtain ⟨S', _, _, _, _, _, f, hf⟩ := Module.Finite.exists_free_surjective R S  | 
 | 69 | +  refine .of_surjective hf ?_  | 
 | 70 | +  apply Submodule.FG.of_restrictScalars R  | 
 | 71 | +  exact Module.FinitePresentation.fg_ker f.toLinearMap hf  | 
 | 72 | + | 
 | 73 | +/-- If `S` is finite as a module over `R` and finitely presented as an algebra over `R`, then  | 
 | 74 | +it is finitely presented as a module over `R`. -/  | 
 | 75 | +@[stacks 0564 "The case M = S"]  | 
 | 76 | +lemma Module.FinitePresentation.of_finite_of_finitePresentation  | 
 | 77 | +    [Module.Finite R S] [Algebra.FinitePresentation R S] :  | 
 | 78 | +    Module.FinitePresentation R S := by  | 
 | 79 | +  classical  | 
 | 80 | +  obtain ⟨R', _, _, _, _, _, f, hf⟩ := Module.Finite.exists_free_surjective R S  | 
 | 81 | +  letI := f.toRingHom.toAlgebra  | 
 | 82 | +  have : IsScalarTower R R' S := .of_algebraMap_eq' f.comp_algebraMap.symm  | 
 | 83 | +  have : Module.FinitePresentation R R' :=  | 
 | 84 | +    Module.finitePresentation_of_projective R R'  | 
 | 85 | +  have : Module.FinitePresentation R' S :=  | 
 | 86 | +    Module.finitePresentation_of_surjective (Algebra.linearMap R' S) hf  | 
 | 87 | +      (Algebra.FinitePresentation.ker_fG_of_surjective f hf)  | 
 | 88 | +  exact .trans R S R'  | 
 | 89 | + | 
 | 90 | +/-- If `S` is a finite `R`-algebra, finitely presented as a module and as an algebra  | 
 | 91 | +is equivalent. -/  | 
 | 92 | +lemma Module.FinitePresentation.iff_finitePresentation_of_finite [Module.Finite R S] :  | 
 | 93 | +    Module.FinitePresentation R S ↔ Algebra.FinitePresentation R S :=  | 
 | 94 | +  ⟨fun _ ↦ .of_finitePresentation R S, fun _ ↦ .of_finite_of_finitePresentation R S⟩  | 
0 commit comments