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

Commit b04aeb5

Browse files
committed
chore(algebra): move lemmas from ring_theory.algebra_tower to algebra.algebra.tower (#5506)
Moved some basic lemmas from `ring_theory.algebra_tower` to `algebra.algebra.tower`.
1 parent a40f31f commit b04aeb5

File tree

2 files changed

+280
-205
lines changed

2 files changed

+280
-205
lines changed

src/algebra/algebra/tower.lean

Lines changed: 277 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,277 @@
1+
/-
2+
Copyright (c) 2020 Kenny Lau. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Kenny Lau
5+
-/
6+
7+
import algebra.algebra.subalgebra
8+
9+
/-!
10+
# Towers of algebras
11+
12+
In this file we prove basic facts about towers of algebra.
13+
14+
An algebra tower A/S/R is expressed by having instances of `algebra A S`,
15+
`algebra R S`, `algebra R A` and `is_scalar_tower R S A`, the later asserting the
16+
compatibility condition `(r • s) • a = r • (s • a)`.
17+
18+
An important definition is `to_alg_hom R S A`, the canonical `R`-algebra homomorphism `S →ₐ[R] A`.
19+
20+
-/
21+
22+
universes u v w u₁ v₁
23+
24+
variables (R : Type u) (S : Type v) (A : Type w) (B : Type u₁) (M : Type v₁)
25+
26+
namespace algebra
27+
28+
variables [comm_semiring R] [semiring A] [algebra R A]
29+
variables [add_comm_monoid M] [semimodule R M] [semimodule A M] [is_scalar_tower R A M]
30+
31+
variables {A}
32+
33+
/-- The `R`-algebra morphism `A → End (M)` corresponding to the representation of the algebra `A`
34+
on the `R`-module `M`. -/
35+
def lsmul : A →ₐ[R] module.End R M :=
36+
{ map_one' := by { ext m, exact one_smul A m },
37+
map_mul' := by { intros a b, ext c, exact smul_assoc a b c },
38+
map_zero' := by { ext m, exact zero_smul A m },
39+
commutes' := by { intro r, ext m, exact algebra_map_smul A r m },
40+
.. (show A →ₗ[R] M →ₗ[R] M, from linear_map.mk₂ R (•)
41+
(λ x y z, add_smul x y z)
42+
(λ c x y, smul_assoc c x y)
43+
(λ x y z, smul_add x y z)
44+
(λ c x y, smul_algebra_smul_comm c x y)) }
45+
46+
@[simp] lemma lsmul_coe (a : A) : (lsmul R M a : M → M) = (•) a := rfl
47+
48+
end algebra
49+
50+
namespace is_scalar_tower
51+
52+
section semimodule
53+
54+
variables [comm_semiring R] [semiring A] [algebra R A]
55+
variables [add_comm_monoid M] [semimodule R M] [semimodule A M] [is_scalar_tower R A M]
56+
57+
variables {R} (A) {M}
58+
theorem algebra_map_smul (r : R) (x : M) : algebra_map R A r • x = r • x :=
59+
by rw [algebra.algebra_map_eq_smul_one, smul_assoc, one_smul]
60+
61+
end semimodule
62+
63+
section semiring
64+
variables [comm_semiring R] [comm_semiring S] [semiring A] [semiring B]
65+
variables [algebra R S] [algebra S A] [algebra S B]
66+
67+
variables {R S A}
68+
theorem of_algebra_map_eq [algebra R A]
69+
(h : ∀ x, algebra_map R A x = algebra_map S A (algebra_map R S x)) :
70+
is_scalar_tower R S A :=
71+
⟨λ x y z, by simp_rw [algebra.smul_def, ring_hom.map_mul, mul_assoc, h]⟩
72+
73+
/-- See note [partially-applied ext lemmas]. -/
74+
theorem of_algebra_map_eq' [algebra R A]
75+
(h : algebra_map R A = (algebra_map S A).comp (algebra_map R S)) :
76+
is_scalar_tower R S A :=
77+
of_algebra_map_eq $ ring_hom.ext_iff.1 h
78+
79+
variables (R S A)
80+
81+
instance subalgebra (S₀ : subalgebra R S) : is_scalar_tower S₀ S A :=
82+
of_algebra_map_eq $ λ x, rfl
83+
84+
variables [algebra R A] [algebra R B]
85+
variables [is_scalar_tower R S A] [is_scalar_tower R S B]
86+
87+
theorem algebra_map_eq :
88+
algebra_map R A = (algebra_map S A).comp (algebra_map R S) :=
89+
ring_hom.ext $ λ x, by simp_rw [ring_hom.comp_apply, algebra.algebra_map_eq_smul_one,
90+
smul_assoc, one_smul]
91+
92+
theorem algebra_map_apply (x : R) : algebra_map R A x = algebra_map S A (algebra_map R S x) :=
93+
by rw [algebra_map_eq R S A, ring_hom.comp_apply]
94+
95+
instance subalgebra' (S₀ : subalgebra R S) : is_scalar_tower R S₀ A :=
96+
@is_scalar_tower.of_algebra_map_eq R S₀ A _ _ _ _ _ _ $ λ _,
97+
(is_scalar_tower.algebra_map_apply R S A _ : _)
98+
99+
@[ext] lemma algebra.ext {S : Type u} {A : Type v} [comm_semiring S] [semiring A]
100+
(h1 h2 : algebra S A) (h : ∀ {r : S} {x : A}, (by haveI := h1; exact r • x) = r • x) : h1 = h2 :=
101+
begin
102+
unfreezingI { cases h1 with f1 g1 h11 h12, cases h2 with f2 g2 h21 h22,
103+
cases f1, cases f2, congr', { ext r x, exact h },
104+
ext r, erw [← mul_one (g1 r), ← h12, ← mul_one (g2 r), ← h22, h], refl }
105+
end
106+
107+
variables (R S A)
108+
theorem algebra_comap_eq : algebra.comap.algebra R S A = ‹_› :=
109+
algebra.ext _ _ $ λ x (z : A),
110+
calc algebra_map R S x • z
111+
= (x • 1 : S) • z : by rw algebra.algebra_map_eq_smul_one
112+
... = x • (1 : S) • z : by rw smul_assoc
113+
... = (by exact x • z : A) : by rw one_smul
114+
115+
/-- In a tower, the canonical map from the middle element to the top element is an
116+
algebra homomorphism over the bottom element. -/
117+
def to_alg_hom : S →ₐ[R] A :=
118+
{ commutes' := λ _, (algebra_map_apply _ _ _ _).symm,
119+
.. algebra_map S A }
120+
121+
lemma to_alg_hom_apply (y : S) : to_alg_hom R S A y = algebra_map S A y := rfl
122+
123+
@[simp] lemma coe_to_alg_hom : ↑(to_alg_hom R S A) = algebra_map S A :=
124+
ring_hom.ext $ λ _, rfl
125+
126+
@[simp] lemma coe_to_alg_hom' : (to_alg_hom R S A : S → A) = algebra_map S A :=
127+
rfl
128+
129+
variables (R) {S A B}
130+
/-- R ⟶ S induces S-Alg ⥤ R-Alg -/
131+
def restrict_base (f : A →ₐ[S] B) : A →ₐ[R] B :=
132+
{ commutes' := λ r, by { rw [algebra_map_apply R S A, algebra_map_apply R S B],
133+
exact f.commutes (algebra_map R S r) },
134+
.. (f : A →+* B) }
135+
136+
lemma restrict_base_apply (f : A →ₐ[S] B) (x : A) : restrict_base R f x = f x := rfl
137+
138+
@[simp] lemma coe_restrict_base (f : A →ₐ[S] B) : (restrict_base R f : A →+* B) = f := rfl
139+
140+
@[simp] lemma coe_restrict_base' (f : A →ₐ[S] B) : (restrict_base R f : A → B) = f := rfl
141+
142+
instance right : is_scalar_tower S A A :=
143+
⟨λ x y z, by rw [smul_eq_mul, smul_eq_mul, algebra.smul_mul_assoc]⟩
144+
145+
instance comap {R S A : Type*} [comm_semiring R] [comm_semiring S] [semiring A]
146+
[algebra R S] [algebra S A] : is_scalar_tower R S (algebra.comap R S A) :=
147+
of_algebra_map_eq $ λ x, rfl
148+
149+
-- conflicts with is_scalar_tower.subalgebra
150+
@[priority 999] instance subsemiring (U : subsemiring S) : is_scalar_tower U S A :=
151+
of_algebra_map_eq $ λ x, rfl
152+
153+
section
154+
local attribute [instance] algebra.of_is_subring subset.comm_ring
155+
-- conflicts with is_scalar_tower.subalgebra
156+
@[priority 999] instance subring {S A : Type*} [comm_ring S] [ring A] [algebra S A]
157+
(U : set S) [is_subring U] : is_scalar_tower U S A :=
158+
of_algebra_map_eq $ λ x, rfl
159+
end
160+
161+
@[nolint instance_priority]
162+
instance of_ring_hom {R A B : Type*} [comm_semiring R] [comm_semiring A] [comm_semiring B]
163+
[algebra R A] [algebra R B] (f : A →ₐ[R] B) :
164+
@is_scalar_tower R A B _ (f.to_ring_hom.to_algebra.to_has_scalar) _ :=
165+
by { letI := (f : A →+* B).to_algebra, exact of_algebra_map_eq (λ x, (f.commutes x).symm) }
166+
167+
end semiring
168+
169+
section division_ring
170+
variables [field R] [division_ring S] [algebra R S] [char_zero R] [char_zero S]
171+
172+
instance rat : is_scalar_tower ℚ R S :=
173+
of_algebra_map_eq $ λ x, ((algebra_map R S).map_rat_cast x).symm
174+
175+
end division_ring
176+
177+
end is_scalar_tower
178+
179+
namespace subalgebra
180+
181+
open is_scalar_tower
182+
183+
section semiring
184+
185+
variables (R) {S A} [comm_semiring R] [comm_semiring S] [semiring A]
186+
variables [algebra R S] [algebra S A] [algebra R A] [is_scalar_tower R S A]
187+
188+
/-- If A/S/R is a tower of algebras then the `res`triction of a S-subalgebra of A is
189+
an R-subalgebra of A. -/
190+
def res (U : subalgebra S A) : subalgebra R A :=
191+
{ algebra_map_mem' := λ x, by { rw algebra_map_apply R S A, exact U.algebra_map_mem _ },
192+
.. U }
193+
194+
@[simp] lemma res_top : res R (⊤ : subalgebra S A) = ⊤ :=
195+
algebra.eq_top_iff.2 $ λ _, show _ ∈ (⊤ : subalgebra S A), from algebra.mem_top
196+
197+
@[simp] lemma mem_res {U : subalgebra S A} {x : A} : x ∈ res R U ↔ x ∈ U := iff.rfl
198+
199+
lemma res_inj {U V : subalgebra S A} (H : res R U = res R V) : U = V :=
200+
ext $ λ x, by rw [← mem_res R, H, mem_res]
201+
202+
/-- Produces a map from `subalgebra.under`. -/
203+
def of_under {R A B : Type*} [comm_semiring R] [comm_semiring A] [semiring B]
204+
[algebra R A] [algebra R B] (S : subalgebra R A) (U : subalgebra S A)
205+
[algebra S B] [is_scalar_tower R S B] (f : U →ₐ[S] B) : S.under U →ₐ[R] B :=
206+
{ commutes' := λ r, (f.commutes (algebra_map R S r)).trans (algebra_map_apply R S B r).symm,
207+
.. f }
208+
209+
end semiring
210+
211+
end subalgebra
212+
213+
namespace is_scalar_tower
214+
215+
open subalgebra
216+
217+
variables [comm_semiring R] [comm_semiring S] [comm_semiring A]
218+
variables [algebra R S] [algebra S A] [algebra R A] [is_scalar_tower R S A]
219+
220+
theorem range_under_adjoin (t : set A) :
221+
(to_alg_hom R S A).range.under (algebra.adjoin _ t) = res R (algebra.adjoin S t) :=
222+
subalgebra.ext $ λ z,
223+
show z ∈ subsemiring.closure (set.range (algebra_map (to_alg_hom R S A).range A) ∪ t : set A) ↔
224+
z ∈ subsemiring.closure (set.range (algebra_map S A) ∪ t : set A),
225+
from suffices set.range (algebra_map (to_alg_hom R S A).range A) = set.range (algebra_map S A),
226+
by rw this,
227+
by { ext z, exact ⟨λ ⟨⟨x, y, _, h1⟩, h2⟩, ⟨y, h2 ▸ h1⟩, λ ⟨y, hy⟩,
228+
⟨⟨z, y, set.mem_univ _, hy⟩, rfl⟩⟩ }
229+
230+
end is_scalar_tower
231+
232+
section semiring
233+
234+
variables {R S A}
235+
variables [comm_semiring R] [semiring S] [add_comm_monoid A]
236+
variables [algebra R S] [semimodule S A] [semimodule R A] [is_scalar_tower R S A]
237+
238+
namespace submodule
239+
240+
open is_scalar_tower
241+
242+
theorem smul_mem_span_smul_of_mem {s : set S} {t : set A} {k : S} (hks : k ∈ span R s)
243+
{x : A} (hx : x ∈ t) : k • x ∈ span R (s • t) :=
244+
span_induction hks (λ c hc, subset_span $ set.mem_smul.2 ⟨c, x, hc, hx, rfl⟩)
245+
(by { rw zero_smul, exact zero_mem _ })
246+
(λ c₁ c₂ ih₁ ih₂, by { rw add_smul, exact add_mem _ ih₁ ih₂ })
247+
(λ b c hc, by { rw is_scalar_tower.smul_assoc, exact smul_mem _ _ hc })
248+
249+
theorem smul_mem_span_smul {s : set S} (hs : span R s = ⊤) {t : set A} {k : S}
250+
{x : A} (hx : x ∈ span R t) :
251+
k • x ∈ span R (s • t) :=
252+
span_induction hx (λ x hx, smul_mem_span_smul_of_mem (hs.symm ▸ mem_top) hx)
253+
(by { rw smul_zero, exact zero_mem _ })
254+
(λ x y ihx ihy, by { rw smul_add, exact add_mem _ ihx ihy })
255+
(λ c x hx, smul_comm c k x ▸ smul_mem _ _ hx)
256+
257+
theorem smul_mem_span_smul' {s : set S} (hs : span R s = ⊤) {t : set A} {k : S}
258+
{x : A} (hx : x ∈ span R (s • t)) :
259+
k • x ∈ span R (s • t) :=
260+
span_induction hx (λ x hx, let ⟨p, q, hp, hq, hpq⟩ := set.mem_smul.1 hx in
261+
by { rw [← hpq, smul_smul], exact smul_mem_span_smul_of_mem (hs.symm ▸ mem_top) hq })
262+
(by { rw smul_zero, exact zero_mem _ })
263+
(λ x y ihx ihy, by { rw smul_add, exact add_mem _ ihx ihy })
264+
(λ c x hx, smul_comm c k x ▸ smul_mem _ _ hx)
265+
266+
theorem span_smul {s : set S} (hs : span R s = ⊤) (t : set A) :
267+
span R (s • t) = (span S t).restrict_scalars R :=
268+
le_antisymm (span_le.2 $ λ x hx, let ⟨p, q, hps, hqt, hpqx⟩ := set.mem_smul.1 hx in
269+
hpqx ▸ (span S t).smul_mem p (subset_span hqt)) $
270+
λ p hp, span_induction hp (λ x hx, one_smul S x ▸ smul_mem_span_smul hs (subset_span hx))
271+
(zero_mem _)
272+
(λ _ _, add_mem _)
273+
(λ k x hx, smul_mem_span_smul' hs hx)
274+
275+
end submodule
276+
277+
end semiring

0 commit comments

Comments
 (0)