The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V09. Commutative algebra I: ideals, polynomials, factorization

Mathlib.RingTheory.PrincipalIdealDomain

76 declarations. Mathlib docs · Source

Principal ideal rings, principal ideal domains, and Bézout rings

A principal ideal ring (PIR) is a ring in which all left ideals are principal. A principal ideal domain (PID) is an integral domain which is a principal ideal ring.

The definition of IsPrincipalIdealRing can be found in Mathlib/RingTheory/Ideal/Span.lean.

Main definitions

Note that for principal ideal domains, one should use [IsDomain R] [IsPrincipalIdealRing R]. There is no explicit definition of a PID. Theorems about PID's are in the PrincipalIdealRing namespace.

  • IsBezout: the predicate saying that every finitely generated left ideal is principal.
  • generator: a generator of a principal ideal (or more generally submodule)
  • to_uniqueFactorizationMonoid: a PID is a unique factorization domain

Main results

  • Ideal.IsPrime.to_maximal_ideal: a non-zero prime ideal in a PID is maximal.
  • EuclideanDomain.instIsPrincipalIdealRing: a Euclidean domain is a PID.
  • IsBezout.nonemptyGCDMonoid: Every Bézout domain is a GCD domain.

theorem IsBezout.gcd.congr_simp E1 #

∀ {R : Type u} [inst : Ring R] (x x_1 : R) (e_x : x = x_1) (y y_1 : R) (e_y : y = y_1)
  [inst_1 : Submodule.IsPrincipal (Ideal.span {x, y})], IsBezout.gcd x y = IsBezout.gcd x_1 y_1

instance bot_isPrincipal E0 #

∀ {R : Type u} {M : Type v} [inst : Semiring R] [inst_1 : AddCommMonoid M] [inst_2 : Module R M], ⊥.IsPrincipal

instance top_isPrincipal E0 #

∀ {R : Type u} [inst : Semiring R], ⊤.IsPrincipal

class IsBezout E3 #

(R : Type u) → [Semiring R] → Prop

A Bézout ring is a ring whose finitely generated ideals are principal.

ctor IsBezout.mk E0 #

∀ {R : Type u} [inst : Semiring R], (∀ (I : Ideal R), I.FG → Submodule.IsPrincipal I) → IsBezout R

theorem IsBezout.isPrincipal_of_FG E1 #

∀ {R : Type u} {inst : Semiring R} [self : IsBezout R] (I : Ideal R), I.FG → Submodule.IsPrincipal I

Any finitely generated ideal is principal.

instance IsBezout.of_isPrincipalIdealRing E0 #

∀ (R : Type u) [inst : Semiring R] [IsPrincipalIdealRing R], IsBezout R

instance DivisionSemiring.isPrincipalIdealRing E0 #

∀ (K : Type u) [inst : DivisionSemiring K], IsPrincipalIdealRing K

theorem Ideal.span_singleton_generator E0 #

∀ {R : Type u} [inst : Semiring R] (I : Ideal R) [inst_1 : Submodule.IsPrincipal I],
  Ideal.span {Submodule.IsPrincipal.generator I} = I

theorem Submodule.IsPrincipal.generator_mem E0 #

∀ {R : Type u} {M : Type v} [inst : AddCommMonoid M] [inst_1 : Semiring R] [inst_2 : Module R M] (S : Submodule R M)
  [inst_3 : S.IsPrincipal], Submodule.IsPrincipal.generator S ∈ S

theorem Submodule.IsPrincipal.mem_iff_eq_smul_generator E0 #

∀ {R : Type u} {M : Type v} [inst : AddCommMonoid M] [inst_1 : Semiring R] [inst_2 : Module R M] (S : Submodule R M)
  [inst_3 : S.IsPrincipal] {x : M}, x ∈ S ↔ ∃ s, x = s • Submodule.IsPrincipal.generator S

theorem Submodule.IsPrincipal.generator_bot E0 #

∀ {R : Type u} {M : Type v} [inst : AddCommMonoid M] [inst_1 : Semiring R] [inst_2 : Module R M],
  Submodule.IsPrincipal.generator ⊥ = 0

theorem Submodule.IsPrincipal.fg E1 #

∀ {R : Type u} {M : Type v} [inst : AddCommMonoid M] [inst_1 : Semiring R] [inst_2 : Module R M] {S : Submodule R M},
  S.IsPrincipal → S.FG

instance PrincipalIdealRing.isNoetherianRing E0 #

∀ {R : Type u} [inst : Semiring R] [IsPrincipalIdealRing R], IsNoetherianRing R

instance IsPrincipalIdealRing.of_isNoetherianRing_of_isBezout E0 #

∀ {R : Type u} [inst : Semiring R] [IsNoetherianRing R] [IsBezout R], IsPrincipalIdealRing R

theorem Submodule.IsPrincipal.associated_generator_span_self E1 #

∀ {R : Type u} [inst : CommSemiring R] [IsDomain R] (r : R),
  Associated (Submodule.IsPrincipal.generator (Ideal.span {r})) r

theorem Submodule.IsPrincipal.mem_iff_generator_dvd E0 #

∀ {R : Type u} [inst : CommSemiring R] (S : Ideal R) [inst_1 : Submodule.IsPrincipal S] {x : R},
  x ∈ S ↔ Submodule.IsPrincipal.generator S ∣ x

theorem Submodule.IsPrincipal.prime_generator_of_isPrime E1 #

∀ {R : Type u} [inst : CommSemiring R] (S : Ideal R) [inst_1 : Submodule.IsPrincipal S] [is_prime : S.IsPrime],
  S ≠ ⊥ → Prime (Submodule.IsPrincipal.generator S)

theorem Submodule.IsPrincipal.generator_map_dvd_of_mem E1 #

∀ {R : Type u} {M : Type v} [inst : AddCommMonoid M] [inst_1 : CommSemiring R] [inst_2 : Module R M] {N : Submodule R M}
  (ϕ : M →ₗ[R] R) [inst_3 : (Submodule.map ϕ N).IsPrincipal] {x : M},
  x ∈ N → Submodule.IsPrincipal.generator (Submodule.map ϕ N) ∣ ϕ x

theorem Submodule.IsPrincipal.generator_submoduleImage_dvd_of_mem E1 #

∀ {R : Type u} {M : Type v} [inst : AddCommMonoid M] [inst_1 : CommSemiring R] [inst_2 : Module R M]
  {N O : Submodule R M} (hNO : N ≤ O) (ϕ : ↥O →ₗ[R] R) [inst_3 : (ϕ.submoduleImage N).IsPrincipal] {x : M} (hx : x ∈ N),
  Submodule.IsPrincipal.generator (ϕ.submoduleImage N) ∣ ϕ ⟨x, ⋯⟩

theorem Submodule.IsPrincipal.dvd_generator_span_iff E0 #

∀ {R : Type u} [inst : CommSemiring R] {r : R} {s : Set R} [inst_1 : Submodule.IsPrincipal (Ideal.span s)],
  r ∣ Submodule.IsPrincipal.generator (Ideal.span s) ↔ ∀ x ∈ s, r ∣ x

instance IsBezout.span_pair_isPrincipal E0 #

∀ {R : Type u} [inst : Ring R] [IsBezout R] (x y : R), Submodule.IsPrincipal (Ideal.span {x, y})

def IsBezout.gcd E1 #

{R : Type u} → [inst : Ring R] → (x y : R) → [Submodule.IsPrincipal (Ideal.span {x, y})] → R

A choice of gcd of two elements in a Bézout domain.

Note that the choice is usually not unique.

theorem IsBezout.span_gcd E1 #

∀ {R : Type u} [inst : Ring R] (x y : R) [inst_1 : Submodule.IsPrincipal (Ideal.span {x, y})],
  Ideal.span {IsBezout.gcd x y} = Ideal.span {x, y}

theorem IsBezout.gcd_dvd_left E1 #

∀ {R : Type u} [inst : CommRing R] (x y : R) [inst_1 : Submodule.IsPrincipal (Ideal.span {x, y})], IsBezout.gcd x y ∣ x

theorem IsBezout.gcd_dvd_right E1 #

∀ {R : Type u} [inst : CommRing R] (x y : R) [inst_1 : Submodule.IsPrincipal (Ideal.span {x, y})], IsBezout.gcd x y ∣ y

theorem IsBezout.dvd_gcd E1 #

∀ {R : Type u} [inst : CommRing R] {x y z : R} [inst_1 : Submodule.IsPrincipal (Ideal.span {x, y})],
  z ∣ x → z ∣ y → z ∣ IsBezout.gcd x y

theorem IsBezout.gcd_eq_sum E1 #

∀ {R : Type u} [inst : CommRing R] (x y : R) [inst_1 : Submodule.IsPrincipal (Ideal.span {x, y})],
  ∃ a b, a * x + b * y = IsBezout.gcd x y

theorem IsRelPrime.isCoprime E1 #

∀ {R : Type u} [inst : CommRing R] {x y : R} [Submodule.IsPrincipal (Ideal.span {x, y})], IsRelPrime x y → IsCoprime x y

theorem isRelPrime_iff_isCoprime E1 #

∀ {R : Type u} [inst : CommRing R] {x y : R} [Submodule.IsPrincipal (Ideal.span {x, y})], IsRelPrime x y ↔ IsCoprime x y

def IsBezout.toGCDDomain E1 #

(R : Type u) → [inst : CommRing R] → [IsBezout R] → [IsCancelMulZero R] → [DecidableEq R] → GCDMonoid R

Any Bézout domain is a GCD domain. This is not an instance since GCDMonoid contains data, and this might not be how we would like to construct it.

instance IsBezout.instIsGCDMonoidOfIsCancelMulZero E0 #

∀ (R : Type u) [inst : CommRing R] [IsBezout R] [IsCancelMulZero R], IsGCDMonoid R

theorem IsBezout.associated_gcd_gcd E1 #

∀ (R : Type u) [inst : CommRing R] {x y : R} [inst_1 : Submodule.IsPrincipal (Ideal.span {x, y})]
  [inst_2 : GCDMonoid R], Associated (IsBezout.gcd x y) (gcd x y)

theorem Finset.gcd_eq_sum_mul E2 #

∀ {R : Type u} {α : Type u_1} [inst : CommRing R] [IsBezout R] [inst_2 : NormalizedGCDMonoid R] (s : Finset α)
  (f : α → R), ∃ g, s.gcd f = ∑ a ∈ s, f a * g a

A version of Bézout's lemma for greatest common divisors over arbitrary Finsets.

theorem IsPrime.to_maximal_ideal E1 #

∀ {R : Type u} [inst : CommRing R] [IsDomain R] [IsPrincipalIdealRing R] {S : Ideal R} [hpi : S.IsPrime],
  S ≠ ⊥ → S.IsMaximal

theorem mod_mem_iff E0 #

∀ {R : Type u} [inst : EuclideanDomain R] {S : Ideal R} {x y : R}, y ∈ S → (x % y ∈ S ↔ x ∈ S)

instance EuclideanDomain.instIsPrincipalIdealRing E3 #

∀ {R : Type u} [inst : EuclideanDomain R], IsPrincipalIdealRing R

theorem IsField.isPrincipalIdealRing E1 #

∀ {R : Type u_1} [inst : Ring R], IsField R → IsPrincipalIdealRing R

theorem PrincipalIdealRing.isMaximal_of_irreducible E1 #

∀ {R : Type u} [inst : CommSemiring R] [IsPrincipalIdealRing R] {p : R}, Irreducible p → Ideal.IsMaximal (R ∙ p)

theorem Ideal.irreducible_iff_isMaximal_span_singleton E1 #

∀ {R : Type u} [inst : CommSemiring R] [IsPrincipalIdealRing R] [IsDomain R] {p : R},
  p ≠ 0 → (Irreducible p ↔ Ideal.IsMaximal (R ∙ p))

theorem Ideal.irreducible_iff_isMaximal_span_singleton_of_not_isField E1 #

∀ {R : Type u} [inst : CommSemiring R] [IsPrincipalIdealRing R] [IsDomain R],
  ¬IsField R → ∀ {p : R}, Irreducible p ↔ Ideal.IsMaximal (R ∙ p)

def PrincipalIdealRing.factors E1 #

{R : Type u} → [inst : CommRing R] → [IsDomain R] → [IsPrincipalIdealRing R] → R → Multiset R

factors a is a multiset of irreducible elements whose product is a, up to units

theorem PrincipalIdealRing.factors_spec E1 #

∀ {R : Type u} [inst : CommRing R] [inst_1 : IsDomain R] [inst_2 : IsPrincipalIdealRing R] (a : R),
  a ≠ 0 → (∀ b ∈ PrincipalIdealRing.factors a, Irreducible b) ∧ Associated (PrincipalIdealRing.factors a).prod a

theorem PrincipalIdealRing.ne_zero_of_mem_factors E1 #

∀ {R : Type v} [inst : CommRing R] [inst_1 : IsDomain R] [inst_2 : IsPrincipalIdealRing R] {a b : R},
  a ≠ 0 → b ∈ PrincipalIdealRing.factors a → b ≠ 0

theorem PrincipalIdealRing.mem_submonoid_of_factors_subset_of_units_subset E0 #

∀ {R : Type u} [inst : CommRing R] [inst_1 : IsDomain R] [inst_2 : IsPrincipalIdealRing R] (s : Submonoid R) {a : R},
  a ≠ 0 → (∀ b ∈ PrincipalIdealRing.factors a, b ∈ s) → (∀ (c : Rˣ), ↑c ∈ s) → a ∈ s

theorem PrincipalIdealRing.ringHom_mem_submonoid_of_factors_subset_of_units_subset E1 #

∀ {R : Type u_1} {S : Type u_2} [inst : CommRing R] [inst_1 : IsDomain R] [inst_2 : IsPrincipalIdealRing R]
  [inst_3 : NonAssocSemiring S] (f : R →+* S) (s : Submonoid S) (a : R),
  a ≠ 0 → (∀ b ∈ PrincipalIdealRing.factors a, f b ∈ s) → (∀ (c : Rˣ), f ↑c ∈ s) → f a ∈ s

If a RingHom maps all units and all factors of an element a into a submonoid s, then it also maps a into that submonoid.

instance PrincipalIdealRing.to_uniqueFactorizationMonoid E3 #

∀ {R : Type u} [inst : CommRing R] [IsDomain R] [IsPrincipalIdealRing R], UniqueFactorizationMonoid R

A principal ideal domain has unique factorization

theorem Submodule.IsPrincipal.map E1 #

∀ {R : Type u} {M : Type v} {N : Type u_2} [inst : Semiring R] [inst_1 : AddCommMonoid M] [inst_2 : AddCommMonoid N]
  [inst_3 : Module R M] [inst_4 : Module R N] (f : M →ₗ[R] N) {S : Submodule R M},
  S.IsPrincipal → (Submodule.map f S).IsPrincipal

theorem Submodule.IsPrincipal.of_comap E1 #

∀ {R : Type u} {M : Type v} {N : Type u_2} [inst : Semiring R] [inst_1 : AddCommMonoid M] [inst_2 : AddCommMonoid N]
  [inst_3 : Module R M] [inst_4 : Module R N] (f : M →ₗ[R] N),
  Function.Surjective ⇑f → ∀ (S : Submodule R N) [hI : (Submodule.comap f S).IsPrincipal], S.IsPrincipal

theorem Submodule.IsPrincipal.map_ringHom E0 #

∀ {R : Type u} {S : Type u_1} {F : Type u_3} [inst : Semiring R] [inst_1 : Semiring S] [inst_2 : FunLike F R S]
  [RingHomClass F R S] (f : F) {I : Ideal R}, Submodule.IsPrincipal I → Submodule.IsPrincipal (Ideal.map f I)

theorem Ideal.IsPrincipal.of_comap E1 #

∀ {R : Type u} {S : Type u_1} {F : Type u_3} [inst : Semiring R] [inst_1 : Semiring S] [inst_2 : FunLike F R S]
  [inst_3 : RingHomClass F R S] (f : F),
  Function.Surjective ⇑f → ∀ (I : Ideal S) [hI : Submodule.IsPrincipal (Ideal.comap f I)], Submodule.IsPrincipal I

theorem IsPrincipalIdealRing.of_surjective E1 #

∀ {R : Type u} {S : Type u_1} {F : Type u_3} [inst : Semiring R] [inst_1 : Semiring S] [inst_2 : FunLike F R S]
  [RingHomClass F R S] [IsPrincipalIdealRing R] (f : F), Function.Surjective ⇑f → IsPrincipalIdealRing S

The surjective image of a principal ideal ring is again a principal ideal ring.

theorem isPrincipalIdealRing_prod_iff E0 #

∀ {R : Type u} {S : Type u_1} [inst : Semiring R] [inst_1 : Semiring S],
  IsPrincipalIdealRing (R × S) ↔ IsPrincipalIdealRing R ∧ IsPrincipalIdealRing S

theorem isPrincipalIdealRing_pi_iff E0 #

∀ {ι : Type u_5} [Finite ι] {R : ι → Type u_4} [inst : (i : ι) → Semiring (R i)],
  IsPrincipalIdealRing ((i : ι) → R i) ↔ ∀ (i : ι), IsPrincipalIdealRing (R i)

theorem isCoprime_of_dvd E1 #

∀ {R : Type u} [inst : CommRing R] [IsBezout R] (x y : R),
  ¬(x = 0 ∧ y = 0) → (∀ z ∈ nonunits R, z ≠ 0 → z ∣ x → ¬z ∣ y) → IsCoprime x y

theorem dvd_or_isCoprime E1 #

∀ {R : Type u} [inst : CommRing R] [IsBezout R] (x y : R), Irreducible x → x ∣ y ∨ IsCoprime x y

theorem Irreducible.coprime_iff_not_dvd E1 #

∀ {R : Type u} [inst : CommRing R] [IsBezout R] {p n : R}, Irreducible p → (IsCoprime p n ↔ ¬p ∣ n)

See also Irreducible.isRelPrime_iff_not_dvd.

theorem Irreducible.dvd_iff_not_isCoprime E1 #

∀ {R : Type u} [inst : CommRing R] [IsBezout R] {p n : R}, Irreducible p → (p ∣ n ↔ ¬IsCoprime p n)

See also Irreducible.coprime_iff_not_dvd'.

theorem Irreducible.coprime_pow_of_not_dvd E1 #

∀ {R : Type u} [inst : CommRing R] [IsBezout R] {p a : R} (m : ℕ), Irreducible p → ¬p ∣ a → IsCoprime a (p ^ m)

theorem Irreducible.isCoprime_or_dvd E1 #

∀ {R : Type u} [inst : CommRing R] [IsBezout R] {p : R}, Irreducible p → ∀ (i : R), IsCoprime p i ∨ p ∣ i

theorem IsBezout.span_gcd_eq_span_gcd E1 #

∀ {R : Type u} [inst : CommRing R] [inst_1 : IsBezout R] [IsDomain R] [inst_3 : GCDMonoid R] (x y : R),
  Ideal.span {gcd x y} = Ideal.span {IsBezout.gcd x y}

theorem span_gcd E1 #

∀ {R : Type u} [inst : CommRing R] [IsBezout R] [IsDomain R] [inst_3 : GCDMonoid R] (x y : R),
  Ideal.span {gcd x y} = Ideal.span {x, y}

theorem gcd_dvd_iff_exists E1 #

∀ {R : Type u} [inst : CommRing R] [IsBezout R] [IsDomain R] [inst_3 : GCDMonoid R] (a b : R) {z : R},
  gcd a b ∣ z ↔ ∃ x y, z = a * x + b * y

theorem exists_gcd_eq_mul_add_mul E3 #

∀ {R : Type u} [inst : CommRing R] [IsBezout R] [IsDomain R] [inst_3 : GCDMonoid R] (a b : R),
  ∃ x y, gcd a b = a * x + b * y

Bézout's lemma

theorem gcd_isUnit_iff E0 #

∀ {R : Type u} [inst : CommRing R] [IsBezout R] [IsDomain R] [inst_3 : GCDMonoid R] (x y : R),
  IsUnit (gcd x y) ↔ IsCoprime x y

theorem Prime.coprime_iff_not_dvd E1 #

∀ {R : Type u} [inst : CommRing R] [IsBezout R] [IsDomain R] {p n : R}, Prime p → (IsCoprime p n ↔ ¬p ∣ n)

theorem exists_associated_pow_of_mul_eq_pow' E1 #

∀ {R : Type u} [inst : CommRing R] [IsBezout R] [IsDomain R] {a b c : R},
  IsCoprime a b → ∀ {k : ℕ}, a * b = c ^ k → ∃ d, Associated (d ^ k) a

theorem exists_associated_pow_of_associated_pow_mul E1 #

∀ {R : Type u} [inst : CommRing R] [IsBezout R] [IsDomain R] {a b c : R},
  IsCoprime a b → ∀ {k : ℕ}, Associated (c ^ k) (a * b) → ∃ d, Associated (d ^ k) a

theorem isCoprime_of_irreducible_dvd E1 #

∀ {R : Type u} [inst : CommRing R] [IsDomain R] [IsPrincipalIdealRing R] {x y : R},
  ¬(x = 0 ∧ y = 0) → (∀ (z : R), Irreducible z → z ∣ x → ¬z ∣ y) → IsCoprime x y

theorem isCoprime_of_prime_dvd E1 #

∀ {R : Type u} [inst : CommRing R] [IsDomain R] [IsPrincipalIdealRing R] {x y : R},
  ¬(x = 0 ∧ y = 0) → (∀ (z : R), Prime z → z ∣ x → ¬z ∣ y) → IsCoprime x y

abbrev Ideal.nonPrincipals E1 #

(R : Type u) → [inst : Semiring R] → Set (Ideal R)

nonPrincipals R is the set of all ideals of R that are not principal ideals.

theorem Ideal.nonPrincipals_eq_empty_iff E0 #

∀ {R : Type u} [inst : Semiring R], Ideal.nonPrincipals R = ∅ ↔ IsPrincipalIdealRing R

theorem Ideal.nonPrincipals_zorn E1 #

∀ {R : Type u} [inst : Semiring R],
  ¬IsPrincipalIdealRing R →
    ∀ c ⊆ Ideal.nonPrincipals R, IsChain (fun x1 x2 ↦ x1 ≤ x2) c → ∃ I ∈ Ideal.nonPrincipals R, ∀ J ∈ c, J ≤ I

Any chain in the set of non-principal ideals has an upper bound which is non-principal. (Namely, the union of the chain is such an upper bound.)

If you want the existence of a maximal non-principal ideal see Ideal.exists_maximal_not_isPrincipal.

theorem Ideal.exists_maximal_not_isPrincipal E1 #

∀ {R : Type u} [inst : Semiring R], ¬IsPrincipalIdealRing R → ∃ I, Maximal (fun x ↦ ¬Submodule.IsPrincipal x) I

theorem span_singleton_inf_span_singleton E1 #

∀ {R : Type u} [inst : EuclideanDomain R] [inst_1 : GCDMonoid R] (n m : R),
  Ideal.span {n} ⊓ Ideal.span {m} = Ideal.span {lcm n m}

theorem Ideal.exists_normalized_span_of_isPrincipal E1 #

∀ {R : Type u_1} [inst : CommSemiring R] [inst_1 : NormalizationMonoid R] (I : Ideal R) [Submodule.IsPrincipal I],
  ∃ x, normalize x = x ∧ I = Ideal.span {x}