doc-next-gen

Mathlib.RingTheory.Ideal.Maps

Module docstring

{"# Maps on modules and ideals

Main definitions include Ideal.map, Ideal.comap, RingHom.ker, Module.annihilator and Submodule.annihilator. "}

Ideal.map definition
(I : Ideal R) : Ideal S
Full source
/-- `I.map f` is the span of the image of the ideal `I` under `f`, which may be bigger than
  the image itself. -/
def map (I : Ideal R) : Ideal S :=
  span (f '' I)
Image of an ideal under a ring homomorphism
Informal description
Given a ring homomorphism \( f : R \to S \) and an ideal \( I \) of \( R \), the image \( \text{map}(f, I) \) is the ideal of \( S \) generated by the set \( f(I) \), which consists of all elements \( f(x) \) for \( x \in I \). This is the smallest ideal of \( S \) containing the image of \( I \) under \( f \).
Ideal.comap definition
[RingHomClass F R S] (I : Ideal S) : Ideal R
Full source
/-- `I.comap f` is the preimage of `I` under `f`. -/
def comap [RingHomClass F R S] (I : Ideal S) : Ideal R where
  carrier := f ⁻¹' I
  add_mem' {x y} hx hy := by
    simp only [Set.mem_preimage, SetLike.mem_coe, map_add f] at hx hy ⊢
    exact add_mem hx hy
  zero_mem' := by simp only [Set.mem_preimage, map_zero, SetLike.mem_coe, Submodule.zero_mem]
  smul_mem' c x hx := by
    simp only [smul_eq_mul, Set.mem_preimage, map_mul, SetLike.mem_coe] at *
    exact mul_mem_left I _ hx
Preimage of an ideal under a ring homomorphism
Informal description
Given a ring homomorphism \( f : R \to S \) and an ideal \( I \) of \( S \), the preimage \( f^{-1}(I) \) is an ideal of \( R \). Specifically, it consists of all elements \( x \in R \) such that \( f(x) \in I \).
Ideal.coe_comap theorem
[RingHomClass F R S] (I : Ideal S) : (comap f I : Set R) = f ⁻¹' I
Full source
@[simp]
theorem coe_comap [RingHomClass F R S] (I : Ideal S) : (comap f I : Set R) = f ⁻¹' I := rfl
Preimage Ideal as Set Preimage
Informal description
For any ring homomorphism $f \colon R \to S$ and any ideal $I$ of $S$, the underlying set of the preimage ideal $\text{comap}(f, I)$ is equal to the preimage of $I$ under $f$, i.e., $f^{-1}(I)$.
Ideal.comap_coe theorem
[RingHomClass F R S] (I : Ideal S) : I.comap (f : R →+* S) = I.comap f
Full source
lemma comap_coe [RingHomClass F R S] (I : Ideal S) : I.comap (f : R →+* S) = I.comap f := rfl
Equality of Ideal Preimages under Ring Homomorphism and its Coercion
Informal description
Let $R$ and $S$ be rings, and let $f : R \to S$ be a ring homomorphism. For any ideal $I$ of $S$, the preimage of $I$ under $f$ is equal to the preimage of $I$ under the coercion of $f$ to a ring homomorphism. That is, $f^{-1}(I) = (f : R \to+* S)^{-1}(I)$.
Ideal.map_coe theorem
[RingHomClass F R S] (I : Ideal R) : I.map (f : R →+* S) = I.map f
Full source
lemma map_coe [RingHomClass F R S] (I : Ideal R) : I.map (f : R →+* S) = I.map f := rfl
Equality of Ideal Images under Ring Homomorphism and its Coercion
Informal description
Let $R$ and $S$ be rings, and let $f : R \to S$ be a ring homomorphism. For any ideal $I$ of $R$, the image of $I$ under $f$ is equal to the image of $I$ under the coercion of $f$ to a ring homomorphism. That is, $f(I) = (f : R \to+* S)(I)$.
Ideal.map_mono theorem
(h : I ≤ J) : map f I ≤ map f J
Full source
theorem map_mono (h : I ≤ J) : map f I ≤ map f J :=
  span_mono <| Set.image_subset _ h
Monotonicity of Ideal Images under Ring Homomorphisms
Informal description
For any ring homomorphism $f : R \to S$ and ideals $I, J$ of $R$, if $I \subseteq J$, then the image of $I$ under $f$ is contained in the image of $J$ under $f$, i.e., $f(I) \subseteq f(J)$.
Ideal.mem_map_of_mem theorem
(f : F) {I : Ideal R} {x : R} (h : x ∈ I) : f x ∈ map f I
Full source
theorem mem_map_of_mem (f : F) {I : Ideal R} {x : R} (h : x ∈ I) : f x ∈ map f I :=
  subset_span ⟨x, h, rfl⟩
Image of Ideal Element under Ring Homomorphism Belongs to Mapped Ideal
Informal description
Let $R$ and $S$ be rings, and let $f : R \to S$ be a ring homomorphism. For any ideal $I$ of $R$ and any element $x \in I$, the image $f(x)$ belongs to the ideal $f(I)$ of $S$.
Ideal.apply_coe_mem_map theorem
(f : F) (I : Ideal R) (x : I) : f x ∈ I.map f
Full source
theorem apply_coe_mem_map (f : F) (I : Ideal R) (x : I) : f x ∈ I.map f :=
  mem_map_of_mem f x.2
Image of Ideal Element under Ring Homomorphism Belongs to Mapped Ideal
Informal description
Let $R$ and $S$ be rings, and let $f : R \to S$ be a ring homomorphism. For any ideal $I$ of $R$ and any element $x \in I$, the image $f(x)$ belongs to the image ideal $f(I)$ of $S$.
Ideal.map_le_iff_le_comap theorem
[RingHomClass F R S] : map f I ≤ K ↔ I ≤ comap f K
Full source
theorem map_le_iff_le_comap [RingHomClass F R S] : mapmap f I ≤ K ↔ I ≤ comap f K :=
  span_le.trans Set.image_subset_iff
Image-Preimage Containment for Ideals under Ring Homomorphism
Informal description
Let $f \colon R \to S$ be a ring homomorphism, $I$ be an ideal of $R$, and $K$ be an ideal of $S$. Then the image of $I$ under $f$ is contained in $K$ if and only if $I$ is contained in the preimage of $K$ under $f$. In symbols: \[ f(I) \subseteq K \leftrightarrow I \subseteq f^{-1}(K). \]
Ideal.mem_comap theorem
[RingHomClass F R S] {x} : x ∈ comap f K ↔ f x ∈ K
Full source
@[simp]
theorem mem_comap [RingHomClass F R S] {x} : x ∈ comap f Kx ∈ comap f K ↔ f x ∈ K :=
  Iff.rfl
Characterization of Elements in the Preimage of an Ideal under a Ring Homomorphism
Informal description
Let $f : R \to S$ be a ring homomorphism and $K$ be an ideal of $S$. For any element $x \in R$, we have $x \in f^{-1}(K)$ if and only if $f(x) \in K$.
Ideal.comap_mono theorem
[RingHomClass F R S] (h : K ≤ L) : comap f K ≤ comap f L
Full source
theorem comap_mono [RingHomClass F R S] (h : K ≤ L) : comap f K ≤ comap f L :=
  Set.preimage_mono fun _ hx => h hx
Monotonicity of Ideal Preimage under Inclusion
Informal description
Let $f : R \to S$ be a ring homomorphism and $K, L$ be ideals of $S$ such that $K \subseteq L$. Then the preimage ideal $f^{-1}(K)$ is contained in the preimage ideal $f^{-1}(L)$.
Ideal.exists_ideal_comap_le_prime theorem
{S} [CommSemiring S] [FunLike F R S] [RingHomClass F R S] {f : F} (P : Ideal R) [P.IsPrime] (I : Ideal S) (le : I.comap f ≤ P) : ∃ Q ≥ I, Q.IsPrime ∧ Q.comap f ≤ P
Full source
lemma exists_ideal_comap_le_prime {S} [CommSemiring S] [FunLike F R S] [RingHomClass F R S]
    {f : F} (P : Ideal R) [P.IsPrime] (I : Ideal S) (le : I.comap f ≤ P) :
    ∃ Q ≥ I, Q.IsPrime ∧ Q.comap f ≤ P :=
  have ⟨Q, hQ, hIQ, disj⟩ := I.exists_le_prime_disjoint (P.primeCompl.map f) <|
    Set.disjoint_left.mpr fun _ ↦ by rintro hI ⟨r, hp, rfl⟩; exact hp (le hI)
  ⟨Q, hIQ, hQ, fun r hp' ↦ of_not_not fun hp ↦ Set.disjoint_left.mp disj hp' ⟨_, hp, rfl⟩⟩
Existence of Prime Ideal Extension with Preimage Condition
Informal description
Let $R$ and $S$ be commutative semirings, and let $f \colon R \to S$ be a ring homomorphism. Given a prime ideal $P$ of $R$ and an ideal $I$ of $S$ such that the preimage $f^{-1}(I)$ is contained in $P$, there exists a prime ideal $Q$ of $S$ containing $I$ such that the preimage $f^{-1}(Q)$ is contained in $P$.
Ideal.map_le_comap_of_inv_on theorem
[RingHomClass G S R] (g : G) (I : Ideal R) (hf : Set.LeftInvOn g f I) : I.map f ≤ I.comap g
Full source
theorem map_le_comap_of_inv_on [RingHomClass G S R] (g : G) (I : Ideal R)
    (hf : Set.LeftInvOn g f I) :
    I.map f ≤ I.comap g := by
  refine Ideal.span_le.2 ?_
  rintro x ⟨x, hx, rfl⟩
  rw [SetLike.mem_coe, mem_comap, hf hx]
  exact hx
Image-Preimage Inclusion for Ideals under Left-Inverse Homomorphisms
Informal description
Let $f : R \to S$ and $g : S \to R$ be ring homomorphisms such that $g$ is a left inverse of $f$ on an ideal $I$ of $R$, i.e., $g(f(x)) = x$ for all $x \in I$. Then the image of $I$ under $f$ is contained in the preimage of $I$ under $g$, i.e., $f(I) \subseteq g^{-1}(I)$.
Ideal.comap_le_map_of_inv_on theorem
[RingHomClass F R S] (g : G) (I : Ideal S) (hf : Set.LeftInvOn g f (f ⁻¹' I)) : I.comap f ≤ I.map g
Full source
theorem comap_le_map_of_inv_on [RingHomClass F R S] (g : G) (I : Ideal S)
    (hf : Set.LeftInvOn g f (f ⁻¹' I)) :
    I.comap f ≤ I.map g :=
  fun x (hx : f x ∈ I) => hf hx ▸ Ideal.mem_map_of_mem g hx
Inclusion of Preimage in Image under Inverse Homomorphism
Informal description
Let $R$ and $S$ be rings, and let $f \colon R \to S$ and $g \colon S \to R$ be ring homomorphisms. For any ideal $I$ of $S$, if $g$ is a left inverse of $f$ on the preimage $f^{-1}(I)$, then the preimage of $I$ under $f$ is contained in the image of $I$ under $g$. In other words, $f^{-1}(I) \subseteq g(I)$.
Ideal.map_le_comap_of_inverse theorem
[RingHomClass G S R] (g : G) (I : Ideal R) (h : Function.LeftInverse g f) : I.map f ≤ I.comap g
Full source
/-- The `Ideal` version of `Set.image_subset_preimage_of_inverse`. -/
theorem map_le_comap_of_inverse [RingHomClass G S R] (g : G) (I : Ideal R)
    (h : Function.LeftInverse g f) :
    I.map f ≤ I.comap g :=
  map_le_comap_of_inv_on _ _ _ <| h.leftInvOn _
Inclusion of Image in Preimage for Ideals under Left-Inverse Homomorphisms
Informal description
Let $R$ and $S$ be rings, and let $f \colon R \to S$ and $g \colon S \to R$ be ring homomorphisms such that $g$ is a left inverse of $f$ (i.e., $g \circ f = \text{id}_R$). For any ideal $I$ of $R$, the image of $I$ under $f$ is contained in the preimage of $I$ under $g$, i.e., $f(I) \subseteq g^{-1}(I)$.
Ideal.comap_le_map_of_inverse theorem
(g : G) (I : Ideal S) (h : Function.LeftInverse g f) : I.comap f ≤ I.map g
Full source
/-- The `Ideal` version of `Set.preimage_subset_image_of_inverse`. -/
theorem comap_le_map_of_inverse (g : G) (I : Ideal S) (h : Function.LeftInverse g f) :
    I.comap f ≤ I.map g :=
  comap_le_map_of_inv_on _ _ _ <| h.leftInvOn _
Inclusion of Preimage in Image under Left Inverse Homomorphism
Informal description
Let $R$ and $S$ be rings, and let $f \colon R \to S$ and $g \colon S \to R$ be ring homomorphisms such that $g$ is a left inverse of $f$ (i.e., $g(f(x)) = x$ for all $x \in R$). Then for any ideal $I$ of $S$, the preimage $f^{-1}(I)$ is contained in the image $g(I)$. In other words, $f^{-1}(I) \subseteq g(I)$.
Ideal.map_top theorem
: map f ⊤ = ⊤
Full source
theorem map_top : map f  =  :=
  (eq_top_iff_one _).2 <| subset_span ⟨1, trivial, map_one f⟩
Image of Top Ideal is Top Ideal
Informal description
For any ring homomorphism $f \colon R \to S$, the image of the top ideal $\top$ (the entire ring $R$) under $f$ is equal to the top ideal $\top$ in $S$.
Ideal.gc_map_comap theorem
: GaloisConnection (Ideal.map f) (Ideal.comap f)
Full source
theorem gc_map_comap : GaloisConnection (Ideal.map f) (Ideal.comap f) := fun _ _ =>
  Ideal.map_le_iff_le_comap
Galois Connection Between Image and Preimage of Ideals under Ring Homomorphism
Informal description
For any ring homomorphism $f \colon R \to S$, the pair of functions $(\text{map}_f, \text{comap}_f)$ forms a Galois connection between the ideals of $R$ and the ideals of $S$. That is, for any ideal $I$ of $R$ and any ideal $K$ of $S$, we have: \[ \text{map}_f(I) \subseteq K \quad \text{if and only if} \quad I \subseteq \text{comap}_f(K). \]
Ideal.comap_id theorem
: I.comap (RingHom.id R) = I
Full source
@[simp]
theorem comap_id : I.comap (RingHom.id R) = I :=
  Ideal.ext fun _ => Iff.rfl
Preimage of Ideal under Identity Homomorphism is Itself
Informal description
For any ideal $I$ of a ring $R$, the preimage of $I$ under the identity ring homomorphism $\text{id}_R : R \to R$ is equal to $I$ itself, i.e., $\text{id}_R^{-1}(I) = I$.
Ideal.comap_idₐ theorem
{R S : Type*} [CommSemiring R] [Semiring S] [Algebra R S] (I : Ideal S) : Ideal.comap (AlgHom.id R S) I = I
Full source
@[simp]
lemma comap_idₐ {R S : Type*} [CommSemiring R] [Semiring S] [Algebra R S] (I : Ideal S) :
    Ideal.comap (AlgHom.id R S) I = I :=
  I.comap_id
Preimage of Ideal under Identity Algebra Homomorphism is Itself
Informal description
For any commutative semiring $R$, semiring $S$ with an algebra structure over $R$, and ideal $I$ of $S$, the preimage of $I$ under the identity algebra homomorphism $\text{id}_R^S : S \to S$ is equal to $I$ itself, i.e., $(\text{id}_R^S)^{-1}(I) = I$.
Ideal.map_id theorem
: I.map (RingHom.id R) = I
Full source
@[simp]
theorem map_id : I.map (RingHom.id R) = I :=
  (gc_map_comap (RingHom.id R)).l_unique GaloisConnection.id comap_id
Image of Ideal under Identity Homomorphism is Itself
Informal description
For any ideal $I$ of a ring $R$, the image of $I$ under the identity ring homomorphism $\text{id}_R : R \to R$ is equal to $I$ itself, i.e., $\text{id}_R(I) = I$.
Ideal.map_idₐ theorem
{R S : Type*} [CommSemiring R] [Semiring S] [Algebra R S] (I : Ideal S) : Ideal.map (AlgHom.id R S) I = I
Full source
@[simp]
lemma map_idₐ {R S : Type*} [CommSemiring R] [Semiring S] [Algebra R S] (I : Ideal S) :
    Ideal.map (AlgHom.id R S) I = I :=
  I.map_id
Image of Ideal under Identity Algebra Homomorphism is Itself
Informal description
For any commutative semiring $R$, semiring $S$ with an algebra structure over $R$, and ideal $I$ of $S$, the image of $I$ under the identity algebra homomorphism $\text{id}_R^S : S \to S$ is equal to $I$ itself, i.e., $\text{id}_R^S(I) = I$.
Ideal.comap_comap theorem
{T : Type*} [Semiring T] {I : Ideal T} (f : R →+* S) (g : S →+* T) : (I.comap g).comap f = I.comap (g.comp f)
Full source
theorem comap_comap {T : Type*} [Semiring T] {I : Ideal T} (f : R →+* S) (g : S →+* T) :
    (I.comap g).comap f = I.comap (g.comp f) :=
  rfl
Composition of Preimages of Ideals under Ring Homomorphisms
Informal description
Let $R$, $S$, and $T$ be semirings, and let $f : R \to S$ and $g : S \to T$ be ring homomorphisms. For any ideal $I$ of $T$, the preimage of the preimage of $I$ under $g$ and $f$ is equal to the preimage of $I$ under the composition $g \circ f$. That is, $(g^{-1}(I))^{-1} \circ f = (g \circ f)^{-1}(I)$.
Ideal.comap_comapₐ theorem
{R A B C : Type*} [CommSemiring R] [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] [Semiring C] [Algebra R C] {I : Ideal C} (f : A →ₐ[R] B) (g : B →ₐ[R] C) : (I.comap g).comap f = I.comap (g.comp f)
Full source
lemma comap_comapₐ {R A B C : Type*} [CommSemiring R] [Semiring A] [Algebra R A] [Semiring B]
    [Algebra R B] [Semiring C] [Algebra R C] {I : Ideal C} (f : A →ₐ[R] B) (g : B →ₐ[R] C) :
    (I.comap g).comap f = I.comap (g.comp f) :=
  I.comap_comap f.toRingHom g.toRingHom
Preimage of Ideal under Composition of Algebra Homomorphisms
Informal description
Let $R$ be a commutative semiring, and let $A$, $B$, and $C$ be $R$-algebras. Given an ideal $I$ of $C$ and $R$-algebra homomorphisms $f : A \to B$ and $g : B \to C$, the preimage under $f$ of the preimage of $I$ under $g$ is equal to the preimage of $I$ under the composition $g \circ f$. That is, $f^{-1}(g^{-1}(I)) = (g \circ f)^{-1}(I)$.
Ideal.map_map theorem
{T : Type*} [Semiring T] {I : Ideal R} (f : R →+* S) (g : S →+* T) : (I.map f).map g = I.map (g.comp f)
Full source
theorem map_map {T : Type*} [Semiring T] {I : Ideal R} (f : R →+* S) (g : S →+* T) :
    (I.map f).map g = I.map (g.comp f) :=
  ((gc_map_comap f).compose (gc_map_comap g)).l_unique (gc_map_comap (g.comp f)) fun _ =>
    comap_comap _ _
Composition of Images of Ideals under Ring Homomorphisms
Informal description
Let $R$, $S$, and $T$ be semirings, and let $f \colon R \to S$ and $g \colon S \to T$ be ring homomorphisms. For any ideal $I$ of $R$, the image of the image of $I$ under $f$ and $g$ is equal to the image of $I$ under the composition $g \circ f$. That is, \[ g(f(I)) = (g \circ f)(I). \]
Ideal.map_mapₐ theorem
{R A B C : Type*} [CommSemiring R] [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] [Semiring C] [Algebra R C] {I : Ideal A} (f : A →ₐ[R] B) (g : B →ₐ[R] C) : (I.map f).map g = I.map (g.comp f)
Full source
lemma map_mapₐ {R A B C : Type*} [CommSemiring R] [Semiring A] [Algebra R A] [Semiring B]
    [Algebra R B] [Semiring C] [Algebra R C] {I : Ideal A} (f : A →ₐ[R] B) (g : B →ₐ[R] C) :
    (I.map f).map g = I.map (g.comp f) :=
  I.map_map f.toRingHom g.toRingHom
Composition of Images of Ideals under Algebra Homomorphisms
Informal description
Let $R$ be a commutative semiring, and let $A$, $B$, and $C$ be $R$-algebras. Given an ideal $I$ of $A$ and $R$-algebra homomorphisms $f : A \to B$ and $g : B \to C$, the image of the image of $I$ under $f$ and $g$ is equal to the image of $I$ under the composition $g \circ f$. That is, \[ g(f(I)) = (g \circ f)(I). \]
Ideal.map_span theorem
(f : F) (s : Set R) : map f (span s) = span (f '' s)
Full source
theorem map_span (f : F) (s : Set R) : map f (span s) = span (f '' s) := by
  refine (Submodule.span_eq_of_le _ ?_ ?_).symm
  · rintro _ ⟨x, hx, rfl⟩; exact mem_map_of_mem f (subset_span hx)
  · rw [map_le_iff_le_comap, span_le, coe_comap, ← Set.image_subset_iff]
    exact subset_span
Image of Span Equals Span of Image for Ring Homomorphisms
Informal description
Let $R$ and $S$ be semirings, and let $f : R \to S$ be a ring homomorphism. For any subset $s \subseteq R$, the image under $f$ of the ideal generated by $s$ is equal to the ideal generated by the image of $s$ under $f$. In symbols: \[ f(\operatorname{span}(s)) = \operatorname{span}(f(s)). \]
Ideal.map_le_of_le_comap theorem
: I ≤ K.comap f → I.map f ≤ K
Full source
theorem map_le_of_le_comap : I ≤ K.comap f → I.map f ≤ K :=
  (gc_map_comap f).l_le
Image of Ideal is Contained in Target Ideal if Ideal is Contained in Preimage
Informal description
For any ring homomorphism $f \colon R \to S$ and ideals $I$ of $R$ and $K$ of $S$, if $I$ is contained in the preimage of $K$ under $f$, then the image of $I$ under $f$ is contained in $K$. In symbols: \[ I \subseteq f^{-1}(K) \implies f(I) \subseteq K. \]
Ideal.le_comap_of_map_le theorem
: I.map f ≤ K → I ≤ K.comap f
Full source
theorem le_comap_of_map_le : I.map f ≤ K → I ≤ K.comap f :=
  (gc_map_comap f).le_u
Inclusion of Ideal in Preimage under Ring Homomorphism
Informal description
For any ring homomorphism $f \colon R \to S$ and ideals $I$ of $R$ and $K$ of $S$, if the image of $I$ under $f$ is contained in $K$, then $I$ is contained in the preimage of $K$ under $f$. In symbols: \[ f(I) \subseteq K \implies I \subseteq f^{-1}(K). \]
Ideal.le_comap_map theorem
: I ≤ (I.map f).comap f
Full source
theorem le_comap_map : I ≤ (I.map f).comap f :=
  (gc_map_comap f).le_u_l _
Inclusion of Ideal in Preimage of its Image under Ring Homomorphism
Informal description
For any ring homomorphism $f \colon R \to S$ and any ideal $I$ of $R$, the ideal $I$ is contained in the preimage of its image under $f$, i.e., $I \subseteq f^{-1}(f(I))$.
Ideal.map_comap_le theorem
: (K.comap f).map f ≤ K
Full source
theorem map_comap_le : (K.comap f).map f ≤ K :=
  (gc_map_comap f).l_u_le _
Image of Preimage of Ideal is Contained in Original Ideal
Informal description
For any ring homomorphism $f \colon R \to S$ and any ideal $K$ of $S$, the image under $f$ of the preimage of $K$ under $f$ is contained in $K$, i.e., $f(f^{-1}(K)) \subseteq K$.
Ideal.comap_top theorem
: (⊤ : Ideal S).comap f = ⊤
Full source
@[simp]
theorem comap_top : ( : Ideal S).comap f =  :=
  (gc_map_comap f).u_top
Preimage of Top Ideal is Top Ideal
Informal description
For any ring homomorphism $f \colon R \to S$, the preimage of the top ideal in $S$ under $f$ is the top ideal in $R$, i.e., $f^{-1}(S) = R$.
Ideal.comap_eq_top_iff theorem
{I : Ideal S} : I.comap f = ⊤ ↔ I = ⊤
Full source
@[simp]
theorem comap_eq_top_iff {I : Ideal S} : I.comap f = ⊤ ↔ I = ⊤ :=
  ⟨fun h => I.eq_top_iff_one.mpr (map_one f ▸ mem_comap.mp ((I.comap f).eq_top_iff_one.mp h)),
    fun h => by rw [h, comap_top]⟩
Preimage of Ideal is Top Ideal if and only if Ideal is Top Ideal
Informal description
For any ring homomorphism $f \colon R \to S$ and any ideal $I$ of $S$, the preimage of $I$ under $f$ is the top ideal of $R$ if and only if $I$ is the top ideal of $S$. In other words, $f^{-1}(I) = R$ if and only if $I = S$.
Ideal.map_bot theorem
: (⊥ : Ideal R).map f = ⊥
Full source
@[simp]
theorem map_bot : ( : Ideal R).map f =  :=
  (gc_map_comap f).l_bot
Image of Zero Ideal is Zero Ideal
Informal description
For any ring homomorphism $f \colon R \to S$, the image of the zero ideal $\bot$ of $R$ under $f$ is the zero ideal $\bot$ of $S$, i.e., $f(\bot) = \bot$.
Ideal.ne_bot_of_map_ne_bot theorem
(hI : map f I ≠ ⊥) : I ≠ ⊥
Full source
theorem ne_bot_of_map_ne_bot (hI : mapmap f I ≠ ⊥) : I ≠ ⊥ :=
  fun h => hI (Eq.mpr (congrArg (fun I ↦ map f I = ) h) map_bot)
Nonzero Image Implies Nonzero Ideal
Informal description
For any ring homomorphism $f \colon R \to S$ and any ideal $I$ of $R$, if the image $f(I)$ is not the zero ideal in $S$, then $I$ is not the zero ideal in $R$.
Ideal.map_comap_map theorem
: ((I.map f).comap f).map f = I.map f
Full source
@[simp]
theorem map_comap_map : ((I.map f).comap f).map f = I.map f :=
  (gc_map_comap f).l_u_l_eq_l I
Idempotence of Image-Preimage-Image Operation on Ideals
Informal description
For any ring homomorphism $f \colon R \to S$ and any ideal $I$ of $R$, the composition of the image, preimage, and image operations satisfies $f(f^{-1}(f(I))) = f(I)$.
Ideal.comap_map_comap theorem
: ((K.comap f).map f).comap f = K.comap f
Full source
@[simp]
theorem comap_map_comap : ((K.comap f).map f).comap f = K.comap f :=
  (gc_map_comap f).u_l_u_eq_u K
Idempotence of Preimage-Image-Preimage Composition for Ideals
Informal description
For any ring homomorphism $f \colon R \to S$ and any ideal $K$ of $S$, the composition of the image and preimage operations satisfies: \[ f^{-1}(f(f^{-1}(K))) = f^{-1}(K). \]
Ideal.map_sup theorem
: (I ⊔ J).map f = I.map f ⊔ J.map f
Full source
theorem map_sup : (I ⊔ J).map f = I.map f ⊔ J.map f :=
  (gc_map_comap f : GaloisConnection (map f) (comap f)).l_sup
Image of Supremum of Ideals Equals Supremum of Images: $f(I \sqcup J) = f(I) \sqcup f(J)$
Informal description
For any ring homomorphism $f \colon R \to S$ and any two ideals $I, J$ of $R$, the image of the supremum $I \sqcup J$ under $f$ equals the supremum of their images, i.e., $$ f(I \sqcup J) = f(I) \sqcup f(J). $$
Ideal.comap_inf theorem
: comap f (K ⊓ L) = comap f K ⊓ comap f L
Full source
theorem comap_inf : comap f (K ⊓ L) = comapcomap f K ⊓ comap f L :=
  rfl
Preimage of Intersection of Ideals Equals Intersection of Preimages
Informal description
For any ring homomorphism $f : R \to S$ and ideals $K, L$ of $S$, the preimage of the intersection $K \cap L$ under $f$ is equal to the intersection of the preimages of $K$ and $L$ under $f$, i.e., $$ f^{-1}(K \cap L) = f^{-1}(K) \cap f^{-1}(L). $$
Ideal.map_iSup theorem
(K : ι → Ideal R) : (iSup K).map f = ⨆ i, (K i).map f
Full source
theorem map_iSup (K : ι → Ideal R) : (iSup K).map f = ⨆ i, (K i).map f :=
  (gc_map_comap f : GaloisConnection (map f) (comap f)).l_iSup
Image of Supremum of Ideals Equals Supremum of Images
Informal description
Let $f \colon R \to S$ be a ring homomorphism and let $(K_i)_{i \in \iota}$ be a family of ideals in $R$. Then the image of the supremum of the family under $f$ is equal to the supremum of the images of each ideal in the family, i.e., \[ f\left(\bigsqcup_i K_i\right) = \bigsqcup_i f(K_i). \]
Ideal.comap_iInf theorem
(K : ι → Ideal S) : (iInf K).comap f = ⨅ i, (K i).comap f
Full source
theorem comap_iInf (K : ι → Ideal S) : (iInf K).comap f = ⨅ i, (K i).comap f :=
  (gc_map_comap f : GaloisConnection (map f) (comap f)).u_iInf
Preimage of Infimum of Ideals Equals Infimum of Preimages
Informal description
Let $f \colon R \to S$ be a ring homomorphism and let $(K_i)_{i \in \iota}$ be a family of ideals in $S$. Then the preimage of the infimum of the family $(K_i)$ under $f$ is equal to the infimum of the preimages of the ideals $K_i$ under $f$, i.e., \[ f^{-1}\left(\bigcap_i K_i\right) = \bigcap_i f^{-1}(K_i). \]
Ideal.map_sSup theorem
(s : Set (Ideal R)) : (sSup s).map f = ⨆ I ∈ s, (I : Ideal R).map f
Full source
theorem map_sSup (s : Set (Ideal R)) : (sSup s).map f = ⨆ I ∈ s, (I : Ideal R).map f :=
  (gc_map_comap f : GaloisConnection (map f) (comap f)).l_sSup
Image of Supremum of Ideals under Ring Homomorphism Equals Supremum of Images
Informal description
Let $R$ and $S$ be rings, and let $f : R \to S$ be a ring homomorphism. For any family of ideals $\{I_i\}_{i \in \mathcal{I}}$ in $R$, the image under $f$ of the supremum of the family equals the supremum of the images of the ideals in the family. That is, \[ f\left(\bigsqcup_{i \in \mathcal{I}} I_i\right) = \bigsqcup_{i \in \mathcal{I}} f(I_i). \]
Ideal.comap_sInf theorem
(s : Set (Ideal S)) : (sInf s).comap f = ⨅ I ∈ s, (I : Ideal S).comap f
Full source
theorem comap_sInf (s : Set (Ideal S)) : (sInf s).comap f = ⨅ I ∈ s, (I : Ideal S).comap f :=
  (gc_map_comap f : GaloisConnection (map f) (comap f)).u_sInf
Preimage of Infimum of Ideals Equals Infimum of Preimages
Informal description
Let $f \colon R \to S$ be a ring homomorphism and let $s$ be a set of ideals of $S$. Then the preimage of the infimum of $s$ under $f$ equals the infimum of the preimages of the ideals in $s$ under $f$. In symbols: \[ f^{-1}\left(\bigcap_{I \in s} I\right) = \bigcap_{I \in s} f^{-1}(I). \]
Ideal.comap_sInf' theorem
(s : Set (Ideal S)) : (sInf s).comap f = ⨅ I ∈ comap f '' s, I
Full source
theorem comap_sInf' (s : Set (Ideal S)) : (sInf s).comap f = ⨅ I ∈ comap f '' s, I :=
  _root_.trans (comap_sInf f s) (by rw [iInf_image])
Preimage of Infimum of Ideals Equals Infimum of Preimage Images
Informal description
Let $f \colon R \to S$ be a ring homomorphism and let $s$ be a set of ideals of $S$. Then the preimage of the infimum of $s$ under $f$ equals the infimum of the preimages of the ideals in the image of $s$ under the preimage map. In symbols: \[ f^{-1}\left(\bigcap_{I \in s} I\right) = \bigcap_{J \in f^{-1}(s)} J. \]
Ideal.comap_isPrime theorem
[H : IsPrime K] : IsPrime (comap f K)
Full source
/-- Variant of `Ideal.IsPrime.comap` where ideal is explicit rather than implicit. -/
theorem comap_isPrime [H : IsPrime K] : IsPrime (comap f K) :=
  H.comap f
Preimage of a Prime Ideal Under a Ring Homomorphism is Prime
Informal description
Let $f \colon R \to S$ be a ring homomorphism and $K$ be a prime ideal of $S$. Then the preimage $f^{-1}(K)$ is a prime ideal of $R$.
Ideal.map_inf_le theorem
: map f (I ⊓ J) ≤ map f I ⊓ map f J
Full source
theorem map_inf_le : map f (I ⊓ J) ≤ mapmap f I ⊓ map f J :=
  (gc_map_comap f : GaloisConnection (map f) (comap f)).monotone_l.map_inf_le _ _
Image of Ideal Intersection Under Ring Homomorphism is Contained in Intersection of Images
Informal description
For any ring homomorphism $f \colon R \to S$ and ideals $I, J$ of $R$, the image of the intersection $I \cap J$ under $f$ is contained in the intersection of the images of $I$ and $J$ under $f$, i.e., \[ f(I \cap J) \subseteq f(I) \cap f(J). \]
Ideal.le_comap_sup theorem
: comap f K ⊔ comap f L ≤ comap f (K ⊔ L)
Full source
theorem le_comap_sup : comapcomap f K ⊔ comap f Lcomap f (K ⊔ L) :=
  (gc_map_comap f : GaloisConnection (map f) (comap f)).monotone_u.le_map_sup _ _
Preimage of Supremum of Ideals Contains Supremum of Preimages
Informal description
Let $f \colon R \to S$ be a ring homomorphism, and let $K$ and $L$ be ideals of $S$. Then the supremum of the preimages of $K$ and $L$ under $f$ is contained in the preimage of the supremum of $K$ and $L$, i.e., \[ f^{-1}(K) \sqcup f^{-1}(L) \leq f^{-1}(K \sqcup L). \]
element_smul_restrictScalars theorem
{R S M} [CommSemiring R] [CommSemiring S] [Algebra R S] [AddCommMonoid M] [Module R M] [Module S M] [IsScalarTower R S M] (r : R) (N : Submodule S M) : (algebraMap R S r • N).restrictScalars R = r • N.restrictScalars R
Full source
theorem _root_.element_smul_restrictScalars {R S M}
    [CommSemiring R] [CommSemiring S] [Algebra R S] [AddCommMonoid M]
    [Module R M] [Module S M] [IsScalarTower R S M] (r : R) (N : Submodule S M) :
    (algebraMap R S r • N).restrictScalars R = r • N.restrictScalars R :=
  SetLike.coe_injective (congrArg (· '' _) (funext (algebraMap_smul S r)))
Equality of Restricted Scalar Multiplications: $\text{algebraMap}(r) \cdot N\big|_R = r \cdot N\big|_R$
Informal description
Let $R$ and $S$ be commutative semirings with an algebra structure $R \to S$, and let $M$ be an $S$-module that is also an $R$-module via restriction of scalars. For any element $r \in R$ and any $S$-submodule $N \subseteq M$, we have the equality: $$(\text{algebraMap}(r) \cdot N)\big|_R = r \cdot N\big|_R$$ where $\cdot$ denotes scalar multiplication, $\text{algebraMap}$ is the algebra homomorphism $R \to S$, and $\big|_R$ denotes restriction of scalars from $S$ to $R$.
Ideal.smul_restrictScalars theorem
{R S M} [CommSemiring R] [CommSemiring S] [Algebra R S] [AddCommMonoid M] [Module R M] [Module S M] [IsScalarTower R S M] (I : Ideal R) (N : Submodule S M) : (I.map (algebraMap R S) • N).restrictScalars R = I • N.restrictScalars R
Full source
theorem smul_restrictScalars {R S M} [CommSemiring R] [CommSemiring S]
    [Algebra R S] [AddCommMonoid M] [Module R M] [Module S M]
    [IsScalarTower R S M] (I : Ideal R) (N : Submodule S M) :
    (I.map (algebraMap R S) • N).restrictScalars R = I • N.restrictScalars R := by
  simp_rw [map, Submodule.span_smul_eq, ← Submodule.coe_set_smul,
    Submodule.set_smul_eq_iSup, ← element_smul_restrictScalars, iSup_image]
  exact map_iSup₂ (Submodule.restrictScalarsLatticeHom R S M) _
Equality of Restricted Scalar Multiplications for Ideal-Submodule Products
Informal description
Let $R$ and $S$ be commutative semirings with an algebra structure $R \to S$, and let $M$ be an $S$-module that is also an $R$-module via restriction of scalars. For any ideal $I$ of $R$ and any $S$-submodule $N$ of $M$, we have the equality: $$(I \cdot N)\big|_R = I \cdot (N\big|_R)$$ where $\cdot$ denotes the scalar multiplication, $\big|_R$ denotes restriction of scalars from $S$ to $R$, and $I \cdot N$ is the ideal-submodule product.
Ideal.smul_top_eq_map theorem
{R S : Type*} [CommSemiring R] [CommSemiring S] [Algebra R S] (I : Ideal R) : I • (⊤ : Submodule R S) = (I.map (algebraMap R S)).restrictScalars R
Full source
@[simp]
theorem smul_top_eq_map {R S : Type*} [CommSemiring R] [CommSemiring S] [Algebra R S]
    (I : Ideal R) : I • ( : Submodule R S) = (I.map (algebraMap R S)).restrictScalars R :=
  Eq.trans (smul_restrictScalars I ( : Ideal S)).symm <|
    congrArg _ <| Eq.trans (Ideal.smul_eq_mul _ _) (Ideal.mul_top _)
Equality of scalar multiplication with top submodule and mapped ideal restriction: $I \bullet \top = (I \cdot S)\big|_R$
Informal description
Let $R$ and $S$ be commutative semirings with an algebra structure $R \to S$. For any ideal $I$ of $R$, the scalar multiplication of $I$ with the top submodule of $S$ (viewed as an $R$-module) equals the restriction of scalars of the image of $I$ under the algebra map. That is: $$I \bullet (\top : \text{Submodule}_R S) = (I \cdot S)\big|_R$$ where $\bullet$ denotes scalar multiplication, $\top$ is the top submodule, $\cdot$ is the ideal product, and $\big|_R$ denotes restriction of scalars from $S$ to $R$.
Ideal.coe_restrictScalars theorem
{R S : Type*} [Semiring R] [Semiring S] [Module R S] [IsScalarTower R S S] (I : Ideal S) : (I.restrictScalars R : Set S) = ↑I
Full source
@[simp]
theorem coe_restrictScalars {R S : Type*} [Semiring R] [Semiring S] [Module R S]
    [IsScalarTower R S S] (I : Ideal S) : (I.restrictScalars R : Set S) = ↑I :=
  rfl
Equality of Underlying Sets for Restricted Scalars of an Ideal
Informal description
Let $R$ and $S$ be semirings with $S$ equipped with an $R$-module structure such that the scalar multiplication is compatible (i.e., $[IsScalarTower R S S]$). For any ideal $I$ of $S$, the underlying set of $I$ viewed as an $R$-submodule via restriction of scalars is equal to the underlying set of $I$ itself. In other words, $(I.restrictScalars R : Set S) = I$ as subsets of $S$.
Ideal.restrictScalars_mul theorem
{R S : Type*} [Semiring R] [Semiring S] [Module R S] [IsScalarTower R S S] (I J : Ideal S) : (I * J).restrictScalars R = I.restrictScalars R * J.restrictScalars R
Full source
/-- The smallest `S`-submodule that contains all `x ∈ I * y ∈ J`
is also the smallest `R`-submodule that does so. -/
@[simp]
theorem restrictScalars_mul {R S : Type*} [Semiring R] [Semiring S] [Module R S]
    [IsScalarTower R S S] (I J : Ideal S) :
    (I * J).restrictScalars R = I.restrictScalars R * J.restrictScalars R :=
  rfl
Restriction of Scalars Preserves Ideal Multiplication
Informal description
Let $R$ and $S$ be semirings with $S$ equipped with an $R$-module structure such that the scalar multiplication is compatible (i.e., $r \cdot (s_1 \cdot s_2) = (r \cdot s_1) \cdot s_2$ for all $r \in R$, $s_1, s_2 \in S$). For any two ideals $I$ and $J$ of $S$, the restriction of scalars of their product $I \cdot J$ to $R$ is equal to the product of their individual restrictions of scalars to $R$. That is, $(I \cdot J).restrictScalars R = (I.restrictScalars R) \cdot (J.restrictScalars R)$.
Ideal.map_comap_of_surjective theorem
(I : Ideal S) : map f (comap f I) = I
Full source
theorem map_comap_of_surjective (I : Ideal S) : map f (comap f I) = I :=
  le_antisymm (map_le_iff_le_comap.2 le_rfl) fun s hsi =>
    let ⟨r, hfrs⟩ := hf s
    hfrs ▸ (mem_map_of_mem f <| show f r ∈ I from hfrs.symm ▸ hsi)
Surjective Ring Homomorphism Preserves Ideal Preimage-Image Equality
Informal description
Let $f \colon R \to S$ be a surjective ring homomorphism and let $I$ be an ideal of $S$. Then the image of the preimage of $I$ under $f$ is equal to $I$ itself, i.e., \[ f(f^{-1}(I)) = I. \]
Ideal.giMapComap definition
: GaloisInsertion (map f) (comap f)
Full source
/-- `map` and `comap` are adjoint, and the composition `map f ∘ comap f` is the
  identity -/
def giMapComap : GaloisInsertion (map f) (comap f) :=
  GaloisInsertion.monotoneIntro (gc_map_comap f).monotone_u (gc_map_comap f).monotone_l
    (fun _ => le_comap_map) (map_comap_of_surjective _ hf)
Galois insertion between ideal lattices via surjective ring homomorphism
Informal description
Given a surjective ring homomorphism \( f : R \to S \), the pair of functions `map f` (which sends an ideal of \( R \) to its image under \( f \)) and `comap f` (which sends an ideal of \( S \) to its preimage under \( f \)) form a Galois insertion. This means: 1. `map f` and `comap f` are monotone (order-preserving) functions between the lattices of ideals of \( R \) and \( S \). 2. For any ideal \( I \) of \( R \), \( I \subseteq f^{-1}(f(I)) \). 3. For any ideal \( J \) of \( S \), \( f(f^{-1}(J)) = J \).
Ideal.map_surjective_of_surjective theorem
: Surjective (map f)
Full source
theorem map_surjective_of_surjective : Surjective (map f) :=
  (giMapComap f hf).l_surjective
Surjectivity of Ideal Map Induced by Surjective Ring Homomorphism
Informal description
If $f \colon R \to S$ is a surjective ring homomorphism, then the map sending an ideal $I$ of $R$ to the ideal of $S$ generated by $f(I)$ is surjective. In other words, every ideal of $S$ is the image under $f$ of some ideal of $R$.
Ideal.comap_injective_of_surjective theorem
: Injective (comap f)
Full source
theorem comap_injective_of_surjective : Injective (comap f) :=
  (giMapComap f hf).u_injective
Injectivity of Ideal Preimage under Surjective Ring Homomorphism
Informal description
Given a surjective ring homomorphism $f : R \to S$, the preimage function $\text{comap}(f) : \text{Ideal}(S) \to \text{Ideal}(R)$ is injective. That is, for any two ideals $I, J$ of $S$, if $f^{-1}(I) = f^{-1}(J)$, then $I = J$.
Ideal.map_sup_comap_of_surjective theorem
(I J : Ideal S) : (I.comap f ⊔ J.comap f).map f = I ⊔ J
Full source
theorem map_sup_comap_of_surjective (I J : Ideal S) : (I.comap f ⊔ J.comap f).map f = I ⊔ J :=
  (giMapComap f hf).l_sup_u _ _
Image of Supremum of Preimages Equals Supremum of Images for Surjective Ring Homomorphism
Informal description
Let $f : R \to S$ be a surjective ring homomorphism, and let $I, J$ be ideals of $S$. Then the image under $f$ of the supremum of the preimages of $I$ and $J$ equals the supremum of $I$ and $J$, i.e., $$f(f^{-1}(I) \sqcup f^{-1}(J)) = I \sqcup J.$$
Ideal.map_iSup_comap_of_surjective theorem
(K : ι → Ideal S) : (⨆ i, (K i).comap f).map f = iSup K
Full source
theorem map_iSup_comap_of_surjective (K : ι → Ideal S) : (⨆ i, (K i).comap f).map f = iSup K :=
  (giMapComap f hf).l_iSup_u _
Image of Supremum of Preimages Equals Supremum of Images for Surjective Ring Homomorphism
Informal description
Let $f : R \to S$ be a surjective ring homomorphism and let $(K_i)_{i \in \iota}$ be a family of ideals in $S$. Then the image under $f$ of the supremum of the preimages of the $K_i$ equals the supremum of the $K_i$, i.e., \[ f\left(\bigsqcup_i f^{-1}(K_i)\right) = \bigsqcup_i K_i. \]
Ideal.map_inf_comap_of_surjective theorem
(I J : Ideal S) : (I.comap f ⊓ J.comap f).map f = I ⊓ J
Full source
theorem map_inf_comap_of_surjective (I J : Ideal S) : (I.comap f ⊓ J.comap f).map f = I ⊓ J :=
  (giMapComap f hf).l_inf_u _ _
Image of Intersection of Preimages Equals Intersection for Surjective Ring Homomorphism
Informal description
Let $f \colon R \to S$ be a surjective ring homomorphism, and let $I$ and $J$ be ideals of $S$. Then the image under $f$ of the intersection of the preimages of $I$ and $J$ equals the intersection of $I$ and $J$, i.e., \[ f(f^{-1}(I) \cap f^{-1}(J)) = I \cap J. \]
Ideal.map_iInf_comap_of_surjective theorem
(K : ι → Ideal S) : (⨅ i, (K i).comap f).map f = iInf K
Full source
theorem map_iInf_comap_of_surjective (K : ι → Ideal S) : (⨅ i, (K i).comap f).map f = iInf K :=
  (giMapComap f hf).l_iInf_u _
Image of Infimum of Preimages Equals Infimum of Ideals under Surjective Homomorphism
Informal description
Let $f \colon R \to S$ be a surjective ring homomorphism, and let $(K_i)_{i \in \iota}$ be a family of ideals in $S$. Then the image under $f$ of the infimum of the preimages of the $K_i$ equals the infimum of the $K_i$, i.e., \[ f\left(\bigcap_i f^{-1}(K_i)\right) = \bigcap_i K_i. \]
Ideal.mem_image_of_mem_map_of_surjective theorem
{I : Ideal R} {y} (H : y ∈ map f I) : y ∈ f '' I
Full source
theorem mem_image_of_mem_map_of_surjective {I : Ideal R} {y} (H : y ∈ map f I) : y ∈ f '' I :=
  Submodule.span_induction (hx := H) (fun _ => id) ⟨0, I.zero_mem, map_zero f⟩
    (fun _ _ _ _ ⟨x1, hx1i, hxy1⟩ ⟨x2, hx2i, hxy2⟩ =>
      ⟨x1 + x2, I.add_mem hx1i hx2i, hxy1 ▸ hxy2 ▸ map_add f _ _⟩)
    fun c _ _ ⟨x, hxi, hxy⟩ =>
    let ⟨d, hdc⟩ := hf c
    ⟨d * x, I.mul_mem_left _ hxi, hdc ▸ hxy ▸ map_mul f _ _⟩
Surjective Image of Ideal Membership
Informal description
Let $f \colon R \to S$ be a surjective ring homomorphism, $I$ an ideal of $R$, and $y \in S$. If $y$ belongs to the image ideal $f(I)$, then there exists an element $x \in I$ such that $f(x) = y$.
Ideal.mem_map_iff_of_surjective theorem
{I : Ideal R} {y} : y ∈ map f I ↔ ∃ x, x ∈ I ∧ f x = y
Full source
theorem mem_map_iff_of_surjective {I : Ideal R} {y} : y ∈ map f Iy ∈ map f I ↔ ∃ x, x ∈ I ∧ f x = y :=
  ⟨fun h => (Set.mem_image _ _ _).2 (mem_image_of_mem_map_of_surjective f hf h), fun ⟨_, hx⟩ =>
    hx.right ▸ mem_map_of_mem f hx.left⟩
Characterization of Ideal Image Membership under Surjective Homomorphism: $y \in f(I) \leftrightarrow \exists x \in I, f(x) = y$
Informal description
Let $f \colon R \to S$ be a surjective ring homomorphism, $I$ an ideal of $R$, and $y \in S$. Then $y$ belongs to the image ideal $f(I)$ if and only if there exists an element $x \in I$ such that $f(x) = y$.
Ideal.le_map_of_comap_le_of_surjective theorem
: comap f K ≤ I → K ≤ map f I
Full source
theorem le_map_of_comap_le_of_surjective : comap f K ≤ I → K ≤ map f I := fun h =>
  map_comap_of_surjective f hf K ▸ map_mono h
Ideal Containment under Surjective Homomorphism: $f^{-1}(K) \subseteq I \implies K \subseteq f(I)$
Informal description
Let $f \colon R \to S$ be a surjective ring homomorphism, $I$ an ideal of $R$, and $K$ an ideal of $S$. If the preimage of $K$ under $f$ is contained in $I$, then $K$ is contained in the image of $I$ under $f$, i.e., \[ f^{-1}(K) \subseteq I \implies K \subseteq f(I). \]
Ideal.map_comap_eq_self_of_equiv theorem
{E : Type*} [EquivLike E R S] [RingEquivClass E R S] (e : E) (I : Ideal S) : map e (comap e I) = I
Full source
theorem map_comap_eq_self_of_equiv {E : Type*} [EquivLike E R S] [RingEquivClass E R S] (e : E)
    (I : Ideal S) : map e (comap e I) = I :=
  I.map_comap_of_surjective e (EquivLike.surjective e)
Ideal Image-Preimage Equality under Ring Equivalence
Informal description
Let $R$ and $S$ be rings, and let $e : R \to S$ be a ring equivalence (i.e., a bijective ring homomorphism). For any ideal $I$ of $S$, the image of the preimage of $I$ under $e$ equals $I$ itself, i.e., \[ e(e^{-1}(I)) = I. \]
Ideal.map_eq_submodule_map theorem
(f : R →+* S) [h : RingHomSurjective f] (I : Ideal R) : I.map f = Submodule.map f.toSemilinearMap I
Full source
theorem map_eq_submodule_map (f : R →+* S) [h : RingHomSurjective f] (I : Ideal R) :
    I.map f = Submodule.map f.toSemilinearMap I :=
  Submodule.ext fun _ => mem_map_iff_of_surjective f h.1
Equality of Ideal Image and Submodule Image under Surjective Ring Homomorphism
Informal description
Let $f \colon R \to S$ be a surjective ring homomorphism and $I$ be an ideal of $R$. Then the image of $I$ under $f$ as an ideal equals the image of $I$ under $f$ viewed as a semilinear map between $R$ and $S$ considered as modules over themselves.
Ideal.instIsTwoSidedMapRingHomOfRingHomSurjective instance
(f : R →+* S) [RingHomSurjective f] (I : Ideal R) [I.IsTwoSided] : (I.map f).IsTwoSided
Full source
instance (priority := low) (f : R →+* S) [RingHomSurjective f] (I : Ideal R) [I.IsTwoSided] :
    (I.map f).IsTwoSided where
  mul_mem_of_left b ha := by
    rw [map_eq_submodule_map] at ha ⊢
    obtain ⟨a, ha, rfl⟩ := ha
    obtain ⟨b, rfl⟩ := f.surjective b
    rw [RingHom.coe_toSemilinearMap, ← map_mul]
    exact ⟨_, I.mul_mem_right _ ha, rfl⟩
Image of a Two-Sided Ideal under a Surjective Ring Homomorphism is Two-Sided
Informal description
Let $f \colon R \to S$ be a surjective ring homomorphism and $I$ be a two-sided ideal of $R$. Then the image $I.map(f)$ is a two-sided ideal of $S$.
Ideal.IsMaximal.comap_piEvalRingHom theorem
{ι : Type*} {R : ι → Type*} [∀ i, Semiring (R i)] {i : ι} {I : Ideal (R i)} (h : I.IsMaximal) : (I.comap <| Pi.evalRingHom R i).IsMaximal
Full source
theorem IsMaximal.comap_piEvalRingHom {ι : Type*} {R : ι → Type*} [∀ i, Semiring (R i)]
    {i : ι} {I : Ideal (R i)} (h : I.IsMaximal) : (I.comap <| Pi.evalRingHom R i).IsMaximal := by
  refine isMaximal_iff.mpr ⟨I.ne_top_iff_one.mp h.ne_top, fun J x le hxI hxJ ↦ ?_⟩
  have ⟨r, y, hy, eq⟩ := h.exists_inv hxI
  classical
  convert J.add_mem (J.mul_mem_left (update 0 i r) hxJ)
    (b := update 1 i y) (le <| by apply update_self i y 1 ▸ hy)
  ext j
  obtain rfl | ne := eq_or_ne j i
  · simpa [eq_comm] using eq
  · simp [update_of_ne ne]
Maximality of Preimage under Evaluation Homomorphism in Product Semiring
Informal description
Let $\{R_i\}_{i \in \iota}$ be a family of semirings indexed by a type $\iota$, and let $I$ be a maximal ideal in $R_i$ for some fixed $i \in \iota$. Then the preimage of $I$ under the evaluation ring homomorphism $\pi_i : \prod_{j \in \iota} R_j \to R_i$ (defined by $\pi_i(f) = f(i)$) is a maximal ideal in the product semiring $\prod_{j \in \iota} R_j$.
Ideal.comap_le_comap_iff_of_surjective theorem
(hf : Function.Surjective f) (I J : Ideal S) : comap f I ≤ comap f J ↔ I ≤ J
Full source
theorem comap_le_comap_iff_of_surjective (hf : Function.Surjective f) (I J : Ideal S) :
    comapcomap f I ≤ comap f J ↔ I ≤ J :=
  ⟨fun h => (map_comap_of_surjective f hf I).symm.le.trans (map_le_of_le_comap h), fun h =>
    le_comap_of_map_le ((map_comap_of_surjective f hf I).le.trans h)⟩
Preimage Ordering under Surjective Ring Homomorphism
Informal description
Let $f \colon R \to S$ be a surjective ring homomorphism, and let $I$ and $J$ be ideals of $S$. Then the preimage of $I$ under $f$ is contained in the preimage of $J$ under $f$ if and only if $I$ is contained in $J$. In symbols: \[ f^{-1}(I) \subseteq f^{-1}(J) \iff I \subseteq J. \]
Ideal.orderEmbeddingOfSurjective definition
(hf : Function.Surjective f) : Ideal S ↪o Ideal R
Full source
/-- The map on ideals induced by a surjective map preserves inclusion. -/
def orderEmbeddingOfSurjective (hf : Function.Surjective f) : IdealIdeal S ↪o Ideal R where
  toFun := comap f
  inj' _ _ eq := SetLike.ext' (Set.preimage_injective.mpr hf <| SetLike.ext'_iff.mp eq)
  map_rel_iff' := comap_le_comap_iff_of_surjective _ hf ..
Order embedding of ideals induced by a surjective ring homomorphism
Informal description
Given a surjective ring homomorphism \( f \colon R \to S \), the function that maps each ideal \( I \) of \( S \) to its preimage \( f^{-1}(I) \) in \( R \) is an order embedding. That is, it is an injective function that preserves and reflects the inclusion order of ideals: for any ideals \( I, J \) of \( S \), \( f^{-1}(I) \subseteq f^{-1}(J) \) if and only if \( I \subseteq J \).
Ideal.map_eq_top_or_isMaximal_of_surjective theorem
(hf : Function.Surjective f) {I : Ideal R} (H : IsMaximal I) : map f I = ⊤ ∨ IsMaximal (map f I)
Full source
theorem map_eq_top_or_isMaximal_of_surjective (hf : Function.Surjective f) {I : Ideal R}
    (H : IsMaximal I) : mapmap f I = ⊤ ∨ IsMaximal (map f I) :=
  or_iff_not_imp_left.2 fun ne_top ↦ ⟨⟨ne_top, fun _J hJ ↦ comap_injective_of_surjective f hf <|
    H.1.2 _ (le_comap_map.trans_lt <| (orderEmbeddingOfSurjective f hf).strictMono hJ)⟩⟩
Maximality Preservation under Surjective Ring Homomorphism: $f(I) = S$ or $f(I)$ is maximal
Informal description
Let $f \colon R \to S$ be a surjective ring homomorphism and $I$ be a maximal ideal of $R$. Then either the image of $I$ under $f$ is the entire ring $S$ (i.e., $f(I) = S$), or $f(I)$ is a maximal ideal of $S$.
Ideal.comap_bot_le_of_injective theorem
(hf : Function.Injective f) : comap f ⊥ ≤ I
Full source
theorem comap_bot_le_of_injective (hf : Function.Injective f) : comap f  ≤ I := by
  refine le_trans (fun x hx => ?_) bot_le
  rw [mem_comap, Submodule.mem_bot, ← map_zero f] at hx
  exact Eq.symm (hf hx) ▸ Submodule.zero_mem 
Inclusion of Kernel in Any Ideal for Injective Ring Homomorphism
Informal description
Let $f : R \to S$ be an injective ring homomorphism. Then the preimage of the zero ideal under $f$ is contained in any ideal $I$ of $R$, i.e., $f^{-1}(\{0\}) \subseteq I$.
Ideal.map_of_equiv theorem
{I : Ideal R} (f : R ≃+* S) : (I.map (f : R →+* S)).map (f.symm : S →+* R) = I
Full source
/-- If `f : R ≃+* S` is a ring isomorphism and `I : Ideal R`, then `map f.symm (map f I) = I`. -/
@[simp]
theorem map_of_equiv {I : Ideal R} (f : R ≃+* S) :
    (I.map (f : R →+* S)).map (f.symm : S →+* R) = I := by
  rw [← RingEquiv.toRingHom_eq_coe, ← RingEquiv.toRingHom_eq_coe, map_map,
    RingEquiv.toRingHom_eq_coe, RingEquiv.toRingHom_eq_coe, RingEquiv.symm_comp, map_id]
Double Image of Ideal under Ring Isomorphism Equals Original Ideal
Informal description
Let $R$ and $S$ be rings, and let $f : R \simeq S$ be a ring isomorphism. For any ideal $I$ of $R$, the image of $I$ under $f$ followed by the image under the inverse isomorphism $f^{-1}$ equals $I$ itself, i.e., $$ f^{-1}(f(I)) = I. $$
Ideal.comap_of_equiv theorem
{I : Ideal R} (f : R ≃+* S) : (I.comap (f.symm : S →+* R)).comap (f : R →+* S) = I
Full source
/-- If `f : R ≃+* S` is a ring isomorphism and `I : Ideal R`,
  then `comap f (comap f.symm I) = I`. -/
@[simp]
theorem comap_of_equiv {I : Ideal R} (f : R ≃+* S) :
    (I.comap (f.symm : S →+* R)).comap (f : R →+* S) = I := by
  rw [← RingEquiv.toRingHom_eq_coe, ← RingEquiv.toRingHom_eq_coe, comap_comap,
    RingEquiv.toRingHom_eq_coe, RingEquiv.toRingHom_eq_coe, RingEquiv.symm_comp, comap_id]
Double Preimage of Ideal under Ring Isomorphism Equals Original Ideal
Informal description
Let $R$ and $S$ be rings, and let $f : R \simeq S$ be a ring isomorphism. For any ideal $I$ of $R$, the double preimage of $I$ under $f$ and its inverse $f^{-1}$ equals $I$ itself, i.e., $$ (f^{-1})^{-1}(I) \circ f = I. $$
Ideal.map_comap_of_equiv theorem
{I : Ideal R} (f : R ≃+* S) : I.map (f : R →+* S) = I.comap f.symm
Full source
/-- If `f : R ≃+* S` is a ring isomorphism and `I : Ideal R`, then `map f I = comap f.symm I`. -/
theorem map_comap_of_equiv {I : Ideal R} (f : R ≃+* S) : I.map (f : R →+* S) = I.comap f.symm :=
  le_antisymm (Ideal.map_le_comap_of_inverse _ _ _ (Equiv.left_inv' _))
    (Ideal.comap_le_map_of_inverse _ _ _ (Equiv.right_inv' _))
Image of Ideal under Ring Isomorphism Equals Preimage under Inverse
Informal description
Let $R$ and $S$ be rings, and let $f : R \simeq S$ be a ring isomorphism. For any ideal $I$ of $R$, the image of $I$ under $f$ is equal to the preimage of $I$ under the inverse isomorphism $f^{-1}$, i.e., $$ f(I) = f^{-1}(I). $$
Ideal.comap_symm theorem
{I : Ideal R} (f : R ≃+* S) : I.comap f.symm = I.map f
Full source
/-- If `f : R ≃+* S` is a ring isomorphism and `I : Ideal R`, then `comap f.symm I = map f I`. -/
@[simp]
theorem comap_symm {I : Ideal R} (f : R ≃+* S) : I.comap f.symm = I.map f :=
  (map_comap_of_equiv f).symm
Preimage of Ideal under Inverse Isomorphism Equals Image under Isomorphism
Informal description
Let $R$ and $S$ be rings, and let $f : R \simeq S$ be a ring isomorphism. For any ideal $I$ of $R$, the preimage of $I$ under the inverse isomorphism $f^{-1}$ is equal to the image of $I$ under $f$, i.e., $$ f^{-1}(I) = f(I). $$
Ideal.map_symm theorem
{I : Ideal S} (f : R ≃+* S) : I.map f.symm = I.comap f
Full source
/-- If `f : R ≃+* S` is a ring isomorphism and `I : Ideal R`, then `map f.symm I = comap f I`. -/
@[simp]

theorem map_symm {I : Ideal S} (f : R ≃+* S) : I.map f.symm = I.comap f :=
  map_comap_of_equiv (RingEquiv.symm f)
Image of Ideal under Inverse Isomorphism Equals Preimage under Original Isomorphism
Informal description
Let $R$ and $S$ be rings, and let $f : R \simeq S$ be a ring isomorphism. For any ideal $I$ of $S$, the image of $I$ under the inverse isomorphism $f^{-1}$ is equal to the preimage of $I$ under $f$, i.e., $$ f^{-1}(I) = f^{-1}(I). $$
Ideal.symm_apply_mem_of_equiv_iff theorem
{I : Ideal R} {f : R ≃+* S} {y : S} : f.symm y ∈ I ↔ y ∈ I.map f
Full source
@[simp]
theorem symm_apply_mem_of_equiv_iff {I : Ideal R} {f : R ≃+* S} {y : S} :
    f.symm y ∈ If.symm y ∈ I ↔ y ∈ I.map f := by
  rw [← comap_symm, mem_comap]
Characterization of Inverse Image Membership via Ideal Image under Ring Isomorphism
Informal description
Let $R$ and $S$ be rings, and let $f : R \simeq S$ be a ring isomorphism. For any ideal $I$ of $R$ and any element $y \in S$, the inverse image $f^{-1}(y)$ belongs to $I$ if and only if $y$ belongs to the image $f(I)$ of $I$ under $f$.
Ideal.apply_mem_of_equiv_iff theorem
{I : Ideal R} {f : R ≃+* S} {x : R} : f x ∈ I.map f ↔ x ∈ I
Full source
@[simp]
theorem apply_mem_of_equiv_iff {I : Ideal R} {f : R ≃+* S} {x : R} :
    f x ∈ I.map ff x ∈ I.map f ↔ x ∈ I := by
  rw [← comap_symm, Ideal.mem_comap, f.symm_apply_apply]
Characterization of Ideal Image under Ring Isomorphism: $f(x) \in f(I) \leftrightarrow x \in I$
Informal description
Let $R$ and $S$ be rings, and let $f : R \simeq S$ be a ring isomorphism. For any ideal $I$ of $R$ and any element $x \in R$, we have $f(x) \in f(I)$ if and only if $x \in I$.
Ideal.mem_map_of_equiv theorem
{E : Type*} [EquivLike E R S] [RingEquivClass E R S] (e : E) {I : Ideal R} (y : S) : y ∈ map e I ↔ ∃ x ∈ I, e x = y
Full source
theorem mem_map_of_equiv {E : Type*} [EquivLike E R S] [RingEquivClass E R S] (e : E)
    {I : Ideal R} (y : S) : y ∈ map e Iy ∈ map e I ↔ ∃ x ∈ I, e x = y := by
  constructor
  · intro h
    simp_rw [show map e I = _ from map_comap_of_equiv (e : R ≃+* S)] at h
    exact ⟨(e : R ≃+* S).symm y, h, (e : R ≃+* S).apply_symm_apply y⟩
  · rintro ⟨x, hx, rfl⟩
    exact mem_map_of_mem e hx
Characterization of Ideal Image under Ring Isomorphism
Informal description
Let $R$ and $S$ be rings, and let $e : R \simeq S$ be a ring isomorphism. For any ideal $I$ of $R$ and any element $y \in S$, we have $y \in e(I)$ if and only if there exists $x \in I$ such that $e(x) = y$.
Ideal.relIsoOfBijective definition
: Ideal S ≃o Ideal R
Full source
/-- Special case of the correspondence theorem for isomorphic rings -/
def relIsoOfBijective : IdealIdeal S ≃o Ideal R where
  toFun := comap f
  invFun := map f
  left_inv := map_comap_of_surjective _ hf.2
  right_inv J :=
    le_antisymm
      (fun _ h ↦ have ⟨y, hy, eq⟩ := (mem_map_iff_of_surjective _ hf.2).mp h; hf.1 eq ▸ hy)
      le_comap_map
  map_rel_iff' {_ _} := by
    refine ⟨fun h ↦ ?_, comap_mono⟩
    have := map_mono (f := f) h
    simpa only [Equiv.coe_fn_mk, map_comap_of_surjective f hf.2] using this
Order isomorphism between ideals induced by a bijective ring homomorphism
Informal description
Given a bijective ring homomorphism \( f : R \to S \), the function that maps an ideal \( I \) of \( S \) to its preimage \( f^{-1}(I) \) in \( R \) is an order isomorphism between the lattice of ideals of \( S \) and the lattice of ideals of \( R \). This isomorphism preserves the inclusion relation, meaning that for any two ideals \( I, J \) of \( S \), \( I \subseteq J \) if and only if \( f^{-1}(I) \subseteq f^{-1}(J) \).
Ideal.comap_le_iff_le_map theorem
: comap f K ≤ I ↔ K ≤ map f I
Full source
theorem comap_le_iff_le_map : comapcomap f K ≤ I ↔ K ≤ map f I :=
  ⟨fun h => le_map_of_comap_le_of_surjective f hf.right h, fun h =>
    (relIsoOfBijective f hf).right_inv I ▸ comap_mono h⟩
Ideal Containment Equivalence: $f^{-1}(K) \subseteq I \iff K \subseteq f(I)$
Informal description
Let $f \colon R \to S$ be a ring homomorphism, $I$ an ideal of $R$, and $K$ an ideal of $S$. Then the preimage of $K$ under $f$ is contained in $I$ if and only if $K$ is contained in the image of $I$ under $f$, i.e., \[ f^{-1}(K) \subseteq I \iff K \subseteq f(I). \]
Ideal.comap_map_of_bijective theorem
: (I.map f).comap f = I
Full source
lemma comap_map_of_bijective : (I.map f).comap f = I :=
  le_antisymm ((comap_le_iff_le_map f hf).mpr fun _ ↦ id) le_comap_map
Preimage of Image Equals Original Ideal for Bijective Ring Homomorphism
Informal description
Let $f \colon R \to S$ be a bijective ring homomorphism and $I$ an ideal of $R$. Then the preimage of the image of $I$ under $f$ is equal to $I$ itself, i.e., \[ f^{-1}(f(I)) = I. \]
Ideal.isMaximal_map_iff_of_bijective theorem
: IsMaximal (map f I) ↔ IsMaximal I
Full source
theorem isMaximal_map_iff_of_bijective : IsMaximalIsMaximal (map f I) ↔ IsMaximal I := by
  simpa only [isMaximal_def] using (relIsoOfBijective _ hf).symm.isCoatom_iff _
Maximality Preservation under Bijective Ring Homomorphism: $f(I)$ is maximal iff $I$ is maximal
Informal description
Let $f : R \to S$ be a bijective ring homomorphism and $I$ an ideal of $R$. Then the image ideal $f(I)$ is maximal in $S$ if and only if $I$ is maximal in $R$.
Ideal.isMaximal_comap_iff_of_bijective theorem
: IsMaximal (comap f K) ↔ IsMaximal K
Full source
theorem isMaximal_comap_iff_of_bijective : IsMaximalIsMaximal (comap f K) ↔ IsMaximal K := by
  simpa only [isMaximal_def] using (relIsoOfBijective _ hf).isCoatom_iff _
Maximality of Preimage Ideal under Bijective Ring Homomorphism
Informal description
Let $f : R \to S$ be a bijective ring homomorphism and $K$ an ideal of $S$. Then the preimage ideal $f^{-1}(K)$ is maximal in $R$ if and only if $K$ is maximal in $S$.
Ideal.map_isMaximal_of_equiv instance
{E : Type*} [EquivLike E R S] [RingEquivClass E R S] (e : E) {p : Ideal R} [hp : p.IsMaximal] : (map e p).IsMaximal
Full source
/-- A ring isomorphism sends a maximal ideal to a maximal ideal. -/
instance map_isMaximal_of_equiv {E : Type*} [EquivLike E R S] [RingEquivClass E R S] (e : E)
    {p : Ideal R} [hp : p.IsMaximal] : (map e p).IsMaximal :=
  hp.map_bijective e (EquivLike.bijective e)
Maximal Ideal Preservation under Ring Isomorphism
Informal description
Let $R$ and $S$ be rings, and let $E$ be a type equipped with an equivalence-like structure between $R$ and $S$ that is also a ring isomorphism. For any maximal ideal $p$ of $R$, the image of $p$ under the isomorphism $e : E$ is a maximal ideal of $S$.
Ideal.comap_isMaximal_of_equiv instance
{E : Type*} [EquivLike E R S] [RingEquivClass E R S] (e : E) {p : Ideal S} [hp : p.IsMaximal] : (comap e p).IsMaximal
Full source
/-- The pullback of a maximal ideal under a ring isomorphism is a maximal ideal. -/
instance comap_isMaximal_of_equiv {E : Type*} [EquivLike E R S] [RingEquivClass E R S] (e : E)
    {p : Ideal S} [hp : p.IsMaximal] : (comap e p).IsMaximal :=
  hp.comap_bijective e (EquivLike.bijective e)
Maximality of Preimage Ideal under Ring Isomorphism
Informal description
For any ring isomorphism $e : R \to S$ and any maximal ideal $p$ of $S$, the preimage ideal $e^{-1}(p)$ is a maximal ideal of $R$.
Ideal.isMaximal_iff_of_bijective theorem
: (⊥ : Ideal R).IsMaximal ↔ (⊥ : Ideal S).IsMaximal
Full source
theorem isMaximal_iff_of_bijective : (⊥ : Ideal R).IsMaximal ↔ (⊥ : Ideal S).IsMaximal :=
  ⟨fun h ↦ map_bot (f := f) ▸ h.map_bijective f hf, fun h ↦ have e := RingEquiv.ofBijective f hf
    map_bot (f := e.symm) ▸ h.map_bijective _ e.symm.bijective⟩
Maximality of Zero Ideal Preserved under Bijective Ring Homomorphism
Informal description
Let $f \colon R \to S$ be a bijective ring homomorphism. Then the zero ideal $\{0\}$ in $R$ is maximal if and only if the zero ideal $\{0\}$ in $S$ is maximal.
Ideal.comap_map_of_surjective theorem
(hf : Function.Surjective f) (I : Ideal R) : comap f (map f I) = I ⊔ comap f ⊥
Full source
theorem comap_map_of_surjective (hf : Function.Surjective f) (I : Ideal R) :
    comap f (map f I) = I ⊔ comap f ⊥ :=
  le_antisymm
    (fun r h =>
      let ⟨s, hsi, hfsr⟩ := mem_image_of_mem_map_of_surjective f hf h
      Submodule.mem_sup.2
        ⟨s, hsi, r - s, (Submodule.mem_bot S).2 <| by rw [map_sub, hfsr, sub_self],
          add_sub_cancel s r⟩)
    (sup_le (map_le_iff_le_comap.1 le_rfl) (comap_mono bot_le))
Preimage of Image Equals Ideal Plus Kernel for Surjective Ring Homomorphism
Informal description
Let $f \colon R \to S$ be a surjective ring homomorphism and $I$ be an ideal of $R$. Then the preimage of the image of $I$ under $f$ is equal to the supremum of $I$ and the kernel of $f$, i.e., \[ f^{-1}(f(I)) = I + f^{-1}(\{0\}). \]
Ideal.relIsoOfSurjective definition
(hf : Function.Surjective f) : Ideal S ≃o { p : Ideal R // comap f ⊥ ≤ p }
Full source
/-- Correspondence theorem -/
def relIsoOfSurjective (hf : Function.Surjective f) :
    IdealIdeal S ≃o { p : Ideal R // comap f ⊥ ≤ p } where
  toFun J := ⟨comap f J, comap_mono bot_le⟩
  invFun I := map f I.1
  left_inv J := map_comap_of_surjective f hf J
  right_inv I :=
    Subtype.eq <|
      show comap f (map f I.1) = I.1 from
        (comap_map_of_surjective f hf I).symmle_antisymm (sup_le le_rfl I.2) le_sup_left
  map_rel_iff' {I1 I2} :=
    ⟨fun H => map_comap_of_surjective f hf I1 ▸ map_comap_of_surjective f hf I2 ▸ map_mono H,
      comap_mono⟩
Order isomorphism between ideals via a surjective ring homomorphism
Informal description
Given a surjective ring homomorphism \( f : R \to S \), there is an order isomorphism between the ideals of \( S \) and the ideals of \( R \) that contain the kernel of \( f \). Specifically, the isomorphism maps an ideal \( J \) of \( S \) to its preimage \( f^{-1}(J) \) in \( R \), and conversely, maps an ideal \( I \) of \( R \) containing \( \ker f \) to the image \( f(I) \) in \( S \).
Ideal.comap_isMaximal_of_surjective theorem
(hf : Function.Surjective f) {K : Ideal S} [H : IsMaximal K] : IsMaximal (comap f K)
Full source
theorem comap_isMaximal_of_surjective (hf : Function.Surjective f) {K : Ideal S} [H : IsMaximal K] :
    IsMaximal (comap f K) := by
  refine ⟨⟨comap_ne_top _ H.1.1, fun J hJ => ?_⟩⟩
  suffices map f J =  by
    have := congr_arg (comap f) this
    rw [comap_top, comap_map_of_surjective _ hf, eq_top_iff] at this
    rw [eq_top_iff]
    exact le_trans this (sup_le (le_of_eq rfl) (le_trans (comap_mono bot_le) (le_of_lt hJ)))
  refine
    H.1.2 (map f J)
      (lt_of_le_of_ne (le_map_of_comap_le_of_surjective _ hf (le_of_lt hJ)) fun h =>
        ne_of_lt hJ (_root_.trans (congr_arg (comap f) h) ?_))
  rw [comap_map_of_surjective _ hf, sup_eq_left]
  exact le_trans (comap_mono bot_le) (le_of_lt hJ)
Preimage of Maximal Ideal under Surjective Homomorphism is Maximal
Informal description
Let $f \colon R \to S$ be a surjective ring homomorphism and $K$ be a maximal ideal of $S$. Then the preimage $f^{-1}(K)$ is a maximal ideal of $R$.
Ideal.map_mul theorem
{R} [Semiring R] [FunLike F R S] [RingHomClass F R S] (f : F) (I J : Ideal R) : map f (I * J) = map f I * map f J
Full source
protected theorem map_mul {R} [Semiring R] [FunLike F R S] [RingHomClass F R S]
    (f : F) (I J : Ideal R) :
    map f (I * J) = map f I * map f J :=
  le_antisymm
    (map_le_iff_le_comap.2 <|
      mul_le.2 fun r hri s hsj =>
        show (f (r * s)) ∈ map f I * map f J by
          rw [map_mul]; exact mul_mem_mul (mem_map_of_mem f hri) (mem_map_of_mem f hsj))
    (span_mul_span (↑f '' ↑I) (↑f '' ↑J) ▸ (span_le.2 <|
      Set.iUnion₂_subset fun _ ⟨r, hri, hfri⟩ =>
        Set.iUnion₂_subset fun _ ⟨s, hsj, hfsj⟩ =>
          Set.singleton_subset_iff.2 <|
            hfri ▸ hfsj ▸ by rw [← map_mul]; exact mem_map_of_mem f (mul_mem_mul hri hsj)))
Image of Product of Ideals Equals Product of Images under Ring Homomorphism
Informal description
Let $R$ and $S$ be semirings, and let $f : R \to S$ be a ring homomorphism. For any two ideals $I$ and $J$ of $R$, the image of their product under $f$ equals the product of their images under $f$. In symbols: $$ f(I \cdot J) = f(I) \cdot f(J). $$
Ideal.mapHom definition
: Ideal R →+* Ideal S
Full source
/-- The pushforward `Ideal.map` as a (semi)ring homomorphism. -/
@[simps]
def mapHom : IdealIdeal R →+* Ideal S where
  toFun := map f
  map_mul' := Ideal.map_mul f
  map_one' := by simp only [one_eq_top]; exact Ideal.map_top f
  map_add' I J := Ideal.map_sup f I J
  map_zero' := Ideal.map_bot
Semiring homomorphism between ideal lattices induced by a ring homomorphism
Informal description
The function `Ideal.mapHom` is a semiring homomorphism from the lattice of ideals of $R$ to the lattice of ideals of $S$, induced by a ring homomorphism $f : R \to S$. It maps an ideal $I$ of $R$ to the ideal of $S$ generated by $f(I)$.
Ideal.map_pow theorem
(n : ℕ) : map f (I ^ n) = map f I ^ n
Full source
protected theorem map_pow (n : ) : map f (I ^ n) = map f I ^ n :=
  map_pow (mapHom f) I n
Power of Ideal Image Equals Image of Ideal Power
Informal description
Let $f : R \to S$ be a ring homomorphism and $I$ be an ideal of $R$. For any natural number $n$, the image of the $n$-th power of $I$ under $f$ equals the $n$-th power of the image of $I$ under $f$, i.e., $$ f(I^n) = (f(I))^n. $$
Ideal.comap_radical theorem
: comap f (radical K) = radical (comap f K)
Full source
theorem comap_radical : comap f (radical K) = radical (comap f K) := by
  ext
  simp [radical]
Preimage of Radical Equals Radical of Preimage
Informal description
Let $f : R \to S$ be a ring homomorphism and $K$ be an ideal of $S$. The preimage of the radical of $K$ under $f$ is equal to the radical of the preimage of $K$ under $f$, i.e., $$ f^{-1}(\sqrt{K}) = \sqrt{f^{-1}(K)}. $$
Ideal.IsRadical.comap theorem
(hK : K.IsRadical) : (comap f K).IsRadical
Full source
theorem IsRadical.comap (hK : K.IsRadical) : (comap f K).IsRadical := by
  rw [← hK.radical, comap_radical]
  apply radical_isRadical
Preimage of a Radical Ideal is Radical
Informal description
Let $f : R \to S$ be a ring homomorphism and $K$ be a radical ideal of $S$. Then the preimage $f^{-1}(K)$ is a radical ideal of $R$.
Ideal.map_radical_le theorem
: map f (radical I) ≤ radical (map f I)
Full source
theorem map_radical_le : map f (radical I) ≤ radical (map f I) :=
  map_le_iff_le_comap.2 fun r ⟨n, hrni⟩ => ⟨n, map_pow f r n ▸ mem_map_of_mem f hrni⟩
Image of Radical Ideal Contained in Radical of Image Ideal
Informal description
Let $f \colon R \to S$ be a ring homomorphism and $I$ be an ideal of $R$. The image of the radical of $I$ under $f$ is contained in the radical of the image of $I$ under $f$, i.e., \[ f(\sqrt{I}) \subseteq \sqrt{f(I)}. \]
Ideal.le_comap_mul theorem
: comap f K * comap f L ≤ comap f (K * L)
Full source
theorem le_comap_mul : comap f K * comap f L ≤ comap f (K * L) :=
  map_le_iff_le_comap.1 <|
    (Ideal.map_mul f (comap f K) (comap f L)).symmmul_mono (map_le_iff_le_comap.2 <| le_rfl) (map_le_iff_le_comap.2 <| le_rfl)
Containment of Product of Preimages in Preimage of Product for Ideals
Informal description
Let $f \colon R \to S$ be a ring homomorphism, and let $K$ and $L$ be ideals of $S$. Then the product of the preimages of $K$ and $L$ under $f$ is contained in the preimage of their product. In symbols: \[ f^{-1}(K) \cdot f^{-1}(L) \subseteq f^{-1}(K \cdot L). \]
Ideal.le_comap_pow theorem
(n : ℕ) : K.comap f ^ n ≤ (K ^ n).comap f
Full source
theorem le_comap_pow (n : ) : K.comap f ^ n ≤ (K ^ n).comap f := by
  induction' n with n n_ih
  · rw [pow_zero, pow_zero, Ideal.one_eq_top, Ideal.one_eq_top]
    exact rfl.le
  · rw [pow_succ, pow_succ]
    exact (Ideal.mul_mono_left n_ih).trans (Ideal.le_comap_mul f)
Containment of Power of Preimage in Preimage of Power for Ideals
Informal description
Let $f \colon R \to S$ be a ring homomorphism, $K$ an ideal of $S$, and $n$ a natural number. Then the $n$-th power of the preimage of $K$ under $f$ is contained in the preimage of the $n$-th power of $K$. In symbols: \[ (f^{-1}(K))^n \subseteq f^{-1}(K^n). \]
Ideal.disjoint_map_primeCompl_iff_comap_le theorem
{S : Type*} [Semiring S] {f : R →+* S} {p : Ideal R} {I : Ideal S} [p.IsPrime] : Disjoint (I : Set S) (p.primeCompl.map f) ↔ I.comap f ≤ p
Full source
lemma disjoint_map_primeCompl_iff_comap_le {S : Type*} [Semiring S] {f : R →+* S}
    {p : Ideal R} {I : Ideal S} [p.IsPrime] :
    DisjointDisjoint (I : Set S) (p.primeCompl.map f) ↔ I.comap f ≤ p := by
  rw [disjoint_comm]
  simp [Set.disjoint_iff, Set.ext_iff, Ideal.primeCompl, not_imp_not, SetLike.le_def]
Disjointness Criterion for Prime Ideal Complements via Preimage Containment
Informal description
Let $R$ and $S$ be semirings, $f : R \to S$ a ring homomorphism, $p$ a prime ideal of $R$, and $I$ an ideal of $S$. Then the following are equivalent: 1. The ideal $I$ is disjoint from the image of the complement of $p$ under $f$ (i.e., $I \cap f(p^c) = \emptyset$). 2. The preimage of $I$ under $f$ is contained in $p$ (i.e., $f^{-1}(I) \subseteq p$).
Ideal.comap_map_eq_self_iff_of_isPrime theorem
{S : Type*} [CommSemiring S] {f : R →+* S} (p : Ideal R) [p.IsPrime] : (p.map f).comap f = p ↔ (∃ (q : Ideal S), q.IsPrime ∧ q.comap f = p)
Full source
/-- For a prime ideal `p` of `R`, `p` extended to `S` and
restricted back to `R` is `p` if and only if `p` is the restriction of a prime in `S`. -/
lemma comap_map_eq_self_iff_of_isPrime {S : Type*} [CommSemiring S] {f : R →+* S}
    (p : Ideal R) [p.IsPrime] :
    (p.map f).comap f = p ↔ (∃ (q : Ideal S), q.IsPrime ∧ q.comap f = p) := by
  refine ⟨fun hp ↦ ?_, ?_⟩
  · obtain ⟨q, hq₁, hq₂, hq₃⟩ := Ideal.exists_le_prime_disjoint _ _
      (disjoint_map_primeCompl_iff_comap_le.mpr hp.le)
    exact ⟨q, hq₁, le_antisymm (disjoint_map_primeCompl_iff_comap_le.mp hq₃)
      (map_le_iff_le_comap.mp hq₂)⟩
  · rintro ⟨q, hq, rfl⟩
    simp
Prime Ideal Extension Criterion: $f^{-1}(f(p)) = p$ iff $p$ is the contraction of a prime ideal in $S$
Informal description
Let $R$ and $S$ be commutative semirings, $f \colon R \to S$ a ring homomorphism, and $p$ a prime ideal of $R$. Then the following are equivalent: 1. The composition of the image and preimage operations satisfies $f^{-1}(f(p)) = p$. 2. There exists a prime ideal $q$ of $S$ such that $f^{-1}(q) = p$.
RingHom.ker definition
: Ideal R
Full source
/-- Kernel of a ring homomorphism as an ideal of the domain. -/
def ker : Ideal R :=
  Ideal.comap f 
Kernel of a ring homomorphism
Informal description
The kernel of a ring homomorphism \( f : R \to S \) is the ideal of \( R \) consisting of all elements \( r \in R \) such that \( f(r) = 0 \). It is defined as the preimage of the zero ideal under \( f \).
RingHom.instIsTwoSidedKer instance
: (ker f).IsTwoSided
Full source
instance (priority := low) : (ker f).IsTwoSided := inferInstanceAs (Ideal.comap f ).IsTwoSided
Kernel of a Ring Homomorphism is Two-Sided
Informal description
For any ring homomorphism $f \colon R \to S$, the kernel $\ker f$ is a two-sided ideal of $R$.
RingHom.mem_ker theorem
{r} : r ∈ ker f ↔ f r = 0
Full source
/-- An element is in the kernel if and only if it maps to zero. -/
@[simp] theorem mem_ker {r} : r ∈ ker fr ∈ ker f ↔ f r = 0 := by rw [ker, Ideal.mem_comap, Submodule.mem_bot]
Characterization of Kernel Membership: $r \in \ker f \leftrightarrow f(r) = 0$
Informal description
An element $r$ belongs to the kernel of a ring homomorphism $f : R \to S$ if and only if $f(r) = 0$.
RingHom.ker_eq theorem
: (ker f : Set R) = Set.preimage f {0}
Full source
theorem ker_eq : (ker f : Set R) = Set.preimage f {0} :=
  rfl
Kernel of a Ring Homomorphism as Preimage of Zero
Informal description
The kernel of a ring homomorphism $f : R \to S$, viewed as a subset of $R$, is equal to the preimage of the singleton set $\{0\}$ under $f$. That is, $\ker f = f^{-1}(\{0\})$.
RingHom.ker_eq_comap_bot theorem
(f : F) : ker f = Ideal.comap f ⊥
Full source
theorem ker_eq_comap_bot (f : F) : ker f = Ideal.comap f  :=
  rfl
Kernel as Preimage of Zero Ideal
Informal description
For any ring homomorphism $f : R \to S$, the kernel of $f$ is equal to the preimage of the zero ideal under $f$, i.e., $\ker f = f^{-1}(\{0\})$.
RingHom.comap_ker theorem
(f : S →+* R) (g : T →+* S) : (ker f).comap g = ker (f.comp g)
Full source
theorem comap_ker (f : S →+* R) (g : T →+* S) : (ker f).comap g = ker (f.comp g) := by
  rw [RingHom.ker_eq_comap_bot, Ideal.comap_comap, RingHom.ker_eq_comap_bot]
Preimage of Kernel under Composition of Ring Homomorphisms
Informal description
Let $T$, $S$, and $R$ be rings, and let $g : T \to S$ and $f : S \to R$ be ring homomorphisms. The preimage of the kernel of $f$ under $g$ is equal to the kernel of the composition $f \circ g$. That is, $g^{-1}(\ker f) = \ker(f \circ g)$.
RingHom.not_one_mem_ker theorem
[Nontrivial S] (f : F) : (1 : R) ∉ ker f
Full source
/-- If the target is not the zero ring, then one is not in the kernel. -/
theorem not_one_mem_ker [Nontrivial S] (f : F) : (1 : R) ∉ ker f := by
  rw [mem_ker, map_one]
  exact one_ne_zero
Non-membership of identity in kernel for nontrivial codomain
Informal description
Let $f : R \to S$ be a ring homomorphism. If the codomain $S$ is a nontrivial ring (i.e., $1 \neq 0$ in $S$), then the multiplicative identity $1_R$ does not belong to the kernel of $f$.
RingHom.ker_ne_top theorem
[Nontrivial S] (f : F) : ker f ≠ ⊤
Full source
theorem ker_ne_top [Nontrivial S] (f : F) : kerker f ≠ ⊤ :=
  (Ideal.ne_top_iff_one _).mpr <| not_one_mem_ker f
Kernel of a Ring Homomorphism is Proper in Nontrivial Codomain
Informal description
For any ring homomorphism $f \colon R \to S$ where $S$ is a nontrivial ring, the kernel of $f$ is not equal to the top ideal of $R$.
Pi.ker_ringHom theorem
{ι : Type*} {R : ι → Type*} [∀ i, Semiring (R i)] (φ : ∀ i, S →+* R i) : ker (Pi.ringHom φ) = ⨅ i, ker (φ i)
Full source
lemma _root_.Pi.ker_ringHom {ι : Type*} {R : ι → Type*} [∀ i, Semiring (R i)]
    (φ : ∀ i, S →+* R i) : ker (Pi.ringHom φ) = ⨅ i, ker (φ i) := by
  ext x
  simp [mem_ker, Ideal.mem_iInf, funext_iff]
Kernel of Product Ring Homomorphism Equals Intersection of Kernels
Informal description
Let $\{R_i\}_{i \in \iota}$ be a family of semirings indexed by $\iota$, and let $\varphi_i : S \to R_i$ be a ring homomorphism for each $i \in \iota$. The kernel of the product homomorphism $\prod_{i \in \iota} \varphi_i : S \to \prod_{i \in \iota} R_i$ is equal to the intersection of the kernels of the individual homomorphisms $\varphi_i$, i.e., \[ \ker\left(\prod_{i \in \iota} \varphi_i\right) = \bigcap_{i \in \iota} \ker(\varphi_i). \]
RingHom.ker_rangeSRestrict theorem
(f : R →+* S) : ker f.rangeSRestrict = ker f
Full source
@[simp]
theorem ker_rangeSRestrict (f : R →+* S) : ker f.rangeSRestrict = ker f :=
  Ideal.ext fun _ ↦ Subtype.ext_iff
Kernel Equality for Restricted Range Homomorphism
Informal description
For any ring homomorphism $f \colon R \to S$, the kernel of the restricted homomorphism $f_{\text{range}} \colon R \to \text{range}(f)$ is equal to the kernel of $f$, i.e., $\ker(f_{\text{range}}) = \ker(f)$.
RingHom.ker_coe_equiv theorem
(f : R ≃+* S) : ker (f : R →+* S) = ⊥
Full source
@[simp]
theorem ker_coe_equiv (f : R ≃+* S) : ker (f : R →+* S) =  := by
  ext; simp
Kernel of a Ring Isomorphism is Trivial
Informal description
For any ring isomorphism $f : R \simeq+* S$, the kernel of the underlying ring homomorphism $f : R \to S$ is the trivial ideal $\{0\}$.
RingHom.ker_coe_toRingHom theorem
: ker (f : R →+* S) = ker f
Full source
theorem ker_coe_toRingHom : ker (f : R →+* S) = ker f := rfl
Kernel Consistency for Ring Homomorphism Representations
Informal description
For a ring homomorphism $f : R \to S$, the kernel of $f$ (viewed as a ring homomorphism) is equal to the kernel of $f$ (viewed as a function).
RingHom.ker_equiv theorem
{F' : Type*} [EquivLike F' R S] [RingEquivClass F' R S] (f : F') : ker f = ⊥
Full source
@[simp]
theorem ker_equiv {F' : Type*} [EquivLike F' R S] [RingEquivClass F' R S] (f : F') :
    ker f =  := by
  ext; simp
Kernel of Ring Equivalence is Trivial
Informal description
Let $R$ and $S$ be rings, and let $F'$ be a type equipped with an `EquivLike` instance and a `RingEquivClass` instance for $R$ and $S$. For any ring equivalence $f : F'$ (a bijective ring homomorphism between $R$ and $S$), the kernel of $f$ is the trivial ideal $\{0\}$ (denoted as $\bot$).
RingHom.ker_equiv_comp theorem
(f : R →+* S) (e : S ≃+* T) : ker (e.toRingHom.comp f) = RingHom.ker f
Full source
lemma ker_equiv_comp (f : R →+* S) (e : S ≃+* T) :
    ker (e.toRingHom.comp f) = RingHom.ker f := by
  rw [← RingHom.comap_ker, RingEquiv.toRingHom_eq_coe, RingHom.ker_coe_equiv, RingHom.ker]
Kernel Preservation under Composition with Ring Isomorphism: $\ker(e \circ f) = \ker(f)$
Informal description
Let $f : R \to S$ be a ring homomorphism and $e : S \to T$ be a ring isomorphism. Then the kernel of the composition $e \circ f$ is equal to the kernel of $f$, i.e., $\ker(e \circ f) = \ker(f)$.
RingHom.injective_iff_ker_eq_bot theorem
: Function.Injective f ↔ ker f = ⊥
Full source
theorem injective_iff_ker_eq_bot : Function.InjectiveFunction.Injective f ↔ ker f = ⊥ := by
  rw [SetLike.ext'_iff, ker_eq, Set.ext_iff]
  exact injective_iff_map_eq_zero' f
Injective Ring Homomorphism Characterization via Kernel: $\text{ker}(f) = \bot$
Informal description
A ring homomorphism $f : R \to S$ is injective if and only if its kernel is the trivial ideal $\{0\}$ (denoted $\bot$). In other words, $f$ is injective precisely when the only element mapped to zero is zero itself.
RingHom.ker_comp_of_injective theorem
[Semiring T] (g : T →+* R) {f : R →+* S} (hf : Function.Injective f) : ker (f.comp g) = RingHom.ker g
Full source
lemma ker_comp_of_injective [Semiring T] (g : T →+* R) {f : R →+* S} (hf : Function.Injective f) :
    ker (f.comp g) = RingHom.ker g := by
  rw [← RingHom.comap_ker, (injective_iff_ker_eq_bot f).mp hf, RingHom.ker]
Kernel of Composition with Injective Ring Homomorphism: $\ker(f \circ g) = \ker g$
Informal description
Let $T$, $R$, and $S$ be semirings, and let $g : T \to R$ and $f : R \to S$ be ring homomorphisms. If $f$ is injective, then the kernel of the composition $f \circ g$ is equal to the kernel of $g$. That is, $\ker(f \circ g) = \ker g$.
AlgHom.ker_coe_equiv theorem
{R A B : Type*} [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B] (e : A ≃ₐ[R] B) : RingHom.ker (e : A →+* B) = ⊥
Full source
/-- Synonym for `RingHom.ker_coe_equiv`, but given an algebra equivalence. -/
@[simp] theorem _root_.AlgHom.ker_coe_equiv {R A B : Type*} [CommSemiring R] [Semiring A]
    [Semiring B] [Algebra R A] [Algebra R B] (e : A ≃ₐ[R] B) :
    RingHom.ker (e : A →+* B) =  :=
  RingHom.ker_coe_equiv (e.toRingEquiv)
Kernel of an Algebra Equivalence is Trivial
Informal description
For any commutative semiring $R$ and semirings $A$ and $B$ with $R$-algebra structures, if $e : A \simeq_{R} B$ is an $R$-algebra equivalence, then the kernel of the underlying ring homomorphism $e : A \to B$ is the trivial ideal $\{0\}$.
RingHom.sub_mem_ker_iff theorem
{x y} : x - y ∈ ker f ↔ f x = f y
Full source
theorem sub_mem_ker_iff {x y} : x - y ∈ ker fx - y ∈ ker f ↔ f x = f y := by rw [mem_ker, map_sub, sub_eq_zero]
Kernel Membership Criterion via Difference: $x - y \in \ker f \leftrightarrow f(x) = f(y)$
Informal description
For any elements $x$ and $y$ in the domain of a ring homomorphism $f : R \to S$, the difference $x - y$ belongs to the kernel of $f$ if and only if $f(x) = f(y)$.
RingHom.ker_rangeRestrict theorem
(f : R →+* S) : ker f.rangeRestrict = ker f
Full source
@[simp]
theorem ker_rangeRestrict (f : R →+* S) : ker f.rangeRestrict = ker f :=
  Ideal.ext fun _ ↦ Subtype.ext_iff
Kernel Equality for Range-Restricted Ring Homomorphism
Informal description
For any ring homomorphism $f : R \to S$, the kernel of the range restriction of $f$ is equal to the kernel of $f$, i.e., $\ker(f_{\text{rangeRestrict}}) = \ker(f)$.
RingHom.ker_isPrime theorem
{F : Type*} [Semiring R] [Semiring S] [IsDomain S] [FunLike F R S] [RingHomClass F R S] (f : F) : (ker f).IsPrime
Full source
/-- The kernel of a homomorphism to a domain is a prime ideal. -/
theorem ker_isPrime {F : Type*} [Semiring R] [Semiring S] [IsDomain S]
    [FunLike F R S] [RingHomClass F R S] (f : F) :
    (ker f).IsPrime :=
  have := Ideal.bot_prime (α := S)
  inferInstanceAs (Ideal.comap f ).IsPrime
Kernel of a Homomorphism to a Domain is Prime
Informal description
Let $R$ and $S$ be semirings with $S$ being a domain, and let $f : R \to S$ be a ring homomorphism. Then the kernel of $f$ is a prime ideal of $R$.
RingHom.ker_isMaximal_of_surjective theorem
{R K F : Type*} [Ring R] [DivisionRing K] [FunLike F R K] [RingHomClass F R K] (f : F) (hf : Function.Surjective f) : (ker f).IsMaximal
Full source
/-- The kernel of a homomorphism to a field is a maximal ideal. -/
theorem ker_isMaximal_of_surjective {R K F : Type*} [Ring R] [DivisionRing K]
    [FunLike F R K] [RingHomClass F R K] (f : F)
    (hf : Function.Surjective f) : (ker f).IsMaximal :=
  have := Ideal.bot_isMaximal (K := K)
  Ideal.comap_isMaximal_of_surjective _ hf
Kernel of Surjective Homomorphism to Division Ring is Maximal Ideal
Informal description
Let $R$ be a ring and $K$ be a division ring. For any surjective ring homomorphism $f \colon R \to K$, the kernel of $f$ is a maximal ideal of $R$.
Module.annihilator definition
: Ideal R
Full source
/-- `Module.annihilator R M` is the ideal of all elements `r : R` such that `r • M = 0`. -/
def Module.annihilator : Ideal R := RingHom.ker (Module.toAddMonoidEnd R M)
Annihilator of a module
Informal description
The annihilator of a module $M$ over a ring $R$, denoted $\text{ann}_R(M)$, is the ideal of $R$ consisting of all elements $r \in R$ such that $r \cdot m = 0$ for every $m \in M$. It is equivalently defined as the kernel of the canonical ring homomorphism from $R$ to the endomorphism ring of the additive group of $M$.
Module.mem_annihilator theorem
{r} : r ∈ Module.annihilator R M ↔ ∀ m : M, r • m = 0
Full source
theorem Module.mem_annihilator {r} : r ∈ Module.annihilator R Mr ∈ Module.annihilator R M ↔ ∀ m : M, r • m = 0 :=
  ⟨fun h ↦ (congr($h ·)), (AddMonoidHom.ext ·)⟩
Characterization of Module Annihilator Elements
Informal description
An element $r$ of a ring $R$ belongs to the annihilator of an $R$-module $M$ if and only if $r$ acts as zero on every element $m \in M$, i.e., $r \cdot m = 0$ for all $m \in M$.
LinearMap.annihilator_le_of_injective theorem
(f : M →ₗ[R] M') (hf : Function.Injective f) : Module.annihilator R M' ≤ Module.annihilator R M
Full source
theorem LinearMap.annihilator_le_of_injective (f : M →ₗ[R] M') (hf : Function.Injective f) :
    Module.annihilator R M' ≤ Module.annihilator R M := fun x h ↦ by
  rw [Module.mem_annihilator] at h ⊢; exact fun m ↦ hf (by rw [map_smul, h, f.map_zero])
Inclusion of Annihilators under Injective Linear Maps
Informal description
Let $R$ be a ring and $M$, $M'$ be $R$-modules. For any injective $R$-linear map $f \colon M \to M'$, the annihilator of $M'$ is contained in the annihilator of $M$, i.e., \[ \text{ann}_R(M') \subseteq \text{ann}_R(M). \]
LinearMap.annihilator_le_of_surjective theorem
(f : M →ₗ[R] M') (hf : Function.Surjective f) : Module.annihilator R M ≤ Module.annihilator R M'
Full source
theorem LinearMap.annihilator_le_of_surjective (f : M →ₗ[R] M')
    (hf : Function.Surjective f) : Module.annihilator R M ≤ Module.annihilator R M' := fun x h ↦ by
  rw [Module.mem_annihilator] at h ⊢
  intro m; obtain ⟨m, rfl⟩ := hf m
  rw [← map_smul, h, f.map_zero]
Annihilator Inclusion under Surjective Linear Maps
Informal description
Let $R$ be a ring and $M$, $M'$ be $R$-modules. For any surjective $R$-linear map $f \colon M \to M'$, the annihilator ideal of $M$ is contained in the annihilator ideal of $M'$, i.e., \[ \text{ann}_R(M) \subseteq \text{ann}_R(M'). \]
LinearEquiv.annihilator_eq theorem
(e : M ≃ₗ[R] M') : Module.annihilator R M = Module.annihilator R M'
Full source
theorem LinearEquiv.annihilator_eq (e : M ≃ₗ[R] M') :
    Module.annihilator R M = Module.annihilator R M' :=
  (e.annihilator_le_of_surjective e.surjective).antisymm (e.annihilator_le_of_injective e.injective)
Annihilator Equality under Linear Isomorphism
Informal description
Let $R$ be a ring and $M$, $M'$ be $R$-modules. For any $R$-linear isomorphism $e \colon M \to M'$, the annihilator ideals of $M$ and $M'$ are equal, i.e., \[ \text{ann}_R(M) = \text{ann}_R(M'). \]
Module.comap_annihilator theorem
{R₀} [CommSemiring R₀] [Module R₀ M] [Algebra R₀ R] [IsScalarTower R₀ R M] : (Module.annihilator R M).comap (algebraMap R₀ R) = Module.annihilator R₀ M
Full source
theorem Module.comap_annihilator {R₀} [CommSemiring R₀] [Module R₀ M]
    [Algebra R₀ R] [IsScalarTower R₀ R M] :
    (Module.annihilator R M).comap (algebraMap R₀ R) = Module.annihilator R₀ M := by
  ext x
  simp [mem_annihilator]
Preimage of Annihilator under Algebra Map Equals Annihilator over Base Ring
Informal description
Let $R₀$ be a commutative semiring, $M$ be a module over $R₀$, and $R$ be an $R₀$-algebra such that the scalar multiplication is compatible via the algebra map $\text{algebraMap} \colon R₀ \to R$. Then the preimage of the annihilator ideal $\text{ann}_R(M)$ under $\text{algebraMap}$ is equal to the annihilator ideal $\text{ann}_{R₀}(M)$. In other words: \[ (\text{ann}_R(M)).\text{comap}(\text{algebraMap}) = \text{ann}_{R₀}(M). \]
Module.annihilator_eq_bot theorem
{R M} [Ring R] [AddCommGroup M] [Module R M] : Module.annihilator R M = ⊥ ↔ FaithfulSMul R M
Full source
lemma Module.annihilator_eq_bot {R M} [Ring R] [AddCommGroup M] [Module R M] :
    Module.annihilatorModule.annihilator R M = ⊥ ↔ FaithfulSMul R M := by
  rw [← le_bot_iff]
  refine ⟨fun H ↦ ⟨fun {r s} H' ↦ ?_⟩, fun ⟨H⟩ {a} ha ↦ ?_⟩
  · rw [← sub_eq_zero]
    exact H (Module.mem_annihilator (r := r - s).mpr
      (by simp only [sub_smul, H', sub_self, implies_true]))
  · exact @H a 0 (by simp [Module.mem_annihilator.mp ha])
Annihilator Equals Bottom Ideal if and only if Scalar Multiplication is Faithful
Informal description
For a ring $R$ and an $R$-module $M$, the annihilator of $M$ is equal to the bottom ideal $\bot$ if and only if the scalar multiplication action of $R$ on $M$ is faithful. In other words: \[ \text{ann}_R(M) = \bot \leftrightarrow \text{FaithfulSMul}\, R\, M. \]
Module.annihilator_eq_top_iff theorem
: annihilator R M = ⊤ ↔ Subsingleton M
Full source
theorem Module.annihilator_eq_top_iff : annihilatorannihilator R M = ⊤ ↔ Subsingleton M :=
  ⟨fun h ↦ ⟨fun m m' ↦ by
      rw [← one_smul R m, ← one_smul R m']
      simp_rw [mem_annihilator.mp (h ▸ Submodule.mem_top)]⟩,
    fun _ ↦ top_le_iff.mp fun _ _ ↦ mem_annihilator.mpr fun _ ↦ Subsingleton.elim _ _⟩
Annihilator Equals Top Ideal if and only if Module is Subsingleton
Informal description
The annihilator of an $R$-module $M$ is equal to the top ideal $\top$ if and only if $M$ is a subsingleton (i.e., has at most one element). In other words: \[ \text{ann}_R(M) = \top \leftrightarrow \text{Subsingleton}(M). \]
Submodule.annihilator abbrev
(N : Submodule R M) : Ideal R
Full source
/-- `N.annihilator` is the ideal of all elements `r : R` such that `r • N = 0`. -/
abbrev annihilator (N : Submodule R M) : Ideal R :=
  Module.annihilator R N
Annihilator Ideal of a Submodule
Informal description
For a submodule $N$ of an $R$-module $M$, the annihilator $\text{ann}_R(N)$ is the ideal of $R$ consisting of all elements $r \in R$ such that $r \cdot n = 0$ for every $n \in N$.
Submodule.annihilator_top theorem
: (⊤ : Submodule R M).annihilator = Module.annihilator R M
Full source
theorem annihilator_top : ( : Submodule R M).annihilator = Module.annihilator R M :=
  topEquiv.annihilator_eq
Annihilator of Top Submodule Equals Module Annihilator
Informal description
For any $R$-module $M$, the annihilator of the top submodule $\top$ (which is $M$ itself) is equal to the annihilator of the module $M$, i.e., \[ \text{ann}_R(\top) = \text{ann}_R(M). \]
Submodule.mem_annihilator theorem
{r} : r ∈ N.annihilator ↔ ∀ n ∈ N, r • n = (0 : M)
Full source
theorem mem_annihilator {r} : r ∈ N.annihilatorr ∈ N.annihilator ↔ ∀ n ∈ N, r • n = (0 : M) := by
  simp_rw [annihilator, Module.mem_annihilator, Subtype.forall, Subtype.ext_iff]; rfl
Characterization of Annihilator Membership: $r \in \text{ann}_R(N) \leftrightarrow \forall n \in N, r \cdot n = 0$
Informal description
An element $r$ of a ring $R$ belongs to the annihilator of a submodule $N$ of an $R$-module $M$ if and only if for every element $n \in N$, the scalar multiplication $r \cdot n$ equals the zero element of $M$. In other words, $r \in \text{ann}_R(N) \leftrightarrow \forall n \in N, r \cdot n = 0_M$.
Submodule.annihilator_bot theorem
: (⊥ : Submodule R M).annihilator = ⊤
Full source
theorem annihilator_bot : ( : Submodule R M).annihilator =  :=
  top_le_iff.mp fun _ _ ↦ mem_annihilator.mpr fun _ ↦ by rintro rfl; rw [smul_zero]
Annihilator of Trivial Submodule is Entire Ring
Informal description
The annihilator of the trivial submodule $\{0\}$ in an $R$-module $M$ is the entire ring $R$, i.e., $\text{ann}_R(\{0\}) = R$.
Submodule.annihilator_eq_top_iff theorem
: N.annihilator = ⊤ ↔ N = ⊥
Full source
theorem annihilator_eq_top_iff : N.annihilator = ⊤ ↔ N = ⊥ := by
  rw [annihilator, Module.annihilator_eq_top_iff, Submodule.subsingleton_iff_eq_bot]
Annihilator Equals Top Ideal if and only if Submodule is Zero
Informal description
For a submodule $N$ of an $R$-module $M$, the annihilator of $N$ is equal to the top ideal $\top$ if and only if $N$ is the zero submodule $\bot$. In other words: \[ \text{ann}_R(N) = \top \leftrightarrow N = \bot. \]
Submodule.annihilator_mono theorem
(h : N ≤ P) : P.annihilator ≤ N.annihilator
Full source
theorem annihilator_mono (h : N ≤ P) : P.annihilator ≤ N.annihilator := fun _ hrp =>
  mem_annihilator.2 fun n hn => mem_annihilator.1 hrp n <| h hn
Monotonicity of Annihilator Ideals with Respect to Submodule Inclusion
Informal description
For any submodules $N$ and $P$ of an $R$-module $M$ such that $N \subseteq P$, the annihilator ideal of $P$ is contained in the annihilator ideal of $N$, i.e., $\text{ann}_R(P) \subseteq \text{ann}_R(N)$.
Submodule.annihilator_iSup theorem
(ι : Sort w) (f : ι → Submodule R M) : annihilator (⨆ i, f i) = ⨅ i, annihilator (f i)
Full source
theorem annihilator_iSup (ι : Sort w) (f : ι → Submodule R M) :
    annihilator (⨆ i, f i) = ⨅ i, annihilator (f i) :=
  le_antisymm (le_iInf fun _ => annihilator_mono <| le_iSup _ _) fun r H =>
    mem_annihilator.2 fun n hn ↦ iSup_induction f (motive := (r • · = 0)) hn
      (fun i ↦ mem_annihilator.1 <| (mem_iInf _).mp H i) (smul_zero _)
      fun m₁ m₂ h₁ h₂ ↦ by simp_rw [smul_add, h₁, h₂, add_zero]
Annihilator of Supremum of Submodules Equals Infimum of Annihilators
Informal description
For any family of submodules $\{f_i\}_{i \in \iota}$ of an $R$-module $M$, the annihilator of their supremum $\bigsqcup_i f_i$ is equal to the infimum of their annihilators $\bigsqcap_i \text{ann}_R(f_i)$. In other words: \[ \text{ann}_R\left(\bigsqcup_i f_i\right) = \bigsqcap_i \text{ann}_R(f_i). \]
Submodule.le_annihilator_iff theorem
{N : Submodule R M} {I : Ideal R} : I ≤ annihilator N ↔ I • N = ⊥
Full source
theorem le_annihilator_iff {N : Submodule R M} {I : Ideal R} : I ≤ annihilator N ↔ I • N = ⊥ := by
  simp_rw [← le_bot_iff, smul_le, SetLike.le_def, mem_annihilator]; rfl
Ideal Containment in Annihilator iff Scalar Product is Zero
Informal description
For a submodule $N$ of an $R$-module $M$ and an ideal $I$ of $R$, the ideal $I$ is contained in the annihilator of $N$ if and only if the scalar product $I \cdot N$ is the zero submodule. In other words, $I \leq \text{ann}_R(N) \leftrightarrow I \cdot N = \{0\}$.
Submodule.annihilator_smul theorem
(N : Submodule R M) : annihilator N • N = ⊥
Full source
@[simp]
theorem annihilator_smul (N : Submodule R M) : annihilator N • N =  :=
  eq_bot_iff.2 (smul_le.2 fun _ => mem_annihilator.1)
Annihilator-Submodule Product is Zero: $\text{ann}_R(N) \cdot N = 0$
Informal description
For any submodule $N$ of an $R$-module $M$, the scalar product of the annihilator ideal $\text{ann}_R(N)$ with $N$ is the zero submodule, i.e., $\text{ann}_R(N) \cdot N = \{0\}$.
Submodule.annihilator_mul theorem
(I : Ideal R) : annihilator I * I = ⊥
Full source
@[simp]
theorem annihilator_mul (I : Ideal R) : annihilator I * I =  :=
  annihilator_smul I
Annihilator-Ideal Product is Zero: $\text{ann}_R(I) \cdot I = 0$
Informal description
For any ideal $I$ of a ring $R$, the product of the annihilator ideal $\text{ann}_R(I)$ with $I$ is the zero ideal, i.e., $\text{ann}_R(I) \cdot I = \{0\}$.
Submodule.mem_annihilator' theorem
{r} : r ∈ N.annihilator ↔ N ≤ comap (r • (LinearMap.id : M →ₗ[R] M)) ⊥
Full source
theorem mem_annihilator' {r} : r ∈ N.annihilatorr ∈ N.annihilator ↔ N ≤ comap (r • (LinearMap.id : M →ₗ[R] M)) ⊥ :=
  mem_annihilator.trans ⟨fun H n hn => (mem_bot R).2 <| H n hn, fun H _ hn => (mem_bot R).1 <| H hn⟩
Annihilator Membership via Kernel Inclusion: $r \in \text{ann}_R(N) \leftrightarrow N \subseteq \ker (r \cdot \text{id}_M)$
Informal description
An element $r$ of a ring $R$ belongs to the annihilator of a submodule $N$ of an $R$-module $M$ if and only if $N$ is contained in the kernel of the linear map $m \mapsto r \cdot m$ from $M$ to itself. In other words, $r \in \text{ann}_R(N) \leftrightarrow N \subseteq \ker (r \cdot \text{id}_M)$.
Submodule.mem_annihilator_span theorem
(s : Set M) (r : R) : r ∈ (Submodule.span R s).annihilator ↔ ∀ n : s, r • (n : M) = 0
Full source
theorem mem_annihilator_span (s : Set M) (r : R) :
    r ∈ (Submodule.span R s).annihilatorr ∈ (Submodule.span R s).annihilator ↔ ∀ n : s, r • (n : M) = 0 := by
  rw [Submodule.mem_annihilator]
  constructor
  · intro h n
    exact h _ (Submodule.subset_span n.prop)
  · intro h n hn
    refine Submodule.span_induction ?_ ?_ ?_ ?_ hn
    · intro x hx
      exact h ⟨x, hx⟩
    · exact smul_zero _
    · intro x y _ _ hx hy
      rw [smul_add, hx, hy, zero_add]
    · intro a x _ hx
      rw [smul_comm, hx, smul_zero]
Annihilator of Span Membership Criterion: $r \in \operatorname{ann}_R(\operatorname{span}_R(s)) \leftrightarrow \forall n \in s, r \cdot n = 0$
Informal description
For any subset $s$ of an $R$-module $M$ and any element $r \in R$, the element $r$ belongs to the annihilator of the submodule $\operatorname{span}_R(s)$ if and only if for every element $n \in s$, the scalar multiplication $r \cdot n$ equals zero in $M$. In other words, \[ r \in \operatorname{ann}_R(\operatorname{span}_R(s)) \leftrightarrow \forall n \in s, r \cdot n = 0. \]
Submodule.mem_annihilator_span_singleton theorem
(g : M) (r : R) : r ∈ (Submodule.span R ({ g } : Set M)).annihilator ↔ r • g = 0
Full source
theorem mem_annihilator_span_singleton (g : M) (r : R) :
    r ∈ (Submodule.span R ({g} : Set M)).annihilatorr ∈ (Submodule.span R ({g} : Set M)).annihilator ↔ r • g = 0 := by simp [mem_annihilator_span]
Annihilator Criterion for a Cyclic Submodule: $r \in \text{ann}(\text{span}\{g\}) \leftrightarrow r \cdot g = 0$
Informal description
For an element $g$ in an $R$-module $M$ and an element $r \in R$, the element $r$ belongs to the annihilator of the submodule generated by $\{g\}$ if and only if $r \cdot g = 0$.
Submodule.annihilator_span theorem
(s : Set M) : (Submodule.span R s).annihilator = ⨅ g : s, ker (toSpanSingleton R M g.1)
Full source
theorem annihilator_span (s : Set M) :
    (Submodule.span R s).annihilator = ⨅ g : s, ker (toSpanSingleton R M g.1) := by
  ext; simp [mem_annihilator_span]
Annihilator of Span Equals Infimum of Kernels of Span Maps
Informal description
For any subset $s$ of an $R$-module $M$, the annihilator of the submodule generated by $s$ is equal to the infimum of the kernels of the linear maps $\text{toSpanSingleton}_R^M g$ for all $g \in s$. That is, \[ \text{ann}_R(\text{span}_R(s)) = \bigsqcap_{g \in s} \ker(\text{toSpanSingleton}_R^M g). \]
Submodule.annihilator_span_singleton theorem
(g : M) : (Submodule.span R { g }).annihilator = ker (toSpanSingleton R M g)
Full source
theorem annihilator_span_singleton (g : M) :
    (Submodule.span R {g}).annihilator = ker (toSpanSingleton R M g) := by
  simp [annihilator_span]
Annihilator of Cyclic Submodule Equals Kernel of Span Map: $\text{ann}(\text{span}\{g\}) = \ker(r \mapsto r \cdot g)$
Informal description
For any element $g$ in an $R$-module $M$, the annihilator of the submodule generated by $\{g\}$ is equal to the kernel of the linear map $\text{toSpanSingleton}_R^M g : R \to M$ defined by $r \mapsto r \cdot g$. That is, \[ \text{ann}_R(\text{span}_R(\{g\})) = \ker(\text{toSpanSingleton}_R^M g). \]
Submodule.mul_annihilator theorem
(I : Ideal R) : I * annihilator I = ⊥
Full source
@[simp]
theorem mul_annihilator (I : Ideal R) : I * annihilator I =  := by rw [mul_comm, annihilator_mul]
Product of Ideal with its Annihilator is Zero: $I \cdot \text{ann}_R(I) = 0$
Informal description
For any ideal $I$ in a commutative ring $R$, the product of $I$ with its annihilator ideal $\text{ann}_R(I)$ is the zero ideal, i.e., $I \cdot \text{ann}_R(I) = \{0\}$.
Ideal.map_eq_bot_iff_le_ker theorem
{I : Ideal R} (f : F) : I.map f = ⊥ ↔ I ≤ RingHom.ker f
Full source
theorem map_eq_bot_iff_le_ker {I : Ideal R} (f : F) : I.map f = ⊥ ↔ I ≤ RingHom.ker f := by
  rw [RingHom.ker, eq_bot_iff, map_le_iff_le_comap]
Image of Ideal is Zero iff Contained in Kernel
Informal description
Let $f \colon R \to S$ be a ring homomorphism and $I$ be an ideal of $R$. The image of $I$ under $f$ is the zero ideal if and only if $I$ is contained in the kernel of $f$. In symbols: \[ f(I) = \{0\} \leftrightarrow I \subseteq \ker f. \]
Ideal.ker_le_comap theorem
{K : Ideal S} (f : F) : RingHom.ker f ≤ comap f K
Full source
theorem ker_le_comap {K : Ideal S} (f : F) : RingHom.ker f ≤ comap f K := fun _ hx =>
  mem_comap.2 (RingHom.mem_ker.1 hx ▸ K.zero_mem)
Kernel is Contained in Preimage of Ideal
Informal description
For any ring homomorphism $f : R \to S$ and any ideal $K$ of $S$, the kernel of $f$ is contained in the preimage of $K$ under $f$. In other words, $\ker f \subseteq f^{-1}(K)$.
Ideal.map_isPrime_of_equiv instance
{F' : Type*} [EquivLike F' R S] [RingEquivClass F' R S] (f : F') {I : Ideal R} [IsPrime I] : IsPrime (map f I)
Full source
/-- A ring isomorphism sends a prime ideal to a prime ideal. -/
instance map_isPrime_of_equiv {F' : Type*} [EquivLike F' R S] [RingEquivClass F' R S]
    (f : F') {I : Ideal R} [IsPrime I] : IsPrime (map f I) := by
  have h : I.map f = I.map ((f : R ≃+* S) : R →+* S) := rfl
  rw [h, map_comap_of_equiv (f : R ≃+* S)]
  exact Ideal.IsPrime.comap (RingEquiv.symm (f : R ≃+* S))
Ring Isomorphisms Preserve Prime Ideals
Informal description
Let $R$ and $S$ be rings, and let $f : R \simeq S$ be a ring isomorphism. For any prime ideal $I$ of $R$, the image $f(I)$ is a prime ideal of $S$.
Ideal.map_eq_bot_iff_of_injective theorem
{I : Ideal R} {f : F} (hf : Function.Injective f) : I.map f = ⊥ ↔ I = ⊥
Full source
theorem map_eq_bot_iff_of_injective {I : Ideal R} {f : F} (hf : Function.Injective f) :
    I.map f = ⊥ ↔ I = ⊥ := by
  simp [map, span_eq_bot, ← map_zero f, -map_zero, hf.eq_iff, I.eq_bot_iff]
Injective Ring Homomorphism Preserves Zero Ideal in Image
Informal description
Let $R$ and $S$ be semirings, $I$ an ideal of $R$, and $f : R \to S$ an injective ring homomorphism. Then the image of $I$ under $f$ is the zero ideal if and only if $I$ itself is the zero ideal. In other words, $\text{map}(f, I) = \{0\} \leftrightarrow I = \{0\}$.
Ideal.comap_map_of_surjective' theorem
(f : F) (hf : Function.Surjective f) (I : Ideal R) : (I.map f).comap f = I ⊔ RingHom.ker f
Full source
lemma comap_map_of_surjective' (f : F) (hf : Function.Surjective f) (I : Ideal R) :
    (I.map f).comap f = I ⊔ RingHom.ker f :=
  comap_map_of_surjective f hf I
Preimage of Image Equals Ideal Plus Kernel for Surjective Ring Homomorphism
Informal description
Let $f \colon R \to S$ be a surjective ring homomorphism and $I$ be an ideal of $R$. Then the preimage of the image of $I$ under $f$ is equal to the supremum of $I$ and the kernel of $f$, i.e., \[ f^{-1}(f(I)) = I + \ker f. \]
Ideal.map_sInf theorem
{A : Set (Ideal R)} {f : F} (hf : Function.Surjective f) : (∀ J ∈ A, RingHom.ker f ≤ J) → map f (sInf A) = sInf (map f '' A)
Full source
theorem map_sInf {A : Set (Ideal R)} {f : F} (hf : Function.Surjective f) :
    (∀ J ∈ A, RingHom.ker f ≤ J) → map f (sInf A) = sInf (mapmap f '' A) := by
  refine fun h => le_antisymm (le_sInf ?_) ?_
  · intro j hj y hy
    obtain ⟨x, hx⟩ := (mem_map_iff_of_surjective f hf).1 hy
    obtain ⟨J, hJ⟩ := (Set.mem_image _ _ _).mp hj
    rw [← hJ.right, ← hx.right]
    exact mem_map_of_mem f (sInf_le_of_le hJ.left (le_of_eq rfl) hx.left)
  · intro y hy
    obtain ⟨x, hx⟩ := hf y
    refine hx ▸ mem_map_of_mem f ?_
    have : ∀ I ∈ A, y ∈ map f I := by simpa using hy
    rw [Submodule.mem_sInf]
    intro J hJ
    rcases (mem_map_iff_of_surjective f hf).1 (this J hJ) with ⟨x', hx', rfl⟩
    have : x - x' ∈ J := by
      apply h J hJ
      rw [RingHom.mem_ker, map_sub, hx, sub_self]
    simpa only [sub_add_cancel] using J.add_mem this hx'
Image of Infimum of Ideals under Surjective Homomorphism Equals Infimum of Images
Informal description
Let $R$ and $S$ be semirings, $f : R \to S$ a surjective ring homomorphism, and $A$ a set of ideals of $R$. If for every ideal $J \in A$, the kernel of $f$ is contained in $J$, then the image under $f$ of the infimum of $A$ equals the infimum of the images of all ideals in $A$ under $f$. In other words, \[ f\left(\bigwedge_{J \in A} J\right) = \bigwedge_{J \in A} f(J). \]
Ideal.map_isPrime_of_surjective theorem
{f : F} (hf : Function.Surjective f) {I : Ideal R} [H : IsPrime I] (hk : RingHom.ker f ≤ I) : IsPrime (map f I)
Full source
theorem map_isPrime_of_surjective {f : F} (hf : Function.Surjective f) {I : Ideal R} [H : IsPrime I]
    (hk : RingHom.ker f ≤ I) : IsPrime (map f I) := by
  refine ⟨fun h => H.ne_top (eq_top_iff.2 ?_), fun {x y} => ?_⟩
  · replace h := congr_arg (comap f) h
    rw [comap_map_of_surjective _ hf, comap_top] at h
    exact h ▸ sup_le (le_of_eq rfl) hk
  · refine fun hxy => (hf x).recOn fun a ha => (hf y).recOn fun b hb => ?_
    rw [← ha, ← hb, ← map_mul f, mem_map_iff_of_surjective _ hf] at hxy
    rcases hxy with ⟨c, hc, hc'⟩
    rw [← sub_eq_zero, ← map_sub] at hc'
    have : a * b ∈ I := by
      convert I.sub_mem hc (hk (hc' : c - a * b ∈ RingHom.ker f)) using 1
      abel
    exact
      (H.mem_or_mem this).imp (fun h => ha ▸ mem_map_of_mem f h) fun h => hb ▸ mem_map_of_mem f h
Preservation of Prime Ideals under Surjective Ring Homomorphisms
Informal description
Let $R$ and $S$ be rings, and let $f \colon R \to S$ be a surjective ring homomorphism. If $I$ is a prime ideal of $R$ containing the kernel of $f$, then the image $f(I)$ is a prime ideal of $S$.
Ideal.map_ne_bot_of_ne_bot theorem
{S : Type*} [Ring S] [Nontrivial S] [Algebra R S] [NoZeroSMulDivisors R S] {I : Ideal R} (h : I ≠ ⊥) : map (algebraMap R S) I ≠ ⊥
Full source
theorem map_ne_bot_of_ne_bot {S : Type*} [Ring S] [Nontrivial S] [Algebra R S]
    [NoZeroSMulDivisors R S] {I : Ideal R} (h : I ≠ ⊥) : mapmap (algebraMap R S) I ≠ ⊥ :=
  (map_eq_bot_iff_of_injective (FaithfulSMul.algebraMap_injective R S)).mp.mt h
Nonzero Ideal Maps to Nonzero Ideal Under Algebra Map with No Zero Divisors
Informal description
Let $R$ and $S$ be rings with $S$ nontrivial, and let there be an algebra structure of $R$ over $S$ with no zero smul divisors. For any nonzero ideal $I$ of $R$ (i.e., $I \neq \{0\}$), the image of $I$ under the algebra map $\text{algebraMap}\, R\, S$ is also nonzero (i.e., $\text{map}\, (\text{algebraMap}\, R\, S)\, I \neq \{0\}$).
Ideal.map_eq_iff_sup_ker_eq_of_surjective theorem
{I J : Ideal R} (f : R →+* S) (hf : Function.Surjective f) : map f I = map f J ↔ I ⊔ RingHom.ker f = J ⊔ RingHom.ker f
Full source
theorem map_eq_iff_sup_ker_eq_of_surjective {I J : Ideal R} (f : R →+* S)
    (hf : Function.Surjective f) : mapmap f I = map f J ↔ I ⊔ RingHom.ker f = J ⊔ RingHom.ker f := by
  rw [← (comap_injective_of_surjective f hf).eq_iff, comap_map_of_surjective f hf,
    comap_map_of_surjective f hf, RingHom.ker_eq_comap_bot]
Equality of Ideal Images under Surjective Homomorphism via Kernel-Adjusted Suprema
Informal description
Let $f \colon R \to S$ be a surjective ring homomorphism, and let $I$ and $J$ be ideals of $R$. Then the images of $I$ and $J$ under $f$ are equal if and only if the suprema of $I$ with the kernel of $f$ and $J$ with the kernel of $f$ are equal, i.e., \[ f(I) = f(J) \iff I + \ker f = J + \ker f. \]
Ideal.map_radical_of_surjective theorem
{f : R →+* S} (hf : Function.Surjective f) {I : Ideal R} (h : RingHom.ker f ≤ I) : map f I.radical = (map f I).radical
Full source
theorem map_radical_of_surjective {f : R →+* S} (hf : Function.Surjective f) {I : Ideal R}
    (h : RingHom.ker f ≤ I) : map f I.radical = (map f I).radical := by
  rw [radical_eq_sInf, radical_eq_sInf]
  have : ∀ J ∈ {J : Ideal R | I ≤ J ∧ J.IsPrime}, RingHom.ker f ≤ J := fun J hJ => h.trans hJ.left
  convert map_sInf hf this
  refine funext fun j => propext ⟨?_, ?_⟩
  · rintro ⟨hj, hj'⟩
    haveI : j.IsPrime := hj'
    exact
      ⟨comap f j, ⟨⟨map_le_iff_le_comap.1 hj, comap_isPrime f j⟩, map_comap_of_surjective f hf j⟩⟩
  · rintro ⟨J, ⟨hJ, hJ'⟩⟩
    haveI : J.IsPrime := hJ.right
    exact ⟨hJ' ▸ map_mono hJ.left, hJ' ▸ map_isPrime_of_surjective hf (le_trans h hJ.left)⟩
Preservation of Radical under Surjective Ring Homomorphism: $f(\sqrt{I}) = \sqrt{f(I)}$
Informal description
Let $f \colon R \to S$ be a surjective ring homomorphism, and let $I$ be an ideal of $R$ containing the kernel of $f$. Then the image of the radical of $I$ under $f$ equals the radical of the image of $I$ under $f$, i.e., \[ f(\sqrt{I}) = \sqrt{f(I)}. \]
RingHom.liftOfRightInverseAux definition
(hf : Function.RightInverse f_inv f) (g : A →+* C) (hg : RingHom.ker f ≤ RingHom.ker g) : B →+* C
Full source
/-- Auxiliary definition used to define `liftOfRightInverse` -/
def liftOfRightInverseAux (hf : Function.RightInverse f_inv f) (g : A →+* C)
    (hg : RingHom.ker f ≤ RingHom.ker g) :
    B →+* C :=
  { AddMonoidHom.liftOfRightInverse f.toAddMonoidHom f_inv hf ⟨g.toAddMonoidHom, hg⟩ with
    toFun := fun b => g (f_inv b)
    map_one' := by
      rw [← map_one g, ← sub_eq_zero, ← map_sub g, ← mem_ker]
      apply hg
      rw [mem_ker, map_sub f, sub_eq_zero, map_one f]
      exact hf 1
    map_mul' := by
      intro x y
      rw [← map_mul g, ← sub_eq_zero, ← map_sub g, ← mem_ker]
      apply hg
      rw [mem_ker, map_sub f, sub_eq_zero, map_mul f]
      simp only [hf _] }
Auxiliary construction for lifting ring homomorphisms via right inverses
Informal description
Given a ring homomorphism $f : A \to B$ with a right inverse $f_{\text{inv}} : B \to A$ (i.e., $f \circ f_{\text{inv}} = \text{id}_B$), and another ring homomorphism $g : A \to C$ whose kernel contains the kernel of $f$, the auxiliary function $\text{liftOfRightInverseAux}\ f\ f_{\text{inv}}\ g$ constructs a ring homomorphism from $B$ to $C$ defined by $b \mapsto g(f_{\text{inv}}(b))$. This function preserves the additive and multiplicative structures, with: 1. $\text{liftOfRightInverseAux}\ f\ f_{\text{inv}}\ g\ (1_B) = 1_C$ 2. $\text{liftOfRightInverseAux}\ f\ f_{\text{inv}}\ g\ (x \cdot y) = \text{liftOfRightInverseAux}\ f\ f_{\text{inv}}\ g\ (x) \cdot \text{liftOfRightInverseAux}\ f\ f_{\text{inv}}\ g\ (y)$ for all $x, y \in B$.
RingHom.liftOfRightInverseAux_comp_apply theorem
(hf : Function.RightInverse f_inv f) (g : A →+* C) (hg : RingHom.ker f ≤ RingHom.ker g) (a : A) : (f.liftOfRightInverseAux f_inv hf g hg) (f a) = g a
Full source
@[simp]
theorem liftOfRightInverseAux_comp_apply (hf : Function.RightInverse f_inv f) (g : A →+* C)
    (hg : RingHom.ker f ≤ RingHom.ker g) (a : A) :
    (f.liftOfRightInverseAux f_inv hf g hg) (f a) = g a :=
  f.toAddMonoidHom.liftOfRightInverse_comp_apply f_inv hf ⟨g.toAddMonoidHom, hg⟩ a
Evaluation of Lifted Homomorphism via Right Inverse
Informal description
Let $f : A \to B$ be a ring homomorphism with a right inverse $f_{\text{inv}} : B \to A$ (i.e., $f \circ f_{\text{inv}} = \text{id}_B$), and let $g : A \to C$ be another ring homomorphism such that $\ker f \subseteq \ker g$. Then for any $a \in A$, the lifted homomorphism $\text{liftOfRightInverseAux}\ f\ f_{\text{inv}}\ g$ satisfies \[ (\text{liftOfRightInverseAux}\ f\ f_{\text{inv}}\ g)(f(a)) = g(a). \]
RingHom.liftOfRightInverse definition
(hf : Function.RightInverse f_inv f) : { g : A →+* C // RingHom.ker f ≤ RingHom.ker g } ≃ (B →+* C)
Full source
/-- `liftOfRightInverse f hf g hg` is the unique ring homomorphism `φ`

* such that `φ.comp f = g` (`RingHom.liftOfRightInverse_comp`),
* where `f : A →+* B` has a right_inverse `f_inv` (`hf`),
* and `g : B →+* C` satisfies `hg : f.ker ≤ g.ker`.

See `RingHom.eq_liftOfRightInverse` for the uniqueness lemma.

```
   A .
   |  \
 f |   \ g
   |    \
   v     \⌟
   B ----> C
      ∃!φ
```
-/
def liftOfRightInverse (hf : Function.RightInverse f_inv f) :
    { g : A →+* C // RingHom.ker f ≤ RingHom.ker g }{ g : A →+* C // RingHom.ker f ≤ RingHom.ker g } ≃ (B →+* C) where
  toFun g := f.liftOfRightInverseAux f_inv hf g.1 g.2
  invFun φ := ⟨φ.comp f, fun x hx => mem_ker.mpr <| by simp [mem_ker.mp hx]⟩
  left_inv g := by
    ext
    simp only [comp_apply, liftOfRightInverseAux_comp_apply, Subtype.coe_mk]
  right_inv φ := by
    ext b
    simp [liftOfRightInverseAux, hf b]
Lifting of ring homomorphisms via right inverses
Informal description
Given a ring homomorphism \( f : A \to B \) with a right inverse \( f_{\text{inv}} : B \to A \) (i.e., \( f \circ f_{\text{inv}} = \text{id}_B \)), there is a bijection between: 1. The set of ring homomorphisms \( g : A \to C \) whose kernel contains the kernel of \( f \), and 2. The set of ring homomorphisms \( \varphi : B \to C \). The bijection is given by: - The forward map sends \( g \) to the unique \( \varphi \) satisfying \( \varphi \circ f = g \). - The inverse map sends \( \varphi \) to \( \varphi \circ f \).
RingHom.liftOfSurjective abbrev
(hf : Function.Surjective f) : { g : A →+* C // RingHom.ker f ≤ RingHom.ker g } ≃ (B →+* C)
Full source
/-- A non-computable version of `RingHom.liftOfRightInverse` for when no computable right
inverse is available, that uses `Function.surjInv`. -/
@[simp]
noncomputable abbrev liftOfSurjective (hf : Function.Surjective f) :
    { g : A →+* C // RingHom.ker f ≤ RingHom.ker g }{ g : A →+* C // RingHom.ker f ≤ RingHom.ker g } ≃ (B →+* C) :=
  f.liftOfRightInverse (Function.surjInv hf) (Function.rightInverse_surjInv hf)
Lifting of Ring Homomorphisms via Surjective Maps
Informal description
Given a surjective ring homomorphism $f \colon A \to B$ and a ring $C$, there is a bijection between: 1. The set of ring homomorphisms $g \colon A \to C$ whose kernel contains $\ker f$, and 2. The set of ring homomorphisms $\varphi \colon B \to C$. The bijection is given by: - The forward map sends $g$ to the unique $\varphi$ satisfying $\varphi \circ f = g$. - The inverse map sends $\varphi$ to $\varphi \circ f$.
RingHom.liftOfRightInverse_comp_apply theorem
(hf : Function.RightInverse f_inv f) (g : { g : A →+* C // RingHom.ker f ≤ RingHom.ker g }) (x : A) : (f.liftOfRightInverse f_inv hf g) (f x) = g.1 x
Full source
theorem liftOfRightInverse_comp_apply (hf : Function.RightInverse f_inv f)
    (g : { g : A →+* C // RingHom.ker f ≤ RingHom.ker g }) (x : A) :
    (f.liftOfRightInverse f_inv hf g) (f x) = g.1 x :=
  f.liftOfRightInverseAux_comp_apply f_inv hf g.1 g.2 x
Evaluation of Lifted Homomorphism via Right Inverse: $\varphi(f(x)) = g(x)$
Informal description
Let $f : A \to B$ be a ring homomorphism with a right inverse $f_{\text{inv}} : B \to A$ (i.e., $f \circ f_{\text{inv}} = \text{id}_B$), and let $g : A \to C$ be a ring homomorphism such that $\ker f \subseteq \ker g$. Then for any $x \in A$, the lifted homomorphism $\varphi = f.\text{liftOfRightInverse}\ f_{\text{inv}}\ hf\ g$ satisfies \[ \varphi(f(x)) = g(x). \]
RingHom.liftOfRightInverse_comp theorem
(hf : Function.RightInverse f_inv f) (g : { g : A →+* C // RingHom.ker f ≤ RingHom.ker g }) : (f.liftOfRightInverse f_inv hf g).comp f = g
Full source
theorem liftOfRightInverse_comp (hf : Function.RightInverse f_inv f)
    (g : { g : A →+* C // RingHom.ker f ≤ RingHom.ker g }) :
    (f.liftOfRightInverse f_inv hf g).comp f = g :=
  RingHom.ext <| f.liftOfRightInverse_comp_apply f_inv hf g
Composition of Lifted Homomorphism via Right Inverse: $\varphi \circ f = g$
Informal description
Let $f \colon A \to B$ be a ring homomorphism with a right inverse $f_{\text{inv}} \colon B \to A$ (i.e., $f \circ f_{\text{inv}} = \text{id}_B$), and let $g \colon A \to C$ be a ring homomorphism such that $\ker f \subseteq \ker g$. Then the composition of the lifted homomorphism $\varphi = f.\text{liftOfRightInverse}\ f_{\text{inv}}\ hf\ g$ with $f$ satisfies \[ \varphi \circ f = g. \]
AlgHom.ker_coe theorem
: RingHom.ker f = RingHom.ker (f : A →+* B)
Full source
lemma ker_coe : RingHom.ker f = RingHom.ker (f : A →+* B) := rfl
Equality of Kernels for Algebra and Ring Homomorphisms
Informal description
For an algebra homomorphism $f : A \to B$, the kernel of $f$ as an algebra homomorphism is equal to the kernel of $f$ viewed as a ring homomorphism. That is, $\ker(f) = \ker(f_{\text{ring}})$ where $f_{\text{ring}}$ denotes $f$ considered as a ring homomorphism.
AlgHom.coe_ideal_map theorem
(I : Ideal A) : Ideal.map f I = Ideal.map (f : A →+* B) I
Full source
lemma coe_ideal_map (I : Ideal A) :
    Ideal.map f I = Ideal.map (f : A →+* B) I := rfl
Equality of Ideal Images under Algebra and Ring Homomorphisms
Informal description
For any ideal $I$ of $A$ and an algebra homomorphism $f : A \to B$, the image of $I$ under $f$ as an algebra homomorphism is equal to the image of $I$ under $f$ viewed as a ring homomorphism. That is, $\text{map}(f, I) = \text{map}(f_{\text{ring}}, I)$, where $f_{\text{ring}}$ denotes $f$ considered as a ring homomorphism.
AlgHom.comap_ker theorem
{C : Type*} [Semiring C] [Algebra R C] (f : B →ₐ[R] C) (g : A →ₐ[R] B) : (RingHom.ker f).comap g = RingHom.ker (f.comp g)
Full source
lemma comap_ker {C : Type*} [Semiring C] [Algebra R C] (f : B →ₐ[R] C) (g : A →ₐ[R] B) :
    (RingHom.ker f).comap g = RingHom.ker (f.comp g) :=
  RingHom.comap_ker f.toRingHom g.toRingHom
Kernel Preimage under Composition of Algebra Homomorphisms
Informal description
Let $R$ be a commutative semiring, and let $A$, $B$, and $C$ be semirings with algebra structures over $R$. For any $R$-algebra homomorphisms $g : A \to B$ and $f : B \to C$, the preimage of the kernel of $f$ under $g$ is equal to the kernel of the composition $f \circ g$. That is, $g^{-1}(\ker f) = \ker(f \circ g)$.
Algebra.idealMap definition
(I : Ideal R) : I →ₗ[R] I.map (algebraMap R S)
Full source
/-- The induced linear map from `I` to the span of `I` in an `R`-algebra `S`. -/
@[simps!]
def idealMap (I : Ideal R) : I →ₗ[R] I.map (algebraMap R S) :=
  (Algebra.linearMap R S).restrict (q := (I.map (algebraMap R S)).restrictScalars R)
    (fun _ ↦ Ideal.mem_map_of_mem _)
Induced linear map from an ideal to its image under an algebra map
Informal description
Given a commutative semiring $R$, a semiring $S$ with an algebra structure over $R$, and an ideal $I$ of $R$, the linear map $\text{idealMap}$ is the restriction of the algebra map $\text{algebraMap} : R \to S$ to $I$, mapping elements of $I$ to their images in the ideal generated by $\text{algebraMap}(I)$ in $S$. More precisely, $\text{idealMap}$ is the $R$-linear map from $I$ to $\text{map}(\text{algebraMap} R S, I)$, where $\text{map}(\text{algebraMap} R S, I)$ is the ideal of $S$ generated by the image of $I$ under $\text{algebraMap}$.
FaithfulSMul.ker_algebraMap_eq_bot theorem
(R A : Type*) [CommSemiring R] [Semiring A] [Algebra R A] [FaithfulSMul R A] : RingHom.ker (algebraMap R A) = ⊥
Full source
@[simp]
theorem FaithfulSMul.ker_algebraMap_eq_bot (R A : Type*) [CommSemiring R] [Semiring A]
    [Algebra R A] [FaithfulSMul R A] : RingHom.ker (algebraMap R A) =  := by
  ext; simp
Faithful scalar multiplication implies trivial kernel of algebra map
Informal description
Let $R$ be a commutative semiring and $A$ be a semiring with an algebra structure over $R$. If the scalar multiplication action of $R$ on $A$ is faithful, then the kernel of the algebra map $\text{algebraMap} : R \to A$ is the trivial ideal $\bot$.