|
| 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.RingTheory.Extension.Presentation.Basic |
| 7 | + |
| 8 | +/-! |
| 9 | +# Presentations on subrings |
| 10 | +
|
| 11 | +In this file we establish the API for realising a presentation over a |
| 12 | +subring of `R`. We define a property `HasCoeffs R₀` for a presentation `P` to mean |
| 13 | +the (sub)ring `R₀` contains the coefficients of the relations of `P`. |
| 14 | +subring `R₀` of `R` that contains the coefficients of the relations |
| 15 | +In this case there exists a model of `S` over `R₀`, i.e., there exists an `R₀`-algebra `S₀` |
| 16 | +such that `S` is isomorphic to `R ⊗[R₀] S₀`. |
| 17 | +
|
| 18 | +If the presentation is finite, `R₀` may be chosen as a Noetherian ring. In this case, |
| 19 | +this API can be used to remove Noetherian hypothesis in certain cases. |
| 20 | +
|
| 21 | +-/ |
| 22 | + |
| 23 | +open TensorProduct |
| 24 | + |
| 25 | +variable {R S ι σ : Type*} [CommRing R] [CommRing S] [Algebra R S] |
| 26 | + |
| 27 | +variable {P : Algebra.Presentation R S ι σ} |
| 28 | + |
| 29 | +namespace Algebra.Presentation |
| 30 | + |
| 31 | +variable (P) in |
| 32 | +/-- The coefficients of a presentation are the coefficients of the relations. -/ |
| 33 | +def coeffs : Set R := ⋃ (i : σ), (P.relation i).coeffs |
| 34 | + |
| 35 | +lemma coeffs_relation_subset_coeffs (x : σ) : |
| 36 | + ((P.relation x).coeffs : Set R) ⊆ P.coeffs := |
| 37 | + Set.subset_iUnion_of_subset x (by simp) |
| 38 | + |
| 39 | +lemma finite_coeffs [Finite σ] : P.coeffs.Finite := |
| 40 | + Set.finite_iUnion fun _ ↦ Finset.finite_toSet _ |
| 41 | + |
| 42 | +variable (P) in |
| 43 | +/-- The core of a presentation is the subalgebra generated by the coefficients of the relations. -/ |
| 44 | +def core : Subalgebra ℤ R := Algebra.adjoin _ P.coeffs |
| 45 | + |
| 46 | +variable (P) in |
| 47 | +lemma coeffs_subset_core : P.coeffs ⊆ P.core := Algebra.subset_adjoin |
| 48 | + |
| 49 | +lemma coeffs_relation_subset_core (x : σ) : |
| 50 | + ((P.relation x).coeffs : Set R) ⊆ P.core := |
| 51 | + subset_trans (P.coeffs_relation_subset_coeffs x) P.coeffs_subset_core |
| 52 | + |
| 53 | +variable (P) in |
| 54 | +/-- The core coerced to a type for performance reasons. -/ |
| 55 | +def Core : Type _ := P.core |
| 56 | + |
| 57 | +instance : CommRing P.Core := fast_instance% (inferInstanceAs <| CommRing P.core) |
| 58 | +instance : Algebra P.Core R := fast_instance% (inferInstanceAs <| Algebra P.core R) |
| 59 | +instance : FaithfulSMul P.Core R := inferInstanceAs <| FaithfulSMul P.core R |
| 60 | +instance : Algebra P.Core S := fast_instance% (inferInstanceAs <| Algebra P.core S) |
| 61 | +instance : IsScalarTower P.Core R S := inferInstanceAs <| IsScalarTower P.core R S |
| 62 | + |
| 63 | +instance [Finite σ] : FiniteType ℤ P.Core := .adjoin_of_finite P.finite_coeffs |
| 64 | + |
| 65 | +variable (P) in |
| 66 | +/-- |
| 67 | +A ring `R₀` has the coefficients of the presentation `P` if the coefficients of the relations of `P` |
| 68 | +lie in the image of `R₀` in `R`. |
| 69 | +The smallest subring of `R` satisfying this is given by `Algebra.Presentation.Core P`. |
| 70 | +-/ |
| 71 | +class HasCoeffs (R₀ : Type*) [CommRing R₀] [Algebra R₀ R] [Algebra R₀ S] |
| 72 | + [IsScalarTower R₀ R S] where |
| 73 | + coeffs_subset_range : P.coeffs ⊆ Set.range (algebraMap R₀ R) |
| 74 | + |
| 75 | +instance : P.HasCoeffs P.Core where |
| 76 | + coeffs_subset_range := by |
| 77 | + refine subset_trans P.coeffs_subset_core ?_ |
| 78 | + simp [Core, Subalgebra.algebraMap_eq] |
| 79 | + |
| 80 | +variable (R₀ : Type*) [CommRing R₀] [Algebra R₀ R] [Algebra R₀ S] [IsScalarTower R₀ R S] |
| 81 | + [P.HasCoeffs R₀] |
| 82 | + |
| 83 | +lemma coeffs_subset_range : (P.coeffs : Set R) ⊆ Set.range (algebraMap R₀ R) := |
| 84 | + HasCoeffs.coeffs_subset_range |
| 85 | + |
| 86 | +lemma HasCoeffs.of_isScalarTower {R₁ : Type*} [CommRing R₁] [Algebra R₀ R₁] [Algebra R₁ R] |
| 87 | + [IsScalarTower R₀ R₁ R] [Algebra R₁ S] [IsScalarTower R₁ R S] : |
| 88 | + P.HasCoeffs R₁ := by |
| 89 | + refine ⟨subset_trans (P.coeffs_subset_range R₀) ?_⟩ |
| 90 | + simp [IsScalarTower.algebraMap_eq R₀ R₁ R, RingHom.coe_comp, Set.range_comp] |
| 91 | + |
| 92 | +instance (s : Set R) : P.HasCoeffs (Algebra.adjoin R₀ s) := HasCoeffs.of_isScalarTower R₀ |
| 93 | + |
| 94 | +lemma HasCoeffs.coeffs_relation_mem_range (x : σ) : |
| 95 | + ↑(P.relation x).coeffs ⊆ Set.range (algebraMap R₀ R) := |
| 96 | + subset_trans (P.coeffs_relation_subset_coeffs x) HasCoeffs.coeffs_subset_range |
| 97 | + |
| 98 | +lemma HasCoeffs.relation_mem_range_map (x : σ) : |
| 99 | + P.relation x ∈ Set.range (MvPolynomial.map (algebraMap R₀ R)) := by |
| 100 | + rw [MvPolynomial.mem_range_map_iff_coeffs_subset] |
| 101 | + exact HasCoeffs.coeffs_relation_mem_range R₀ x |
| 102 | + |
| 103 | +/-- The `r`-th relation of `P` as a polynomial in `R₀`. This is the (arbitrary) choice of a |
| 104 | +pre-image under the map `R₀[X] → R[X]`. -/ |
| 105 | +noncomputable def relationOfHasCoeffs (r : σ) : MvPolynomial ι R₀ := |
| 106 | + (HasCoeffs.relation_mem_range_map (P := P) R₀ r).choose |
| 107 | + |
| 108 | +lemma map_relationOfHasCoeffs (r : σ) : |
| 109 | + MvPolynomial.map (algebraMap R₀ R) (P.relationOfHasCoeffs R₀ r) = P.relation r := |
| 110 | + (HasCoeffs.relation_mem_range_map R₀ r).choose_spec |
| 111 | + |
| 112 | +@[simp] |
| 113 | +lemma aeval_val_relationOfHasCoeffs (r : σ) : |
| 114 | + MvPolynomial.aeval P.val (P.relationOfHasCoeffs R₀ r) = 0 := by |
| 115 | + rw [← MvPolynomial.aeval_map_algebraMap R, map_relationOfHasCoeffs, aeval_val_relation] |
| 116 | + |
| 117 | +@[simp] |
| 118 | +lemma algebraTensorAlgEquiv_symm_relation (r : σ) : |
| 119 | + (MvPolynomial.algebraTensorAlgEquiv R₀ R).symm (P.relation r) = |
| 120 | + 1 ⊗ₜ P.relationOfHasCoeffs R₀ r := by |
| 121 | + rw [← map_relationOfHasCoeffs R₀, MvPolynomial.algebraTensorAlgEquiv_symm_map] |
| 122 | + |
| 123 | +/-- The model of `S` over a `R₀` that contains the coefficients of `P` is `R₀[X]` quotiented by the |
| 124 | +same relations. -/ |
| 125 | +abbrev ModelOfHasCoeffs : Type _ := |
| 126 | + MvPolynomial ι R₀ ⧸ (Ideal.span <| Set.range (P.relationOfHasCoeffs R₀)) |
| 127 | + |
| 128 | +instance [Finite ι] [Finite σ] : Algebra.FinitePresentation R₀ (P.ModelOfHasCoeffs R₀) := by |
| 129 | + classical |
| 130 | + cases nonempty_fintype σ |
| 131 | + exact .quotient ⟨Finset.image (P.relationOfHasCoeffs R₀) .univ, by simp⟩ |
| 132 | + |
| 133 | +variable (P) in |
| 134 | +/-- (Implementation detail): The underlying `AlgHom` of `tensorModelOfHasCoeffsEquiv`. -/ |
| 135 | +noncomputable def tensorModelOfHasCoeffsHom : R ⊗[R₀] P.ModelOfHasCoeffs R₀ →ₐ[R] S := |
| 136 | + Algebra.TensorProduct.lift (Algebra.ofId R S) |
| 137 | + (Ideal.Quotient.liftₐ _ (MvPolynomial.aeval P.val) <| by |
| 138 | + simp_rw [← RingHom.mem_ker, ← SetLike.le_def, Ideal.span_le] |
| 139 | + rintro a ⟨i, rfl⟩ |
| 140 | + simp) |
| 141 | + fun _ _ ↦ Commute.all _ _ |
| 142 | + |
| 143 | +@[simp] |
| 144 | +lemma tensorModelOfHasCoeffsHom_tmul (x : R) (y : MvPolynomial ι R₀) : |
| 145 | + P.tensorModelOfHasCoeffsHom R₀ (x ⊗ₜ y) = algebraMap R S x * MvPolynomial.aeval P.val y := |
| 146 | + rfl |
| 147 | + |
| 148 | +variable (P) in |
| 149 | +/-- (Implementation detail): The inverse of `tensorModelOfHasCoeffsHom`. -/ |
| 150 | +noncomputable def tensorModelOfHasCoeffsInv : S →ₐ[R] R ⊗[R₀] P.ModelOfHasCoeffs R₀ := |
| 151 | + (Ideal.Quotient.liftₐ _ |
| 152 | + ((Algebra.TensorProduct.map (.id R R) (Ideal.Quotient.mkₐ _ _)).comp |
| 153 | + (MvPolynomial.algebraTensorAlgEquiv R₀ R).symm.toAlgHom) <| by |
| 154 | + simp_rw [← RingHom.mem_ker, ← SetLike.le_def] |
| 155 | + rw [← P.span_range_relation_eq_ker, Ideal.span_le] |
| 156 | + rintro a ⟨i, rfl⟩ |
| 157 | + simp only [AlgEquiv.toAlgHom_eq_coe, SetLike.mem_coe, RingHom.mem_ker, AlgHom.coe_comp, |
| 158 | + AlgHom.coe_coe, Function.comp_apply, algebraTensorAlgEquiv_symm_relation] |
| 159 | + simp only [TensorProduct.map_tmul, AlgHom.coe_id, id_eq, Ideal.Quotient.mkₐ_eq_mk, |
| 160 | + Ideal.Quotient.mk_span_range, tmul_zero]).comp |
| 161 | + (P.quotientEquiv.restrictScalars R).symm.toAlgHom |
| 162 | + |
| 163 | +@[simp] |
| 164 | +lemma tensorModelOfHasCoeffsInv_aeval_val (x : MvPolynomial ι R₀) : |
| 165 | + P.tensorModelOfHasCoeffsInv R₀ (MvPolynomial.aeval P.val x) = |
| 166 | + 1 ⊗ₜ[R₀] (Ideal.Quotient.mk _ x) := by |
| 167 | + rw [← MvPolynomial.aeval_map_algebraMap R, ← Generators.algebraMap_apply, ← quotientEquiv_mk] |
| 168 | + simp [tensorModelOfHasCoeffsInv, -quotientEquiv_symm, -quotientEquiv_mk] |
| 169 | + |
| 170 | +private lemma hom_comp_inv : |
| 171 | + (P.tensorModelOfHasCoeffsHom R₀).comp (P.tensorModelOfHasCoeffsInv R₀) = AlgHom.id R S := by |
| 172 | + have h : Function.Surjective |
| 173 | + ((P.quotientEquiv.restrictScalars R).toAlgHom.comp (Ideal.Quotient.mkₐ _ _)) := |
| 174 | + (P.quotientEquiv.restrictScalars R).surjective.comp Ideal.Quotient.mk_surjective |
| 175 | + simp only [← AlgHom.cancel_right h, tensorModelOfHasCoeffsInv, AlgEquiv.toAlgHom_eq_coe, |
| 176 | + AlgHom.id_comp] |
| 177 | + rw [AlgHom.comp_assoc, AlgHom.comp_assoc, ← AlgHom.comp_assoc _ _ (Ideal.Quotient.mkₐ R P.ker), |
| 178 | + AlgEquiv.symm_comp, AlgHom.id_comp] |
| 179 | + ext x |
| 180 | + simp |
| 181 | + |
| 182 | +private lemma inv_comp_hom : |
| 183 | + (P.tensorModelOfHasCoeffsInv R₀).comp (P.tensorModelOfHasCoeffsHom R₀) = AlgHom.id R _ := by |
| 184 | + ext x |
| 185 | + obtain ⟨x, rfl⟩ := Ideal.Quotient.mk_surjective x |
| 186 | + simp |
| 187 | + |
| 188 | +/-- The natural isomorphism `R ⊗[R₀] S₀ ≃ₐ[R] S`. -/ |
| 189 | +noncomputable def tensorModelOfHasCoeffsEquiv : R ⊗[R₀] P.ModelOfHasCoeffs R₀ ≃ₐ[R] S := |
| 190 | + AlgEquiv.ofAlgHom (P.tensorModelOfHasCoeffsHom R₀) (P.tensorModelOfHasCoeffsInv R₀) |
| 191 | + (P.hom_comp_inv R₀) (P.inv_comp_hom R₀) |
| 192 | + |
| 193 | +@[simp] |
| 194 | +lemma tensorModelOfHasCoeffsEquiv_tmul (x : R) (y : MvPolynomial ι R₀) : |
| 195 | + P.tensorModelOfHasCoeffsEquiv R₀ (x ⊗ₜ y) = algebraMap R S x * MvPolynomial.aeval P.val y := |
| 196 | + rfl |
| 197 | + |
| 198 | +@[simp] |
| 199 | +lemma tensorModelOfHasCoeffsEquiv_symm_tmul (x : MvPolynomial ι R₀) : |
| 200 | + (P.tensorModelOfHasCoeffsEquiv R₀).symm (MvPolynomial.aeval P.val x) = |
| 201 | + 1 ⊗ₜ[R₀] (Ideal.Quotient.mk _ x) := |
| 202 | + tensorModelOfHasCoeffsInv_aeval_val _ x |
| 203 | + |
| 204 | +end Algebra.Presentation |
0 commit comments