state
stringlengths 0
159k
| srcUpToTactic
stringlengths 387
167k
| nextTactic
stringlengths 3
9k
| declUpToTactic
stringlengths 22
11.5k
| declId
stringlengths 38
95
| decl
stringlengths 16
1.89k
| file_tag
stringlengths 17
73
|
---|---|---|---|---|---|---|
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
x : P
hx : x = 0
⊢ (Algebra.linearMap R P) 0 = x | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by | simp [hx] | @[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by | Mathlib.RingTheory.FractionalIdeal.275_0.90B1BH8AtSmfl9S | @[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : FractionalIdeal S P
h : ↑I = ⊥
⊢ (fun I => ↑I) I = (fun I => ↑I) 0 | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by | simp [h] | theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by | Mathlib.RingTheory.FractionalIdeal.326_0.90B1BH8AtSmfl9S | theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : FractionalIdeal S P
h : I = 0
⊢ ↑I = ⊥ | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by | simp [h] | theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by | Mathlib.RingTheory.FractionalIdeal.326_0.90B1BH8AtSmfl9S | theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
⊢ ↑1 = 1 | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
| rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top] | @[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
| Mathlib.RingTheory.FractionalIdeal.369_0.90B1BH8AtSmfl9S | @[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : FractionalIdeal S P
⊢ 0 ≤ I | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
| intro x hx | theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
| Mathlib.RingTheory.FractionalIdeal.390_0.90B1BH8AtSmfl9S | theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : FractionalIdeal S P
x : P
hx : x ∈ 0
⊢ x ∈ I | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
| rw [(mem_zero_iff _).mp hx] | theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
| Mathlib.RingTheory.FractionalIdeal.390_0.90B1BH8AtSmfl9S | theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : FractionalIdeal S P
x : P
hx : x ∈ 0
⊢ 0 ∈ I | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
| exact zero_mem (I : Submodule R P) | theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
| Mathlib.RingTheory.FractionalIdeal.390_0.90B1BH8AtSmfl9S | theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : FractionalIdeal S P
h : I = 0
x : P
hx : x ∈ I
⊢ x = 0 | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by | simpa [h, mem_zero_iff] using hx | theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by | Mathlib.RingTheory.FractionalIdeal.412_0.90B1BH8AtSmfl9S | theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : Submodule R P
aI : R
haI : aI ∈ S
hI : ∀ b ∈ I, IsInteger R (aI • b)
aJ : R
haJ : aJ ∈ S
hJ : ∀ b ∈ J, IsInteger R (aJ • b)
b : P
hb : b ∈ I ⊔ J
⊢ IsInteger R ((aI * aJ) • b) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
| rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩ | theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
| Mathlib.RingTheory.FractionalIdeal.417_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩ | Mathlib_RingTheory_FractionalIdeal |
case intro.intro.intro.intro
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : Submodule R P
aI : R
haI : aI ∈ S
hI : ∀ b ∈ I, IsInteger R (aI • b)
aJ : R
haJ : aJ ∈ S
hJ : ∀ b ∈ J, IsInteger R (aJ • b)
bI : P
hbI : bI ∈ I
bJ : P
hbJ : bJ ∈ J
hb : bI + bJ ∈ I ⊔ J
⊢ IsInteger R ((aI * aJ) • (bI + bJ)) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
| rw [smul_add] | theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
| Mathlib.RingTheory.FractionalIdeal.417_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩ | Mathlib_RingTheory_FractionalIdeal |
case intro.intro.intro.intro
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : Submodule R P
aI : R
haI : aI ∈ S
hI : ∀ b ∈ I, IsInteger R (aI • b)
aJ : R
haJ : aJ ∈ S
hJ : ∀ b ∈ J, IsInteger R (aJ • b)
bI : P
hbI : bI ∈ I
bJ : P
hbJ : bJ ∈ J
hb : bI + bJ ∈ I ⊔ J
⊢ IsInteger R ((aI * aJ) • bI + (aI * aJ) • bJ) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
| apply isInteger_add | theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
| Mathlib.RingTheory.FractionalIdeal.417_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩ | Mathlib_RingTheory_FractionalIdeal |
case intro.intro.intro.intro.ha
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : Submodule R P
aI : R
haI : aI ∈ S
hI : ∀ b ∈ I, IsInteger R (aI • b)
aJ : R
haJ : aJ ∈ S
hJ : ∀ b ∈ J, IsInteger R (aJ • b)
bI : P
hbI : bI ∈ I
bJ : P
hbJ : bJ ∈ J
hb : bI + bJ ∈ I ⊔ J
⊢ IsInteger R ((aI * aJ) • bI) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· | rw [mul_smul, smul_comm] | theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· | Mathlib.RingTheory.FractionalIdeal.417_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩ | Mathlib_RingTheory_FractionalIdeal |
case intro.intro.intro.intro.ha
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : Submodule R P
aI : R
haI : aI ∈ S
hI : ∀ b ∈ I, IsInteger R (aI • b)
aJ : R
haJ : aJ ∈ S
hJ : ∀ b ∈ J, IsInteger R (aJ • b)
bI : P
hbI : bI ∈ I
bJ : P
hbJ : bJ ∈ J
hb : bI + bJ ∈ I ⊔ J
⊢ IsInteger R (aJ • aI • bI) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
| exact isInteger_smul (hI bI hbI) | theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
| Mathlib.RingTheory.FractionalIdeal.417_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩ | Mathlib_RingTheory_FractionalIdeal |
case intro.intro.intro.intro.hb
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : Submodule R P
aI : R
haI : aI ∈ S
hI : ∀ b ∈ I, IsInteger R (aI • b)
aJ : R
haJ : aJ ∈ S
hJ : ∀ b ∈ J, IsInteger R (aJ • b)
bI : P
hbI : bI ∈ I
bJ : P
hbJ : bJ ∈ J
hb : bI + bJ ∈ I ⊔ J
⊢ IsInteger R ((aI * aJ) • bJ) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· | rw [mul_smul] | theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· | Mathlib.RingTheory.FractionalIdeal.417_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩ | Mathlib_RingTheory_FractionalIdeal |
case intro.intro.intro.intro.hb
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : Submodule R P
aI : R
haI : aI ∈ S
hI : ∀ b ∈ I, IsInteger R (aI • b)
aJ : R
haJ : aJ ∈ S
hJ : ∀ b ∈ J, IsInteger R (aJ • b)
bI : P
hbI : bI ∈ I
bJ : P
hbJ : bJ ∈ J
hb : bI + bJ ∈ I ⊔ J
⊢ IsInteger R (aI • aJ • bJ) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
| exact isInteger_smul (hJ bJ hbJ) | theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
| Mathlib.RingTheory.FractionalIdeal.417_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩ | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : Submodule R P
aI : R
haI : aI ∈ S
hI : ∀ b ∈ I, IsInteger R (aI • b)
J : Submodule R P
b : P
hb : b ∈ I ⊓ J
⊢ IsInteger R (aI • b) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
| rcases mem_inf.mp hb with ⟨hbI, _⟩ | theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
| Mathlib.RingTheory.FractionalIdeal.430_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩ | Mathlib_RingTheory_FractionalIdeal |
case intro
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : Submodule R P
aI : R
haI : aI ∈ S
hI : ∀ b ∈ I, IsInteger R (aI • b)
J : Submodule R P
b : P
hb : b ∈ I ⊓ J
hbI : b ∈ I
right✝ : b ∈ J
⊢ IsInteger R (aI • b) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
| exact hI b hbI | theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
| Mathlib.RingTheory.FractionalIdeal.430_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩ | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : Submodule R P
x✝ : IsFractional S I
⊢ IsFractional S (0 • I) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
| rw [zero_smul] | theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
| Mathlib.RingTheory.FractionalIdeal.483_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h) | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : Submodule R P
x✝ : IsFractional S I
⊢ IsFractional S 0 | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
| convert ((0 : Ideal R) : FractionalIdeal S P).isFractional | theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
| Mathlib.RingTheory.FractionalIdeal.483_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h) | Mathlib_RingTheory_FractionalIdeal |
case h.e'_7
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : Submodule R P
x✝ : IsFractional S I
⊢ 0 = ↑↑0 | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
| simp | theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
| Mathlib.RingTheory.FractionalIdeal.483_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h) | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : Submodule R P
n : ℕ
h : IsFractional S I
⊢ IsFractional S ((n + 1) • I) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
| rw [succ_nsmul] | theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
| Mathlib.RingTheory.FractionalIdeal.483_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h) | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : Submodule R P
n : ℕ
h : IsFractional S I
⊢ IsFractional S (I + n • I) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
| exact h.sup (IsFractional.nsmul n h) | theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
| Mathlib.RingTheory.FractionalIdeal.483_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h) | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : Submodule R P
aI : R
haI : aI ∈ S
hI : ∀ b ∈ I, IsInteger R (aI • b)
aJ : R
haJ : aJ ∈ S
hJ : ∀ b ∈ J, IsInteger R (aJ • b)
b : P
hb : b ∈ I * J
⊢ IsInteger R ((aI * aJ) • b) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
| refine Submodule.mul_induction_on hb ?_ ?_ | theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
| Mathlib.RingTheory.FractionalIdeal.502_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ | Mathlib_RingTheory_FractionalIdeal |
case refine_1
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : Submodule R P
aI : R
haI : aI ∈ S
hI : ∀ b ∈ I, IsInteger R (aI • b)
aJ : R
haJ : aJ ∈ S
hJ : ∀ b ∈ J, IsInteger R (aJ • b)
b : P
hb : b ∈ I * J
⊢ ∀ m ∈ I, ∀ n ∈ J, IsInteger R ((aI * aJ) • (m * n)) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· | intro m hm n hn | theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· | Mathlib.RingTheory.FractionalIdeal.502_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ | Mathlib_RingTheory_FractionalIdeal |
case refine_1
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : Submodule R P
aI : R
haI : aI ∈ S
hI : ∀ b ∈ I, IsInteger R (aI • b)
aJ : R
haJ : aJ ∈ S
hJ : ∀ b ∈ J, IsInteger R (aJ • b)
b : P
hb : b ∈ I * J
m : P
hm : m ∈ I
n : P
hn : n ∈ J
⊢ IsInteger R ((aI * aJ) • (m * n)) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
| obtain ⟨n', hn'⟩ := hJ n hn | theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
| Mathlib.RingTheory.FractionalIdeal.502_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ | Mathlib_RingTheory_FractionalIdeal |
case refine_1.intro
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : Submodule R P
aI : R
haI : aI ∈ S
hI : ∀ b ∈ I, IsInteger R (aI • b)
aJ : R
haJ : aJ ∈ S
hJ : ∀ b ∈ J, IsInteger R (aJ • b)
b : P
hb : b ∈ I * J
m : P
hm : m ∈ I
n : P
hn : n ∈ J
n' : R
hn' : (algebraMap R P) n' = aJ • n
⊢ IsInteger R ((aI * aJ) • (m * n)) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
| rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def] | theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
| Mathlib.RingTheory.FractionalIdeal.502_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ | Mathlib_RingTheory_FractionalIdeal |
case refine_1.intro
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : Submodule R P
aI : R
haI : aI ∈ S
hI : ∀ b ∈ I, IsInteger R (aI • b)
aJ : R
haJ : aJ ∈ S
hJ : ∀ b ∈ J, IsInteger R (aJ • b)
b : P
hb : b ∈ I * J
m : P
hm : m ∈ I
n : P
hn : n ∈ J
n' : R
hn' : (algebraMap R P) n' = aJ • n
⊢ IsInteger R (aI • n' • m) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
| apply hI | theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
| Mathlib.RingTheory.FractionalIdeal.502_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ | Mathlib_RingTheory_FractionalIdeal |
case refine_1.intro.a
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : Submodule R P
aI : R
haI : aI ∈ S
hI : ∀ b ∈ I, IsInteger R (aI • b)
aJ : R
haJ : aJ ∈ S
hJ : ∀ b ∈ J, IsInteger R (aJ • b)
b : P
hb : b ∈ I * J
m : P
hm : m ∈ I
n : P
hn : n ∈ J
n' : R
hn' : (algebraMap R P) n' = aJ • n
⊢ n' • m ∈ I | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
| exact Submodule.smul_mem _ _ hm | theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
| Mathlib.RingTheory.FractionalIdeal.502_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ | Mathlib_RingTheory_FractionalIdeal |
case refine_2
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : Submodule R P
aI : R
haI : aI ∈ S
hI : ∀ b ∈ I, IsInteger R (aI • b)
aJ : R
haJ : aJ ∈ S
hJ : ∀ b ∈ J, IsInteger R (aJ • b)
b : P
hb : b ∈ I * J
⊢ ∀ (x y : P), IsInteger R ((aI * aJ) • x) → IsInteger R ((aI * aJ) • y) → IsInteger R ((aI * aJ) • (x + y)) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· | intro x y hx hy | theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· | Mathlib.RingTheory.FractionalIdeal.502_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ | Mathlib_RingTheory_FractionalIdeal |
case refine_2
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : Submodule R P
aI : R
haI : aI ∈ S
hI : ∀ b ∈ I, IsInteger R (aI • b)
aJ : R
haJ : aJ ∈ S
hJ : ∀ b ∈ J, IsInteger R (aJ • b)
b : P
hb : b ∈ I * J
x y : P
hx : IsInteger R ((aI * aJ) • x)
hy : IsInteger R ((aI * aJ) • y)
⊢ IsInteger R ((aI * aJ) • (x + y)) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
| rw [smul_add] | theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
| Mathlib.RingTheory.FractionalIdeal.502_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ | Mathlib_RingTheory_FractionalIdeal |
case refine_2
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : Submodule R P
aI : R
haI : aI ∈ S
hI : ∀ b ∈ I, IsInteger R (aI • b)
aJ : R
haJ : aJ ∈ S
hJ : ∀ b ∈ J, IsInteger R (aJ • b)
b : P
hb : b ∈ I * J
x y : P
hx : IsInteger R ((aI * aJ) • x)
hy : IsInteger R ((aI * aJ) • y)
⊢ IsInteger R ((aI * aJ) • x + (aI * aJ) • y) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
| apply isInteger_add hx hy | theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
| Mathlib.RingTheory.FractionalIdeal.502_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : FractionalIdeal S P
⊢ I * J = { val := ↑I * ↑J, property := (_ : IsFractional S (↑I * ↑J)) } | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by | simp only [← mul_eq_mul, mul] | theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by | Mathlib.RingTheory.FractionalIdeal.544_0.90B1BH8AtSmfl9S | theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : FractionalIdeal S P
⊢ ↑(I * J) = ↑I * ↑J | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
| simp only [mul_def, coe_mk] | @[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
| Mathlib.RingTheory.FractionalIdeal.548_0.90B1BH8AtSmfl9S | @[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : Ideal R
⊢ ↑(I * J) = ↑I * ↑J | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
| simp only [mul_def] | @[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
| Mathlib.RingTheory.FractionalIdeal.553_0.90B1BH8AtSmfl9S | @[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : Ideal R
⊢ ↑(I * J) = { val := ↑↑I * ↑↑J, property := (_ : IsFractional S (↑↑I * ↑↑J)) } | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
| exact coeToSubmodule_injective (coeSubmodule_mul _ _ _) | @[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
| Mathlib.RingTheory.FractionalIdeal.553_0.90B1BH8AtSmfl9S | @[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : FractionalIdeal S P
⊢ Monotone fun x => I * x | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
| intro J J' h | theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
| Mathlib.RingTheory.FractionalIdeal.559_0.90B1BH8AtSmfl9S | theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J J' : FractionalIdeal S P
h : J ≤ J'
⊢ (fun x => I * x) J ≤ (fun x => I * x) J' | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
| simp only [mul_def] | theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
| Mathlib.RingTheory.FractionalIdeal.559_0.90B1BH8AtSmfl9S | theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J J' : FractionalIdeal S P
h : J ≤ J'
⊢ { val := ↑I * ↑J, property := (_ : IsFractional S (↑I * ↑J)) } ≤
{ val := ↑I * ↑J', property := (_ : IsFractional S (↑I * ↑J')) } | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
| exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy) | theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
| Mathlib.RingTheory.FractionalIdeal.559_0.90B1BH8AtSmfl9S | theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : FractionalIdeal S P
⊢ Monotone fun J => J * I | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
| intro J J' h | theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
| Mathlib.RingTheory.FractionalIdeal.565_0.90B1BH8AtSmfl9S | theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J J' : FractionalIdeal S P
h : J ≤ J'
⊢ (fun J => J * I) J ≤ (fun J => J * I) J' | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
| simp only [mul_def] | theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
| Mathlib.RingTheory.FractionalIdeal.565_0.90B1BH8AtSmfl9S | theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J J' : FractionalIdeal S P
h : J ≤ J'
⊢ { val := ↑J * ↑I, property := (_ : IsFractional S (↑J * ↑I)) } ≤
{ val := ↑J' * ↑I, property := (_ : IsFractional S (↑J' * ↑I)) } | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
| exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy | theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
| Mathlib.RingTheory.FractionalIdeal.565_0.90B1BH8AtSmfl9S | theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : FractionalIdeal S P
i j : P
hi : i ∈ I
hj : j ∈ J
⊢ i * j ∈ I * J | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
| simp only [mul_def] | theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
| Mathlib.RingTheory.FractionalIdeal.571_0.90B1BH8AtSmfl9S | theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : FractionalIdeal S P
i j : P
hi : i ∈ I
hj : j ∈ J
⊢ i * j ∈ { val := ↑I * ↑J, property := (_ : IsFractional S (↑I * ↑J)) } | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
| exact Submodule.mul_mem_mul hi hj | theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
| Mathlib.RingTheory.FractionalIdeal.571_0.90B1BH8AtSmfl9S | theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J K : FractionalIdeal S P
⊢ I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
| simp only [mul_def] | theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
| Mathlib.RingTheory.FractionalIdeal.577_0.90B1BH8AtSmfl9S | theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J K : FractionalIdeal S P
⊢ { val := ↑I * ↑J, property := (_ : IsFractional S (↑I * ↑J)) } ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
| exact Submodule.mul_le | theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
| Mathlib.RingTheory.FractionalIdeal.577_0.90B1BH8AtSmfl9S | theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : FractionalIdeal S P
C : P → Prop
r : P
hr : r ∈ I * J
hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)
ha : ∀ (x y : P), C x → C y → C (x + y)
⊢ C r | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
| simp only [mul_def] at hr | @[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
| Mathlib.RingTheory.FractionalIdeal.590_0.90B1BH8AtSmfl9S | @[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I J : FractionalIdeal S P
C : P → Prop
r : P
hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)
ha : ∀ (x y : P), C x → C y → C (x + y)
hr : r ∈ { val := ↑I * ↑J, property := (_ : IsFractional S (↑I * ↑J)) }
⊢ C r | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
| exact Submodule.mul_induction_on hr hm ha | @[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
| Mathlib.RingTheory.FractionalIdeal.590_0.90B1BH8AtSmfl9S | @[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
n : ℕ
⊢ ↑(Nat.unaryCast n) = ↑n | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by | induction n | theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by | Mathlib.RingTheory.FractionalIdeal.601_0.90B1BH8AtSmfl9S | theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n | Mathlib_RingTheory_FractionalIdeal |
case zero
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
⊢ ↑(Nat.unaryCast Nat.zero) = ↑Nat.zero | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> | simp [*, Nat.unaryCast] | theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> | Mathlib.RingTheory.FractionalIdeal.601_0.90B1BH8AtSmfl9S | theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n | Mathlib_RingTheory_FractionalIdeal |
case succ
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
n✝ : ℕ
n_ih✝ : ↑(Nat.unaryCast n✝) = ↑n✝
⊢ ↑(Nat.unaryCast (Nat.succ n✝)) = ↑(Nat.succ n✝) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> | simp [*, Nat.unaryCast] | theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> | Mathlib.RingTheory.FractionalIdeal.601_0.90B1BH8AtSmfl9S | theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : FractionalIdeal S P
hI : 1 ≤ I
⊢ I ≤ I * I | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
| convert mul_left_mono I hI | theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
| Mathlib.RingTheory.FractionalIdeal.636_0.90B1BH8AtSmfl9S | theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I | Mathlib_RingTheory_FractionalIdeal |
case h.e'_3
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : FractionalIdeal S P
hI : 1 ≤ I
⊢ I = (fun x => I * x) 1 | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
| exact (mul_one I).symm | theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
| Mathlib.RingTheory.FractionalIdeal.636_0.90B1BH8AtSmfl9S | theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : FractionalIdeal S P
hI : I ≤ 1
⊢ I * I ≤ I | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
| convert mul_left_mono I hI | theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
| Mathlib.RingTheory.FractionalIdeal.641_0.90B1BH8AtSmfl9S | theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I | Mathlib_RingTheory_FractionalIdeal |
case h.e'_4
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : FractionalIdeal S P
hI : I ≤ 1
⊢ I = (fun x => I * x) 1 | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
| exact (mul_one I).symm | theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
| Mathlib.RingTheory.FractionalIdeal.641_0.90B1BH8AtSmfl9S | theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
⊢ J ≤ 1 ↔ ∃ I, ↑I = J | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
| constructor | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
| Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mp
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
⊢ J ≤ 1 → ∃ I, ↑I = J | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· | intro hJ | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· | Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mp
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
⊢ ∃ I, ↑I = J | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
| refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩ | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
| Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mp.refine'_1
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
⊢ ∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} → b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J} | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· | intro a b ha hb | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· | Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mp.refine'_1
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
a b : R
ha : a ∈ {x | (algebraMap R P) x ∈ J}
hb : b ∈ {x | (algebraMap R P) x ∈ J}
⊢ a + b ∈ {x | (algebraMap R P) x ∈ J} | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
| rw [mem_setOf, RingHom.map_add] | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
| Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mp.refine'_1
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
a b : R
ha : a ∈ {x | (algebraMap R P) x ∈ J}
hb : b ∈ {x | (algebraMap R P) x ∈ J}
⊢ (algebraMap R P) a + (algebraMap R P) b ∈ J | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
| exact J.val.add_mem ha hb | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
| Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mp.refine'_2
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
⊢ 0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) }.carrier | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· | rw [mem_setOf, RingHom.map_zero] | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· | Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mp.refine'_2
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
⊢ 0 ∈ J | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
| exact J.val.zero_mem | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
| Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mp.refine'_3
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
⊢ ∀ (c : R) {x : R},
x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈ {x | (algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier →
c • x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈ {x | (algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· | intro c x hx | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· | Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mp.refine'_3
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
c x : R
hx :
x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈ {x | (algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier
⊢ c • x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈ {x | (algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
| rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def] | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
| Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mp.refine'_3
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
c x : R
hx :
x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈ {x | (algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier
⊢ c • (algebraMap R P) x ∈ J | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
| exact J.val.smul_mem c hx | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
| Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mp.refine'_4
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
⊢ ↑{
toAddSubmonoid :=
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) }.carrier) },
smul_mem' :=
(_ :
∀ (c : R) {x : R},
x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈
{x | (algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier →
c • x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈
{x | (algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier) } =
J | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· | ext x | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· | Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mp.refine'_4.a
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
x : P
⊢ x ∈
↑{
toAddSubmonoid :=
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) }.carrier) },
smul_mem' :=
(_ :
∀ (c : R) {x : R},
x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈
{x | (algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier →
c • x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈
{x |
(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier) } ↔
x ∈ J | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
| constructor | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
| Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mp.refine'_4.a.mp
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
x : P
⊢ x ∈
↑{
toAddSubmonoid :=
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) }.carrier) },
smul_mem' :=
(_ :
∀ (c : R) {x : R},
x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈
{x | (algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier →
c • x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈
{x |
(algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier) } →
x ∈ J | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· | rintro ⟨y, hy, eq_y⟩ | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· | Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mp.refine'_4.a.mp.intro.intro
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
x : P
y : R
hy :
y ∈
↑{
toAddSubmonoid :=
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) }.carrier) },
smul_mem' :=
(_ :
∀ (c : R) {x : R},
x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈
{x | (algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier →
c • x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈
{x | (algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier) }
eq_y : (Algebra.linearMap R P) y = x
⊢ x ∈ J | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
| rwa [← eq_y] | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
| Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mp.refine'_4.a.mpr
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
x : P
⊢ x ∈ J →
x ∈
↑{
toAddSubmonoid :=
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) }.carrier) },
smul_mem' :=
(_ :
∀ (c : R) {x : R},
x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈
{x | (algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier →
c • x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈
{x | (algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier) } | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· | intro hx | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· | Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mp.refine'_4.a.mpr
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
x : P
hx : x ∈ J
⊢ x ∈
↑{
toAddSubmonoid :=
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) }.carrier) },
smul_mem' :=
(_ :
∀ (c : R) {x : R},
x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈
{x | (algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier →
c • x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈
{x | (algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier) } | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
| obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx) | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
| Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mp.refine'_4.a.mpr.intro
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
hJ : J ≤ 1
y : R
hx : (algebraMap R P) y ∈ J
⊢ (algebraMap R P) y ∈
↑{
toAddSubmonoid :=
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) }.carrier) },
smul_mem' :=
(_ :
∀ (c : R) {x : R},
x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈
{x | (algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier →
c • x ∈
{
toAddSubsemigroup :=
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} → a + b ∈ {x | (algebraMap R P) x ∈ J}) },
zero_mem' :=
(_ :
0 ∈
{ carrier := {x | (algebraMap R P) x ∈ J},
add_mem' :=
(_ :
∀ {a b : R},
a ∈ {x | (algebraMap R P) x ∈ J} →
b ∈ {x | (algebraMap R P) x ∈ J} →
a + b ∈
{x | (algebraMap R P) x ∈ J}) }.carrier) }.toAddSubsemigroup.carrier) } | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
| exact mem_setOf.mpr ⟨y, hx, rfl⟩ | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
| Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mpr
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
⊢ (∃ I, ↑I = J) → J ≤ 1 | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· | rintro ⟨I, hI⟩ | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· | Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mpr.intro
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
I : Ideal R
hI : ↑I = J
⊢ J ≤ 1 | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
| rw [← hI] | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
| Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
case mpr.intro
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
J : FractionalIdeal S P
I : Ideal R
hI : ↑I = J
⊢ ↑I ≤ 1 | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
| apply coeIdeal_le_one | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
| Mathlib.RingTheory.FractionalIdeal.651_0.90B1BH8AtSmfl9S | theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
I : FractionalIdeal S P
⊢ 1 ≤ I ↔ 1 ∈ I | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
| rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe] | @[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
| Mathlib.RingTheory.FractionalIdeal.676_0.90B1BH8AtSmfl9S | @[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝² : CommRing R
S : Submonoid R
P : Type u_2
inst✝¹ : CommRing P
inst✝ : Algebra R P
loc : IsLocalization S P
⊢ ↑1 = 1 | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by | rw [Ideal.one_eq_top, coeIdeal_top] | /-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by | Mathlib.RingTheory.FractionalIdeal.683_0.90B1BH8AtSmfl9S | /-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
g : P →ₐ[R] P'
I : Submodule R P
a : R
a_nonzero : a ∈ S
hI : ∀ b ∈ I, IsInteger R (a • b)
b : P'
hb : b ∈ Submodule.map (AlgHom.toLinearMap g) I
⊢ IsInteger R (a • b) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
| obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb | theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
| Mathlib.RingTheory.FractionalIdeal.711_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ | Mathlib_RingTheory_FractionalIdeal |
case intro.intro
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
g : P →ₐ[R] P'
I : Submodule R P
a : R
a_nonzero : a ∈ S
hI : ∀ b ∈ I, IsInteger R (a • b)
b : P'
hb : b ∈ Submodule.map (AlgHom.toLinearMap g) I
b' : P
b'_mem : b' ∈ I
hb' : (AlgHom.toLinearMap g) b' = b
⊢ IsInteger R (a • b) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
| rw [AlgHom.toLinearMap_apply] at hb' | theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
| Mathlib.RingTheory.FractionalIdeal.711_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ | Mathlib_RingTheory_FractionalIdeal |
case intro.intro
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
g : P →ₐ[R] P'
I : Submodule R P
a : R
a_nonzero : a ∈ S
hI : ∀ b ∈ I, IsInteger R (a • b)
b : P'
hb : b ∈ Submodule.map (AlgHom.toLinearMap g) I
b' : P
b'_mem : b' ∈ I
hb' : g b' = b
⊢ IsInteger R (a • b) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
| obtain ⟨x, hx⟩ := hI b' b'_mem | theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
| Mathlib.RingTheory.FractionalIdeal.711_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ | Mathlib_RingTheory_FractionalIdeal |
case intro.intro.intro
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
g : P →ₐ[R] P'
I : Submodule R P
a : R
a_nonzero : a ∈ S
hI : ∀ b ∈ I, IsInteger R (a • b)
b : P'
hb : b ∈ Submodule.map (AlgHom.toLinearMap g) I
b' : P
b'_mem : b' ∈ I
hb' : g b' = b
x : R
hx : (algebraMap R P) x = a • b'
⊢ IsInteger R (a • b) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
| use x | theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
| Mathlib.RingTheory.FractionalIdeal.711_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ | Mathlib_RingTheory_FractionalIdeal |
case h
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
g : P →ₐ[R] P'
I : Submodule R P
a : R
a_nonzero : a ∈ S
hI : ∀ b ∈ I, IsInteger R (a • b)
b : P'
hb : b ∈ Submodule.map (AlgHom.toLinearMap g) I
b' : P
b'_mem : b' ∈ I
hb' : g b' = b
x : R
hx : (algebraMap R P) x = a • b'
⊢ (algebraMap R P') x = a • b | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
| rw [← g.commutes, hx, g.map_smul, hb'] | theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
| Mathlib.RingTheory.FractionalIdeal.711_0.90B1BH8AtSmfl9S | theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I✝ J : FractionalIdeal S P
g : P →ₐ[R] P'
I : Ideal R
⊢ map g ↑I = ↑I | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
rw [← g.commutes, hx, g.map_smul, hb']⟩
#align is_fractional.map IsFractional.map
/-- `I.map g` is the pushforward of the fractional ideal `I` along the algebra morphism `g` -/
def map (g : P →ₐ[R] P') : FractionalIdeal S P → FractionalIdeal S P' := fun I =>
⟨Submodule.map g.toLinearMap I, I.isFractional.map g⟩
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
↑(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P →ₐ[R] P'} {y : P'} :
y ∈ I.map g ↔ ∃ x, x ∈ I ∧ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P →ₐ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
| ext x | @[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
| Mathlib.RingTheory.FractionalIdeal.751_0.90B1BH8AtSmfl9S | @[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I | Mathlib_RingTheory_FractionalIdeal |
case a
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I✝ J : FractionalIdeal S P
g : P →ₐ[R] P'
I : Ideal R
x : P'
⊢ x ∈ map g ↑I ↔ x ∈ ↑I | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
rw [← g.commutes, hx, g.map_smul, hb']⟩
#align is_fractional.map IsFractional.map
/-- `I.map g` is the pushforward of the fractional ideal `I` along the algebra morphism `g` -/
def map (g : P →ₐ[R] P') : FractionalIdeal S P → FractionalIdeal S P' := fun I =>
⟨Submodule.map g.toLinearMap I, I.isFractional.map g⟩
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
↑(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P →ₐ[R] P'} {y : P'} :
y ∈ I.map g ↔ ∃ x, x ∈ I ∧ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P →ₐ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
| simp only [mem_coeIdeal] | @[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
| Mathlib.RingTheory.FractionalIdeal.751_0.90B1BH8AtSmfl9S | @[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I | Mathlib_RingTheory_FractionalIdeal |
case a
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I✝ J : FractionalIdeal S P
g : P →ₐ[R] P'
I : Ideal R
x : P'
⊢ x ∈ map g ↑I ↔ ∃ x' ∈ I, (algebraMap R P') x' = x | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
rw [← g.commutes, hx, g.map_smul, hb']⟩
#align is_fractional.map IsFractional.map
/-- `I.map g` is the pushforward of the fractional ideal `I` along the algebra morphism `g` -/
def map (g : P →ₐ[R] P') : FractionalIdeal S P → FractionalIdeal S P' := fun I =>
⟨Submodule.map g.toLinearMap I, I.isFractional.map g⟩
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
↑(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P →ₐ[R] P'} {y : P'} :
y ∈ I.map g ↔ ∃ x, x ∈ I ∧ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P →ₐ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
| constructor | @[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
| Mathlib.RingTheory.FractionalIdeal.751_0.90B1BH8AtSmfl9S | @[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I | Mathlib_RingTheory_FractionalIdeal |
case a.mp
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I✝ J : FractionalIdeal S P
g : P →ₐ[R] P'
I : Ideal R
x : P'
⊢ x ∈ map g ↑I → ∃ x' ∈ I, (algebraMap R P') x' = x | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
rw [← g.commutes, hx, g.map_smul, hb']⟩
#align is_fractional.map IsFractional.map
/-- `I.map g` is the pushforward of the fractional ideal `I` along the algebra morphism `g` -/
def map (g : P →ₐ[R] P') : FractionalIdeal S P → FractionalIdeal S P' := fun I =>
⟨Submodule.map g.toLinearMap I, I.isFractional.map g⟩
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
↑(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P →ₐ[R] P'} {y : P'} :
y ∈ I.map g ↔ ∃ x, x ∈ I ∧ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P →ₐ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· | rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩ | @[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· | Mathlib.RingTheory.FractionalIdeal.751_0.90B1BH8AtSmfl9S | @[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I | Mathlib_RingTheory_FractionalIdeal |
case a.mp.intro.intro.intro.intro
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I✝ J : FractionalIdeal S P
g : P →ₐ[R] P'
I : Ideal R
y : R
hy : y ∈ ↑I
⊢ ∃ x' ∈ I, (algebraMap R P') x' = (AlgHom.toLinearMap g) ((Algebra.linearMap R P) y) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
rw [← g.commutes, hx, g.map_smul, hb']⟩
#align is_fractional.map IsFractional.map
/-- `I.map g` is the pushforward of the fractional ideal `I` along the algebra morphism `g` -/
def map (g : P →ₐ[R] P') : FractionalIdeal S P → FractionalIdeal S P' := fun I =>
⟨Submodule.map g.toLinearMap I, I.isFractional.map g⟩
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
↑(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P →ₐ[R] P'} {y : P'} :
y ∈ I.map g ↔ ∃ x, x ∈ I ∧ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P →ₐ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩
| exact ⟨y, hy, (g.commutes y).symm⟩ | @[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩
| Mathlib.RingTheory.FractionalIdeal.751_0.90B1BH8AtSmfl9S | @[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I | Mathlib_RingTheory_FractionalIdeal |
case a.mpr
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I✝ J : FractionalIdeal S P
g : P →ₐ[R] P'
I : Ideal R
x : P'
⊢ (∃ x' ∈ I, (algebraMap R P') x' = x) → x ∈ map g ↑I | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
rw [← g.commutes, hx, g.map_smul, hb']⟩
#align is_fractional.map IsFractional.map
/-- `I.map g` is the pushforward of the fractional ideal `I` along the algebra morphism `g` -/
def map (g : P →ₐ[R] P') : FractionalIdeal S P → FractionalIdeal S P' := fun I =>
⟨Submodule.map g.toLinearMap I, I.isFractional.map g⟩
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
↑(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P →ₐ[R] P'} {y : P'} :
y ∈ I.map g ↔ ∃ x, x ∈ I ∧ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P →ₐ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩
exact ⟨y, hy, (g.commutes y).symm⟩
· | rintro ⟨y, hy, rfl⟩ | @[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩
exact ⟨y, hy, (g.commutes y).symm⟩
· | Mathlib.RingTheory.FractionalIdeal.751_0.90B1BH8AtSmfl9S | @[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I | Mathlib_RingTheory_FractionalIdeal |
case a.mpr.intro.intro
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I✝ J : FractionalIdeal S P
g : P →ₐ[R] P'
I : Ideal R
y : R
hy : y ∈ I
⊢ (algebraMap R P') y ∈ map g ↑I | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
rw [← g.commutes, hx, g.map_smul, hb']⟩
#align is_fractional.map IsFractional.map
/-- `I.map g` is the pushforward of the fractional ideal `I` along the algebra morphism `g` -/
def map (g : P →ₐ[R] P') : FractionalIdeal S P → FractionalIdeal S P' := fun I =>
⟨Submodule.map g.toLinearMap I, I.isFractional.map g⟩
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
↑(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P →ₐ[R] P'} {y : P'} :
y ∈ I.map g ↔ ∃ x, x ∈ I ∧ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P →ₐ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩
exact ⟨y, hy, (g.commutes y).symm⟩
· rintro ⟨y, hy, rfl⟩
| exact ⟨_, ⟨y, hy, rfl⟩, g.commutes y⟩ | @[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩
exact ⟨y, hy, (g.commutes y).symm⟩
· rintro ⟨y, hy, rfl⟩
| Mathlib.RingTheory.FractionalIdeal.751_0.90B1BH8AtSmfl9S | @[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I J : FractionalIdeal S P
g : P →ₐ[R] P'
⊢ map g (I * J) = map g I * map g J | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
rw [← g.commutes, hx, g.map_smul, hb']⟩
#align is_fractional.map IsFractional.map
/-- `I.map g` is the pushforward of the fractional ideal `I` along the algebra morphism `g` -/
def map (g : P →ₐ[R] P') : FractionalIdeal S P → FractionalIdeal S P' := fun I =>
⟨Submodule.map g.toLinearMap I, I.isFractional.map g⟩
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
↑(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P →ₐ[R] P'} {y : P'} :
y ∈ I.map g ↔ ∃ x, x ∈ I ∧ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P →ₐ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩
exact ⟨y, hy, (g.commutes y).symm⟩
· rintro ⟨y, hy, rfl⟩
exact ⟨_, ⟨y, hy, rfl⟩, g.commutes y⟩
#align fractional_ideal.map_coe_ideal FractionalIdeal.map_coeIdeal
@[simp]
theorem map_one : (1 : FractionalIdeal S P).map g = 1 :=
map_coeIdeal g ⊤
#align fractional_ideal.map_one FractionalIdeal.map_one
@[simp]
theorem map_zero : (0 : FractionalIdeal S P).map g = 0 :=
map_coeIdeal g 0
#align fractional_ideal.map_zero FractionalIdeal.map_zero
@[simp]
theorem map_add : (I + J).map g = I.map g + J.map g :=
coeToSubmodule_injective (Submodule.map_sup _ _ _)
#align fractional_ideal.map_add FractionalIdeal.map_add
@[simp]
theorem map_mul : (I * J).map g = I.map g * J.map g := by
| simp only [mul_def] | @[simp]
theorem map_mul : (I * J).map g = I.map g * J.map g := by
| Mathlib.RingTheory.FractionalIdeal.777_0.90B1BH8AtSmfl9S | @[simp]
theorem map_mul : (I * J).map g = I.map g * J.map g | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I J : FractionalIdeal S P
g : P →ₐ[R] P'
⊢ map g { val := ↑I * ↑J, property := (_ : IsFractional S (↑I * ↑J)) } =
{ val := ↑(map g I) * ↑(map g J), property := (_ : IsFractional S (↑(map g I) * ↑(map g J))) } | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
rw [← g.commutes, hx, g.map_smul, hb']⟩
#align is_fractional.map IsFractional.map
/-- `I.map g` is the pushforward of the fractional ideal `I` along the algebra morphism `g` -/
def map (g : P →ₐ[R] P') : FractionalIdeal S P → FractionalIdeal S P' := fun I =>
⟨Submodule.map g.toLinearMap I, I.isFractional.map g⟩
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
↑(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P →ₐ[R] P'} {y : P'} :
y ∈ I.map g ↔ ∃ x, x ∈ I ∧ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P →ₐ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩
exact ⟨y, hy, (g.commutes y).symm⟩
· rintro ⟨y, hy, rfl⟩
exact ⟨_, ⟨y, hy, rfl⟩, g.commutes y⟩
#align fractional_ideal.map_coe_ideal FractionalIdeal.map_coeIdeal
@[simp]
theorem map_one : (1 : FractionalIdeal S P).map g = 1 :=
map_coeIdeal g ⊤
#align fractional_ideal.map_one FractionalIdeal.map_one
@[simp]
theorem map_zero : (0 : FractionalIdeal S P).map g = 0 :=
map_coeIdeal g 0
#align fractional_ideal.map_zero FractionalIdeal.map_zero
@[simp]
theorem map_add : (I + J).map g = I.map g + J.map g :=
coeToSubmodule_injective (Submodule.map_sup _ _ _)
#align fractional_ideal.map_add FractionalIdeal.map_add
@[simp]
theorem map_mul : (I * J).map g = I.map g * J.map g := by
simp only [mul_def]
| exact coeToSubmodule_injective (Submodule.map_mul _ _ _) | @[simp]
theorem map_mul : (I * J).map g = I.map g * J.map g := by
simp only [mul_def]
| Mathlib.RingTheory.FractionalIdeal.777_0.90B1BH8AtSmfl9S | @[simp]
theorem map_mul : (I * J).map g = I.map g * J.map g | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I J : FractionalIdeal S P
g✝ : P →ₐ[R] P'
g : P ≃ₐ[R] P'
⊢ map (↑(AlgEquiv.symm g)) (map (↑g) I) = I | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
rw [← g.commutes, hx, g.map_smul, hb']⟩
#align is_fractional.map IsFractional.map
/-- `I.map g` is the pushforward of the fractional ideal `I` along the algebra morphism `g` -/
def map (g : P →ₐ[R] P') : FractionalIdeal S P → FractionalIdeal S P' := fun I =>
⟨Submodule.map g.toLinearMap I, I.isFractional.map g⟩
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
↑(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P →ₐ[R] P'} {y : P'} :
y ∈ I.map g ↔ ∃ x, x ∈ I ∧ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P →ₐ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩
exact ⟨y, hy, (g.commutes y).symm⟩
· rintro ⟨y, hy, rfl⟩
exact ⟨_, ⟨y, hy, rfl⟩, g.commutes y⟩
#align fractional_ideal.map_coe_ideal FractionalIdeal.map_coeIdeal
@[simp]
theorem map_one : (1 : FractionalIdeal S P).map g = 1 :=
map_coeIdeal g ⊤
#align fractional_ideal.map_one FractionalIdeal.map_one
@[simp]
theorem map_zero : (0 : FractionalIdeal S P).map g = 0 :=
map_coeIdeal g 0
#align fractional_ideal.map_zero FractionalIdeal.map_zero
@[simp]
theorem map_add : (I + J).map g = I.map g + J.map g :=
coeToSubmodule_injective (Submodule.map_sup _ _ _)
#align fractional_ideal.map_add FractionalIdeal.map_add
@[simp]
theorem map_mul : (I * J).map g = I.map g * J.map g := by
simp only [mul_def]
exact coeToSubmodule_injective (Submodule.map_mul _ _ _)
#align fractional_ideal.map_mul FractionalIdeal.map_mul
@[simp]
theorem map_map_symm (g : P ≃ₐ[R] P') : (I.map (g : P →ₐ[R] P')).map (g.symm : P' →ₐ[R] P) = I := by
| rw [← map_comp, g.symm_comp, map_id] | @[simp]
theorem map_map_symm (g : P ≃ₐ[R] P') : (I.map (g : P →ₐ[R] P')).map (g.symm : P' →ₐ[R] P) = I := by
| Mathlib.RingTheory.FractionalIdeal.783_0.90B1BH8AtSmfl9S | @[simp]
theorem map_map_symm (g : P ≃ₐ[R] P') : (I.map (g : P →ₐ[R] P')).map (g.symm : P' →ₐ[R] P) = I | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I✝ J : FractionalIdeal S P
g✝ : P →ₐ[R] P'
I : FractionalIdeal S P'
g : P ≃ₐ[R] P'
⊢ map (↑g) (map (↑(AlgEquiv.symm g)) I) = I | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
rw [← g.commutes, hx, g.map_smul, hb']⟩
#align is_fractional.map IsFractional.map
/-- `I.map g` is the pushforward of the fractional ideal `I` along the algebra morphism `g` -/
def map (g : P →ₐ[R] P') : FractionalIdeal S P → FractionalIdeal S P' := fun I =>
⟨Submodule.map g.toLinearMap I, I.isFractional.map g⟩
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
↑(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P →ₐ[R] P'} {y : P'} :
y ∈ I.map g ↔ ∃ x, x ∈ I ∧ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P →ₐ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩
exact ⟨y, hy, (g.commutes y).symm⟩
· rintro ⟨y, hy, rfl⟩
exact ⟨_, ⟨y, hy, rfl⟩, g.commutes y⟩
#align fractional_ideal.map_coe_ideal FractionalIdeal.map_coeIdeal
@[simp]
theorem map_one : (1 : FractionalIdeal S P).map g = 1 :=
map_coeIdeal g ⊤
#align fractional_ideal.map_one FractionalIdeal.map_one
@[simp]
theorem map_zero : (0 : FractionalIdeal S P).map g = 0 :=
map_coeIdeal g 0
#align fractional_ideal.map_zero FractionalIdeal.map_zero
@[simp]
theorem map_add : (I + J).map g = I.map g + J.map g :=
coeToSubmodule_injective (Submodule.map_sup _ _ _)
#align fractional_ideal.map_add FractionalIdeal.map_add
@[simp]
theorem map_mul : (I * J).map g = I.map g * J.map g := by
simp only [mul_def]
exact coeToSubmodule_injective (Submodule.map_mul _ _ _)
#align fractional_ideal.map_mul FractionalIdeal.map_mul
@[simp]
theorem map_map_symm (g : P ≃ₐ[R] P') : (I.map (g : P →ₐ[R] P')).map (g.symm : P' →ₐ[R] P) = I := by
rw [← map_comp, g.symm_comp, map_id]
#align fractional_ideal.map_map_symm FractionalIdeal.map_map_symm
@[simp]
theorem map_symm_map (I : FractionalIdeal S P') (g : P ≃ₐ[R] P') :
(I.map (g.symm : P' →ₐ[R] P)).map (g : P →ₐ[R] P') = I := by
| rw [← map_comp, g.comp_symm, map_id] | @[simp]
theorem map_symm_map (I : FractionalIdeal S P') (g : P ≃ₐ[R] P') :
(I.map (g.symm : P' →ₐ[R] P)).map (g : P →ₐ[R] P') = I := by
| Mathlib.RingTheory.FractionalIdeal.788_0.90B1BH8AtSmfl9S | @[simp]
theorem map_symm_map (I : FractionalIdeal S P') (g : P ≃ₐ[R] P') :
(I.map (g.symm : P' →ₐ[R] P)).map (g : P →ₐ[R] P') = I | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I✝ J : FractionalIdeal S P
g✝ : P →ₐ[R] P'
g : P ≃ₐ[R] P'
I : FractionalIdeal S P
⊢ map (↑(AlgEquiv.symm g)) (map (↑g) I) = I | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
rw [← g.commutes, hx, g.map_smul, hb']⟩
#align is_fractional.map IsFractional.map
/-- `I.map g` is the pushforward of the fractional ideal `I` along the algebra morphism `g` -/
def map (g : P →ₐ[R] P') : FractionalIdeal S P → FractionalIdeal S P' := fun I =>
⟨Submodule.map g.toLinearMap I, I.isFractional.map g⟩
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
↑(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P →ₐ[R] P'} {y : P'} :
y ∈ I.map g ↔ ∃ x, x ∈ I ∧ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P →ₐ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩
exact ⟨y, hy, (g.commutes y).symm⟩
· rintro ⟨y, hy, rfl⟩
exact ⟨_, ⟨y, hy, rfl⟩, g.commutes y⟩
#align fractional_ideal.map_coe_ideal FractionalIdeal.map_coeIdeal
@[simp]
theorem map_one : (1 : FractionalIdeal S P).map g = 1 :=
map_coeIdeal g ⊤
#align fractional_ideal.map_one FractionalIdeal.map_one
@[simp]
theorem map_zero : (0 : FractionalIdeal S P).map g = 0 :=
map_coeIdeal g 0
#align fractional_ideal.map_zero FractionalIdeal.map_zero
@[simp]
theorem map_add : (I + J).map g = I.map g + J.map g :=
coeToSubmodule_injective (Submodule.map_sup _ _ _)
#align fractional_ideal.map_add FractionalIdeal.map_add
@[simp]
theorem map_mul : (I * J).map g = I.map g * J.map g := by
simp only [mul_def]
exact coeToSubmodule_injective (Submodule.map_mul _ _ _)
#align fractional_ideal.map_mul FractionalIdeal.map_mul
@[simp]
theorem map_map_symm (g : P ≃ₐ[R] P') : (I.map (g : P →ₐ[R] P')).map (g.symm : P' →ₐ[R] P) = I := by
rw [← map_comp, g.symm_comp, map_id]
#align fractional_ideal.map_map_symm FractionalIdeal.map_map_symm
@[simp]
theorem map_symm_map (I : FractionalIdeal S P') (g : P ≃ₐ[R] P') :
(I.map (g.symm : P' →ₐ[R] P)).map (g : P →ₐ[R] P') = I := by
rw [← map_comp, g.comp_symm, map_id]
#align fractional_ideal.map_symm_map FractionalIdeal.map_symm_map
theorem map_mem_map {f : P →ₐ[R] P'} (h : Function.Injective f) {x : P} {I : FractionalIdeal S P} :
f x ∈ map f I ↔ x ∈ I :=
mem_map.trans ⟨fun ⟨_, hx', x'_eq⟩ => h x'_eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.map_mem_map FractionalIdeal.map_mem_map
theorem map_injective (f : P →ₐ[R] P') (h : Function.Injective f) :
Function.Injective (map f : FractionalIdeal S P → FractionalIdeal S P') := fun _ _ hIJ =>
ext fun _ => (map_mem_map h).symm.trans (hIJ.symm ▸ map_mem_map h)
#align fractional_ideal.map_injective FractionalIdeal.map_injective
/-- If `g` is an equivalence, `map g` is an isomorphism -/
def mapEquiv (g : P ≃ₐ[R] P') : FractionalIdeal S P ≃+* FractionalIdeal S P' where
toFun := map g
invFun := map g.symm
map_add' I J := map_add I J _
map_mul' I J := map_mul I J _
left_inv I := by | rw [← map_comp, AlgEquiv.symm_comp, map_id] | /-- If `g` is an equivalence, `map g` is an isomorphism -/
def mapEquiv (g : P ≃ₐ[R] P') : FractionalIdeal S P ≃+* FractionalIdeal S P' where
toFun := map g
invFun := map g.symm
map_add' I J := map_add I J _
map_mul' I J := map_mul I J _
left_inv I := by | Mathlib.RingTheory.FractionalIdeal.804_0.90B1BH8AtSmfl9S | /-- If `g` is an equivalence, `map g` is an isomorphism -/
def mapEquiv (g : P ≃ₐ[R] P') : FractionalIdeal S P ≃+* FractionalIdeal S P' where
toFun | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I✝ J : FractionalIdeal S P
g✝ : P →ₐ[R] P'
g : P ≃ₐ[R] P'
I : FractionalIdeal S P'
⊢ map (↑g) (map (↑(AlgEquiv.symm g)) I) = I | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
rw [← g.commutes, hx, g.map_smul, hb']⟩
#align is_fractional.map IsFractional.map
/-- `I.map g` is the pushforward of the fractional ideal `I` along the algebra morphism `g` -/
def map (g : P →ₐ[R] P') : FractionalIdeal S P → FractionalIdeal S P' := fun I =>
⟨Submodule.map g.toLinearMap I, I.isFractional.map g⟩
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
↑(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P →ₐ[R] P'} {y : P'} :
y ∈ I.map g ↔ ∃ x, x ∈ I ∧ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P →ₐ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩
exact ⟨y, hy, (g.commutes y).symm⟩
· rintro ⟨y, hy, rfl⟩
exact ⟨_, ⟨y, hy, rfl⟩, g.commutes y⟩
#align fractional_ideal.map_coe_ideal FractionalIdeal.map_coeIdeal
@[simp]
theorem map_one : (1 : FractionalIdeal S P).map g = 1 :=
map_coeIdeal g ⊤
#align fractional_ideal.map_one FractionalIdeal.map_one
@[simp]
theorem map_zero : (0 : FractionalIdeal S P).map g = 0 :=
map_coeIdeal g 0
#align fractional_ideal.map_zero FractionalIdeal.map_zero
@[simp]
theorem map_add : (I + J).map g = I.map g + J.map g :=
coeToSubmodule_injective (Submodule.map_sup _ _ _)
#align fractional_ideal.map_add FractionalIdeal.map_add
@[simp]
theorem map_mul : (I * J).map g = I.map g * J.map g := by
simp only [mul_def]
exact coeToSubmodule_injective (Submodule.map_mul _ _ _)
#align fractional_ideal.map_mul FractionalIdeal.map_mul
@[simp]
theorem map_map_symm (g : P ≃ₐ[R] P') : (I.map (g : P →ₐ[R] P')).map (g.symm : P' →ₐ[R] P) = I := by
rw [← map_comp, g.symm_comp, map_id]
#align fractional_ideal.map_map_symm FractionalIdeal.map_map_symm
@[simp]
theorem map_symm_map (I : FractionalIdeal S P') (g : P ≃ₐ[R] P') :
(I.map (g.symm : P' →ₐ[R] P)).map (g : P →ₐ[R] P') = I := by
rw [← map_comp, g.comp_symm, map_id]
#align fractional_ideal.map_symm_map FractionalIdeal.map_symm_map
theorem map_mem_map {f : P →ₐ[R] P'} (h : Function.Injective f) {x : P} {I : FractionalIdeal S P} :
f x ∈ map f I ↔ x ∈ I :=
mem_map.trans ⟨fun ⟨_, hx', x'_eq⟩ => h x'_eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.map_mem_map FractionalIdeal.map_mem_map
theorem map_injective (f : P →ₐ[R] P') (h : Function.Injective f) :
Function.Injective (map f : FractionalIdeal S P → FractionalIdeal S P') := fun _ _ hIJ =>
ext fun _ => (map_mem_map h).symm.trans (hIJ.symm ▸ map_mem_map h)
#align fractional_ideal.map_injective FractionalIdeal.map_injective
/-- If `g` is an equivalence, `map g` is an isomorphism -/
def mapEquiv (g : P ≃ₐ[R] P') : FractionalIdeal S P ≃+* FractionalIdeal S P' where
toFun := map g
invFun := map g.symm
map_add' I J := map_add I J _
map_mul' I J := map_mul I J _
left_inv I := by rw [← map_comp, AlgEquiv.symm_comp, map_id]
right_inv I := by | rw [← map_comp, AlgEquiv.comp_symm, map_id] | /-- If `g` is an equivalence, `map g` is an isomorphism -/
def mapEquiv (g : P ≃ₐ[R] P') : FractionalIdeal S P ≃+* FractionalIdeal S P' where
toFun := map g
invFun := map g.symm
map_add' I J := map_add I J _
map_mul' I J := map_mul I J _
left_inv I := by rw [← map_comp, AlgEquiv.symm_comp, map_id]
right_inv I := by | Mathlib.RingTheory.FractionalIdeal.804_0.90B1BH8AtSmfl9S | /-- If `g` is an equivalence, `map g` is an isomorphism -/
def mapEquiv (g : P ≃ₐ[R] P') : FractionalIdeal S P ≃+* FractionalIdeal S P' where
toFun | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I J : FractionalIdeal S P
g : P →ₐ[R] P'
x : FractionalIdeal S P
⊢ (mapEquiv AlgEquiv.refl) x = (RingEquiv.refl (FractionalIdeal S P)) x | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
rw [← g.commutes, hx, g.map_smul, hb']⟩
#align is_fractional.map IsFractional.map
/-- `I.map g` is the pushforward of the fractional ideal `I` along the algebra morphism `g` -/
def map (g : P →ₐ[R] P') : FractionalIdeal S P → FractionalIdeal S P' := fun I =>
⟨Submodule.map g.toLinearMap I, I.isFractional.map g⟩
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
↑(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P →ₐ[R] P'} {y : P'} :
y ∈ I.map g ↔ ∃ x, x ∈ I ∧ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P →ₐ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩
exact ⟨y, hy, (g.commutes y).symm⟩
· rintro ⟨y, hy, rfl⟩
exact ⟨_, ⟨y, hy, rfl⟩, g.commutes y⟩
#align fractional_ideal.map_coe_ideal FractionalIdeal.map_coeIdeal
@[simp]
theorem map_one : (1 : FractionalIdeal S P).map g = 1 :=
map_coeIdeal g ⊤
#align fractional_ideal.map_one FractionalIdeal.map_one
@[simp]
theorem map_zero : (0 : FractionalIdeal S P).map g = 0 :=
map_coeIdeal g 0
#align fractional_ideal.map_zero FractionalIdeal.map_zero
@[simp]
theorem map_add : (I + J).map g = I.map g + J.map g :=
coeToSubmodule_injective (Submodule.map_sup _ _ _)
#align fractional_ideal.map_add FractionalIdeal.map_add
@[simp]
theorem map_mul : (I * J).map g = I.map g * J.map g := by
simp only [mul_def]
exact coeToSubmodule_injective (Submodule.map_mul _ _ _)
#align fractional_ideal.map_mul FractionalIdeal.map_mul
@[simp]
theorem map_map_symm (g : P ≃ₐ[R] P') : (I.map (g : P →ₐ[R] P')).map (g.symm : P' →ₐ[R] P) = I := by
rw [← map_comp, g.symm_comp, map_id]
#align fractional_ideal.map_map_symm FractionalIdeal.map_map_symm
@[simp]
theorem map_symm_map (I : FractionalIdeal S P') (g : P ≃ₐ[R] P') :
(I.map (g.symm : P' →ₐ[R] P)).map (g : P →ₐ[R] P') = I := by
rw [← map_comp, g.comp_symm, map_id]
#align fractional_ideal.map_symm_map FractionalIdeal.map_symm_map
theorem map_mem_map {f : P →ₐ[R] P'} (h : Function.Injective f) {x : P} {I : FractionalIdeal S P} :
f x ∈ map f I ↔ x ∈ I :=
mem_map.trans ⟨fun ⟨_, hx', x'_eq⟩ => h x'_eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.map_mem_map FractionalIdeal.map_mem_map
theorem map_injective (f : P →ₐ[R] P') (h : Function.Injective f) :
Function.Injective (map f : FractionalIdeal S P → FractionalIdeal S P') := fun _ _ hIJ =>
ext fun _ => (map_mem_map h).symm.trans (hIJ.symm ▸ map_mem_map h)
#align fractional_ideal.map_injective FractionalIdeal.map_injective
/-- If `g` is an equivalence, `map g` is an isomorphism -/
def mapEquiv (g : P ≃ₐ[R] P') : FractionalIdeal S P ≃+* FractionalIdeal S P' where
toFun := map g
invFun := map g.symm
map_add' I J := map_add I J _
map_mul' I J := map_mul I J _
left_inv I := by rw [← map_comp, AlgEquiv.symm_comp, map_id]
right_inv I := by rw [← map_comp, AlgEquiv.comp_symm, map_id]
#align fractional_ideal.map_equiv FractionalIdeal.mapEquiv
@[simp]
theorem coeFun_mapEquiv (g : P ≃ₐ[R] P') :
(mapEquiv g : FractionalIdeal S P → FractionalIdeal S P') = map g :=
rfl
#align fractional_ideal.coe_fun_map_equiv FractionalIdeal.coeFun_mapEquiv
@[simp]
theorem mapEquiv_apply (g : P ≃ₐ[R] P') (I : FractionalIdeal S P) : mapEquiv g I = map (↑g) I :=
rfl
#align fractional_ideal.map_equiv_apply FractionalIdeal.mapEquiv_apply
@[simp]
theorem mapEquiv_symm (g : P ≃ₐ[R] P') :
((mapEquiv g).symm : FractionalIdeal S P' ≃+* _) = mapEquiv g.symm :=
rfl
#align fractional_ideal.map_equiv_symm FractionalIdeal.mapEquiv_symm
@[simp]
theorem mapEquiv_refl : mapEquiv AlgEquiv.refl = RingEquiv.refl (FractionalIdeal S P) :=
RingEquiv.ext fun x => by | simp | @[simp]
theorem mapEquiv_refl : mapEquiv AlgEquiv.refl = RingEquiv.refl (FractionalIdeal S P) :=
RingEquiv.ext fun x => by | Mathlib.RingTheory.FractionalIdeal.831_0.90B1BH8AtSmfl9S | @[simp]
theorem mapEquiv_refl : mapEquiv AlgEquiv.refl = RingEquiv.refl (FractionalIdeal S P) | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I J : FractionalIdeal S P
g : P →ₐ[R] P'
s : Set P
x✝ : ∃ a ∈ S, ∀ b ∈ s, IsInteger R (a • b)
a : R
a_mem : a ∈ S
h : ∀ b ∈ s, IsInteger R (a • b)
b : P
hb : b ∈ span R s
⊢ IsInteger R (a • 0) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
rw [← g.commutes, hx, g.map_smul, hb']⟩
#align is_fractional.map IsFractional.map
/-- `I.map g` is the pushforward of the fractional ideal `I` along the algebra morphism `g` -/
def map (g : P →ₐ[R] P') : FractionalIdeal S P → FractionalIdeal S P' := fun I =>
⟨Submodule.map g.toLinearMap I, I.isFractional.map g⟩
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
↑(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P →ₐ[R] P'} {y : P'} :
y ∈ I.map g ↔ ∃ x, x ∈ I ∧ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P →ₐ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩
exact ⟨y, hy, (g.commutes y).symm⟩
· rintro ⟨y, hy, rfl⟩
exact ⟨_, ⟨y, hy, rfl⟩, g.commutes y⟩
#align fractional_ideal.map_coe_ideal FractionalIdeal.map_coeIdeal
@[simp]
theorem map_one : (1 : FractionalIdeal S P).map g = 1 :=
map_coeIdeal g ⊤
#align fractional_ideal.map_one FractionalIdeal.map_one
@[simp]
theorem map_zero : (0 : FractionalIdeal S P).map g = 0 :=
map_coeIdeal g 0
#align fractional_ideal.map_zero FractionalIdeal.map_zero
@[simp]
theorem map_add : (I + J).map g = I.map g + J.map g :=
coeToSubmodule_injective (Submodule.map_sup _ _ _)
#align fractional_ideal.map_add FractionalIdeal.map_add
@[simp]
theorem map_mul : (I * J).map g = I.map g * J.map g := by
simp only [mul_def]
exact coeToSubmodule_injective (Submodule.map_mul _ _ _)
#align fractional_ideal.map_mul FractionalIdeal.map_mul
@[simp]
theorem map_map_symm (g : P ≃ₐ[R] P') : (I.map (g : P →ₐ[R] P')).map (g.symm : P' →ₐ[R] P) = I := by
rw [← map_comp, g.symm_comp, map_id]
#align fractional_ideal.map_map_symm FractionalIdeal.map_map_symm
@[simp]
theorem map_symm_map (I : FractionalIdeal S P') (g : P ≃ₐ[R] P') :
(I.map (g.symm : P' →ₐ[R] P)).map (g : P →ₐ[R] P') = I := by
rw [← map_comp, g.comp_symm, map_id]
#align fractional_ideal.map_symm_map FractionalIdeal.map_symm_map
theorem map_mem_map {f : P →ₐ[R] P'} (h : Function.Injective f) {x : P} {I : FractionalIdeal S P} :
f x ∈ map f I ↔ x ∈ I :=
mem_map.trans ⟨fun ⟨_, hx', x'_eq⟩ => h x'_eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.map_mem_map FractionalIdeal.map_mem_map
theorem map_injective (f : P →ₐ[R] P') (h : Function.Injective f) :
Function.Injective (map f : FractionalIdeal S P → FractionalIdeal S P') := fun _ _ hIJ =>
ext fun _ => (map_mem_map h).symm.trans (hIJ.symm ▸ map_mem_map h)
#align fractional_ideal.map_injective FractionalIdeal.map_injective
/-- If `g` is an equivalence, `map g` is an isomorphism -/
def mapEquiv (g : P ≃ₐ[R] P') : FractionalIdeal S P ≃+* FractionalIdeal S P' where
toFun := map g
invFun := map g.symm
map_add' I J := map_add I J _
map_mul' I J := map_mul I J _
left_inv I := by rw [← map_comp, AlgEquiv.symm_comp, map_id]
right_inv I := by rw [← map_comp, AlgEquiv.comp_symm, map_id]
#align fractional_ideal.map_equiv FractionalIdeal.mapEquiv
@[simp]
theorem coeFun_mapEquiv (g : P ≃ₐ[R] P') :
(mapEquiv g : FractionalIdeal S P → FractionalIdeal S P') = map g :=
rfl
#align fractional_ideal.coe_fun_map_equiv FractionalIdeal.coeFun_mapEquiv
@[simp]
theorem mapEquiv_apply (g : P ≃ₐ[R] P') (I : FractionalIdeal S P) : mapEquiv g I = map (↑g) I :=
rfl
#align fractional_ideal.map_equiv_apply FractionalIdeal.mapEquiv_apply
@[simp]
theorem mapEquiv_symm (g : P ≃ₐ[R] P') :
((mapEquiv g).symm : FractionalIdeal S P' ≃+* _) = mapEquiv g.symm :=
rfl
#align fractional_ideal.map_equiv_symm FractionalIdeal.mapEquiv_symm
@[simp]
theorem mapEquiv_refl : mapEquiv AlgEquiv.refl = RingEquiv.refl (FractionalIdeal S P) :=
RingEquiv.ext fun x => by simp
#align fractional_ideal.map_equiv_refl FractionalIdeal.mapEquiv_refl
theorem isFractional_span_iff {s : Set P} :
IsFractional S (span R s) ↔ ∃ a ∈ S, ∀ b : P, b ∈ s → IsInteger R (a • b) :=
⟨fun ⟨a, a_mem, h⟩ => ⟨a, a_mem, fun b hb => h b (subset_span hb)⟩, fun ⟨a, a_mem, h⟩ =>
⟨a, a_mem, fun b hb =>
span_induction hb h
(by
| rw [smul_zero] | theorem isFractional_span_iff {s : Set P} :
IsFractional S (span R s) ↔ ∃ a ∈ S, ∀ b : P, b ∈ s → IsInteger R (a • b) :=
⟨fun ⟨a, a_mem, h⟩ => ⟨a, a_mem, fun b hb => h b (subset_span hb)⟩, fun ⟨a, a_mem, h⟩ =>
⟨a, a_mem, fun b hb =>
span_induction hb h
(by
| Mathlib.RingTheory.FractionalIdeal.836_0.90B1BH8AtSmfl9S | theorem isFractional_span_iff {s : Set P} :
IsFractional S (span R s) ↔ ∃ a ∈ S, ∀ b : P, b ∈ s → IsInteger R (a • b) | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I J : FractionalIdeal S P
g : P →ₐ[R] P'
s : Set P
x✝ : ∃ a ∈ S, ∀ b ∈ s, IsInteger R (a • b)
a : R
a_mem : a ∈ S
h : ∀ b ∈ s, IsInteger R (a • b)
b : P
hb : b ∈ span R s
⊢ IsInteger R 0 | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
rw [← g.commutes, hx, g.map_smul, hb']⟩
#align is_fractional.map IsFractional.map
/-- `I.map g` is the pushforward of the fractional ideal `I` along the algebra morphism `g` -/
def map (g : P →ₐ[R] P') : FractionalIdeal S P → FractionalIdeal S P' := fun I =>
⟨Submodule.map g.toLinearMap I, I.isFractional.map g⟩
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
↑(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P →ₐ[R] P'} {y : P'} :
y ∈ I.map g ↔ ∃ x, x ∈ I ∧ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P →ₐ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩
exact ⟨y, hy, (g.commutes y).symm⟩
· rintro ⟨y, hy, rfl⟩
exact ⟨_, ⟨y, hy, rfl⟩, g.commutes y⟩
#align fractional_ideal.map_coe_ideal FractionalIdeal.map_coeIdeal
@[simp]
theorem map_one : (1 : FractionalIdeal S P).map g = 1 :=
map_coeIdeal g ⊤
#align fractional_ideal.map_one FractionalIdeal.map_one
@[simp]
theorem map_zero : (0 : FractionalIdeal S P).map g = 0 :=
map_coeIdeal g 0
#align fractional_ideal.map_zero FractionalIdeal.map_zero
@[simp]
theorem map_add : (I + J).map g = I.map g + J.map g :=
coeToSubmodule_injective (Submodule.map_sup _ _ _)
#align fractional_ideal.map_add FractionalIdeal.map_add
@[simp]
theorem map_mul : (I * J).map g = I.map g * J.map g := by
simp only [mul_def]
exact coeToSubmodule_injective (Submodule.map_mul _ _ _)
#align fractional_ideal.map_mul FractionalIdeal.map_mul
@[simp]
theorem map_map_symm (g : P ≃ₐ[R] P') : (I.map (g : P →ₐ[R] P')).map (g.symm : P' →ₐ[R] P) = I := by
rw [← map_comp, g.symm_comp, map_id]
#align fractional_ideal.map_map_symm FractionalIdeal.map_map_symm
@[simp]
theorem map_symm_map (I : FractionalIdeal S P') (g : P ≃ₐ[R] P') :
(I.map (g.symm : P' →ₐ[R] P)).map (g : P →ₐ[R] P') = I := by
rw [← map_comp, g.comp_symm, map_id]
#align fractional_ideal.map_symm_map FractionalIdeal.map_symm_map
theorem map_mem_map {f : P →ₐ[R] P'} (h : Function.Injective f) {x : P} {I : FractionalIdeal S P} :
f x ∈ map f I ↔ x ∈ I :=
mem_map.trans ⟨fun ⟨_, hx', x'_eq⟩ => h x'_eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.map_mem_map FractionalIdeal.map_mem_map
theorem map_injective (f : P →ₐ[R] P') (h : Function.Injective f) :
Function.Injective (map f : FractionalIdeal S P → FractionalIdeal S P') := fun _ _ hIJ =>
ext fun _ => (map_mem_map h).symm.trans (hIJ.symm ▸ map_mem_map h)
#align fractional_ideal.map_injective FractionalIdeal.map_injective
/-- If `g` is an equivalence, `map g` is an isomorphism -/
def mapEquiv (g : P ≃ₐ[R] P') : FractionalIdeal S P ≃+* FractionalIdeal S P' where
toFun := map g
invFun := map g.symm
map_add' I J := map_add I J _
map_mul' I J := map_mul I J _
left_inv I := by rw [← map_comp, AlgEquiv.symm_comp, map_id]
right_inv I := by rw [← map_comp, AlgEquiv.comp_symm, map_id]
#align fractional_ideal.map_equiv FractionalIdeal.mapEquiv
@[simp]
theorem coeFun_mapEquiv (g : P ≃ₐ[R] P') :
(mapEquiv g : FractionalIdeal S P → FractionalIdeal S P') = map g :=
rfl
#align fractional_ideal.coe_fun_map_equiv FractionalIdeal.coeFun_mapEquiv
@[simp]
theorem mapEquiv_apply (g : P ≃ₐ[R] P') (I : FractionalIdeal S P) : mapEquiv g I = map (↑g) I :=
rfl
#align fractional_ideal.map_equiv_apply FractionalIdeal.mapEquiv_apply
@[simp]
theorem mapEquiv_symm (g : P ≃ₐ[R] P') :
((mapEquiv g).symm : FractionalIdeal S P' ≃+* _) = mapEquiv g.symm :=
rfl
#align fractional_ideal.map_equiv_symm FractionalIdeal.mapEquiv_symm
@[simp]
theorem mapEquiv_refl : mapEquiv AlgEquiv.refl = RingEquiv.refl (FractionalIdeal S P) :=
RingEquiv.ext fun x => by simp
#align fractional_ideal.map_equiv_refl FractionalIdeal.mapEquiv_refl
theorem isFractional_span_iff {s : Set P} :
IsFractional S (span R s) ↔ ∃ a ∈ S, ∀ b : P, b ∈ s → IsInteger R (a • b) :=
⟨fun ⟨a, a_mem, h⟩ => ⟨a, a_mem, fun b hb => h b (subset_span hb)⟩, fun ⟨a, a_mem, h⟩ =>
⟨a, a_mem, fun b hb =>
span_induction hb h
(by
rw [smul_zero]
| exact isInteger_zero | theorem isFractional_span_iff {s : Set P} :
IsFractional S (span R s) ↔ ∃ a ∈ S, ∀ b : P, b ∈ s → IsInteger R (a • b) :=
⟨fun ⟨a, a_mem, h⟩ => ⟨a, a_mem, fun b hb => h b (subset_span hb)⟩, fun ⟨a, a_mem, h⟩ =>
⟨a, a_mem, fun b hb =>
span_induction hb h
(by
rw [smul_zero]
| Mathlib.RingTheory.FractionalIdeal.836_0.90B1BH8AtSmfl9S | theorem isFractional_span_iff {s : Set P} :
IsFractional S (span R s) ↔ ∃ a ∈ S, ∀ b : P, b ∈ s → IsInteger R (a • b) | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I J : FractionalIdeal S P
g : P →ₐ[R] P'
s : Set P
x✝ : ∃ a ∈ S, ∀ b ∈ s, IsInteger R (a • b)
a : R
a_mem : a ∈ S
h : ∀ b ∈ s, IsInteger R (a • b)
b : P
hb : b ∈ span R s
x y : P
hx : IsInteger R (a • x)
hy : IsInteger R (a • y)
⊢ IsInteger R (a • (x + y)) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
rw [← g.commutes, hx, g.map_smul, hb']⟩
#align is_fractional.map IsFractional.map
/-- `I.map g` is the pushforward of the fractional ideal `I` along the algebra morphism `g` -/
def map (g : P →ₐ[R] P') : FractionalIdeal S P → FractionalIdeal S P' := fun I =>
⟨Submodule.map g.toLinearMap I, I.isFractional.map g⟩
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
↑(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P →ₐ[R] P'} {y : P'} :
y ∈ I.map g ↔ ∃ x, x ∈ I ∧ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P →ₐ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩
exact ⟨y, hy, (g.commutes y).symm⟩
· rintro ⟨y, hy, rfl⟩
exact ⟨_, ⟨y, hy, rfl⟩, g.commutes y⟩
#align fractional_ideal.map_coe_ideal FractionalIdeal.map_coeIdeal
@[simp]
theorem map_one : (1 : FractionalIdeal S P).map g = 1 :=
map_coeIdeal g ⊤
#align fractional_ideal.map_one FractionalIdeal.map_one
@[simp]
theorem map_zero : (0 : FractionalIdeal S P).map g = 0 :=
map_coeIdeal g 0
#align fractional_ideal.map_zero FractionalIdeal.map_zero
@[simp]
theorem map_add : (I + J).map g = I.map g + J.map g :=
coeToSubmodule_injective (Submodule.map_sup _ _ _)
#align fractional_ideal.map_add FractionalIdeal.map_add
@[simp]
theorem map_mul : (I * J).map g = I.map g * J.map g := by
simp only [mul_def]
exact coeToSubmodule_injective (Submodule.map_mul _ _ _)
#align fractional_ideal.map_mul FractionalIdeal.map_mul
@[simp]
theorem map_map_symm (g : P ≃ₐ[R] P') : (I.map (g : P →ₐ[R] P')).map (g.symm : P' →ₐ[R] P) = I := by
rw [← map_comp, g.symm_comp, map_id]
#align fractional_ideal.map_map_symm FractionalIdeal.map_map_symm
@[simp]
theorem map_symm_map (I : FractionalIdeal S P') (g : P ≃ₐ[R] P') :
(I.map (g.symm : P' →ₐ[R] P)).map (g : P →ₐ[R] P') = I := by
rw [← map_comp, g.comp_symm, map_id]
#align fractional_ideal.map_symm_map FractionalIdeal.map_symm_map
theorem map_mem_map {f : P →ₐ[R] P'} (h : Function.Injective f) {x : P} {I : FractionalIdeal S P} :
f x ∈ map f I ↔ x ∈ I :=
mem_map.trans ⟨fun ⟨_, hx', x'_eq⟩ => h x'_eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.map_mem_map FractionalIdeal.map_mem_map
theorem map_injective (f : P →ₐ[R] P') (h : Function.Injective f) :
Function.Injective (map f : FractionalIdeal S P → FractionalIdeal S P') := fun _ _ hIJ =>
ext fun _ => (map_mem_map h).symm.trans (hIJ.symm ▸ map_mem_map h)
#align fractional_ideal.map_injective FractionalIdeal.map_injective
/-- If `g` is an equivalence, `map g` is an isomorphism -/
def mapEquiv (g : P ≃ₐ[R] P') : FractionalIdeal S P ≃+* FractionalIdeal S P' where
toFun := map g
invFun := map g.symm
map_add' I J := map_add I J _
map_mul' I J := map_mul I J _
left_inv I := by rw [← map_comp, AlgEquiv.symm_comp, map_id]
right_inv I := by rw [← map_comp, AlgEquiv.comp_symm, map_id]
#align fractional_ideal.map_equiv FractionalIdeal.mapEquiv
@[simp]
theorem coeFun_mapEquiv (g : P ≃ₐ[R] P') :
(mapEquiv g : FractionalIdeal S P → FractionalIdeal S P') = map g :=
rfl
#align fractional_ideal.coe_fun_map_equiv FractionalIdeal.coeFun_mapEquiv
@[simp]
theorem mapEquiv_apply (g : P ≃ₐ[R] P') (I : FractionalIdeal S P) : mapEquiv g I = map (↑g) I :=
rfl
#align fractional_ideal.map_equiv_apply FractionalIdeal.mapEquiv_apply
@[simp]
theorem mapEquiv_symm (g : P ≃ₐ[R] P') :
((mapEquiv g).symm : FractionalIdeal S P' ≃+* _) = mapEquiv g.symm :=
rfl
#align fractional_ideal.map_equiv_symm FractionalIdeal.mapEquiv_symm
@[simp]
theorem mapEquiv_refl : mapEquiv AlgEquiv.refl = RingEquiv.refl (FractionalIdeal S P) :=
RingEquiv.ext fun x => by simp
#align fractional_ideal.map_equiv_refl FractionalIdeal.mapEquiv_refl
theorem isFractional_span_iff {s : Set P} :
IsFractional S (span R s) ↔ ∃ a ∈ S, ∀ b : P, b ∈ s → IsInteger R (a • b) :=
⟨fun ⟨a, a_mem, h⟩ => ⟨a, a_mem, fun b hb => h b (subset_span hb)⟩, fun ⟨a, a_mem, h⟩ =>
⟨a, a_mem, fun b hb =>
span_induction hb h
(by
rw [smul_zero]
exact isInteger_zero)
(fun x y hx hy => by
| rw [smul_add] | theorem isFractional_span_iff {s : Set P} :
IsFractional S (span R s) ↔ ∃ a ∈ S, ∀ b : P, b ∈ s → IsInteger R (a • b) :=
⟨fun ⟨a, a_mem, h⟩ => ⟨a, a_mem, fun b hb => h b (subset_span hb)⟩, fun ⟨a, a_mem, h⟩ =>
⟨a, a_mem, fun b hb =>
span_induction hb h
(by
rw [smul_zero]
exact isInteger_zero)
(fun x y hx hy => by
| Mathlib.RingTheory.FractionalIdeal.836_0.90B1BH8AtSmfl9S | theorem isFractional_span_iff {s : Set P} :
IsFractional S (span R s) ↔ ∃ a ∈ S, ∀ b : P, b ∈ s → IsInteger R (a • b) | Mathlib_RingTheory_FractionalIdeal |
R : Type u_1
inst✝⁶ : CommRing R
S : Submonoid R
P : Type u_2
inst✝⁵ : CommRing P
inst✝⁴ : Algebra R P
loc : IsLocalization S P
P' : Type u_3
inst✝³ : CommRing P'
inst✝² : Algebra R P'
loc' : IsLocalization S P'
P'' : Type u_4
inst✝¹ : CommRing P''
inst✝ : Algebra R P''
loc'' : IsLocalization S P''
I J : FractionalIdeal S P
g : P →ₐ[R] P'
s : Set P
x✝ : ∃ a ∈ S, ∀ b ∈ s, IsInteger R (a • b)
a : R
a_mem : a ∈ S
h : ∀ b ∈ s, IsInteger R (a • b)
b : P
hb : b ∈ span R s
x y : P
hx : IsInteger R (a • x)
hy : IsInteger R (a • y)
⊢ IsInteger R (a • x + a • y) | /-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Filippo A. E. Nuccio
-/
import Mathlib.Algebra.BigOperators.Finprod
import Mathlib.RingTheory.IntegralClosure
import Mathlib.RingTheory.Localization.Integer
import Mathlib.RingTheory.Localization.Submodule
import Mathlib.RingTheory.Noetherian
import Mathlib.RingTheory.PrincipalIdealDomain
import Mathlib.Tactic.FieldSimp
#align_import ring_theory.fractional_ideal from "leanprover-community/mathlib"@"ed90a7d327c3a5caf65a6faf7e8a0d63c4605df7"
/-!
# Fractional ideals
This file defines fractional ideals of an integral domain and proves basic facts about them.
## Main definitions
Let `S` be a submonoid of an integral domain `R`, `P` the localization of `R` at `S`, and `f` the
natural ring hom from `R` to `P`.
* `IsFractional` defines which `R`-submodules of `P` are fractional ideals
* `FractionalIdeal S P` is the type of fractional ideals in `P`
* a coercion `coeIdeal : Ideal R → FractionalIdeal S P`
* `CommSemiring (FractionalIdeal S P)` instance:
the typical ideal operations generalized to fractional ideals
* `Lattice (FractionalIdeal S P)` instance
* `map` is the pushforward of a fractional ideal along an algebra morphism
Let `K` be the localization of `R` at `R⁰ = R \ {0}` (i.e. the field of fractions).
* `FractionalIdeal R⁰ K` is the type of fractional ideals in the field of fractions
* `Div (FractionalIdeal R⁰ K)` instance:
the ideal quotient `I / J` (typically written $I : J$, but a `:` operator cannot be defined)
## Main statements
* `mul_left_mono` and `mul_right_mono` state that ideal multiplication is monotone
* `mul_div_self_cancel_iff` states that `1 / I` is the inverse of `I` if one exists
* `isNoetherian` states that every fractional ideal of a noetherian integral domain is noetherian
## Implementation notes
Fractional ideals are considered equal when they contain the same elements,
independent of the denominator `a : R` such that `a I ⊆ R`.
Thus, we define `FractionalIdeal` to be the subtype of the predicate `IsFractional`,
instead of having `FractionalIdeal` be a structure of which `a` is a field.
Most definitions in this file specialize operations from submodules to fractional ideals,
proving that the result of this operation is fractional if the input is fractional.
Exceptions to this rule are defining `(+) := (⊔)` and `⊥ := 0`,
in order to re-use their respective proof terms.
We can still use `simp` to show `↑I + ↑J = ↑(I + J)` and `↑⊥ = ↑0`.
Many results in fact do not need that `P` is a localization, only that `P` is an
`R`-algebra. We omit the `IsLocalization` parameter whenever this is practical.
Similarly, we don't assume that the localization is a field until we need it to
define ideal quotients. When this assumption is needed, we replace `S` with `R⁰`,
making the localization a field.
## References
* https://en.wikipedia.org/wiki/Fractional_ideal
## Tags
fractional ideal, fractional ideals, invertible ideal
-/
open IsLocalization
open Pointwise
open nonZeroDivisors
section Defs
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P]
variable (S)
/-- A submodule `I` is a fractional ideal if `a I ⊆ R` for some `a ≠ 0`. -/
def IsFractional (I : Submodule R P) :=
∃ a ∈ S, ∀ b ∈ I, IsInteger R (a • b)
#align is_fractional IsFractional
variable (P)
/-- The fractional ideals of a domain `R` are ideals of `R` divided by some `a ∈ R`.
More precisely, let `P` be a localization of `R` at some submonoid `S`,
then a fractional ideal `I ⊆ P` is an `R`-submodule of `P`,
such that there is a nonzero `a : R` with `a I ⊆ R`.
-/
def FractionalIdeal :=
{ I : Submodule R P // IsFractional S I }
#align fractional_ideal FractionalIdeal
end Defs
namespace FractionalIdeal
open Set
open Submodule
variable {R : Type*} [CommRing R] {S : Submonoid R} {P : Type*} [CommRing P]
variable [Algebra R P] [loc : IsLocalization S P]
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This implements the coercion `FractionalIdeal S P → Submodule R P`.
-/
@[coe]
def coeToSubmodule (I : FractionalIdeal S P) : Submodule R P :=
I.val
/-- Map a fractional ideal `I` to a submodule by forgetting that `∃ a, a I ⊆ R`.
This coercion is typically called `coeToSubmodule` in lemma names
(or `coe` when the coercion is clear from the context),
not to be confused with `IsLocalization.coeSubmodule : Ideal R → Submodule R P`
(which we use to define `coe : Ideal R → FractionalIdeal S P`).
-/
instance : CoeOut (FractionalIdeal S P) (Submodule R P) :=
⟨coeToSubmodule⟩
protected theorem isFractional (I : FractionalIdeal S P) : IsFractional S (I : Submodule R P) :=
I.prop
#align fractional_ideal.is_fractional FractionalIdeal.isFractional
section SetLike
instance : SetLike (FractionalIdeal S P) P where
coe I := ↑(I : Submodule R P)
coe_injective' := SetLike.coe_injective.comp Subtype.coe_injective
@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I :=
Iff.rfl
#align fractional_ideal.mem_coe FractionalIdeal.mem_coe
@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J :=
SetLike.ext
#align fractional_ideal.ext FractionalIdeal.ext
/-- Copy of a `FractionalIdeal` with a new underlying set equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : FractionalIdeal S P :=
⟨Submodule.copy p s hs, by
convert p.isFractional
ext
simp only [hs]
rfl⟩
#align fractional_ideal.copy FractionalIdeal.copy
@[simp]
theorem coe_copy (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : ↑(p.copy s hs) = s :=
rfl
#align fractional_ideal.coe_copy FractionalIdeal.coe_copy
theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p :=
SetLike.coe_injective hs
#align fractional_ideal.coe_eq FractionalIdeal.coe_eq
end SetLike
-- Porting note: this seems to be needed a lot more than in Lean 3
@[simp]
theorem val_eq_coe (I : FractionalIdeal S P) : I.val = I :=
rfl
#align fractional_ideal.val_eq_coe FractionalIdeal.val_eq_coe
-- Porting note: had to rephrase this to make it clear to `simp` what was going on.
@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
coeToSubmodule ⟨I, hI⟩ = I :=
rfl
#align fractional_ideal.coe_mk FractionalIdeal.coe_mk
-- Porting note: added this lemma because Lean can't see through the composition of coercions.
theorem coeToSet_coeToSubmodule (I : FractionalIdeal S P) :
((I : Submodule R P) : Set P) = I :=
rfl
/-! Transfer instances from `Submodule R P` to `FractionalIdeal S P`. -/
instance (I : FractionalIdeal S P) : Module R I :=
Submodule.module (I : Submodule R P)
theorem coeToSubmodule_injective :
Function.Injective (fun (I : FractionalIdeal S P) ↦ (I : Submodule R P)) :=
Subtype.coe_injective
#align fractional_ideal.coe_to_submodule_injective FractionalIdeal.coeToSubmodule_injective
theorem coeToSubmodule_inj {I J : FractionalIdeal S P} : (I : Submodule R P) = J ↔ I = J :=
coeToSubmodule_injective.eq_iff
#align fractional_ideal.coe_to_submodule_inj FractionalIdeal.coeToSubmodule_inj
theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I := by
use 1, S.one_mem
intro b hb
rw [one_smul]
obtain ⟨b', b'_mem, rfl⟩ := h hb
exact Set.mem_range_self b'
#align fractional_ideal.is_fractional_of_le_one FractionalIdeal.isFractional_of_le_one
theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
IsFractional S I := by
obtain ⟨a, a_mem, ha⟩ := J.isFractional
use a, a_mem
intro b b_mem
exact ha b (hIJ b_mem)
#align fractional_ideal.is_fractional_of_le FractionalIdeal.isFractional_of_le
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is the function that implements the coercion `Ideal R → FractionalIdeal S P`. -/
@[coe]
def coeIdeal (I : Ideal R) : FractionalIdeal S P :=
⟨coeSubmodule P I,
isFractional_of_le_one _ <| by simpa using coeSubmodule_mono P (le_top : I ≤ ⊤)⟩
-- Is a `CoeTC` rather than `Coe` to speed up failing inference, see library note [use has_coe_t]
/-- Map an ideal `I` to a fractional ideal by forgetting `I` is integral.
This is a bundled version of `IsLocalization.coeSubmodule : Ideal R → Submodule R P`,
which is not to be confused with the `coe : FractionalIdeal S P → Submodule R P`,
also called `coeToSubmodule` in theorem names.
This map is available as a ring hom, called `FractionalIdeal.coeIdealHom`.
-/
instance : CoeTC (Ideal R) (FractionalIdeal S P) :=
⟨fun I => coeIdeal I⟩
@[simp, norm_cast]
theorem coe_coeIdeal (I : Ideal R) :
((I : FractionalIdeal S P) : Submodule R P) = coeSubmodule P I :=
rfl
#align fractional_ideal.coe_coe_ideal FractionalIdeal.coe_coeIdeal
variable (S)
@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x :=
mem_coeSubmodule _ _
#align fractional_ideal.mem_coe_ideal FractionalIdeal.mem_coeIdeal
theorem mem_coeIdeal_of_mem {x : R} {I : Ideal R} (hx : x ∈ I) :
algebraMap R P x ∈ (I : FractionalIdeal S P) :=
(mem_coeIdeal S).mpr ⟨x, hx, rfl⟩
#align fractional_ideal.mem_coe_ideal_of_mem FractionalIdeal.mem_coeIdeal_of_mem
theorem coeIdeal_le_coeIdeal' [IsLocalization S P] (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) ≤ J ↔ I ≤ J :=
coeSubmodule_le_coeSubmodule h
#align fractional_ideal.coe_ideal_le_coe_ideal' FractionalIdeal.coeIdeal_le_coeIdeal'
@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
{I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J :=
IsFractionRing.coeSubmodule_le_coeSubmodule
#align fractional_ideal.coe_ideal_le_coe_ideal FractionalIdeal.coeIdeal_le_coeIdeal
instance : Zero (FractionalIdeal S P) :=
⟨(0 : Ideal R)⟩
@[simp]
theorem mem_zero_iff {x : P} : x ∈ (0 : FractionalIdeal S P) ↔ x = 0 :=
⟨fun ⟨x', x'_mem_zero, x'_eq_x⟩ => by
have x'_eq_zero : x' = 0 := x'_mem_zero
simp [x'_eq_x.symm, x'_eq_zero], fun hx => ⟨0, rfl, by simp [hx]⟩⟩
#align fractional_ideal.mem_zero_iff FractionalIdeal.mem_zero_iff
variable {S}
@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P) :=
Submodule.ext fun _ => mem_zero_iff S
#align fractional_ideal.coe_zero FractionalIdeal.coe_zero
@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.coe_ideal_bot FractionalIdeal.coeIdeal_bot
variable (P)
@[simp]
theorem exists_mem_algebraMap_eq {x : R} {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(∃ x', x' ∈ I ∧ algebraMap R P x' = algebraMap R P x) ↔ x ∈ I :=
⟨fun ⟨_, hx', Eq⟩ => IsLocalization.injective _ h Eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.exists_mem_to_map_eq FractionalIdeal.exists_mem_algebraMap_eq
variable {P}
theorem coeIdeal_injective' (h : S ≤ nonZeroDivisors R) :
Function.Injective (fun (I : Ideal R) ↦ (I : FractionalIdeal S P)) := fun _ _ h' =>
((coeIdeal_le_coeIdeal' S h).mp h'.le).antisymm ((coeIdeal_le_coeIdeal' S h).mp
h'.ge)
#align fractional_ideal.coe_ideal_injective' FractionalIdeal.coeIdeal_injective'
theorem coeIdeal_inj' (h : S ≤ nonZeroDivisors R) {I J : Ideal R} :
(I : FractionalIdeal S P) = J ↔ I = J :=
(coeIdeal_injective' h).eq_iff
#align fractional_ideal.coe_ideal_inj' FractionalIdeal.coeIdeal_inj'
-- Porting note: doesn't need to be @[simp] because it can be proved by coeIdeal_eq_zero
theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R) :=
coeIdeal_inj' h
#align fractional_ideal.coe_ideal_eq_zero' FractionalIdeal.coeIdeal_eq_zero'
theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
(I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R) :=
not_iff_not.mpr <| coeIdeal_eq_zero' h
#align fractional_ideal.coe_ideal_ne_zero' FractionalIdeal.coeIdeal_ne_zero'
theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0 :=
⟨fun h => coeToSubmodule_injective (by simp [h]), fun h => by simp [h]⟩
#align fractional_ideal.coe_to_submodule_eq_bot FractionalIdeal.coeToSubmodule_eq_bot
theorem coeToSubmodule_ne_bot {I : FractionalIdeal S P} : ↑I ≠ (⊥ : Submodule R P) ↔ I ≠ 0 :=
not_iff_not.mpr coeToSubmodule_eq_bot
#align fractional_ideal.coe_to_submodule_ne_bot FractionalIdeal.coeToSubmodule_ne_bot
instance : Inhabited (FractionalIdeal S P) :=
⟨0⟩
instance : One (FractionalIdeal S P) :=
⟨(⊤ : Ideal R)⟩
variable (S)
@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1 :=
rfl
#align fractional_ideal.coe_ideal_top FractionalIdeal.coeIdeal_top
theorem mem_one_iff {x : P} : x ∈ (1 : FractionalIdeal S P) ↔ ∃ x' : R, algebraMap R P x' = x :=
Iff.intro (fun ⟨x', _, h⟩ => ⟨x', h⟩) fun ⟨x', h⟩ => ⟨x', ⟨⟩, h⟩
#align fractional_ideal.mem_one_iff FractionalIdeal.mem_one_iff
theorem coe_mem_one (x : R) : algebraMap R P x ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨x, rfl⟩
#align fractional_ideal.coe_mem_one FractionalIdeal.coe_mem_one
theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P) :=
(mem_one_iff S).mpr ⟨1, RingHom.map_one _⟩
#align fractional_ideal.one_mem_one FractionalIdeal.one_mem_one
variable {S}
/-- `(1 : FractionalIdeal S P)` is defined as the R-submodule `f(R) ≤ P`.
However, this is not definitionally equal to `1 : Submodule R P`,
which is proved in the actual `simp` lemma `coe_one`. -/
theorem coe_one_eq_coeSubmodule_top : ↑(1 : FractionalIdeal S P) = coeSubmodule P (⊤ : Ideal R) :=
rfl
#align fractional_ideal.coe_one_eq_coe_submodule_top FractionalIdeal.coe_one_eq_coeSubmodule_top
@[simp, norm_cast]
theorem coe_one : (↑(1 : FractionalIdeal S P) : Submodule R P) = 1 := by
rw [coe_one_eq_coeSubmodule_top, coeSubmodule_top]
#align fractional_ideal.coe_one FractionalIdeal.coe_one
section Lattice
/-!
### `Lattice` section
Defines the order on fractional ideals as inclusion of their underlying sets,
and ports the lattice structure on submodules to fractional ideals.
-/
@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
(I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J :=
Iff.rfl
#align fractional_ideal.coe_le_coe FractionalIdeal.coe_le_coe
theorem zero_le (I : FractionalIdeal S P) : 0 ≤ I := by
intro x hx
-- Porting note: changed the proof from convert; simp into rw; exact
rw [(mem_zero_iff _).mp hx]
exact zero_mem (I : Submodule R P)
#align fractional_ideal.zero_le FractionalIdeal.zero_le
instance orderBot : OrderBot (FractionalIdeal S P) where
bot := 0
bot_le := zero_le
#align fractional_ideal.order_bot FractionalIdeal.orderBot
@[simp]
theorem bot_eq_zero : (⊥ : FractionalIdeal S P) = 0 :=
rfl
#align fractional_ideal.bot_eq_zero FractionalIdeal.bot_eq_zero
@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0 :=
le_bot_iff
#align fractional_ideal.le_zero_iff FractionalIdeal.le_zero_iff
theorem eq_zero_iff {I : FractionalIdeal S P} : I = 0 ↔ ∀ x ∈ I, x = (0 : P) :=
⟨fun h x hx => by simpa [h, mem_zero_iff] using hx, fun h =>
le_bot_iff.mp fun x hx => (mem_zero_iff S).mpr (h x hx)⟩
#align fractional_ideal.eq_zero_iff FractionalIdeal.eq_zero_iff
theorem _root_.IsFractional.sup {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I ⊔ J)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
rcases mem_sup.mp hb with ⟨bI, hbI, bJ, hbJ, rfl⟩
rw [smul_add]
apply isInteger_add
· rw [mul_smul, smul_comm]
exact isInteger_smul (hI bI hbI)
· rw [mul_smul]
exact isInteger_smul (hJ bJ hbJ)⟩
#align is_fractional.sup IsFractional.sup
theorem _root_.IsFractional.inf_right {I : Submodule R P} :
IsFractional S I → ∀ J, IsFractional S (I ⊓ J)
| ⟨aI, haI, hI⟩, J =>
⟨aI, haI, fun b hb => by
rcases mem_inf.mp hb with ⟨hbI, _⟩
exact hI b hbI⟩
#align is_fractional.inf_right IsFractional.inf_right
instance : Inf (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊓ J, I.isFractional.inf_right J⟩⟩
@[simp, norm_cast]
theorem coe_inf (I J : FractionalIdeal S P) : ↑(I ⊓ J) = (I ⊓ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_inf FractionalIdeal.coe_inf
instance : Sup (FractionalIdeal S P) :=
⟨fun I J => ⟨I ⊔ J, I.isFractional.sup J.isFractional⟩⟩
@[norm_cast]
theorem coe_sup (I J : FractionalIdeal S P) : ↑(I ⊔ J) = (I ⊔ J : Submodule R P) :=
rfl
#align fractional_ideal.coe_sup FractionalIdeal.coe_sup
instance lattice : Lattice (FractionalIdeal S P) :=
Function.Injective.lattice _ Subtype.coe_injective coe_sup coe_inf
#align fractional_ideal.lattice FractionalIdeal.lattice
instance : SemilatticeSup (FractionalIdeal S P) :=
{ FractionalIdeal.lattice with }
end Lattice
section Semiring
instance : Add (FractionalIdeal S P) :=
⟨(· ⊔ ·)⟩
@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J :=
rfl
#align fractional_ideal.sup_eq_add FractionalIdeal.sup_eq_add
@[simp, norm_cast]
theorem coe_add (I J : FractionalIdeal S P) : (↑(I + J) : Submodule R P) = I + J :=
rfl
#align fractional_ideal.coe_add FractionalIdeal.coe_add
@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P) :=
coeToSubmodule_injective <| coeSubmodule_sup _ _ _
#align fractional_ideal.coe_ideal_sup FractionalIdeal.coeIdeal_sup
theorem _root_.IsFractional.nsmul {I : Submodule R P} :
∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)
| 0, _ => by
rw [zero_smul]
convert ((0 : Ideal R) : FractionalIdeal S P).isFractional
simp
| n + 1, h => by
rw [succ_nsmul]
exact h.sup (IsFractional.nsmul n h)
#align is_fractional.nsmul IsFractional.nsmul
instance : SMul ℕ (FractionalIdeal S P) where smul n I := ⟨n • ↑I, I.isFractional.nsmul n⟩
@[norm_cast]
theorem coe_nsmul (n : ℕ) (I : FractionalIdeal S P) :
(↑(n • I) : Submodule R P) = n • (I : Submodule R P) :=
rfl
#align fractional_ideal.coe_nsmul FractionalIdeal.coe_nsmul
theorem _root_.IsFractional.mul {I J : Submodule R P} :
IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)
| ⟨aI, haI, hI⟩, ⟨aJ, haJ, hJ⟩ =>
⟨aI * aJ, S.mul_mem haI haJ, fun b hb => by
refine Submodule.mul_induction_on hb ?_ ?_
· intro m hm n hn
obtain ⟨n', hn'⟩ := hJ n hn
rw [mul_smul, mul_comm m, ← smul_mul_assoc, ← hn', ← Algebra.smul_def]
apply hI
exact Submodule.smul_mem _ _ hm
· intro x y hx hy
rw [smul_add]
apply isInteger_add hx hy⟩
#align is_fractional.mul IsFractional.mul
theorem _root_.IsFractional.pow {I : Submodule R P} (h : IsFractional S I) :
∀ n : ℕ, IsFractional S (I ^ n : Submodule R P)
| 0 => isFractional_of_le_one _ (pow_zero _).le
| n + 1 => (pow_succ I n).symm ▸ h.mul (IsFractional.pow h n)
#align is_fractional.pow IsFractional.pow
/-- `FractionalIdeal.mul` is the product of two fractional ideals,
used to define the `Mul` instance.
This is only an auxiliary definition: the preferred way of writing `I.mul J` is `I * J`.
Elaborated terms involving `FractionalIdeal` tend to grow quite large,
so by making definitions irreducible, we hope to avoid deep unfolds.
-/
irreducible_def mul (lemma := mul_def') (I J : FractionalIdeal S P) : FractionalIdeal S P :=
⟨I * J, I.isFractional.mul J.isFractional⟩
#align fractional_ideal.mul FractionalIdeal.mul
-- local attribute [semireducible] mul
instance : Mul (FractionalIdeal S P) :=
⟨fun I J => mul I J⟩
@[simp]
theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J :=
rfl
#align fractional_ideal.mul_eq_mul FractionalIdeal.mul_eq_mul
theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ :=
by simp only [← mul_eq_mul, mul]
#align fractional_ideal.mul_def FractionalIdeal.mul_def
@[simp, norm_cast]
theorem coe_mul (I J : FractionalIdeal S P) : (↑(I * J) : Submodule R P) = I * J := by
simp only [mul_def, coe_mk]
#align fractional_ideal.coe_mul FractionalIdeal.coe_mul
@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J := by
simp only [mul_def]
exact coeToSubmodule_injective (coeSubmodule_mul _ _ _)
#align fractional_ideal.coe_ideal_mul FractionalIdeal.coeIdeal_mul
theorem mul_left_mono (I : FractionalIdeal S P) : Monotone (I * ·) := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul hx (h hy)
#align fractional_ideal.mul_left_mono FractionalIdeal.mul_left_mono
theorem mul_right_mono (I : FractionalIdeal S P) : Monotone fun J => J * I := by
intro J J' h
simp only [mul_def]
exact mul_le.mpr fun x hx y hy => mul_mem_mul (h hx) hy
#align fractional_ideal.mul_right_mono FractionalIdeal.mul_right_mono
theorem mul_mem_mul {I J : FractionalIdeal S P} {i j : P} (hi : i ∈ I) (hj : j ∈ J) :
i * j ∈ I * J := by
simp only [mul_def]
exact Submodule.mul_mem_mul hi hj
#align fractional_ideal.mul_mem_mul FractionalIdeal.mul_mem_mul
theorem mul_le {I J K : FractionalIdeal S P} : I * J ≤ K ↔ ∀ i ∈ I, ∀ j ∈ J, i * j ∈ K := by
simp only [mul_def]
exact Submodule.mul_le
#align fractional_ideal.mul_le FractionalIdeal.mul_le
instance : Pow (FractionalIdeal S P) ℕ :=
⟨fun I n => ⟨(I : Submodule R P) ^ n, I.isFractional.pow n⟩⟩
@[simp, norm_cast]
theorem coe_pow (I : FractionalIdeal S P) (n : ℕ) : ↑(I ^ n) = (I : Submodule R P) ^ n :=
rfl
#align fractional_ideal.coe_pow FractionalIdeal.coe_pow
@[elab_as_elim]
protected theorem mul_induction_on {I J : FractionalIdeal S P} {C : P → Prop} {r : P}
(hr : r ∈ I * J) (hm : ∀ i ∈ I, ∀ j ∈ J, C (i * j)) (ha : ∀ x y, C x → C y → C (x + y)) :
C r := by
simp only [mul_def] at hr
exact Submodule.mul_induction_on hr hm ha
#align fractional_ideal.mul_induction_on FractionalIdeal.mul_induction_on
instance : NatCast (FractionalIdeal S P) :=
⟨Nat.unaryCast⟩
theorem coe_nat_cast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n :=
show ((n.unaryCast : FractionalIdeal S P) : Submodule R P) = n
by induction n <;> simp [*, Nat.unaryCast]
#align fractional_ideal.coe_nat_cast FractionalIdeal.coe_nat_cast
instance commSemiring : CommSemiring (FractionalIdeal S P) :=
Function.Injective.commSemiring _ Subtype.coe_injective coe_zero coe_one coe_add coe_mul
(fun _ _ => coe_nsmul _ _) coe_pow coe_nat_cast
variable (S P)
/-- `FractionalIdeal.coeToSubmodule` as a bundled `RingHom`. -/
@[simps]
def coeSubmoduleHom : FractionalIdeal S P →+* Submodule R P where
toFun := coeToSubmodule
map_one' := coe_one
map_mul' := coe_mul
map_zero' := coe_zero (S := S)
map_add' := coe_add
#align fractional_ideal.coe_submodule_hom FractionalIdeal.coeSubmoduleHom
variable {S P}
section Order
theorem add_le_add_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' + I ≤ J' + J :=
sup_le_sup_left hIJ J'
#align fractional_ideal.add_le_add_left FractionalIdeal.add_le_add_left
theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
J' * I ≤ J' * J :=
mul_le.mpr fun _ hk _ hj => mul_mem_mul hk (hIJ hj)
#align fractional_ideal.mul_le_mul_left FractionalIdeal.mul_le_mul_left
theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.le_self_mul_self FractionalIdeal.le_self_mul_self
theorem mul_self_le_self {I : FractionalIdeal S P} (hI : I ≤ 1) : I * I ≤ I := by
convert mul_left_mono I hI
exact (mul_one I).symm
#align fractional_ideal.mul_self_le_self FractionalIdeal.mul_self_le_self
theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1 := fun _ hx =>
let ⟨y, _, hy⟩ := (mem_coeIdeal S).mp hx
(mem_one_iff S).mpr ⟨y, hy⟩
#align fractional_ideal.coe_ideal_le_one FractionalIdeal.coeIdeal_le_one
theorem le_one_iff_exists_coeIdeal {J : FractionalIdeal S P} :
J ≤ (1 : FractionalIdeal S P) ↔ ∃ I : Ideal R, ↑I = J := by
constructor
· intro hJ
refine' ⟨⟨⟨⟨{ x : R | algebraMap R P x ∈ J }, _⟩, _⟩, _⟩, _⟩
· intro a b ha hb
rw [mem_setOf, RingHom.map_add]
exact J.val.add_mem ha hb
· rw [mem_setOf, RingHom.map_zero]
exact J.val.zero_mem
· intro c x hx
rw [smul_eq_mul, mem_setOf, RingHom.map_mul, ← Algebra.smul_def]
exact J.val.smul_mem c hx
· ext x
constructor
· rintro ⟨y, hy, eq_y⟩
rwa [← eq_y]
· intro hx
obtain ⟨y, rfl⟩ := (mem_one_iff S).mp (hJ hx)
exact mem_setOf.mpr ⟨y, hx, rfl⟩
· rintro ⟨I, hI⟩
rw [← hI]
apply coeIdeal_le_one
#align fractional_ideal.le_one_iff_exists_coe_ideal FractionalIdeal.le_one_iff_exists_coeIdeal
@[simp]
theorem one_le {I : FractionalIdeal S P} : 1 ≤ I ↔ (1 : P) ∈ I := by
rw [← coe_le_coe, coe_one, Submodule.one_le, mem_coe]
#align fractional_ideal.one_le FractionalIdeal.one_le
variable (S P)
/-- `coeIdealHom (S : Submonoid R) P` is `(↑) : Ideal R → FractionalIdeal S P` as a ring hom -/
@[simps]
def coeIdealHom : Ideal R →+* FractionalIdeal S P where
toFun := coeIdeal
map_add' := coeIdeal_sup
map_mul' := coeIdeal_mul
map_one' := by rw [Ideal.one_eq_top, coeIdeal_top]
map_zero' := coeIdeal_bot
#align fractional_ideal.coe_ideal_hom FractionalIdeal.coeIdealHom
theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n :=
(coeIdealHom S P).map_pow _ n
#align fractional_ideal.coe_ideal_pow FractionalIdeal.coeIdeal_pow
open BigOperators
theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
(hS : S ≤ nonZeroDivisors R) :
((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P) :=
MonoidHom.map_finprod_of_injective (coeIdealHom S P).toMonoidHom (coeIdeal_injective' hS) f
#align fractional_ideal.coe_ideal_finprod FractionalIdeal.coeIdeal_finprod
end Order
variable {P' : Type*} [CommRing P'] [Algebra R P'] [loc' : IsLocalization S P']
variable {P'' : Type*} [CommRing P''] [Algebra R P''] [loc'' : IsLocalization S P'']
theorem _root_.IsFractional.map (g : P →ₐ[R] P') {I : Submodule R P} :
IsFractional S I → IsFractional S (Submodule.map g.toLinearMap I)
| ⟨a, a_nonzero, hI⟩ =>
⟨a, a_nonzero, fun b hb => by
obtain ⟨b', b'_mem, hb'⟩ := Submodule.mem_map.mp hb
rw [AlgHom.toLinearMap_apply] at hb'
obtain ⟨x, hx⟩ := hI b' b'_mem
use x
rw [← g.commutes, hx, g.map_smul, hb']⟩
#align is_fractional.map IsFractional.map
/-- `I.map g` is the pushforward of the fractional ideal `I` along the algebra morphism `g` -/
def map (g : P →ₐ[R] P') : FractionalIdeal S P → FractionalIdeal S P' := fun I =>
⟨Submodule.map g.toLinearMap I, I.isFractional.map g⟩
#align fractional_ideal.map FractionalIdeal.map
@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
↑(map g I) = Submodule.map g.toLinearMap I :=
rfl
#align fractional_ideal.coe_map FractionalIdeal.coe_map
@[simp]
theorem mem_map {I : FractionalIdeal S P} {g : P →ₐ[R] P'} {y : P'} :
y ∈ I.map g ↔ ∃ x, x ∈ I ∧ g x = y :=
Submodule.mem_map
#align fractional_ideal.mem_map FractionalIdeal.mem_map
variable (I J : FractionalIdeal S P) (g : P →ₐ[R] P')
@[simp]
theorem map_id : I.map (AlgHom.id _ _) = I :=
coeToSubmodule_injective (Submodule.map_id (I : Submodule R P))
#align fractional_ideal.map_id FractionalIdeal.map_id
@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g' :=
coeToSubmodule_injective (Submodule.map_comp g.toLinearMap g'.toLinearMap I)
#align fractional_ideal.map_comp FractionalIdeal.map_comp
@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I := by
ext x
simp only [mem_coeIdeal]
constructor
· rintro ⟨_, ⟨y, hy, rfl⟩, rfl⟩
exact ⟨y, hy, (g.commutes y).symm⟩
· rintro ⟨y, hy, rfl⟩
exact ⟨_, ⟨y, hy, rfl⟩, g.commutes y⟩
#align fractional_ideal.map_coe_ideal FractionalIdeal.map_coeIdeal
@[simp]
theorem map_one : (1 : FractionalIdeal S P).map g = 1 :=
map_coeIdeal g ⊤
#align fractional_ideal.map_one FractionalIdeal.map_one
@[simp]
theorem map_zero : (0 : FractionalIdeal S P).map g = 0 :=
map_coeIdeal g 0
#align fractional_ideal.map_zero FractionalIdeal.map_zero
@[simp]
theorem map_add : (I + J).map g = I.map g + J.map g :=
coeToSubmodule_injective (Submodule.map_sup _ _ _)
#align fractional_ideal.map_add FractionalIdeal.map_add
@[simp]
theorem map_mul : (I * J).map g = I.map g * J.map g := by
simp only [mul_def]
exact coeToSubmodule_injective (Submodule.map_mul _ _ _)
#align fractional_ideal.map_mul FractionalIdeal.map_mul
@[simp]
theorem map_map_symm (g : P ≃ₐ[R] P') : (I.map (g : P →ₐ[R] P')).map (g.symm : P' →ₐ[R] P) = I := by
rw [← map_comp, g.symm_comp, map_id]
#align fractional_ideal.map_map_symm FractionalIdeal.map_map_symm
@[simp]
theorem map_symm_map (I : FractionalIdeal S P') (g : P ≃ₐ[R] P') :
(I.map (g.symm : P' →ₐ[R] P)).map (g : P →ₐ[R] P') = I := by
rw [← map_comp, g.comp_symm, map_id]
#align fractional_ideal.map_symm_map FractionalIdeal.map_symm_map
theorem map_mem_map {f : P →ₐ[R] P'} (h : Function.Injective f) {x : P} {I : FractionalIdeal S P} :
f x ∈ map f I ↔ x ∈ I :=
mem_map.trans ⟨fun ⟨_, hx', x'_eq⟩ => h x'_eq ▸ hx', fun h => ⟨x, h, rfl⟩⟩
#align fractional_ideal.map_mem_map FractionalIdeal.map_mem_map
theorem map_injective (f : P →ₐ[R] P') (h : Function.Injective f) :
Function.Injective (map f : FractionalIdeal S P → FractionalIdeal S P') := fun _ _ hIJ =>
ext fun _ => (map_mem_map h).symm.trans (hIJ.symm ▸ map_mem_map h)
#align fractional_ideal.map_injective FractionalIdeal.map_injective
/-- If `g` is an equivalence, `map g` is an isomorphism -/
def mapEquiv (g : P ≃ₐ[R] P') : FractionalIdeal S P ≃+* FractionalIdeal S P' where
toFun := map g
invFun := map g.symm
map_add' I J := map_add I J _
map_mul' I J := map_mul I J _
left_inv I := by rw [← map_comp, AlgEquiv.symm_comp, map_id]
right_inv I := by rw [← map_comp, AlgEquiv.comp_symm, map_id]
#align fractional_ideal.map_equiv FractionalIdeal.mapEquiv
@[simp]
theorem coeFun_mapEquiv (g : P ≃ₐ[R] P') :
(mapEquiv g : FractionalIdeal S P → FractionalIdeal S P') = map g :=
rfl
#align fractional_ideal.coe_fun_map_equiv FractionalIdeal.coeFun_mapEquiv
@[simp]
theorem mapEquiv_apply (g : P ≃ₐ[R] P') (I : FractionalIdeal S P) : mapEquiv g I = map (↑g) I :=
rfl
#align fractional_ideal.map_equiv_apply FractionalIdeal.mapEquiv_apply
@[simp]
theorem mapEquiv_symm (g : P ≃ₐ[R] P') :
((mapEquiv g).symm : FractionalIdeal S P' ≃+* _) = mapEquiv g.symm :=
rfl
#align fractional_ideal.map_equiv_symm FractionalIdeal.mapEquiv_symm
@[simp]
theorem mapEquiv_refl : mapEquiv AlgEquiv.refl = RingEquiv.refl (FractionalIdeal S P) :=
RingEquiv.ext fun x => by simp
#align fractional_ideal.map_equiv_refl FractionalIdeal.mapEquiv_refl
theorem isFractional_span_iff {s : Set P} :
IsFractional S (span R s) ↔ ∃ a ∈ S, ∀ b : P, b ∈ s → IsInteger R (a • b) :=
⟨fun ⟨a, a_mem, h⟩ => ⟨a, a_mem, fun b hb => h b (subset_span hb)⟩, fun ⟨a, a_mem, h⟩ =>
⟨a, a_mem, fun b hb =>
span_induction hb h
(by
rw [smul_zero]
exact isInteger_zero)
(fun x y hx hy => by
rw [smul_add]
| exact isInteger_add hx hy | theorem isFractional_span_iff {s : Set P} :
IsFractional S (span R s) ↔ ∃ a ∈ S, ∀ b : P, b ∈ s → IsInteger R (a • b) :=
⟨fun ⟨a, a_mem, h⟩ => ⟨a, a_mem, fun b hb => h b (subset_span hb)⟩, fun ⟨a, a_mem, h⟩ =>
⟨a, a_mem, fun b hb =>
span_induction hb h
(by
rw [smul_zero]
exact isInteger_zero)
(fun x y hx hy => by
rw [smul_add]
| Mathlib.RingTheory.FractionalIdeal.836_0.90B1BH8AtSmfl9S | theorem isFractional_span_iff {s : Set P} :
IsFractional S (span R s) ↔ ∃ a ∈ S, ∀ b : P, b ∈ s → IsInteger R (a • b) | Mathlib_RingTheory_FractionalIdeal |
Subsets and Splits