Skip to content

Commit 2777305

Browse files
acmepjzbjoernkjoshanssen
authored andcommitted
feat: add comap_map for sub(semi)ring, subalgebra, subfield and intermediate fields (#15193)
Generalizes `Subgroup.comap_map_eq`, `Subgroup.comap_map_eq_self`, `Subgroup.comap_map_eq_self_of_injective`, and `Subgroup.map_comap_eq`, `Subgroup.map_comap_eq_self`, `Subgroup.map_comap_eq_self_of_surjective`.
1 parent 55d0a1e commit 2777305

File tree

8 files changed

+177
-0
lines changed

8 files changed

+177
-0
lines changed

Mathlib/Algebra/Algebra/Subalgebra/Basic.lean

+25
Original file line numberDiff line numberDiff line change
@@ -1170,3 +1170,28 @@ theorem ext_on_codisjoint {φ ψ : F} {S T : Subalgebra R A} (hST : Codisjoint S
11701170
end AlgHom
11711171

11721172
end Equalizer
1173+
1174+
section MapComap
1175+
1176+
namespace Subalgebra
1177+
1178+
variable {R A B : Type*} [CommSemiring R] [Semiring A] [Algebra R A] [Semiring B] [Algebra R B]
1179+
1180+
theorem map_comap_eq (f : A →ₐ[R] B) (S : Subalgebra R B) : (S.comap f).map f = S ⊓ f.range :=
1181+
SetLike.coe_injective Set.image_preimage_eq_inter_range
1182+
1183+
theorem map_comap_eq_self
1184+
{f : A →ₐ[R] B} {S : Subalgebra R B} (h : S ≤ f.range) : (S.comap f).map f = S := by
1185+
simpa only [inf_of_le_left h] using map_comap_eq f S
1186+
1187+
theorem map_comap_eq_self_of_surjective
1188+
{f : A →ₐ[R] B} (hf : Function.Surjective f) (S : Subalgebra R B) : (S.comap f).map f = S :=
1189+
map_comap_eq_self <| by simp [(Algebra.range_top_iff_surjective f).2 hf]
1190+
1191+
theorem comap_map_eq_self_of_injective
1192+
{f : A →ₐ[R] B} (hf : Function.Injective f) (S : Subalgebra R A) : (S.map f).comap f = S :=
1193+
SetLike.coe_injective (Set.preimage_image_eq _ hf)
1194+
1195+
end Subalgebra
1196+
1197+
end MapComap

Mathlib/Algebra/Field/Subfield.lean

+18
Original file line numberDiff line numberDiff line change
@@ -840,3 +840,21 @@ theorem mem_closure_iff {s : Set K} {x} :
840840
end Commutative
841841

842842
end Subfield
843+
844+
namespace Subfield
845+
846+
theorem map_comap_eq (f : K →+* L) (s : Subfield L) : (s.comap f).map f = s ⊓ f.fieldRange :=
847+
SetLike.coe_injective Set.image_preimage_eq_inter_range
848+
849+
theorem map_comap_eq_self
850+
{f : K →+* L} {s : Subfield L} (h : s ≤ f.fieldRange) : (s.comap f).map f = s := by
851+
simpa only [inf_of_le_left h] using map_comap_eq f s
852+
853+
theorem map_comap_eq_self_of_surjective
854+
{f : K →+* L} (hf : Function.Surjective f) (s : Subfield L) : (s.comap f).map f = s :=
855+
SetLike.coe_injective (Set.image_preimage_eq _ hf)
856+
857+
theorem comap_map (f : K →+* L) (s : Subfield K) : (s.map f).comap f = s :=
858+
SetLike.coe_injective (Set.preimage_image_eq _ f.injective)
859+
860+
end Subfield

Mathlib/Algebra/Group/Submonoid/Operations.lean

+15
Original file line numberDiff line numberDiff line change
@@ -1182,3 +1182,18 @@ namespace Nat
11821182
exact fun n hn ↦ AddSubmonoid.add_mem _ hn <| subset_closure <| Set.mem_singleton _
11831183

11841184
end Nat
1185+
1186+
namespace Submonoid
1187+
1188+
variable {F : Type*} [FunLike F M N] [mc : MonoidHomClass F M N]
1189+
1190+
@[to_additive]
1191+
theorem map_comap_eq (f : F) (S : Submonoid N) : (S.comap f).map f = S ⊓ MonoidHom.mrange f :=
1192+
SetLike.coe_injective Set.image_preimage_eq_inter_range
1193+
1194+
@[to_additive]
1195+
theorem map_comap_eq_self {f : F} {S : Submonoid N} (h : S ≤ MonoidHom.mrange f) :
1196+
(S.comap f).map f = S := by
1197+
simpa only [inf_of_le_left h] using map_comap_eq f S
1198+
1199+
end Submonoid

Mathlib/Algebra/Group/Subsemigroup/Operations.lean

+15
Original file line numberDiff line numberDiff line change
@@ -772,3 +772,18 @@ def subsemigroupMap (e : M ≃* N) (S : Subsemigroup M) : S ≃* S.map (e : M
772772
invFun := fun x => ⟨e.symm x, _⟩ }
773773

774774
end MulEquiv
775+
776+
namespace Subsemigroup
777+
778+
variable [Mul M] [Mul N]
779+
780+
@[to_additive]
781+
theorem map_comap_eq (f : M →ₙ* N) (S : Subsemigroup N) : (S.comap f).map f = S ⊓ f.srange :=
782+
SetLike.coe_injective Set.image_preimage_eq_inter_range
783+
784+
@[to_additive]
785+
theorem map_comap_eq_self {f : M →ₙ* N} {S : Subsemigroup N} (h : S ≤ f.srange) :
786+
(S.comap f).map f = S := by
787+
simpa only [inf_of_le_left h] using map_comap_eq f S
788+
789+
end Subsemigroup

Mathlib/Algebra/Ring/Subring/Basic.lean

+38
Original file line numberDiff line numberDiff line change
@@ -1286,3 +1286,41 @@ instance center.smulCommClass_right : SMulCommClass R (center R) R :=
12861286
end Subring
12871287

12881288
end Actions
1289+
1290+
namespace Subring
1291+
1292+
theorem map_comap_eq (f : R →+* S) (t : Subring S) : (t.comap f).map f = t ⊓ f.range :=
1293+
SetLike.coe_injective Set.image_preimage_eq_inter_range
1294+
1295+
theorem map_comap_eq_self
1296+
{f : R →+* S} {t : Subring S} (h : t ≤ f.range) : (t.comap f).map f = t := by
1297+
simpa only [inf_of_le_left h] using Subring.map_comap_eq f t
1298+
1299+
theorem map_comap_eq_self_of_surjective
1300+
{f : R →+* S} (hf : Function.Surjective f) (t : Subring S) : (t.comap f).map f = t :=
1301+
map_comap_eq_self <| by simp [hf]
1302+
1303+
theorem comap_map_eq (f : R →+* S) (s : Subring R) :
1304+
(s.map f).comap f = s ⊔ closure (f ⁻¹' {0}) := by
1305+
apply le_antisymm
1306+
· intro x hx
1307+
rw [mem_comap, mem_map] at hx
1308+
obtain ⟨y, hy, hxy⟩ := hx
1309+
replace hxy : x - y ∈ f ⁻¹' {0} := by simp [hxy]
1310+
rw [← closure_eq s, ← closure_union, ← add_sub_cancel y x]
1311+
exact Subring.add_mem _ (subset_closure <| Or.inl hy) (subset_closure <| Or.inr hxy)
1312+
· rw [← map_le_iff_le_comap, map_sup, f.map_closure]
1313+
apply le_of_eq
1314+
rw [sup_eq_left, closure_le]
1315+
exact (Set.image_preimage_subset f {0}).trans (Set.singleton_subset_iff.2 (s.map f).zero_mem)
1316+
1317+
theorem comap_map_eq_self {f : R →+* S} {s : Subring R}
1318+
(h : f ⁻¹' {0} ⊆ s) : (s.map f).comap f = s := by
1319+
convert comap_map_eq f s
1320+
rwa [left_eq_sup, closure_le]
1321+
1322+
theorem comap_map_eq_self_of_injective
1323+
{f : R →+* S} (hf : Function.Injective f) (s : Subring R) : (s.map f).comap f = s :=
1324+
SetLike.coe_injective (Set.preimage_image_eq _ hf)
1325+
1326+
end Subring

Mathlib/Algebra/Ring/Subsemiring/Basic.lean

+19
Original file line numberDiff line numberDiff line change
@@ -1195,3 +1195,22 @@ def closureCommSemiringOfComm {s : Set R'} (hcomm : ∀ a ∈ s, ∀ b ∈ s, a
11951195
end Subsemiring
11961196

11971197
end Actions
1198+
1199+
namespace Subsemiring
1200+
1201+
theorem map_comap_eq (f : R →+* S) (t : Subsemiring S) : (t.comap f).map f = t ⊓ f.rangeS :=
1202+
SetLike.coe_injective Set.image_preimage_eq_inter_range
1203+
1204+
theorem map_comap_eq_self
1205+
{f : R →+* S} {t : Subsemiring S} (h : t ≤ f.rangeS) : (t.comap f).map f = t := by
1206+
simpa only [inf_of_le_left h] using map_comap_eq f t
1207+
1208+
theorem map_comap_eq_self_of_surjective
1209+
{f : R →+* S} (hf : Function.Surjective f) (t : Subsemiring S) : (t.comap f).map f = t :=
1210+
map_comap_eq_self <| by simp [hf]
1211+
1212+
theorem comap_map_eq_self_of_injective
1213+
{f : R →+* S} (hf : Function.Injective f) (s : Subsemiring R) : (s.map f).comap f = s :=
1214+
SetLike.coe_injective (Set.preimage_image_eq _ hf)
1215+
1216+
end Subsemiring

Mathlib/FieldTheory/Adjoin.lean

+21
Original file line numberDiff line numberDiff line change
@@ -1399,3 +1399,24 @@ theorem equivAdjoinSimple_symm_gen (pb : PowerBasis K L) :
13991399
rw [equivAdjoinSimple, equivOfMinpoly_symm, equivOfMinpoly_gen, adjoin.powerBasis_gen]
14001400

14011401
end PowerBasis
1402+
1403+
namespace IntermediateField
1404+
1405+
variable {K L L' : Type*} [Field K] [Field L] [Field L'] [Algebra K L] [Algebra K L']
1406+
1407+
theorem map_comap_eq (f : L →ₐ[K] L') (S : IntermediateField K L') :
1408+
(S.comap f).map f = S ⊓ f.fieldRange :=
1409+
SetLike.coe_injective Set.image_preimage_eq_inter_range
1410+
1411+
theorem map_comap_eq_self {f : L →ₐ[K] L'} {S : IntermediateField K L'} (h : S ≤ f.fieldRange) :
1412+
(S.comap f).map f = S := by
1413+
simpa only [inf_of_le_left h] using map_comap_eq f S
1414+
1415+
theorem map_comap_eq_self_of_surjective {f : L →ₐ[K] L'} (hf : Function.Surjective f)
1416+
(S : IntermediateField K L') : (S.comap f).map f = S :=
1417+
SetLike.coe_injective (Set.image_preimage_eq _ hf)
1418+
1419+
theorem comap_map (f : L →ₐ[K] L') (S : IntermediateField K L) : (S.map f).comap f = S :=
1420+
SetLike.coe_injective (Set.preimage_image_eq _ f.injective)
1421+
1422+
end IntermediateField

Mathlib/RingTheory/Adjoin/Basic.lean

+26
Original file line numberDiff line numberDiff line change
@@ -516,3 +516,29 @@ theorem Algebra.restrictScalars_adjoin_of_algEquiv
516516
erw [hi, Set.range_comp, i.toEquiv.range_eq_univ, Set.image_univ]
517517

518518
end
519+
520+
namespace Subalgebra
521+
522+
variable [CommSemiring R] [Ring A] [Algebra R A] [Ring B] [Algebra R B]
523+
524+
theorem comap_map_eq (f : A →ₐ[R] B) (S : Subalgebra R A) :
525+
(S.map f).comap f = S ⊔ Algebra.adjoin R (f ⁻¹' {0}) := by
526+
apply le_antisymm
527+
· intro x hx
528+
rw [mem_comap, mem_map] at hx
529+
obtain ⟨y, hy, hxy⟩ := hx
530+
replace hxy : x - y ∈ f ⁻¹' {0} := by simp [hxy]
531+
rw [← Algebra.adjoin_eq S, ← Algebra.adjoin_union, ← add_sub_cancel y x]
532+
exact Subalgebra.add_mem _
533+
(Algebra.subset_adjoin <| Or.inl hy) (Algebra.subset_adjoin <| Or.inr hxy)
534+
· rw [← map_le, Algebra.map_sup, f.map_adjoin]
535+
apply le_of_eq
536+
rw [sup_eq_left, Algebra.adjoin_le_iff]
537+
exact (Set.image_preimage_subset f {0}).trans (Set.singleton_subset_iff.2 (S.map f).zero_mem)
538+
539+
theorem comap_map_eq_self {f : A →ₐ[R] B} {S : Subalgebra R A}
540+
(h : f ⁻¹' {0} ⊆ S) : (S.map f).comap f = S := by
541+
convert comap_map_eq f S
542+
rwa [left_eq_sup, Algebra.adjoin_le_iff]
543+
544+
end Subalgebra

0 commit comments

Comments
 (0)