|
| 1 | +/- |
| 2 | +Copyright (c) 2021 Anne Baanen. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Anne Baanen |
| 5 | +
|
| 6 | +! This file was ported from Lean 3 source module ring_theory.integrally_closed |
| 7 | +! leanprover-community/mathlib commit d35b4ff446f1421bd551fafa4b8efd98ac3ac408 |
| 8 | +! Please do not edit these lines, except to modify the commit id |
| 9 | +! if you have ported upstream changes. |
| 10 | +-/ |
| 11 | +import Mathlib.RingTheory.IntegralClosure |
| 12 | +import Mathlib.RingTheory.Localization.Integral |
| 13 | + |
| 14 | +/-! |
| 15 | +# Integrally closed rings |
| 16 | +
|
| 17 | +An integrally closed domain `R` contains all the elements of `Frac(R)` that are |
| 18 | +integral over `R`. A special case of integrally closed domains are the Dedekind domains. |
| 19 | +
|
| 20 | +## Main definitions |
| 21 | +
|
| 22 | +* `IsIntegrallyClosed R` states `R` contains all integral elements of `Frac(R)` |
| 23 | +
|
| 24 | +## Main results |
| 25 | +
|
| 26 | +* `isIntegrallyClosed_iff K`, where `K` is a fraction field of `R`, states `R` |
| 27 | + is integrally closed iff it is the integral closure of `R` in `K` |
| 28 | +-/ |
| 29 | + |
| 30 | + |
| 31 | +open scoped nonZeroDivisors Polynomial |
| 32 | + |
| 33 | +open Polynomial |
| 34 | + |
| 35 | +/-- `R` is integrally closed if all integral elements of `Frac(R)` are also elements of `R`. |
| 36 | +
|
| 37 | +This definition uses `FractionRing R` to denote `Frac(R)`. See `isIntegrallyClosed_iff` |
| 38 | +if you want to choose another field of fractions for `R`. |
| 39 | +-/ |
| 40 | +class IsIntegrallyClosed (R : Type _) [CommRing R] [IsDomain R] : Prop where |
| 41 | + /-- All integral elements of `Frac(R)` are also elements of `R`. -/ |
| 42 | + algebraMap_eq_of_integral : |
| 43 | + ∀ {x : FractionRing R}, IsIntegral R x → ∃ y, algebraMap R (FractionRing R) y = x |
| 44 | +#align is_integrally_closed IsIntegrallyClosed |
| 45 | + |
| 46 | +section Iff |
| 47 | + |
| 48 | +variable {R : Type _} [CommRing R] [IsDomain R] |
| 49 | + |
| 50 | +variable (K : Type _) [Field K] [Algebra R K] [IsFractionRing R K] |
| 51 | + |
| 52 | +/-- `R` is integrally closed iff all integral elements of its fraction field `K` |
| 53 | +are also elements of `R`. -/ |
| 54 | +theorem isIntegrallyClosed_iff : |
| 55 | + IsIntegrallyClosed R ↔ ∀ {x : K}, IsIntegral R x → ∃ y, algebraMap R K y = x := by |
| 56 | + let e : K ≃ₐ[R] FractionRing R := IsLocalization.algEquiv R⁰ _ _ |
| 57 | + constructor |
| 58 | + · rintro ⟨cl⟩ |
| 59 | + refine' fun hx => _ |
| 60 | + obtain ⟨y, hy⟩ := cl ((isIntegral_algEquiv e).mpr hx) |
| 61 | + exact ⟨y, e.algebraMap_eq_apply.mp hy⟩ |
| 62 | + · rintro cl |
| 63 | + refine' ⟨fun hx => _⟩ |
| 64 | + obtain ⟨y, hy⟩ := cl ((isIntegral_algEquiv e.symm).mpr hx) |
| 65 | + exact ⟨y, e.symm.algebraMap_eq_apply.mp hy⟩ |
| 66 | +#align is_integrally_closed_iff isIntegrallyClosed_iff |
| 67 | + |
| 68 | +/-- `R` is integrally closed iff it is the integral closure of itself in its field of fractions. -/ |
| 69 | +theorem isIntegrallyClosed_iff_isIntegralClosure : IsIntegrallyClosed R ↔ IsIntegralClosure R R K := |
| 70 | + (isIntegrallyClosed_iff K).trans <| by |
| 71 | + constructor |
| 72 | + · intro cl |
| 73 | + refine' ⟨IsFractionRing.injective R K, ⟨cl, _⟩⟩ |
| 74 | + rintro ⟨y, y_eq⟩ |
| 75 | + rw [← y_eq] |
| 76 | + exact isIntegral_algebraMap |
| 77 | + · rintro ⟨-, cl⟩ x hx |
| 78 | + exact cl.mp hx |
| 79 | +#align is_integrally_closed_iff_is_integral_closure isIntegrallyClosed_iff_isIntegralClosure |
| 80 | + |
| 81 | +end Iff |
| 82 | + |
| 83 | +namespace IsIntegrallyClosed |
| 84 | + |
| 85 | +variable {R : Type _} [CommRing R] [id : IsDomain R] [iic : IsIntegrallyClosed R] |
| 86 | + |
| 87 | +variable {K : Type _} [Field K] [Algebra R K] [ifr : IsFractionRing R K] |
| 88 | + |
| 89 | +instance : IsIntegralClosure R R K := |
| 90 | + (isIntegrallyClosed_iff_isIntegralClosure K).mp iic |
| 91 | + |
| 92 | +theorem isIntegral_iff {x : K} : IsIntegral R x ↔ ∃ y : R, algebraMap R K y = x := |
| 93 | + IsIntegralClosure.isIntegral_iff |
| 94 | +#align is_integrally_closed.is_integral_iff IsIntegrallyClosed.isIntegral_iff |
| 95 | + |
| 96 | +theorem exists_algebraMap_eq_of_isIntegral_pow {x : K} {n : ℕ} (hn : 0 < n) |
| 97 | + (hx : IsIntegral R <| x ^ n) : ∃ y : R, algebraMap R K y = x := |
| 98 | + isIntegral_iff.mp <| isIntegral_of_pow hn hx |
| 99 | +#align is_integrally_closed.exists_algebra_map_eq_of_is_integral_pow IsIntegrallyClosed.exists_algebraMap_eq_of_isIntegral_pow |
| 100 | + |
| 101 | +theorem exists_algebraMap_eq_of_pow_mem_subalgebra {K : Type _} [Field K] [Algebra R K] |
| 102 | + {S : Subalgebra R K} [IsIntegrallyClosed S] [IsFractionRing S K] {x : K} {n : ℕ} (hn : 0 < n) |
| 103 | + (hx : x ^ n ∈ S) : ∃ y : S, algebraMap S K y = x := |
| 104 | + exists_algebraMap_eq_of_isIntegral_pow hn <| isIntegral_iff.mpr ⟨⟨x ^ n, hx⟩, rfl⟩ |
| 105 | +#align is_integrally_closed.exists_algebra_map_eq_of_pow_mem_subalgebra IsIntegrallyClosed.exists_algebraMap_eq_of_pow_mem_subalgebra |
| 106 | + |
| 107 | +variable (K) |
| 108 | + |
| 109 | +theorem integralClosure_eq_bot_iff : integralClosure R K = ⊥ ↔ IsIntegrallyClosed R := by |
| 110 | + refine' eq_bot_iff.trans _ |
| 111 | + constructor |
| 112 | + · rw [isIntegrallyClosed_iff K] |
| 113 | + intro h x hx |
| 114 | + exact Set.mem_range.mp (Algebra.mem_bot.mp (h hx)) |
| 115 | + · intro h x hx |
| 116 | + rw [Algebra.mem_bot, Set.mem_range] |
| 117 | + exact isIntegral_iff.mp hx |
| 118 | +#align is_integrally_closed.integral_closure_eq_bot_iff IsIntegrallyClosed.integralClosure_eq_bot_iff |
| 119 | + |
| 120 | +variable (R) |
| 121 | + |
| 122 | +@[simp] |
| 123 | +theorem integralClosure_eq_bot : integralClosure R K = ⊥ := |
| 124 | + (integralClosure_eq_bot_iff K).mpr ‹_› |
| 125 | +#align is_integrally_closed.integral_closure_eq_bot IsIntegrallyClosed.integralClosure_eq_bot |
| 126 | + |
| 127 | +end IsIntegrallyClosed |
| 128 | + |
| 129 | +namespace integralClosure |
| 130 | + |
| 131 | +open IsIntegrallyClosed |
| 132 | + |
| 133 | +variable {R : Type _} [CommRing R] |
| 134 | + |
| 135 | +variable (K : Type _) [Field K] [Algebra R K] |
| 136 | + |
| 137 | +variable [IsDomain R] [IsFractionRing R K] |
| 138 | + |
| 139 | +variable {L : Type _} [Field L] [Algebra K L] [Algebra R L] [IsScalarTower R K L] |
| 140 | + |
| 141 | +-- Can't be an instance because you need to supply `K`. |
| 142 | +theorem isIntegrallyClosedOfFiniteExtension [FiniteDimensional K L] : |
| 143 | + IsIntegrallyClosed (integralClosure R L) := |
| 144 | + letI : IsFractionRing (integralClosure R L) L := isFractionRing_of_finite_extension K L |
| 145 | + (integralClosure_eq_bot_iff L).mp integralClosure_idem |
| 146 | +#align integral_closure.is_integrally_closed_of_finite_extension integralClosure.isIntegrallyClosedOfFiniteExtension |
| 147 | + |
| 148 | +end integralClosure |
0 commit comments