Skip to content

Commit 3426e8e

Browse files
committed
chore(RingTheory): reorganize imports around locality properties of finiteness (leanprover-community#36044)
1 parent 89bf604 commit 3426e8e

8 files changed

Lines changed: 440 additions & 373 deletions

File tree

Mathlib.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6134,6 +6134,8 @@ public import Mathlib.RingTheory.Finiteness.Cardinality
61346134
public import Mathlib.RingTheory.Finiteness.Cofinite
61356135
public import Mathlib.RingTheory.Finiteness.Defs
61366136
public import Mathlib.RingTheory.Finiteness.Descent
6137+
public import Mathlib.RingTheory.Finiteness.FinitePresentationLocal
6138+
public import Mathlib.RingTheory.Finiteness.FiniteTypeLocal
61376139
public import Mathlib.RingTheory.Finiteness.Finsupp
61386140
public import Mathlib.RingTheory.Finiteness.Ideal
61396141
public import Mathlib.RingTheory.Finiteness.Lattice
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
/-
2+
Copyright (c) 2024 Christian Merten. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Christian Merten
5+
-/
6+
module
7+
8+
public import Mathlib.RingTheory.Finiteness.FiniteTypeLocal
9+
public import Mathlib.RingTheory.Localization.Away.AdjoinRoot
10+
11+
/-!
12+
13+
# `Algebra.FinitePresentation` is local
14+
15+
In this file we show that being a finitely presented algebra is local.
16+
17+
## Main results
18+
19+
- `Algebra.FinitePresentation.of_span_eq_top_target`: finite presentation is local on the
20+
(algebraic) target
21+
22+
-/
23+
24+
@[expose] public section
25+
26+
open scoped Pointwise TensorProduct
27+
28+
namespace Algebra.FinitePresentation
29+
30+
variable {R S : Type*} [CommRing R] [CommRing S] [Algebra R S]
31+
32+
/--
33+
If `S` is an `R`-algebra with a surjection from a finitely-presented `R`-algebra `A`, such that
34+
localized at a spanning set `{ r }` of elements of `A`, `Sᵣ` is finitely-presented, then
35+
`S` is finitely presented.
36+
This is almost `finitePresentation_ofLocalizationSpanTarget`. The difference is,
37+
that here the set `t` generates the unit ideal of `A`, while in the general version,
38+
it only generates a quotient of `A`.
39+
-/
40+
lemma of_span_eq_top_target_aux {A : Type*} [CommRing A] [Algebra R A]
41+
[Algebra.FinitePresentation R A] (f : A →ₐ[R] S) (hf : Function.Surjective f)
42+
(t : Finset A) (ht : Ideal.span (t : Set A) = ⊤)
43+
(H : ∀ g : t, Algebra.FinitePresentation R (Localization.Away (f g))) :
44+
Algebra.FinitePresentation R S := by
45+
apply Algebra.FinitePresentation.of_surjective hf
46+
apply RingHom.ker_fg_of_localizationSpan t ht
47+
intro g
48+
let f' : Localization.Away g.val →ₐ[R] Localization.Away (f g) :=
49+
Localization.awayMapₐ f g.val
50+
have (g : t) : Algebra.FinitePresentation R (Localization.Away g.val) :=
51+
haveI : Algebra.FinitePresentation A (Localization.Away g.val) :=
52+
IsLocalization.Away.finitePresentation g.val
53+
Algebra.FinitePresentation.trans R A (Localization.Away g.val)
54+
apply Algebra.FinitePresentation.ker_fG_of_surjective f'
55+
exact IsLocalization.Away.mapₐ_surjective_of_surjective _ hf
56+
57+
universe u
58+
59+
set_option backward.isDefEq.respectTransparency false in
60+
/-- Finite-presentation can be checked on a standard covering of the target. -/
61+
lemma of_span_eq_top_target (s : Set S) (hs : Ideal.span (s : Set S) = ⊤)
62+
(h : ∀ i ∈ s, Algebra.FinitePresentation R (Localization.Away i)) :
63+
Algebra.FinitePresentation R S := by
64+
obtain ⟨s, h₁, hs⟩ := (Ideal.span_eq_top_iff_finite s).mp hs
65+
replace h (i : s) : Algebra.FinitePresentation R (Localization.Away i.val) := h i (h₁ i.property)
66+
classical
67+
/-
68+
We already know that `S` is of finite type over `R`, so we have a surjection
69+
`MvPolynomial (Fin n) R →ₐ[R] S`. To reason about the kernel, we want to check it on the stalks
70+
of preimages of `s`. But the preimages do not necessarily span `MvPolynomial (Fin n) R`, so
71+
we quotient out by an ideal and apply `finitePresentation_ofLocalizationSpanTarget_aux`.
72+
-/
73+
have hfintype : Algebra.FiniteType R S := by
74+
apply Algebra.FiniteType.of_span_eq_top_target s hs
75+
intro x hx
76+
have := h ⟨x, hx⟩
77+
infer_instance
78+
obtain ⟨n, f, hf⟩ := Algebra.FiniteType.iff_quotient_mvPolynomial''.mp hfintype
79+
obtain ⟨l, hl⟩ := (Finsupp.mem_span_iff_linearCombination S (s : Set S) 1).mp
80+
(show (1 : S) ∈ Ideal.span (s : Set S) by rw [hs]; trivial)
81+
choose g' hg' using (fun g : s ↦ hf g)
82+
choose h' hh' using (fun g : s ↦ hf (l g))
83+
let I : Ideal (MvPolynomial (Fin n) R) := Ideal.span { ∑ g : s, g' g * h' g - 1 }
84+
let A := MvPolynomial (Fin n) R ⧸ I
85+
have hfI : ∀ a ∈ I, f a = 0 := by
86+
intro p hp
87+
simp only [Finset.univ_eq_attach, I, Ideal.mem_span_singleton] at hp
88+
obtain ⟨q, rfl⟩ := hp
89+
simp only [map_mul, map_sub, map_sum, map_one, hg', hh']
90+
rw [Finsupp.linearCombination_apply_of_mem_supported (α := (s : Set S)) S (s := s.attach)] at hl
91+
· rw [← hl]
92+
simp only [Finset.coe_sort_coe, smul_eq_mul, mul_comm, sub_self, zero_mul]
93+
· rintro a -
94+
simp
95+
let f' : A →ₐ[R] S := Ideal.Quotient.liftₐ I f hfI
96+
have hf' : Function.Surjective f' :=
97+
Ideal.Quotient.lift_surjective_of_surjective I hfI hf
98+
let t : Finset A := Finset.image (fun g ↦ g' g) Finset.univ
99+
have ht : Ideal.span (t : Set A) = ⊤ := by
100+
rw [Ideal.eq_top_iff_one]
101+
have : ∑ g : { x // x ∈ s }, g' g * h' g = (1 : A) := by
102+
apply eq_of_sub_eq_zero
103+
rw [← map_one (Ideal.Quotient.mk I), ← map_sub, Ideal.Quotient.eq_zero_iff_mem]
104+
apply Ideal.subset_span
105+
simp
106+
simp_rw [← this, Finset.univ_eq_attach, map_sum, map_mul]
107+
refine Ideal.sum_mem _ (fun g _ ↦ Ideal.mul_mem_right _ _ <| Ideal.subset_span ?_)
108+
simp [t]
109+
have : Algebra.FinitePresentation R A := by
110+
apply Algebra.FinitePresentation.quotient
111+
simp only [Finset.univ_eq_attach, I]
112+
exact ⟨{∑ g ∈ s.attach, g' g * h' g - 1}, by simp⟩
113+
have Ht (g : t) : Algebra.FinitePresentation R (Localization.Away (f' g)) := by
114+
have : ∃ (a : S) (hb : a ∈ s), (Ideal.Quotient.mk I) (g' ⟨a, hb⟩) = g.val := by
115+
obtain ⟨g, hg⟩ := g
116+
convert hg
117+
simp [A, t]
118+
obtain ⟨r, hr, hrr⟩ := this
119+
simp only [f']
120+
rw [← hrr, Ideal.Quotient.liftₐ_apply, Ideal.Quotient.lift_mk]
121+
simp_rw +instances [RingHom.coe_coe]
122+
rw [hg']
123+
apply h
124+
exact of_span_eq_top_target_aux f' hf' t ht Ht
125+
126+
/-- Finite-presentation can be checked on a standard covering of the target. -/
127+
lemma of_span_eq_top_target_of_isLocalizationAway {ι : Type*} (s : ι → S)
128+
(hs : Ideal.span (Set.range s) = ⊤) (T : ι → Type*) [∀ i, CommRing (T i)] [∀ i, Algebra R (T i)]
129+
[∀ i, Algebra S (T i)] [∀ i, IsScalarTower R S (T i)] [∀ i, IsLocalization.Away (s i) (T i)]
130+
[∀ i, Algebra.FinitePresentation R (T i)] :
131+
Algebra.FinitePresentation R S := by
132+
apply of_span_eq_top_target _ hs
133+
rintro - ⟨i, rfl⟩
134+
exact .equiv <| (IsLocalization.algEquiv (.powers <| s i) _ (T i)).symm |>.restrictScalars R
135+
136+
instance pi {ι : Type*} [Finite ι] (S : ι → Type*) [∀ i, CommRing (S i)] [∀ i, Algebra R (S i)]
137+
[∀ i, Algebra.FinitePresentation R (S i)] :
138+
Algebra.FinitePresentation R (∀ a, S a) := by
139+
classical
140+
let (i : ι) : Algebra (Π a, S a) (S i) := (Pi.evalAlgHom R S i).toAlgebra
141+
have (i : ι) : IsLocalization.Away (Pi.single i 1 : ∀ a, S a) (S i) := by
142+
refine IsLocalization.away_of_isIdempotentElem ?_ (RingHom.ker_evalRingHom _ _)
143+
((Pi.evalRingHom S i).surjective)
144+
simp [IsIdempotentElem, ← Pi.single_mul_left]
145+
exact Algebra.FinitePresentation.of_span_eq_top_target_of_isLocalizationAway
146+
_ (Ideal.span_single_eq_top S) (fun i ↦ S i)
147+
148+
end Algebra.FinitePresentation
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
/-
2+
Copyright (c) 2021 Andrew Yang. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Andrew Yang
5+
-/
6+
module
7+
8+
public import Mathlib.RingTheory.FiniteType
9+
public import Mathlib.RingTheory.Localization.Finiteness
10+
public import Mathlib.RingTheory.Localization.BaseChange
11+
12+
/-!
13+
14+
# Locality of `Algebra.FiniteType`
15+
16+
In this file we show that finite-type is local on the source and the target.
17+
18+
## Main results
19+
20+
- `Algebra.FiniteType.of_span_eq_top_source`: finite-type is local on the (algebraic) source
21+
- `Algebra.FiniteType.of_span_eq_top_target`: finite-type is local on the (algebraic) target
22+
23+
-/
24+
25+
public section
26+
27+
section Algebra
28+
29+
open scoped Pointwise TensorProduct
30+
31+
variable {R S : Type*} [CommRing R] [CommRing S] [Algebra R S] (M : Submonoid R)
32+
variable (R' S' : Type*) [CommRing R'] [CommRing S']
33+
variable [Algebra R R'] [Algebra S S']
34+
35+
variable {S'} in
36+
open scoped Classical in
37+
/-- Let `S` be an `R`-algebra, `M` a submonoid of `S`, `S' = M⁻¹S`.
38+
Suppose the image of some `x : S` falls in the adjoin of some finite `s ⊆ S'` over `R`,
39+
and `A` is an `R`-subalgebra of `S` containing both `M` and the numerators of `s`.
40+
Then, there exists some `m : M` such that `m • x` falls in `A`.
41+
-/
42+
theorem IsLocalization.exists_smul_mem_of_mem_adjoin [Algebra R S']
43+
[IsScalarTower R S S'] (M : Submonoid S) [IsLocalization M S'] (x : S) (s : Finset S')
44+
(A : Subalgebra R S) (hA₁ : (IsLocalization.finsetIntegerMultiple M s : Set S) ⊆ A)
45+
(hA₂ : M ≤ A.toSubmonoid) (hx : algebraMap S S' x ∈ Algebra.adjoin R (s : Set S')) :
46+
∃ m : M, m • x ∈ A := by
47+
let g : S →ₐ[R] S' := IsScalarTower.toAlgHom R S S'
48+
let y := IsLocalization.commonDenomOfFinset M s
49+
have hx₁ : (y : S) • (s : Set S') = g '' _ :=
50+
(IsLocalization.finsetIntegerMultiple_image _ s).symm
51+
obtain ⟨n, hn⟩ :=
52+
Algebra.pow_smul_mem_of_smul_subset_of_mem_adjoin (y : S) (s : Set S') (A.map g)
53+
(by rw [hx₁]; exact Set.image_mono hA₁) hx (Set.mem_image_of_mem _ (hA₂ y.2))
54+
obtain ⟨x', hx', hx''⟩ := hn n (le_of_eq rfl)
55+
rw [Algebra.smul_def, ← map_mul] at hx''
56+
obtain ⟨a, ha₂⟩ := (IsLocalization.eq_iff_exists M S').mp hx''
57+
use a * y ^ n
58+
convert A.mul_mem hx' (hA₂ a.prop) using 1
59+
rw [Submonoid.smul_def, smul_eq_mul, Submonoid.coe_mul, SubmonoidClass.coe_pow, mul_assoc, ← ha₂,
60+
mul_comm]
61+
62+
variable {S'} in
63+
open scoped Classical in
64+
/-- Let `S` be an `R`-algebra, `M` a submonoid of `R`, and `S' = M⁻¹S`.
65+
If the image of some `x : S` falls in the adjoin of some finite `s ⊆ S'` over `R`,
66+
then there exists some `m : M` such that `m • x` falls in the
67+
adjoin of `IsLocalization.finsetIntegerMultiple _ s` over `R`.
68+
-/
69+
theorem IsLocalization.lift_mem_adjoin_finsetIntegerMultiple [Algebra R S']
70+
[IsScalarTower R S S'] [IsLocalization (M.map (algebraMap R S)) S'] (x : S) (s : Finset S')
71+
(hx : algebraMap S S' x ∈ Algebra.adjoin R (s : Set S')) :
72+
∃ m : M, m • x ∈
73+
Algebra.adjoin R
74+
(IsLocalization.finsetIntegerMultiple (M.map (algebraMap R S)) s : Set S) := by
75+
obtain ⟨⟨_, a, ha, rfl⟩, e⟩ :=
76+
IsLocalization.exists_smul_mem_of_mem_adjoin (M.map (algebraMap R S)) x s (Algebra.adjoin R _)
77+
Algebra.subset_adjoin (by rintro _ ⟨a, _, rfl⟩; exact Subalgebra.algebraMap_mem _ a) hx
78+
refine ⟨⟨a, ha⟩, ?_⟩
79+
simpa only [Submonoid.smul_def, algebraMap_smul] using e
80+
81+
/-- Finite-type can be checked on a standard covering of the target. -/
82+
lemma Algebra.FiniteType.of_span_eq_top_target (s : Set S) (hs : Ideal.span (s : Set S) = ⊤)
83+
(h : ∀ x ∈ s, Algebra.FiniteType R (Localization.Away x)) :
84+
Algebra.FiniteType R S := by
85+
obtain ⟨s, h₁, hs⟩ := (Ideal.span_eq_top_iff_finite s).mp hs
86+
replace h (i : s) : Algebra.FiniteType R (Localization.Away i.val) := h i (h₁ i.property)
87+
classical
88+
-- Suppose `s : Finset S` spans `S`, and each `Sᵣ` is finitely generated as an `R`-algebra.
89+
-- Say `t r : Finset Sᵣ` generates `Sᵣ`. By assumption, we may find `lᵢ` such that
90+
-- `∑ lᵢ * sᵢ = 1`. I claim that all `s` and `l` and the numerators of `t` and generates `S`.
91+
replace h := fun r => (h r).1
92+
choose t ht using h
93+
obtain ⟨l, hl⟩ :=
94+
(Finsupp.mem_span_iff_linearCombination S (s : Set S) 1).mp
95+
(show (1 : S) ∈ Ideal.span (s : Set S) by rw [hs]; trivial)
96+
let sf := fun x : s => IsLocalization.finsetIntegerMultiple (Submonoid.powers (x : S)) (t x)
97+
use s.attach.biUnion sf ∪ s ∪ l.support.image l
98+
rw [_root_.eq_top_iff]
99+
-- We need to show that every `x` falls in the subalgebra generated by those elements.
100+
-- Since all `s` and `l` are in the subalgebra, it suffices to check that `sᵢ ^ nᵢ • x` falls in
101+
-- the algebra for each `sᵢ` and some `nᵢ`.
102+
rintro x -
103+
apply Subalgebra.mem_of_span_eq_top_of_smul_pow_mem _ (s : Set S) l hl _ _ x _
104+
· intro x hx
105+
apply Algebra.subset_adjoin
106+
rw [Finset.coe_union, Finset.coe_union]
107+
exact Or.inl (Or.inr hx)
108+
· intro i
109+
by_cases h : l i = 0; · rw [h]; exact zero_mem _
110+
apply Algebra.subset_adjoin
111+
rw [Finset.coe_union, Finset.coe_image]
112+
exact Or.inr (Set.mem_image_of_mem _ (Finsupp.mem_support_iff.mpr h))
113+
· intro r
114+
rw [Finset.coe_union, Finset.coe_union, Finset.coe_biUnion]
115+
-- Since all `sᵢ` and numerators of `t r` are in the algebra, it suffices to show that the
116+
-- image of `x` in `Sᵣ` falls in the `R`-adjoin of `t r`, which is of course true.
117+
-- Porting note: The following `obtain` fails because Lean wants to know right away what the
118+
-- placeholders are, so we need to provide a little more guidance
119+
-- obtain ⟨⟨_, n₂, rfl⟩, hn₂⟩ := IsLocalization.exists_smul_mem_of_mem_adjoin
120+
-- (Submonoid.powers (r : S)) x (t r) (Algebra.adjoin R _) _ _ _
121+
rw [show ∀ A : Set S, (∃ n, (r : S) ^ n • x ∈ Algebra.adjoin R A) ↔
122+
(∃ m : (Submonoid.powers (r : S)), (m : S) • x ∈ Algebra.adjoin R A) by
123+
{ exact fun _ => by simp [Submonoid.mem_powers_iff] }]
124+
refine IsLocalization.exists_smul_mem_of_mem_adjoin
125+
(Submonoid.powers (r : S)) x (t r) (Algebra.adjoin R _) ?_ ?_ ?_
126+
· intro x hx
127+
apply Algebra.subset_adjoin
128+
exact Or.inl (Or.inl ⟨_, ⟨r, rfl⟩, _, ⟨s.mem_attach r, rfl⟩, hx⟩)
129+
· rw [Submonoid.powers_eq_closure, Submonoid.closure_le, Set.singleton_subset_iff]
130+
apply Algebra.subset_adjoin
131+
exact Or.inl (Or.inr r.2)
132+
· rw [ht]; trivial
133+
134+
attribute [local instance] Algebra.TensorProduct.rightAlgebra in
135+
lemma Algebra.FiniteType.of_span_eq_top_source (s : Set R) (hs : Ideal.span (s : Set R) = ⊤)
136+
(h : ∀ i ∈ s, Algebra.FiniteType (Localization.Away i) (Localization.Away i ⊗[R] S)) :
137+
Algebra.FiniteType R S := by
138+
obtain ⟨s, h₁, hs⟩ := (Ideal.span_eq_top_iff_finite s).mp hs
139+
replace h (i : s) := h i.val (h₁ i.property)
140+
classical
141+
letI := fun r : s => (Localization.awayMap (algebraMap R S) r).toAlgebra
142+
set f := algebraMap R S
143+
constructor
144+
replace H := fun r => (h r).1
145+
choose s₁ s₂ using H
146+
let sf := fun x : s => IsLocalization.finsetIntegerMultiple (Submonoid.powers (f x)) (s₁ x)
147+
use s.attach.biUnion sf
148+
convert (Algebra.adjoin_attach_biUnion (R := R) sf).trans _
149+
rw [eq_top_iff]
150+
rintro x -
151+
apply (⨆ x : s, Algebra.adjoin R (sf x : Set S)).toSubmodule.mem_of_span_eq_top_of_smul_pow_mem
152+
_ hs _ _
153+
intro r
154+
obtain ⟨⟨_, n₁, rfl⟩, hn₁⟩ :=
155+
multiple_mem_adjoin_of_mem_localization_adjoin (Submonoid.powers (r : R))
156+
(Localization.Away (r : R)) (s₁ r : Set (Localization.Away r.val ⊗[R] S))
157+
(algebraMap S _ x) (by rw [s₂ r]; trivial)
158+
rw [Submonoid.smul_def, Algebra.smul_def, IsScalarTower.algebraMap_apply R S, ← map_mul] at hn₁
159+
obtain ⟨⟨_, n₂, rfl⟩, hn₂⟩ :=
160+
IsLocalization.lift_mem_adjoin_finsetIntegerMultiple (Submonoid.powers (r : R)) _ (s₁ r) hn₁
161+
rw [Submonoid.smul_def, ← Algebra.smul_def, smul_smul, ← pow_add] at hn₂
162+
simp_rw [Submonoid.map_powers] at hn₂
163+
use n₂ + n₁
164+
exact le_iSup (fun x : s => Algebra.adjoin R (sf x : Set S)) r hn₂
165+
166+
end Algebra

0 commit comments

Comments
 (0)