Skip to content

Commit 840dee5

Browse files
feat(RingTheory/Finiteness): Improve fg_induction (#37484)
- include the FG-hypothesis into motive for `fg_induction`. This is necessary, since it might be that `P (M₁ ⊔ M₂)` is only provable from `P M₁`and `P M₂` if we can use that `M₁` and `M₂` are FG. Also, `M₁.FG` and `M₂.FG` are not provable from `(M₁ ⊔ M₂).FG` in general. This also enables the use of the `induction` tactic with `fg_induction`. - add `fg_sup_span_induction` that adds one 1-dimensional submodule at a time. - give expressive names to the induction start and induction step hypotheses. Co-authored-by: Martin Winter <martin.winter.math@gmail.com>
1 parent 8145118 commit 840dee5

4 files changed

Lines changed: 46 additions & 34 deletions

File tree

Mathlib/RingTheory/Bezout.lean

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ theorem iff_span_pair_isPrincipal :
3838
constructor
3939
apply Submodule.fg_induction
4040
· exact fun _ => ⟨⟨_, rfl⟩⟩
41-
· rintro _ _ ⟨⟨x, rfl⟩⟩ ⟨⟨y, rfl⟩⟩; rw [← Submodule.span_insert]; exact H _ _
41+
· rintro _ _ _ _ ⟨⟨x, rfl⟩⟩ ⟨⟨y, rfl⟩⟩
42+
rw [← Submodule.span_insert]
43+
exact H _ _
4244

4345
theorem _root_.Function.Surjective.isBezout {S : Type v} [CommRing S] (f : R →+* S)
4446
(hf : Function.Surjective f) [IsBezout R] : IsBezout S := by

Mathlib/RingTheory/Finiteness/Basic.lean

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -127,18 +127,29 @@ protected theorem fg_top (N : Submodule R M) : (⊤ : Submodule R N).FG ↔ N.FG
127127
theorem fg_of_linearEquiv (e : M ≃ₗ[R] P) (h : (⊤ : Submodule R P).FG) : (⊤ : Submodule R M).FG :=
128128
e.symm.range ▸ map_top (e.symm : P →ₗ[R] M) ▸ h.map _
129129

130-
theorem fg_induction (R M : Type*) [Semiring R] [AddCommMonoid M] [Module R M]
131-
(P : Submodule R M → Prop) (h₁ : ∀ x, P (Submodule.span R {x}))
132-
(h₂ : ∀ M₁ M₂, P M₁ → P M₂ → P (M₁ ⊔ M₂)) (N : Submodule R M) (hN : N.FG) : P N := by
133-
classical
134-
obtain ⟨s, rfl⟩ := hN
135-
induction s using Finset.induction with
136-
| empty =>
137-
rw [Finset.coe_empty, span_empty, ← span_zero_singleton]
138-
exact h₁ _
139-
| insert _ _ _ ih =>
140-
rw [Finset.coe_insert, span_insert]
141-
exact h₂ _ _ (h₁ _) ih
130+
theorem fg_induction {R M : Type*} [Semiring R] [AddCommMonoid M] [Module R M]
131+
{motive : ∀ N : Submodule R M, N.FG → Prop}
132+
(singleton : ∀ x : M, motive (R ∙ x) (fg_span_singleton _))
133+
(sup : ∀ (N₁ N₂ : Submodule R M) (hN₁ : N₁.FG) (hN₂ : N₂.FG),
134+
motive N₁ hN₁ → motive N₂ hN₂ → motive (N₁ ⊔ N₂) (hN₁.sup hN₂))
135+
(N : Submodule R M) (hN : N.FG) : motive N hN := by classical
136+
obtain ⟨s, rfl⟩ := hN
137+
induction s using Finset.induction with
138+
| empty => simpa using singleton 0
139+
| insert x s hxs ih =>
140+
simpa [span_insert, sup_comm] using
141+
sup (span R s) (R ∙ x) _ (fg_span_singleton _) ih (singleton x)
142+
143+
theorem fg_sup_span_induction {R M : Type*} [Semiring R] [AddCommMonoid M] [Module R M]
144+
{motive : ∀ N : Submodule R M, N.FG → Prop}
145+
(bot : motive ⊥ fg_bot)
146+
(sup : ∀ (N : Submodule R M) (x : M) (hN : N.FG),
147+
motive N hN → motive (N ⊔ (R ∙ x)) (hN.sup <| fg_span_singleton x))
148+
(N : Submodule R M) (hN : N.FG) : motive N hN := by classical
149+
obtain ⟨s, rfl⟩ := hN
150+
induction s using Finset.induction with
151+
| empty => simp [bot]
152+
| insert x s hxs ih => simpa [span_insert, sup_comm] using sup (span R s) x (by use s) ih
142153

143154
section RestrictScalars
144155

Mathlib/RingTheory/Finiteness/Ideal.lean

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,14 @@ theorem fg_ker_comp {R S A : Type*} [CommRing R] [CommRing S] [CommRing A] (f :
4949

5050
theorem exists_radical_pow_le_of_fg {R : Type*} [CommSemiring R] (I : Ideal R) (h : I.radical.FG) :
5151
∃ n : ℕ, I.radical ^ n ≤ I := by
52-
have := le_refl I.radical
53-
revert this
54-
refine Submodule.fg_induction _ _ (fun J => J ≤ I.radical → ∃ n : ℕ, J ^ n ≤ I) ?_ ?_ _ h
55-
· intro x hx
56-
obtain ⟨n, hn⟩ := hx (subset_span (Set.mem_singleton x))
52+
suffices hJ : ∀ J : Ideal R, J.FG → J ≤ I.radical → ∃ n : ℕ, J ^ n ≤ I by
53+
simpa using hJ I.radical h
54+
intro J hJ hJK
55+
induction J, hJ using Submodule.fg_induction with
56+
| singleton x =>
57+
obtain ⟨n, hn⟩ := hJK (subset_span (Set.mem_singleton x))
5758
exact ⟨n, by rwa [← span, span_singleton_pow, span_le, Set.singleton_subset_iff]⟩
58-
· intro J K hJ hK hJK
59+
| sup J K _ _ hJ hK =>
5960
obtain ⟨n, hn⟩ := hJ fun x hx => hJK <| mem_sup_left hx
6061
obtain ⟨m, hm⟩ := hK fun x hx => hJK <| mem_sup_right hx
6162
use n + m
@@ -74,15 +75,14 @@ theorem exists_pow_le_of_le_radical_of_fg_radical {R : Type*} [CommSemiring R] {
7475
lemma exists_pow_le_of_le_radical_of_fg {R : Type*} [CommSemiring R] {I J : Ideal R}
7576
(h' : I ≤ J.radical) (h : I.FG) :
7677
∃ n : ℕ, I ^ n ≤ J := by
77-
revert h'
78-
apply Submodule.fg_induction _ _ _ _ _ I h
79-
· intro x hJ
80-
simp only [submodule_span_eq, span_le, Set.singleton_subset_iff, SetLike.mem_coe] at hJ
81-
obtain ⟨n, hn⟩ := hJ
78+
induction I, h using Submodule.fg_induction with
79+
| singleton x =>
80+
simp only [submodule_span_eq, span_le, Set.singleton_subset_iff, SetLike.mem_coe] at h'
81+
obtain ⟨n, hn⟩ := h'
8282
refine ⟨n, by simpa [span_singleton_pow, span_le]⟩
83-
· intro I₁ I₂ h₁ h₂ hJ
84-
obtain ⟨n₁, hn₁⟩ := h₁ (le_sup_left.trans hJ)
85-
obtain ⟨n₂, hn₂⟩ := h₂ (le_sup_right.trans hJ)
83+
| sup I₁ I₂ _ _ h₁ h₂ =>
84+
obtain ⟨n₁, hn₁⟩ := h₁ (le_sup_left.trans h')
85+
obtain ⟨n₂, hn₂⟩ := h₂ (le_sup_right.trans h')
8686
use n₁ + n₂
8787
exact sup_pow_add_le_pow_sup_pow.trans (sup_le hn₁ hn₂)
8888

Mathlib/RingTheory/Flat/EquationalCriterion.lean

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,13 @@ private theorem exists_factorization_of_comp_eq_zero_of_free_aux [Flat R M] {K :
234234
x = y ∘ₗ a ∧ a ∘ₗ f = 0 := by
235235
have (K' : Submodule R K) (hK' : K'.FG) : ∃ (k : ℕ) (a : (Fin n →₀ R) →ₗ[R] (Fin k →₀ R))
236236
(y : (Fin k →₀ R) →ₗ[R] M), x = y ∘ₗ a ∧ K' ≤ LinearMap.ker (a ∘ₗ f) := by
237-
revert n
238-
apply Submodule.fg_induction (N := K') (hN := hK')
239-
· intro k n f x hfx
240-
have : x (f k) = 0 := by simpa using LinearMap.congr_fun hfx k
237+
induction K', hK' using Submodule.fg_induction generalizing n with
238+
| singleton k =>
239+
have : x (f k) = 0 := by simpa using LinearMap.congr_fun h k
241240
simpa using exists_factorization_of_apply_eq_zero_of_free this
242-
· intro K₁ K₂ ih₁ ih₂ n f x hfx
243-
obtain ⟨k₁, a₁, y₁, rfl, ha₁⟩ := ih₁ hfx
244-
have : y₁ ∘ₗ (a₁ ∘ₗ f) = 0 := by rw [← comp_assoc, hfx]
241+
| sup K₁ K₂ _ _ ih₁ ih₂ =>
242+
obtain ⟨k₁, a₁, y₁, rfl, ha₁⟩ := ih₁ h
243+
have : y₁ ∘ₗ (a₁ ∘ₗ f) = 0 := by rw [← comp_assoc, h]
245244
obtain ⟨k₂, a₂, y₂, rfl, ha₂⟩ := ih₂ this
246245
use k₂, a₂ ∘ₗ a₁, y₂
247246
simp_rw [comp_assoc]

0 commit comments

Comments
 (0)