Skip to content

Commit b2cf514

Browse files
committed
chore(RingTheory/PrincipalIdealDomain): factor out IsPrincipal.map, use RingHomClass (#18010)
1 parent 616d464 commit b2cf514

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

Mathlib/RingTheory/PrincipalIdealDomain.lean

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -348,23 +348,32 @@ section Surjective
348348

349349
open Submodule
350350

351-
variable {S N : Type*} [Ring R] [AddCommGroup M] [AddCommGroup N] [Ring S]
352-
variable [Module R M] [Module R N]
351+
variable {S N F : Type*} [Ring R] [AddCommGroup M] [AddCommGroup N] [Ring S]
352+
variable [Module R M] [Module R N] [FunLike F R S] [RingHomClass F R S]
353+
354+
theorem Submodule.IsPrincipal.map (f : M →ₗ[R] N) {S : Submodule R M}
355+
(hI : IsPrincipal S) : IsPrincipal (map f S) :=
356+
⟨⟨f (IsPrincipal.generator S), by
357+
rw [← Set.image_singleton, ← map_span, span_singleton_generator]⟩⟩
353358

354359
theorem Submodule.IsPrincipal.of_comap (f : M →ₗ[R] N) (hf : Function.Surjective f)
355-
(S : Submodule R N) [hI : IsPrincipal (S.comap f)] : IsPrincipal S :=
356-
⟨⟨f (IsPrincipal.generator (S.comap f)), by
357-
rw [← Set.image_singleton, ← Submodule.map_span, IsPrincipal.span_singleton_generator,
358-
Submodule.map_comap_eq_of_surjective hf]⟩⟩
359-
360-
theorem Ideal.IsPrincipal.of_comap (f : R →+* S) (hf : Function.Surjective f) (I : Ideal S)
361-
[hI : IsPrincipal (I.comap f)] : IsPrincipal I :=
362-
⟨⟨f (IsPrincipal.generator (I.comap f)), by
360+
(S : Submodule R N) [hI : IsPrincipal (S.comap f)] : IsPrincipal S := by
361+
rw [← Submodule.map_comap_eq_of_surjective hf S]
362+
exact hI.map f
363+
364+
theorem Submodule.IsPrincipal.map_ringHom (f : F) {I : Ideal R}
365+
(hI : IsPrincipal I) : IsPrincipal (Ideal.map f I) :=
366+
⟨⟨f (IsPrincipal.generator I), by
363367
rw [Ideal.submodule_span_eq, ← Set.image_singleton, ← Ideal.map_span,
364-
Ideal.span_singleton_generator, Ideal.map_comap_of_surjective f hf]⟩⟩
368+
Ideal.span_singleton_generator]⟩⟩
369+
370+
theorem Ideal.IsPrincipal.of_comap (f : F) (hf : Function.Surjective f) (I : Ideal S)
371+
[hI : IsPrincipal (I.comap f)] : IsPrincipal I := by
372+
rw [← map_comap_of_surjective f hf I]
373+
exact hI.map_ringHom f
365374

366375
/-- The surjective image of a principal ideal ring is again a principal ideal ring. -/
367-
theorem IsPrincipalIdealRing.of_surjective [IsPrincipalIdealRing R] (f : R →+* S)
376+
theorem IsPrincipalIdealRing.of_surjective [IsPrincipalIdealRing R] (f : F)
368377
(hf : Function.Surjective f) : IsPrincipalIdealRing S :=
369378
fun I => Ideal.IsPrincipal.of_comap f hf I⟩
370379

0 commit comments

Comments
 (0)