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

Commit 792f541

Browse files
kckennylaukim-em
andcommitted
feat(field_theory/tower): tower law (#3355)
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent 501aeb7 commit 792f541

File tree

6 files changed

+242
-8
lines changed

6 files changed

+242
-8
lines changed

src/algebra/big_operators.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,11 @@ by simp [prod_apply_dite _ _ (λ x, x)]
459459
(∏ x in s.filter p, f x) * (∏ x in s.filter (λ x, ¬ p x), g x) :=
460460
by simp [prod_apply_ite _ _ (λ x, x)]
461461

462+
@[to_additive]
463+
lemma prod_extend_by_one [decidable_eq α] (s : finset α) (f : α → β) :
464+
∏ i in s, (if i ∈ s then f i else 1) = ∏ i in s, f i :=
465+
prod_congr rfl $ λ i hi, if_pos hi
466+
462467
@[simp, to_additive]
463468
lemma prod_dite_eq [decidable_eq α] (s : finset α) (a : α) (b : Π x : α, a = x → β) :
464469
(∏ x in s, (if h : a = x then b x h else 1)) = ite (a ∈ s) (b a rfl) 1 :=

src/algebra/pointwise.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,12 @@ lemma image_smul_prod [has_scalar α β] {t : set β} :
259259
(λ x : α × β, x.fst • x.snd) '' s.prod t = s • t :=
260260
image_prod _
261261

262+
theorem range_smul_range [has_scalar α β] {ι κ : Type*} (b : ι → α) (c : κ → β) :
263+
range b • range c = range (λ p : ι × κ, b p.1 • c p.2) :=
264+
ext $ λ x, ⟨λ hx, let ⟨p, q, ⟨i, hi⟩, ⟨j, hj⟩, hpq⟩ := set.mem_smul.1 hx in
265+
⟨(i, j), hpq ▸ hi ▸ hj ▸ rfl⟩,
266+
λ ⟨⟨i, j⟩, h⟩, set.mem_smul.2 ⟨b i, c j, ⟨i, rfl⟩, ⟨j, rfl⟩, h⟩⟩
267+
262268
lemma singleton_smul [has_scalar α β] {t : set β} : ({a} : set α) • t = a • t :=
263269
image2_singleton_left
264270

src/data/finset/basic.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,6 +1770,10 @@ protected def product (s : finset α) (t : finset β) : finset (α × β) := ⟨
17701770

17711771
@[simp] theorem mem_product {p : α × β} : p ∈ s.product t ↔ p.1 ∈ s ∧ p.2 ∈ t := mem_product
17721772

1773+
theorem subset_product [decidable_eq α] [decidable_eq β] {s : finset (α × β)} :
1774+
s ⊆ (s.image prod.fst).product (s.image prod.snd) :=
1775+
λ p hp, mem_product.2 ⟨mem_image_of_mem _ hp, mem_image_of_mem _ hp⟩
1776+
17731777
theorem product_eq_bind [decidable_eq α] [decidable_eq β] (s : finset α) (t : finset β) :
17741778
s.product t = s.bind (λa, t.image $ λb, (a, b)) :=
17751779
ext $ λ ⟨x, y⟩, by simp only [mem_product, mem_bind, mem_image, exists_prop, prod.mk.inj_iff,

src/field_theory/tower.lean

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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 ring_theory.algebra_tower
8+
import linear_algebra.finite_dimensional
9+
10+
/-!
11+
# Tower of field extensions
12+
13+
In this file we prove the tower law for arbitrary extensions and finite extensions.
14+
Suppose `L` is a field extension of `K` and `K` is a field extension of `F`.
15+
Then `[L:F] = [L:K] [K:F]` where `[E₁:E₂]` means the `E₂`-dimension of `E₁`.
16+
17+
In fact we generalize it to algebras, where `L` is not necessarily a field, but just a `K`-algebra.
18+
19+
## Implementation notes
20+
21+
We prove two versions, since there are two notions of dimensions: `vector_space.dim` which gives
22+
the dimension of an arbitrary vector space as a cardinal, and `finite_dimensional.findim` which
23+
gives the dimension of a finitely-dimensional vector space as a natural number.
24+
25+
## Tags
26+
27+
tower law
28+
29+
-/
30+
31+
universes u v w u₁ v₁ w₁
32+
open_locale classical big_operators
33+
34+
section field
35+
36+
open cardinal
37+
38+
variables (F : Type u) (K : Type v) (A : Type w)
39+
variables [field F] [field K] [ring A]
40+
variables [algebra F K] [algebra K A] [algebra F A] [is_algebra_tower F K A]
41+
42+
/-- Tower law: if `A` is a `K`-algebra and `K` is a field extension of `F` then
43+
`dim_F(A) = dim_F(K) * dim_K(A)`. -/
44+
theorem dim_mul_dim' :
45+
(cardinal.lift.{v w} (vector_space.dim F K) *
46+
cardinal.lift.{w v} (vector_space.dim K A) : cardinal.{max w v}) =
47+
cardinal.lift.{w v} (vector_space.dim F A) :=
48+
let ⟨b, hb⟩ := exists_is_basis F K, ⟨c, hc⟩ := exists_is_basis K A in
49+
by rw [← (vector_space.dim F K).lift_id, ← hb.mk_eq_dim,
50+
← (vector_space.dim K A).lift_id, ← hc.mk_eq_dim,
51+
← lift_umax.{w v}, ← (hb.smul hc).mk_eq_dim, mk_prod, lift_mul,
52+
lift_lift, lift_lift, lift_lift, lift_lift, lift_umax]
53+
54+
/-- Tower law: if `A` is a `K`-algebra and `K` is a field extension of `F` then
55+
`dim_F(A) = dim_F(K) * dim_K(A)`. -/
56+
theorem dim_mul_dim (F : Type u) (K A : Type v) [field F] [field K] [ring A]
57+
[algebra F K] [algebra K A] [algebra F A] [is_algebra_tower F K A] :
58+
vector_space.dim F K * vector_space.dim K A = vector_space.dim F A :=
59+
by convert dim_mul_dim' F K A; rw lift_id
60+
61+
namespace finite_dimensional
62+
63+
theorem trans [finite_dimensional F K] [finite_dimensional K A] : finite_dimensional F A :=
64+
let ⟨b, hb⟩ := finite_dimensional.exists_is_basis_finset F K in
65+
let ⟨c, hc⟩ := finite_dimensional.exists_is_basis_finset K A in
66+
finite_dimensional.of_finite_basis $ hb.smul hc
67+
68+
/-- Tower law: if `A` is a `K`-algebra and `K` is a field extension of `F` then
69+
`dim_F(A) = dim_F(K) * dim_K(A)`. -/
70+
theorem findim_mul_findim [finite_dimensional F K] [finite_dimensional K A] :
71+
findim F K * findim K A = findim F A :=
72+
let ⟨b, hb⟩ := finite_dimensional.exists_is_basis_finset F K in
73+
let ⟨c, hc⟩ := finite_dimensional.exists_is_basis_finset K A in
74+
by rw [findim_eq_card_basis hb, findim_eq_card_basis hc,
75+
findim_eq_card_basis (hb.smul hc), fintype.card_prod]
76+
77+
end finite_dimensional
78+
79+
end field

src/linear_algebra/basis.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ linear_independent_iff.trans
101101
λ hf l hl, finsupp.ext $ λ i, classical.by_contradiction $ λ hni, hni $ hf _ _ hl _ $
102102
finsupp.mem_support_iff.2 hni⟩
103103

104+
theorem linear_independent_iff'' :
105+
linear_independent R v ↔ ∀ (s : finset ι) (g : ι → R) (hg : ∀ i ∉ s, g i = 0),
106+
∑ i in s, g i • v i = 0 → ∀ i, g i = 0 :=
107+
linear_independent_iff'.trans ⟨λ H s g hg hv i, if his : i ∈ s then H s g hv i his else hg i his,
108+
λ H s g hg i hi, by { convert H s (λ j, if j ∈ s then g j else 0) (λ j hj, if_neg hj)
109+
(by simp_rw [ite_smul, zero_smul, finset.sum_extend_by_zero, hg]) i,
110+
exact (if_pos hi).symm }⟩
111+
104112
theorem linear_dependent_iff : ¬ linear_independent R v ↔
105113
∃ s : finset ι, ∃ g : ι → R, s.sum (λ i, g i • v i) = 0 ∧ (∃ i ∈ s, g i ≠ 0) :=
106114
begin

src/ring_theory/algebra_tower.lean

Lines changed: 140 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@ Authors: Kenny Lau
66

77
import ring_theory.adjoin
88

9+
/-!
10+
# Towers of algebras
11+
12+
We set up the basic theory of algebra towers.
13+
The typeclass `is_algebra_tower R S A` expresses that `A` is an `S`-algebra,
14+
and both `S` and `A` are `R`-algebras, with the compatibility condition
15+
`(r • s) • a = r • (s • a)`.
16+
17+
In `field_theory/tower.lean` we use this to prove the tower law for finite extensions,
18+
that if `R` and `S` are both fields, then `[A:R] = [A:S] [S:A]`.
19+
20+
In this file we prepare the main lemma:
21+
if `{bi | i ∈ I}` is an `R`-basis of `S` and `{cj | j ∈ J}` is a `S`-basis
22+
of `A`, then `{bi cj | i ∈ I, j ∈ J}` is an `R`-basis of `A`. This statement does not require the
23+
base rings to be a field, so we also generalize the lemma to rings in this file.
24+
-/
25+
926
universes u v w u₁
1027

1128
variables (R : Type u) (S : Type v) (A : Type w) (B : Type u₁)
@@ -21,19 +38,30 @@ section semiring
2138
variables [comm_semiring R] [comm_semiring S] [semiring A] [semiring B]
2239
variables [algebra R S] [algebra S A] [algebra R A] [algebra S B] [algebra R B]
2340

24-
theorem algebra_map_eq [is_algebra_tower R S A] :
41+
variables {R S A}
42+
theorem of_algebra_map_eq (h : ∀ x, algebra_map R A x = algebra_map S A (algebra_map R S x)) :
43+
is_algebra_tower R S A :=
44+
⟨λ x y z, by simp_rw [algebra.smul_def, ring_hom.map_mul, mul_assoc, h]⟩
45+
46+
variables [is_algebra_tower R S A] [is_algebra_tower R S B]
47+
48+
variables (R S A)
49+
theorem algebra_map_eq :
2550
algebra_map R A = (algebra_map S A).comp (algebra_map R S) :=
2651
ring_hom.ext $ λ x, by simp_rw [ring_hom.comp_apply, algebra.algebra_map_eq_smul_one,
2752
smul_assoc, one_smul]
2853

29-
theorem algebra_map_apply [is_algebra_tower R S A] (x : R) :
30-
algebra_map R A x = algebra_map S A (algebra_map R S x) :=
54+
theorem algebra_map_apply (x : R) : algebra_map R A x = algebra_map S A (algebra_map R S x) :=
3155
by rw [algebra_map_eq R S A, ring_hom.comp_apply]
3256

57+
variables {R} (S) {A}
58+
theorem algebra_map_smul (r : R) (x : A) : algebra_map R S r • x = r • x :=
59+
by rw [algebra.algebra_map_eq_smul_one, smul_assoc, one_smul]
60+
3361
variables {R S A}
34-
theorem of_algebra_map_eq (h : ∀ x, algebra_map R A x = algebra_map S A (algebra_map R S x)) :
35-
is_algebra_tower R S A :=
36-
⟨λ x y z, by simp_rw [algebra.smul_def, ring_hom.map_mul, mul_assoc, h]⟩
62+
theorem smul_left_comm (r : R) (s : S) (x : A) : r • s • x = s • r • x :=
63+
by simp_rw [algebra.smul_def, ← mul_assoc, algebra_map_apply R S A,
64+
← (algebra_map S A).map_mul, mul_comm s]
3765

3866
@[ext] lemma algebra.ext {S : Type u} {A : Type v} [comm_semiring S] [semiring A]
3967
(h1 h2 : algebra S A) (h : ∀ {r : S} {x : A}, (by clear h2; exact r • x) = r • x) : h1 = h2 :=
@@ -43,8 +71,6 @@ begin
4371
ext r, erw [← mul_one (g1 r), ← h12, ← mul_one (g2 r), ← h22, h], refl }
4472
end
4573

46-
variables [is_algebra_tower R S A] [is_algebra_tower R S B]
47-
4874
variables (R S A)
4975
theorem comap_eq : algebra.comap.algebra R S A = ‹_› :=
5076
algebra.ext _ _ $ λ x (z : A),
@@ -167,3 +193,109 @@ le_antisymm (adjoin_le $ set.image_subset_iff.2 $ λ y hy, ⟨y, subset_adjoin h
167193
(subalgebra.map_le.2 $ adjoin_le $ λ y hy, subset_adjoin ⟨y, hy, rfl⟩)
168194

169195
end algebra
196+
197+
namespace submodule
198+
199+
open is_algebra_tower
200+
201+
variables [comm_semiring R] [comm_semiring S] [semiring A]
202+
variables [algebra R S] [algebra S A] [algebra R A] [is_algebra_tower R S A]
203+
204+
variables (R) {S A}
205+
/-- Restricting the scalars of submodules in an algebra tower. -/
206+
def restrict_scalars' (U : submodule S A) : submodule R A :=
207+
{ smul_mem' := λ r x hx, algebra_map_smul S r x ▸ U.smul_mem _ hx, .. U }
208+
209+
variables (R S A)
210+
theorem restrict_scalars'_top : restrict_scalars' R (⊤ : submodule S A) = ⊤ := rfl
211+
212+
variables {R S A}
213+
theorem restrict_scalars'_injective (U₁ U₂ : submodule S A)
214+
(h : restrict_scalars' R U₁ = restrict_scalars' R U₂) : U₁ = U₂ :=
215+
ext $ by convert set.ext_iff.1 (ext'_iff.1 h); refl
216+
217+
theorem restrict_scalars'_inj {U₁ U₂ : submodule S A} :
218+
restrict_scalars' R U₁ = restrict_scalars' R U₂ ↔ U₁ = U₂ :=
219+
⟨restrict_scalars'_injective U₁ U₂, congr_arg _⟩
220+
221+
end submodule
222+
223+
section semiring
224+
225+
variables {R S A}
226+
variables [comm_semiring R] [comm_semiring S] [semiring A]
227+
variables [algebra R S] [algebra S A] [algebra R A] [is_algebra_tower R S A]
228+
229+
namespace submodule
230+
231+
open is_algebra_tower
232+
233+
theorem smul_mem_span_smul_of_mem {s : set S} {t : set A} {k : S} (hks : k ∈ span R s)
234+
{x : A} (hx : x ∈ t) : k • x ∈ span R (s • t) :=
235+
span_induction hks (λ c hc, subset_span $ set.mem_smul.2 ⟨c, x, hc, hx, rfl⟩)
236+
(by { rw zero_smul, exact zero_mem _ })
237+
(λ c₁ c₂ ih₁ ih₂, by { rw add_smul, exact add_mem _ ih₁ ih₂ })
238+
(λ b c hc, by { rw is_algebra_tower.smul_assoc, exact smul_mem _ _ hc })
239+
240+
theorem smul_mem_span_smul {s : set S} (hs : span R s = ⊤) {t : set A} {k : S}
241+
{x : A} (hx : x ∈ span R t) :
242+
k • x ∈ span R (s • t) :=
243+
span_induction hx (λ x hx, smul_mem_span_smul_of_mem (hs.symm ▸ mem_top) hx)
244+
(by { rw smul_zero, exact zero_mem _ })
245+
(λ x y ihx ihy, by { rw smul_add, exact add_mem _ ihx ihy })
246+
(λ c x hx, smul_left_comm c k x ▸ smul_mem _ _ hx)
247+
248+
theorem smul_mem_span_smul' {s : set S} (hs : span R s = ⊤) {t : set A} {k : S}
249+
{x : A} (hx : x ∈ span R (s • t)) :
250+
k • x ∈ span R (s • t) :=
251+
span_induction hx (λ x hx, let ⟨p, q, hp, hq, hpq⟩ := set.mem_smul.1 hx in
252+
by { rw [← hpq, smul_smul], exact smul_mem_span_smul_of_mem (hs.symm ▸ mem_top) hq })
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_left_comm c k x ▸ smul_mem _ _ hx)
256+
257+
theorem span_smul {s : set S} (hs : span R s = ⊤) (t : set A) :
258+
span R (s • t) = (span S t).restrict_scalars' R :=
259+
le_antisymm (span_le.2 $ λ x hx, let ⟨p, q, hps, hqt, hpqx⟩ := set.mem_smul.1 hx in
260+
hpqx ▸ (span S t).smul_mem p (subset_span hqt)) $
261+
λ p hp, span_induction hp (λ x hx, one_smul S x ▸ smul_mem_span_smul hs (subset_span hx))
262+
(zero_mem _)
263+
(λ _ _, add_mem _)
264+
(λ k x hx, smul_mem_span_smul' hs hx)
265+
266+
end submodule
267+
268+
end semiring
269+
270+
271+
section ring
272+
273+
open_locale big_operators classical
274+
universes v₁ w₁
275+
276+
variables {R S A}
277+
variables [comm_ring R] [comm_ring S] [ring A]
278+
variables [algebra R S] [algebra S A] [algebra R A] [is_algebra_tower R S A]
279+
280+
theorem linear_independent_smul {ι : Type v₁} {b : ι → S} {κ : Type w₁} {c : κ → A}
281+
(hb : linear_independent R b) (hc : linear_independent S c) :
282+
linear_independent R (λ p : ι × κ, b p.1 • c p.2) :=
283+
begin
284+
rw linear_independent_iff' at hb hc, rw linear_independent_iff'', rintros s g hg hsg ⟨i, k⟩,
285+
by_cases hik : (i, k) ∈ s,
286+
{ have h1 : ∑ i in (s.image prod.fst).product (s.image prod.snd), g i • b i.1 • c i.2 = 0,
287+
{ rw ← hsg, exact (finset.sum_subset finset.subset_product $ λ p _ hp,
288+
show g p • b p.1 • c p.2 = 0, by rw [hg p hp, zero_smul]).symm },
289+
rw [finset.sum_product, finset.sum_comm] at h1,
290+
simp_rw [← is_algebra_tower.smul_assoc, ← finset.sum_smul] at h1,
291+
exact hb _ _ (hc _ _ h1 k (finset.mem_image_of_mem _ hik)) i (finset.mem_image_of_mem _ hik) },
292+
exact hg _ hik
293+
end
294+
295+
theorem is_basis.smul {ι : Type v₁} {b : ι → S} {κ : Type w₁} {c : κ → A}
296+
(hb : is_basis R b) (hc : is_basis S c) : is_basis R (λ p : ι × κ, b p.1 • c p.2) :=
297+
⟨linear_independent_smul hb.1 hc.1,
298+
by rw [← set.range_smul_range, submodule.span_smul hb.2, ← submodule.restrict_scalars'_top R S A,
299+
submodule.restrict_scalars'_inj, hc.2]⟩
300+
301+
end ring

0 commit comments

Comments
 (0)