Skip to content

Commit 108a53e

Browse files
committed
feat(Algebra/Homology): sandwich a comm group between two finite comm groups (#31227)
From ClassFieldTheory
1 parent ebbb9b3 commit 108a53e

File tree

6 files changed

+64
-39
lines changed

6 files changed

+64
-39
lines changed

Mathlib/Algebra/Homology/ShortComplex/Ab.lean

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ Copyright (c) 2023 Joël Riou. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Joël Riou
55
-/
6-
import Mathlib.Algebra.Homology.ShortComplex.ShortExact
76
import Mathlib.Algebra.Category.Grp.Abelian
87
import Mathlib.Algebra.Category.Grp.Kernels
98
import Mathlib.Algebra.Exact
9+
import Mathlib.Algebra.Homology.ShortComplex.ShortExact
10+
import Mathlib.GroupTheory.QuotientGroup.Finite
1011

1112
/-!
1213
# Homology and exactness of short complexes of abelian groups
@@ -121,6 +122,8 @@ lemma ab_exact_iff_function_exact :
121122
simp only [ab_zero_apply]
122123
· tauto
123124

125+
variable {S}
126+
124127
lemma ab_exact_iff_ker_le_range : S.Exact ↔ S.g.hom.ker ≤ S.f.hom.range := S.ab_exact_iff
125128

126129
lemma ab_exact_iff_range_eq_ker : S.Exact ↔ S.f.hom.range = S.g.hom.ker := by
@@ -134,7 +137,17 @@ lemma ab_exact_iff_range_eq_ker : S.Exact ↔ S.f.hom.range = S.g.hom.ker := by
134137
· intro h
135138
rw [h]
136139

137-
variable {S}
140+
alias ⟨Exact.ab_range_eq_ker, _⟩ := ab_exact_iff_range_eq_ker
141+
142+
/-- In an exact sequence of abelian groups, if the first and last groups are finite, then so is the
143+
middle one. -/
144+
lemma Exact.ab_finite {S : ShortComplex Ab.{u}} (hS : S.Exact) [Finite S.X₁] [Finite S.X₃] :
145+
Finite S.X₂ := by
146+
have : Finite S.f.hom.range := Set.finite_range _
147+
have : Finite (S.X₂ ⧸ S.f.hom.range) := by
148+
rw [hS.ab_range_eq_ker]
149+
exact .of_equiv _ (QuotientAddGroup.quotientKerEquivRange _).toEquiv.symm
150+
exact .of_addSubgroup_quotient (H := S.f.hom.range)
138151

139152
lemma ShortExact.ab_injective_f (hS : S.ShortExact) :
140153
Function.Injective S.f :=
@@ -144,12 +157,15 @@ lemma ShortExact.ab_surjective_g (hS : S.ShortExact) :
144157
Function.Surjective S.g :=
145158
(AddCommGrpCat.epi_iff_surjective _).1 hS.epi_g
146159

147-
variable (S)
160+
/-- In a short exact sequence of abelian groups, the middle group is finite iff the first and last
161+
are. -/
162+
lemma ShortExact.ab_finite_iff {S : ShortComplex Ab.{u}} (hS : S.ShortExact) :
163+
Finite S.X₂ ↔ Finite S.X₁ ∧ Finite S.X₃ where
164+
mp _ := ⟨.of_injective _ hS.ab_injective_f, .of_surjective _ hS.ab_surjective_g⟩
165+
mpr | ⟨_, _⟩ => hS.exact.ab_finite
148166

149-
lemma ShortExact.ab_exact_iff_function_exact :
150-
S.Exact ↔ Function.Exact S.f S.g := by
151-
rw [ab_exact_iff_range_eq_ker, AddMonoidHom.exact_iff]
152-
tauto
167+
@[deprecated (since := "2025-11-03")]
168+
protected alias ShortExact.ab_exact_iff_function_exact := ab_exact_iff_function_exact
153169

154170
end ShortComplex
155171

Mathlib/Data/Finite/Prod.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ theorem prod_right (α) [Finite (α × β)] [Nonempty α] : Finite β :=
3838

3939
end Finite
4040

41+
lemma Prod.finite_iff [Nonempty α] [Nonempty β] : Finite (α × β) ↔ Finite α ∧ Finite β where
42+
mp _ := ⟨.prod_left β, .prod_right α⟩
43+
mpr | ⟨_, _⟩ => inferInstance
44+
4145
instance Pi.finite {α : Sort*} {β : α → Sort*} [Finite α] [∀ a, Finite (β a)] :
4246
Finite (∀ a, β a) := by
4347
classical

Mathlib/Data/Set/Finite/Basic.lean

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,9 @@ theorem finite_union {s t : Set α} : (s ∪ t).Finite ↔ s.Finite ∧ t.Finite
664664
theorem finite_image_iff {s : Set α} {f : α → β} (hi : InjOn f s) : (f '' s).Finite ↔ s.Finite :=
665665
fun h => h.of_finite_image hi, Finite.image _⟩
666666

667+
lemma finite_range_iff {f : α → β} (hf : f.Injective) : (range f).Finite ↔ Finite α := by
668+
simpa [finite_univ_iff] using finite_image_iff (s := univ) hf.injOn
669+
667670
theorem univ_finite_iff_nonempty_fintype : (univ : Set α).Finite ↔ Nonempty (Fintype α) :=
668671
fun h => ⟨fintypeOfFiniteUniv h⟩, fun ⟨_i⟩ => finite_univ⟩
669672

@@ -865,9 +868,8 @@ theorem infinite_image_iff {s : Set α} {f : α → β} (hi : InjOn f s) :
865868
(f '' s).Infinite ↔ s.Infinite :=
866869
not_congr <| finite_image_iff hi
867870

868-
theorem infinite_range_iff {f : α → β} (hi : Injective f) :
869-
(range f).Infinite ↔ Infinite α := by
870-
rw [← image_univ, infinite_image_iff hi.injOn, infinite_univ_iff]
871+
theorem infinite_range_iff {f : α → β} (hf : Injective f) : (range f).Infinite ↔ Infinite α := by
872+
simpa using (finite_range_iff hf).not
871873

872874
protected alias ⟨_, Infinite.image⟩ := infinite_image_iff
873875

Mathlib/GroupTheory/QuotientGroup/Finite.lean

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,15 @@ import Mathlib.GroupTheory.QuotientGroup.Basic
1313
# Deducing finiteness of a group.
1414
-/
1515

16-
open Function
16+
open Function QuotientGroup Subgroup
1717
open scoped Pointwise
1818

19-
universe u v w x
2019

21-
namespace Group
22-
23-
open QuotientGroup Subgroup
24-
25-
variable {F G H : Type u} [Group F] [Group G] [Group H] [Fintype F] [Fintype H]
20+
variable {F G H : Type*} [Group F] [Group G] [Group H] [Fintype F] [Fintype H]
2621
variable (f : F →* G) (g : G →* H)
2722

23+
namespace Group
24+
2825
open scoped Classical in
2926
/-- If `F` and `H` are finite such that `ker(G →* H) ≤ im(F →* G)`, then `G` is finite. -/
3027
@[to_additive
@@ -52,9 +49,18 @@ noncomputable def fintypeOfKerOfCodom [Fintype g.ker] : Fintype G :=
5249
noncomputable def fintypeOfDomOfCoker [Normal f.range] [Fintype <| G ⧸ f.range] : Fintype G :=
5350
fintypeOfKerLeRange _ (mk' f.range) fun x => (eq_one_iff x).mp
5451

52+
end Group
53+
5554
@[to_additive]
56-
lemma _root_.Finite.of_finite_quot_finite_subgroup {H : Subgroup G} [Finite H] [Finite (G ⧸ H)] :
57-
Finite G :=
58-
Finite.of_equiv _ (groupEquivQuotientProdSubgroup (s := H)).symm
55+
lemma finite_iff_subgroup_quotient (H : Subgroup G) : Finite G ↔ Finite H ∧ Finite (G ⧸ H) := by
56+
rw [(groupEquivQuotientProdSubgroup (s := H)).finite_iff, Prod.finite_iff, and_comm]
5957

60-
end Group
58+
@[to_additive]
59+
lemma Finite.of_subgroup_quotient (H : Subgroup G) [Finite H] [Finite (G ⧸ H)] : Finite G := by
60+
rw [finite_iff_subgroup_quotient]; constructor <;> assumption
61+
62+
@[deprecated (since := "2025-11-11")]
63+
alias Finite.of_finite_quot_finite_subgroup := Finite.of_subgroup_quotient
64+
65+
@[deprecated (since := "2025-11-11")]
66+
alias Finite.of_finite_quot_finite_addSubgroup := Finite.of_addSubgroup_quotient

Mathlib/RingTheory/Ideal/Quotient/Basic.lean

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,14 @@ See `Algebra.RingQuot` for quotients of semirings.
2424
2525
-/
2626

27-
28-
universe u v w
29-
30-
namespace Ideal
31-
3227
open Set
3328

34-
variable {R : Type u} [Ring R] (I J : Ideal R) {a b : R}
35-
variable {S : Type v}
29+
variable {ι ι' R S : Type*} [Ring R] (I J : Ideal R) {a b : R}
3630

37-
namespace Quotient
31+
namespace Ideal.Quotient
3832

3933
@[simp]
40-
lemma mk_span_range {ι : Type*} (f : ι → R) [(span (range f)).IsTwoSided] (i : ι) :
34+
lemma mk_span_range (f : ι → R) [(span (range f)).IsTwoSided] (i : ι) :
4135
mk (span (.range f)) (f i) = 0 := by
4236
rw [Ideal.Quotient.eq_zero_iff_mem]
4337
exact Ideal.subset_span ⟨i, rfl⟩
@@ -174,8 +168,6 @@ end Quotient
174168

175169
section Pi
176170

177-
variable (ι : Type v)
178-
179171
/-- `R^n/I^n` is a `R/I`-module. -/
180172
instance modulePi [I.IsTwoSided] : Module (R ⧸ I) ((ι → R) ⧸ pi fun _ ↦ I) where
181173
smul c m :=
@@ -192,6 +184,7 @@ instance modulePi [I.IsTwoSided] : Module (R ⧸ I) ((ι → R) ⧸ pi fun _ ↦
192184
add_smul := by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩; exact congr_arg _ (add_smul _ _ _)
193185
zero_smul := by rintro ⟨a⟩; exact congr_arg _ (zero_smul _ _)
194186

187+
variable (ι) in
195188
/-- `R^n/I^n` is isomorphic to `(R/I)^n` as an `R/I`-module. -/
196189
noncomputable def piQuotEquiv [I.IsTwoSided] : ((ι → R) ⧸ pi fun _ ↦ I) ≃ₗ[R ⧸ I] ι → (R ⧸ I) where
197190
toFun x := Quotient.liftOn' x (fun f i ↦ Ideal.Quotient.mk I (f i)) fun _ _ hab ↦
@@ -206,7 +199,7 @@ noncomputable def piQuotEquiv [I.IsTwoSided] : ((ι → R) ⧸ pi fun _ ↦ I)
206199

207200
/-- If `f : R^n → R^m` is an `R`-linear map and `I ⊆ R` is an ideal, then the image of `I^n` is
208201
contained in `I^m`. -/
209-
theorem map_pi [I.IsTwoSided] {ι : Type*} [Finite ι] {ι' : Type w} (x : ι → R) (hi : ∀ i, x i ∈ I)
202+
theorem map_pi [I.IsTwoSided] [Finite ι] (x : ι → R) (hi : ∀ i, x i ∈ I)
210203
(f : (ι → R) →ₗ[R] ι' → R) (i : ι') : f x i ∈ I := by
211204
classical
212205
cases nonempty_fintype ι
@@ -221,8 +214,13 @@ open scoped Pointwise in
221214
lemma univ_eq_iUnion_image_add : (Set.univ (α := R)) = ⋃ x : R ⧸ I, x.out +ᵥ (I : Set R) :=
222215
QuotientAddGroup.univ_eq_iUnion_vadd I.toAddSubgroup
223216

224-
variable {I} in
225-
lemma _root_.Finite.of_finite_quot_finite_ideal [hI : Finite I] [h : Finite (R ⧸ I)] : Finite R :=
226-
@Finite.of_finite_quot_finite_addSubgroup _ _ _ hI h
227-
228217
end Ideal
218+
219+
lemma finite_iff_ideal_quotient (I : Ideal R) : Finite R ↔ Finite I ∧ Finite (R ⧸ I) :=
220+
finite_iff_addSubgroup_quotient I.toAddSubgroup
221+
222+
lemma Finite.of_ideal_quotient (I : Ideal R) [Finite I] [Finite (R ⧸ I)] : Finite R := by
223+
rw [finite_iff_ideal_quotient]; constructor <;> assumption
224+
225+
@[deprecated (since := "2025-11-11")]
226+
alias Finite.of_finite_quot_finite_ideal := Finite.of_ideal_quotient

Mathlib/Topology/Algebra/Valued/LocallyCompact.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ lemma finite_quotient_maximalIdeal_pow_of_finite_residueField [IsDiscreteValuati
114114
have : 𝓂[K] ^ (n + 1) ≤ 𝓂[K] ^ n := Ideal.pow_le_pow_right (by simp)
115115
replace ih := Finite.of_equiv _ (DoubleQuot.quotQuotEquivQuotOfLE this).symm.toEquiv
116116
suffices Finite (Ideal.map (Ideal.Quotient.mk (𝓂[K] ^ (n + 1))) (𝓂[K] ^ n)) from
117-
Finite.of_finite_quot_finite_ideal
118-
(I := Ideal.map (Ideal.Quotient.mk _) (𝓂[K] ^ n))
117+
.of_ideal_quotient (.map (Ideal.Quotient.mk _) (𝓂[K] ^ n))
119118
exact @Finite.of_equiv _ _ h
120119
((Ideal.quotEquivPowQuotPowSuccEquiv (IsPrincipalIdealRing.principal 𝓂[K])
121120
(IsDiscreteValuationRing.not_a_field _) n).trans

0 commit comments

Comments
 (0)