Skip to content

Commit c5f79a7

Browse files
committed
feat(RingTheory/FinitePresentation): a finite product of finitely presented algebras is finitely presented (leanprover-community#32758)
From Pi1.
1 parent fb469c7 commit c5f79a7

4 files changed

Lines changed: 45 additions & 3 deletions

File tree

Mathlib/Algebra/BigOperators/Pi.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,19 +197,19 @@ def Pi.monoidHomMulEquiv {ι : Type*} [Fintype ι] [DecidableEq ι] (M : ι →
197197

198198
end MulEquiv
199199

200-
variable [Finite ι] [DecidableEq ι] {M : Type*}
200+
variable [Finite ι] [DecidableEq ι] {M : ι → Type*}
201201

202202
-- manually additivized to fix variable names
203203
-- See https://github.com/leanprover-community/mathlib4/issues/11462
204-
lemma Pi.single_induction [AddCommMonoid M] (p : (ι → M) → Prop) (f : ι → M)
204+
lemma Pi.single_induction [∀ i, AddCommMonoid (M i)] (p : (Π i, M i) → Prop) (f : Π i, M i)
205205
(zero : p 0) (add : ∀ f g, p f → p g → p (f + g))
206206
(single : ∀ i m, p (Pi.single i m)) : p f := by
207207
cases nonempty_fintype ι
208208
rw [← Finset.univ_sum_single f]
209209
exact Finset.sum_induction _ _ add zero (by simp [single])
210210

211211
@[to_additive existing (attr := elab_as_elim)]
212-
lemma Pi.mulSingle_induction [CommMonoid M] (p : (ι → M) → Prop) (f : ι → M)
212+
lemma Pi.mulSingle_induction [∀ i, CommMonoid (M i)] (p : (Π i, M i) → Prop) (f : Π i, M i)
213213
(one : p 1) (mul : ∀ f g, p f → p g → p (f * g))
214214
(mulSingle : ∀ i m, p (Pi.mulSingle i m)) : p f := by
215215
cases nonempty_fintype ι

Mathlib/RingTheory/Ideal/Basic.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,17 @@ theorem prod_mem {ι : Type*} {f : ι → α} {s : Finset ι}
200200
rw [Finset.prod_eq_prod_diff_singleton_mul hi]
201201
exact Ideal.mul_mem_left _ _ hfi
202202

203+
lemma span_single_eq_top {ι : Type*} [DecidableEq ι] [Finite ι] (R : ι → Type*)
204+
[∀ i, Semiring (R i)] : Ideal.span (Set.range fun i ↦ (Pi.single i 1 : Π i, R i)) = ⊤ := by
205+
rw [_root_.eq_top_iff]
206+
rintro x -
207+
induction x using Pi.single_induction with
208+
| zero => simp
209+
| add f g hf hg => exact Ideal.add_mem _ hf hg
210+
| single i r =>
211+
rw [show Pi.single i r = Pi.single i r * Pi.single i 1 by simp [← Pi.single_mul_left]]
212+
exact Ideal.mul_mem_left _ _ (Ideal.subset_span ⟨i, rfl⟩)
213+
203214
end Ideal
204215

205216
end CommSemiring

Mathlib/RingTheory/Ideal/Maps.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,3 +1257,12 @@ instance {R S : Type*} [Semiring R] [Semiring S] (f : R →+* S) (I : Ideal R) [
12571257
Ideal.submodule_span_eq]⟩
12581258

12591259
end PrincipalIdeal
1260+
1261+
lemma RingHom.ker_evalRingHom {ι : Type*} [DecidableEq ι] (R : ι → Type*)
1262+
[∀ i, CommRing (R i)] (i : ι) :
1263+
RingHom.ker (Pi.evalRingHom R i) = Ideal.span {1 - Pi.single i 1} := by
1264+
refine le_antisymm (fun x hx ↦ ?_) (by simp [Ideal.span_le])
1265+
simp only [RingHom.mem_ker, Pi.evalRingHom_apply] at hx
1266+
rw [Ideal.mem_span_singleton]
1267+
use x + Pi.single i 1
1268+
simp [mul_add, sub_mul, one_mul, ← Pi.single_mul_left, hx]

Mathlib/RingTheory/RingHom/FinitePresentation.lean

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,28 @@ lemma of_span_eq_top_target (s : Set S) (hs : Ideal.span (s : Set S) = ⊤)
118118
apply h
119119
exact of_span_eq_top_target_aux f' hf' t ht Ht
120120

121+
/-- Finite-presentation can be checked on a standard covering of the target. -/
122+
lemma of_span_eq_top_target_of_isLocalizationAway {ι : Type*} (s : ι → S)
123+
(hs : Ideal.span (Set.range s) = ⊤) (T : ι → Type*) [∀ i, CommRing (T i)] [∀ i, Algebra R (T i)]
124+
[∀ i, Algebra S (T i)] [∀ i, IsScalarTower R S (T i)] [∀ i, IsLocalization.Away (s i) (T i)]
125+
[∀ i, Algebra.FinitePresentation R (T i)] :
126+
Algebra.FinitePresentation R S := by
127+
apply of_span_eq_top_target _ hs
128+
rintro - ⟨i, rfl⟩
129+
exact .equiv <| (IsLocalization.algEquiv (.powers <| s i) _ (T i)).symm |>.restrictScalars R
130+
131+
instance pi {ι : Type*} [Finite ι] (S : ι → Type*) [∀ i, CommRing (S i)] [∀ i, Algebra R (S i)]
132+
[∀ i, Algebra.FinitePresentation R (S i)] :
133+
Algebra.FinitePresentation R (∀ a, S a) := by
134+
classical
135+
let (i : ι) : Algebra (Π a, S a) (S i) := (Pi.evalAlgHom R S i).toAlgebra
136+
have (i : ι) : IsLocalization.Away (Pi.single i 1 : ∀ a, S a) (S i) := by
137+
refine IsLocalization.away_of_isIdempotentElem ?_ (RingHom.ker_evalRingHom _ _)
138+
((Pi.evalRingHom S i).surjective)
139+
simp [IsIdempotentElem, ← Pi.single_mul_left]
140+
exact Algebra.FinitePresentation.of_span_eq_top_target_of_isLocalizationAway
141+
_ (Ideal.span_single_eq_top S) (fun i ↦ S i)
142+
121143
end Algebra.FinitePresentation
122144

123145
namespace RingHom

0 commit comments

Comments
 (0)