Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 41e152f

Browse files
committed
fix(algebra/algebra/tower): remove subalgebra.res which duplicates subalgebra.restrict_scalars (#9251)
We use the name `restrict_scalars` everywhere else, so I kept that one instead of `res`. `res` was here first, but the duplicate was added by #7949 presumably because the `res` name wasn't discoverable.
1 parent 5e58247 commit 41e152f

File tree

4 files changed

+35
-36
lines changed

4 files changed

+35
-36
lines changed

src/algebra/algebra/tower.lean

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,6 @@ variables (R) {A S B}
158158

159159
open is_scalar_tower
160160

161-
/-- Given a scalar tower `R`, `S`, `A` of algebras, reinterpret an `S`-subalgebra of `A` an as an
162-
`R`-subalgebra. -/
163-
def subalgebra.restrict_scalars (iSB : subalgebra S A) :
164-
subalgebra R A :=
165-
{ one_mem' := iSB.one_mem,
166-
mul_mem' := λ _ _, iSB.mul_mem,
167-
algebra_map_mem' := λ r, begin
168-
rw is_scalar_tower.algebra_map_eq R S,
169-
exact iSB.algebra_map_mem' _,
170-
end,
171-
.. iSB.to_submodule.restrict_scalars R }
172-
173161
namespace alg_hom
174162

175163
/-- R ⟶ S induces S-Alg ⥤ R-Alg -/
@@ -221,19 +209,25 @@ section semiring
221209
variables (R) {S A} [comm_semiring R] [comm_semiring S] [semiring A]
222210
variables [algebra R S] [algebra S A] [algebra R A] [is_scalar_tower R S A]
223211

224-
/-- If A/S/R is a tower of algebras then the `res`triction of a S-subalgebra of A is
225-
an R-subalgebra of A. -/
226-
def res (U : subalgebra S A) : subalgebra R A :=
212+
/-- Given a scalar tower `R`, `S`, `A` of algebras, reinterpret an `S`-subalgebra of `A` an as an
213+
`R`-subalgebra. -/
214+
def restrict_scalars (U : subalgebra S A) : subalgebra R A :=
227215
{ algebra_map_mem' := λ x, by { rw algebra_map_apply R S A, exact U.algebra_map_mem _ },
228216
.. U }
229217

230-
@[simp] lemma res_top : res R (⊤ : subalgebra S A) = ⊤ :=
231-
algebra.eq_top_iff.2 $ λ _, show _ ∈ (⊤ : subalgebra S A), from algebra.mem_top
218+
@[simp] lemma restrict_scalars_top : restrict_scalars R (⊤ : subalgebra S A) = ⊤ :=
219+
set_like.coe_injective rfl
220+
221+
@[simp] lemma restrict_scalars_to_submodule {U : subalgebra S A} :
222+
(U.restrict_scalars R).to_submodule = U.to_submodule.restrict_scalars R :=
223+
set_like.coe_injective rfl
232224

233-
@[simp] lemma mem_res {U : subalgebra S A} {x : A} : x ∈ res R U ↔ x ∈ U := iff.rfl
225+
@[simp] lemma mem_restrict_scalars {U : subalgebra S A} {x : A} :
226+
x ∈ restrict_scalars R U ↔ x ∈ U := iff.rfl
234227

235-
lemma res_inj {U V : subalgebra S A} (H : res R U = res R V) : U = V :=
236-
ext $ λ x, by rw [← mem_res R, H, mem_res]
228+
lemma restrict_scalars_injective :
229+
function.injective (restrict_scalars R : subalgebra S A → subalgebra R A) :=
230+
λ U V H, ext $ λ x, by rw [← mem_restrict_scalars R, H, mem_restrict_scalars]
237231

238232
/-- Produces a map from `subalgebra.under`. -/
239233
def of_under {R A B : Type*} [comm_semiring R] [comm_semiring A] [semiring B]
@@ -254,7 +248,7 @@ variables [comm_semiring R] [comm_semiring S] [comm_semiring A]
254248
variables [algebra R S] [algebra S A] [algebra R A] [is_scalar_tower R S A]
255249

256250
theorem range_under_adjoin (t : set A) :
257-
(to_alg_hom R S A).range.under (algebra.adjoin _ t) = res R (algebra.adjoin S t) :=
251+
(to_alg_hom R S A).range.under (algebra.adjoin _ t) = (algebra.adjoin S t).restrict_scalars R :=
258252
subalgebra.ext $ λ z,
259253
show z ∈ subsemiring.closure (set.range (algebra_map (to_alg_hom R S A).range A) ∪ t : set A) ↔
260254
z ∈ subsemiring.closure (set.range (algebra_map S A) ∪ t : set A),

src/field_theory/normal.lean

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,11 @@ begin
177177
←aeval_def, minpoly.aeval F z, ring_hom.map_zero] } },
178178
rw [←intermediate_field.to_subalgebra_le_to_subalgebra, intermediate_field.top_to_subalgebra],
179179
apply ge_trans (intermediate_field.algebra_adjoin_le_adjoin C S),
180-
suffices : (algebra.adjoin C S).res F = (algebra.adjoin E {adjoin_root.root q}).res F,
181-
{ rw [adjoin_root.adjoin_root_eq_top, subalgebra.res_top, ←@subalgebra.res_top F C] at this,
182-
exact top_le_iff.mpr (subalgebra.res_inj F this) },
180+
suffices : (algebra.adjoin C S).restrict_scalars F
181+
= (algebra.adjoin E {adjoin_root.root q}).restrict_scalars F,
182+
{ rw [adjoin_root.adjoin_root_eq_top, subalgebra.restrict_scalars_top,
183+
←@subalgebra.restrict_scalars_top F C] at this,
184+
exact top_le_iff.mpr (subalgebra.restrict_scalars_injective F this) },
183185
dsimp only [S],
184186
rw [←finset.image_to_finset, finset.coe_image],
185187
apply eq.trans (algebra.adjoin_res_eq_adjoin_res F E C D

src/field_theory/splitting_field.lean

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ rw [roots_mul hmf0, map_sub, map_X, map_C, roots_X_sub_C, multiset.to_finset_add
655655
adjoin_root.adjoin_root_eq_top, algebra.map_top,
656656
is_scalar_tower.range_under_adjoin K (adjoin_root f.factor)
657657
(splitting_field_aux n f.remove_factor (nat_degree_remove_factor' hfn)),
658-
ih, subalgebra.res_top] }
658+
ih, subalgebra.restrict_scalars_top] }
659659

660660
end splitting_field_aux
661661

@@ -715,7 +715,8 @@ variables {K}
715715
instance map (f : polynomial F) [is_splitting_field F L f] :
716716
is_splitting_field K L (f.map $ algebra_map F K) :=
717717
by { rw [splits_map_iff, ← is_scalar_tower.algebra_map_eq], exact splits L f },
718-
subalgebra.res_inj F $ by { rw [map_map, ← is_scalar_tower.algebra_map_eq, subalgebra.res_top,
718+
subalgebra.restrict_scalars_injective F $
719+
by { rw [map_map, ← is_scalar_tower.algebra_map_eq, subalgebra.restrict_scalars_top,
719720
eq_top_iff, ← adjoin_roots L f, algebra.adjoin_le_iff],
720721
exact λ x hx, @algebra.subset_adjoin K _ _ _ _ _ _ hx }⟩
721722

@@ -742,7 +743,7 @@ theorem mul (f g : polynomial F) (hf : f ≠ 0) (hg : g ≠ 0) [is_splitting_fie
742743
roots_map (algebra_map K L) ((splits_id_iff_splits $ algebra_map F K).2 $ splits K f),
743744
multiset.to_finset_map, finset.coe_image, algebra.adjoin_algebra_map, adjoin_roots,
744745
algebra.map_top, is_scalar_tower.range_under_adjoin, ← map_map, adjoin_roots,
745-
subalgebra.res_top]⟩
746+
subalgebra.restrict_scalars_top]⟩
746747

747748
end scalar_tower
748749

src/ring_theory/algebra_tower.lean

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,11 @@ theorem adjoin_algebra_map (R : Type u) (S : Type v) (A : Type w)
8181
le_antisymm (adjoin_le $ set.image_subset_iff.2 $ λ y hy, ⟨y, subset_adjoin hy, rfl⟩)
8282
(subalgebra.map_le.2 $ adjoin_le $ λ y hy, subset_adjoin ⟨y, hy, rfl⟩)
8383

84-
lemma adjoin_res (C D E : Type*) [comm_semiring C] [comm_semiring D] [comm_semiring E]
84+
lemma adjoin_restrict_scalars (C D E : Type*) [comm_semiring C] [comm_semiring D] [comm_semiring E]
8585
[algebra C D] [algebra C E] [algebra D E] [is_scalar_tower C D E] (S : set E) :
86-
(algebra.adjoin D S).res C = ((⊤ : subalgebra C D).map (is_scalar_tower.to_alg_hom C D E)).under
87-
(algebra.adjoin ((⊤ : subalgebra C D).map (is_scalar_tower.to_alg_hom C D E)) S) :=
86+
(algebra.adjoin D S).restrict_scalars C =
87+
((⊤ : subalgebra C D).map (is_scalar_tower.to_alg_hom C D E)).under
88+
(algebra.adjoin ((⊤ : subalgebra C D).map (is_scalar_tower.to_alg_hom C D E)) S) :=
8889
begin
8990
suffices : set.range (algebra_map D E) =
9091
set.range (algebra_map ((⊤ : subalgebra C D).map (is_scalar_tower.to_alg_hom C D E)) E),
@@ -101,11 +102,12 @@ lemma adjoin_res_eq_adjoin_res (C D E F : Type*) [comm_semiring C] [comm_semirin
101102
[comm_semiring E] [comm_semiring F] [algebra C D] [algebra C E] [algebra C F] [algebra D F]
102103
[algebra E F] [is_scalar_tower C D F] [is_scalar_tower C E F] {S : set D} {T : set E}
103104
(hS : algebra.adjoin C S = ⊤) (hT : algebra.adjoin C T = ⊤) :
104-
(algebra.adjoin E (algebra_map D F '' S)).res C =
105-
(algebra.adjoin D (algebra_map E F '' T)).res C :=
106-
by { rw [adjoin_res, adjoin_res, ←hS, ←hT, ←algebra.adjoin_image, ←algebra.adjoin_image,
107-
←alg_hom.coe_to_ring_hom, ←alg_hom.coe_to_ring_hom, is_scalar_tower.coe_to_alg_hom,
108-
is_scalar_tower.coe_to_alg_hom, ←adjoin_union_eq_under, ←adjoin_union_eq_under, set.union_comm] }
105+
(algebra.adjoin E (algebra_map D F '' S)).restrict_scalars C =
106+
(algebra.adjoin D (algebra_map E F '' T)).restrict_scalars C :=
107+
by rw [adjoin_restrict_scalars, adjoin_restrict_scalars, ←hS, ←hT, ←algebra.adjoin_image,
108+
←algebra.adjoin_image, ←alg_hom.coe_to_ring_hom, ←alg_hom.coe_to_ring_hom,
109+
is_scalar_tower.coe_to_alg_hom, is_scalar_tower.coe_to_alg_hom, ←adjoin_union_eq_under,
110+
←adjoin_union_eq_under, set.union_comm]
109111

110112
end algebra
111113

@@ -118,7 +120,7 @@ lemma algebra.fg_trans' {R S A : Type*} [comm_ring R] [comm_ring S] [comm_ring A
118120
let ⟨s, hs⟩ := hRS, ⟨t, ht⟩ := hSA in ⟨s.image (algebra_map S A) ∪ t,
119121
by rw [finset.coe_union, finset.coe_image, algebra.adjoin_union_eq_under,
120122
algebra.adjoin_algebra_map, hs, algebra.map_top, is_scalar_tower.range_under_adjoin, ht,
121-
subalgebra.res_top]⟩
123+
subalgebra.restrict_scalars_top]⟩
122124
end
123125

124126
section algebra_map_coeffs

0 commit comments

Comments
 (0)