Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
100K - 1M
License:
/- | |
Copyright (c) 2017 Johannes HΓΆlzl. All rights reserved. | |
Released under Apache 2.0 license as described in the file LICENSE. | |
Authors: Johannes HΓΆlzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov, Eric Wieser | |
-/ | |
import linear_algebra.span | |
import order.partial_sups | |
import algebra.algebra.basic | |
/-! ### Products of modules | |
This file defines constructors for linear maps whose domains or codomains are products. | |
It contains theorems relating these to each other, as well as to `submodule.prod`, `submodule.map`, | |
`submodule.comap`, `linear_map.range`, and `linear_map.ker`. | |
- products in the domain: | |
- `linear_map.fst` | |
- `linear_map.snd` | |
- `linear_map.coprod` | |
- `linear_map.prod_ext` | |
- products in the codomain: | |
- `linear_map.inl` | |
- `linear_map.inr` | |
- `linear_map.prod` | |
- products in both domain and codomain: | |
- `linear_map.prod_map` | |
- `linear_equiv.prod_map` | |
- `linear_equiv.skew_prod` | |
-/ | |
universes u v w x y z u' v' w' y' | |
variables {R : Type u} {K : Type u'} {M : Type v} {V : Type v'} {Mβ : Type w} {Vβ : Type w'} | |
variables {Mβ : Type y} {Vβ : Type y'} {Mβ : Type z} {ΞΉ : Type x} | |
variables {Mβ Mβ : Type*} | |
section prod | |
namespace linear_map | |
variables (S : Type*) [semiring R] [semiring S] | |
variables [add_comm_monoid M] [add_comm_monoid Mβ] [add_comm_monoid Mβ] [add_comm_monoid Mβ] | |
variables [add_comm_monoid Mβ ] [add_comm_monoid Mβ] | |
variables [module R M] [module R Mβ] [module R Mβ] [module R Mβ] | |
variables [module R Mβ ] [module R Mβ] | |
variables (f : M ββ[R] Mβ) | |
section | |
variables (R M Mβ) | |
/-- The first projection of a product is a linear map. -/ | |
def fst : M Γ Mβ ββ[R] M := { to_fun := prod.fst, map_add' := Ξ» x y, rfl, map_smul' := Ξ» x y, rfl } | |
/-- The second projection of a product is a linear map. -/ | |
def snd : M Γ Mβ ββ[R] Mβ := { to_fun := prod.snd, map_add' := Ξ» x y, rfl, map_smul' := Ξ» x y, rfl } | |
end | |
@[simp] theorem fst_apply (x : M Γ Mβ) : fst R M Mβ x = x.1 := rfl | |
@[simp] theorem snd_apply (x : M Γ Mβ) : snd R M Mβ x = x.2 := rfl | |
theorem fst_surjective : function.surjective (fst R M Mβ) := Ξ» x, β¨(x, 0), rflβ© | |
theorem snd_surjective : function.surjective (snd R M Mβ) := Ξ» x, β¨(0, x), rflβ© | |
/-- The prod of two linear maps is a linear map. -/ | |
@[simps] def prod (f : M ββ[R] Mβ) (g : M ββ[R] Mβ) : (M ββ[R] Mβ Γ Mβ) := | |
{ to_fun := pi.prod f g, | |
map_add' := Ξ» x y, by simp only [pi.prod, prod.mk_add_mk, map_add], | |
map_smul' := Ξ» c x, by simp only [pi.prod, prod.smul_mk, map_smul, ring_hom.id_apply] } | |
lemma coe_prod (f : M ββ[R] Mβ) (g : M ββ[R] Mβ) : β(f.prod g) = pi.prod f g := rfl | |
@[simp] theorem fst_prod (f : M ββ[R] Mβ) (g : M ββ[R] Mβ) : | |
(fst R Mβ Mβ).comp (prod f g) = f := by ext; refl | |
@[simp] theorem snd_prod (f : M ββ[R] Mβ) (g : M ββ[R] Mβ) : | |
(snd R Mβ Mβ).comp (prod f g) = g := by ext; refl | |
@[simp] theorem pair_fst_snd : prod (fst R M Mβ) (snd R M Mβ) = linear_map.id := | |
fun_like.coe_injective pi.prod_fst_snd | |
/-- Taking the product of two maps with the same domain is equivalent to taking the product of | |
their codomains. | |
See note [bundled maps over different rings] for why separate `R` and `S` semirings are used. -/ | |
@[simps] def prod_equiv | |
[module S Mβ] [module S Mβ] [smul_comm_class R S Mβ] [smul_comm_class R S Mβ] : | |
((M ββ[R] Mβ) Γ (M ββ[R] Mβ)) ββ[S] (M ββ[R] Mβ Γ Mβ) := | |
{ to_fun := Ξ» f, f.1.prod f.2, | |
inv_fun := Ξ» f, ((fst _ _ _).comp f, (snd _ _ _).comp f), | |
left_inv := Ξ» f, by ext; refl, | |
right_inv := Ξ» f, by ext; refl, | |
map_add' := Ξ» a b, rfl, | |
map_smul' := Ξ» r a, rfl } | |
section | |
variables (R M Mβ) | |
/-- The left injection into a product is a linear map. -/ | |
def inl : M ββ[R] M Γ Mβ := prod linear_map.id 0 | |
/-- The right injection into a product is a linear map. -/ | |
def inr : Mβ ββ[R] M Γ Mβ := prod 0 linear_map.id | |
theorem range_inl : range (inl R M Mβ) = ker (snd R M Mβ) := | |
begin | |
ext x, | |
simp only [mem_ker, mem_range], | |
split, | |
{ rintros β¨y, rflβ©, refl }, | |
{ intro h, exact β¨x.fst, prod.ext rfl h.symmβ© } | |
end | |
theorem ker_snd : ker (snd R M Mβ) = range (inl R M Mβ) := | |
eq.symm $ range_inl R M Mβ | |
theorem range_inr : range (inr R M Mβ) = ker (fst R M Mβ) := | |
begin | |
ext x, | |
simp only [mem_ker, mem_range], | |
split, | |
{ rintros β¨y, rflβ©, refl }, | |
{ intro h, exact β¨x.snd, prod.ext h.symm rflβ© } | |
end | |
theorem ker_fst : ker (fst R M Mβ) = range (inr R M Mβ) := | |
eq.symm $ range_inr R M Mβ | |
end | |
@[simp] theorem coe_inl : (inl R M Mβ : M β M Γ Mβ) = Ξ» x, (x, 0) := rfl | |
theorem inl_apply (x : M) : inl R M Mβ x = (x, 0) := rfl | |
@[simp] theorem coe_inr : (inr R M Mβ : Mβ β M Γ Mβ) = prod.mk 0 := rfl | |
theorem inr_apply (x : Mβ) : inr R M Mβ x = (0, x) := rfl | |
theorem inl_eq_prod : inl R M Mβ = prod linear_map.id 0 := rfl | |
theorem inr_eq_prod : inr R M Mβ = prod 0 linear_map.id := rfl | |
theorem inl_injective : function.injective (inl R M Mβ) := | |
Ξ» _, by simp | |
theorem inr_injective : function.injective (inr R M Mβ) := | |
Ξ» _, by simp | |
/-- The coprod function `Ξ» x : M Γ Mβ, f x.1 + g x.2` is a linear map. -/ | |
def coprod (f : M ββ[R] Mβ) (g : Mβ ββ[R] Mβ) : M Γ Mβ ββ[R] Mβ := | |
f.comp (fst _ _ _) + g.comp (snd _ _ _) | |
@[simp] theorem coprod_apply (f : M ββ[R] Mβ) (g : Mβ ββ[R] Mβ) (x : M Γ Mβ) : | |
coprod f g x = f x.1 + g x.2 := rfl | |
@[simp] theorem coprod_inl (f : M ββ[R] Mβ) (g : Mβ ββ[R] Mβ) : | |
(coprod f g).comp (inl R M Mβ) = f := | |
by ext; simp only [map_zero, add_zero, coprod_apply, inl_apply, comp_apply] | |
@[simp] theorem coprod_inr (f : M ββ[R] Mβ) (g : Mβ ββ[R] Mβ) : | |
(coprod f g).comp (inr R M Mβ) = g := | |
by ext; simp only [map_zero, coprod_apply, inr_apply, zero_add, comp_apply] | |
@[simp] theorem coprod_inl_inr : coprod (inl R M Mβ) (inr R M Mβ) = linear_map.id := | |
by ext; simp only [prod.mk_add_mk, add_zero, id_apply, coprod_apply, | |
inl_apply, inr_apply, zero_add] | |
theorem comp_coprod (f : Mβ ββ[R] Mβ) (gβ : M ββ[R] Mβ) (gβ : Mβ ββ[R] Mβ) : | |
f.comp (gβ.coprod gβ) = (f.comp gβ).coprod (f.comp gβ) := | |
ext $ Ξ» x, f.map_add (gβ x.1) (gβ x.2) | |
theorem fst_eq_coprod : fst R M Mβ = coprod linear_map.id 0 := by ext; simp | |
theorem snd_eq_coprod : snd R M Mβ = coprod 0 linear_map.id := by ext; simp | |
@[simp] theorem coprod_comp_prod (f : Mβ ββ[R] Mβ) (g : Mβ ββ[R] Mβ) | |
(f' : M ββ[R] Mβ) (g' : M ββ[R] Mβ) : | |
(f.coprod g).comp (f'.prod g') = f.comp f' + g.comp g' := | |
rfl | |
@[simp] | |
lemma coprod_map_prod (f : M ββ[R] Mβ) (g : Mβ ββ[R] Mβ) (S : submodule R M) | |
(S' : submodule R Mβ) : | |
(submodule.prod S S').map (linear_map.coprod f g) = S.map f β S'.map g := | |
set_like.coe_injective $ begin | |
simp only [linear_map.coprod_apply, submodule.coe_sup, submodule.map_coe], | |
rw [βset.image2_add, set.image2_image_left, set.image2_image_right], | |
exact set.image_prod (Ξ» m mβ, f m + g mβ), | |
end | |
/-- Taking the product of two maps with the same codomain is equivalent to taking the product of | |
their domains. | |
See note [bundled maps over different rings] for why separate `R` and `S` semirings are used. -/ | |
@[simps] def coprod_equiv [module S Mβ] [smul_comm_class R S Mβ] : | |
((M ββ[R] Mβ) Γ (Mβ ββ[R] Mβ)) ββ[S] (M Γ Mβ ββ[R] Mβ) := | |
{ to_fun := Ξ» f, f.1.coprod f.2, | |
inv_fun := Ξ» f, (f.comp (inl _ _ _), f.comp (inr _ _ _)), | |
left_inv := Ξ» f, by simp only [prod.mk.eta, coprod_inl, coprod_inr], | |
right_inv := Ξ» f, by simp only [βcomp_coprod, comp_id, coprod_inl_inr], | |
map_add' := Ξ» a b, | |
by { ext, simp only [prod.snd_add, add_apply, coprod_apply, prod.fst_add, add_add_add_comm] }, | |
map_smul' := Ξ» r a, | |
by { dsimp, ext, simp only [smul_add, smul_apply, prod.smul_snd, prod.smul_fst, | |
coprod_apply] } } | |
theorem prod_ext_iff {f g : M Γ Mβ ββ[R] Mβ} : | |
f = g β f.comp (inl _ _ _) = g.comp (inl _ _ _) β§ f.comp (inr _ _ _) = g.comp (inr _ _ _) := | |
(coprod_equiv β).symm.injective.eq_iff.symm.trans prod.ext_iff | |
/-- | |
Split equality of linear maps from a product into linear maps over each component, to allow `ext` | |
to apply lemmas specific to `M ββ Mβ` and `Mβ ββ Mβ`. | |
See note [partially-applied ext lemmas]. -/ | |
@[ext] theorem prod_ext {f g : M Γ Mβ ββ[R] Mβ} | |
(hl : f.comp (inl _ _ _) = g.comp (inl _ _ _)) | |
(hr : f.comp (inr _ _ _) = g.comp (inr _ _ _)) : | |
f = g := | |
prod_ext_iff.2 β¨hl, hrβ© | |
/-- `prod.map` of two linear maps. -/ | |
def prod_map (f : M ββ[R] Mβ) (g : Mβ ββ[R] Mβ) : (M Γ Mβ) ββ[R] (Mβ Γ Mβ) := | |
(f.comp (fst R M Mβ)).prod (g.comp (snd R M Mβ)) | |
@[simp] theorem prod_map_apply (f : M ββ[R] Mβ) (g : Mβ ββ[R] Mβ) (x) : | |
f.prod_map g x = (f x.1, g x.2) := rfl | |
lemma prod_map_comap_prod (f : M ββ[R] Mβ) (g : Mβ ββ[R] Mβ) (S : submodule R Mβ) | |
(S' : submodule R Mβ) : | |
(submodule.prod S S').comap (linear_map.prod_map f g) = (S.comap f).prod (S'.comap g) := | |
set_like.coe_injective $ set.preimage_prod_map_prod f g _ _ | |
lemma ker_prod_map (f : M ββ[R] Mβ) (g : Mβ ββ[R] Mβ) : | |
(linear_map.prod_map f g).ker = submodule.prod f.ker g.ker := | |
begin | |
dsimp only [ker], | |
rw [βprod_map_comap_prod, submodule.prod_bot], | |
end | |
@[simp] | |
lemma prod_map_id : (id : M ββ[R] M).prod_map (id : Mβ ββ[R] Mβ) = id := | |
linear_map.ext $ Ξ» _, prod.mk.eta | |
@[simp] | |
lemma prod_map_one : (1 : M ββ[R] M).prod_map (1 : Mβ ββ[R] Mβ) = 1 := | |
linear_map.ext $ Ξ» _, prod.mk.eta | |
lemma prod_map_comp (fββ : M ββ[R] Mβ) (fββ : Mβ ββ[R] Mβ) (gββ : Mβ ββ[R] Mβ ) (gββ : Mβ ββ[R] Mβ) : | |
fββ.prod_map gββ ββ fββ.prod_map gββ = (fββ ββ fββ).prod_map (gββ ββ gββ) := rfl | |
lemma prod_map_mul (fββ : M ββ[R] M) (fββ : M ββ[R] M) (gββ : Mβ ββ[R] Mβ) (gββ : Mβ ββ[R] Mβ) : | |
fββ.prod_map gββ * fββ.prod_map gββ = (fββ * fββ).prod_map (gββ * gββ) := rfl | |
lemma prod_map_add (fβ : M ββ[R] Mβ) (fβ : M ββ[R] Mβ) (gβ : Mβ ββ[R] Mβ) (gβ : Mβ ββ[R] Mβ) : | |
(fβ + fβ).prod_map (gβ + gβ) = fβ.prod_map gβ + fβ.prod_map gβ := rfl | |
@[simp] lemma prod_map_zero : | |
(0 : M ββ[R] Mβ).prod_map (0 : Mβ ββ[R] Mβ) = 0 := rfl | |
@[simp] lemma prod_map_smul | |
[module S Mβ] [module S Mβ] [smul_comm_class R S Mβ] [smul_comm_class R S Mβ] | |
(s : S) (f : M ββ[R] Mβ) (g : Mβ ββ[R] Mβ) : prod_map (s β’ f) (s β’ g) = s β’ prod_map f g := rfl | |
variables (R M Mβ Mβ Mβ) | |
/-- `linear_map.prod_map` as a `linear_map` -/ | |
@[simps] | |
def prod_map_linear | |
[module S Mβ] [module S Mβ] [smul_comm_class R S Mβ] [smul_comm_class R S Mβ] : | |
((M ββ[R] Mβ) Γ (Mβ ββ[R] Mβ)) ββ[S] ((M Γ Mβ) ββ[R] (Mβ Γ Mβ)) := | |
{ to_fun := Ξ» f, prod_map f.1 f.2, | |
map_add' := Ξ» _ _, rfl, | |
map_smul' := Ξ» _ _, rfl} | |
/-- `linear_map.prod_map` as a `ring_hom` -/ | |
@[simps] | |
def prod_map_ring_hom : (M ββ[R] M) Γ (Mβ ββ[R] Mβ) β+* ((M Γ Mβ) ββ[R] (M Γ Mβ)) := | |
{ to_fun := Ξ» f, prod_map f.1 f.2, | |
map_one' := prod_map_one, | |
map_zero' := rfl, | |
map_add' := Ξ» _ _, rfl, | |
map_mul' := Ξ» _ _, rfl } | |
variables {R M Mβ Mβ Mβ} | |
section map_mul | |
variables {A : Type*} [non_unital_non_assoc_semiring A] [module R A] | |
variables {B : Type*} [non_unital_non_assoc_semiring B] [module R B] | |
lemma inl_map_mul (aβ aβ : A) : linear_map.inl R A B (aβ * aβ) = | |
linear_map.inl R A B aβ * linear_map.inl R A B aβ := | |
prod.ext rfl (by simp) | |
lemma inr_map_mul (bβ bβ : B) : linear_map.inr R A B (bβ * bβ) = | |
linear_map.inr R A B bβ * linear_map.inr R A B bβ := | |
prod.ext (by simp) rfl | |
end map_mul | |
end linear_map | |
end prod | |
namespace linear_map | |
variables (R M Mβ) | |
variables [comm_semiring R] | |
variables [add_comm_monoid M] [add_comm_monoid Mβ] | |
variables [module R M] [module R Mβ] | |
/-- `linear_map.prod_map` as an `algebra_hom` -/ | |
@[simps] | |
def prod_map_alg_hom : (module.End R M) Γ (module.End R Mβ) ββ[R] module.End R (M Γ Mβ) := | |
{ commutes' := Ξ» _, rfl, ..prod_map_ring_hom R M Mβ } | |
end linear_map | |
namespace linear_map | |
open submodule | |
variables [semiring R] | |
[add_comm_monoid M] [add_comm_monoid Mβ] [add_comm_monoid Mβ] [add_comm_monoid Mβ] | |
[module R M] [module R Mβ] [module R Mβ] [module R Mβ] | |
lemma range_coprod (f : M ββ[R] Mβ) (g : Mβ ββ[R] Mβ) : | |
(f.coprod g).range = f.range β g.range := | |
submodule.ext $ Ξ» x, by simp [mem_sup] | |
lemma is_compl_range_inl_inr : is_compl (inl R M Mβ).range (inr R M Mβ).range := | |
begin | |
split, | |
{ rintros β¨_, _β© β¨β¨x, hxβ©, β¨y, hyβ©β©, | |
simp only [prod.ext_iff, inl_apply, inr_apply, mem_bot] at hx hy β’, | |
exact β¨hy.1.symm, hx.2.symmβ© }, | |
{ rintros β¨x, yβ© -, | |
simp only [mem_sup, mem_range, exists_prop], | |
refine β¨(x, 0), β¨x, rflβ©, (0, y), β¨y, rflβ©, _β©, | |
simp } | |
end | |
lemma sup_range_inl_inr : (inl R M Mβ).range β (inr R M Mβ).range = β€ := | |
is_compl_range_inl_inr.sup_eq_top | |
lemma disjoint_inl_inr : disjoint (inl R M Mβ).range (inr R M Mβ).range := | |
by simp [disjoint_def, @eq_comm M 0, @eq_comm Mβ 0] {contextual := tt}; intros; refl | |
theorem map_coprod_prod (f : M ββ[R] Mβ) (g : Mβ ββ[R] Mβ) | |
(p : submodule R M) (q : submodule R Mβ) : | |
map (coprod f g) (p.prod q) = map f p β map g q := | |
begin | |
refine le_antisymm _ (sup_le (map_le_iff_le_comap.2 _) (map_le_iff_le_comap.2 _)), | |
{ rw set_like.le_def, rintro _ β¨x, β¨hβ, hββ©, rflβ©, | |
exact mem_sup.2 β¨_, β¨_, hβ, rflβ©, _, β¨_, hβ, rflβ©, rflβ© }, | |
{ exact Ξ» x hx, β¨(x, 0), by simp [hx]β© }, | |
{ exact Ξ» x hx, β¨(0, x), by simp [hx]β© } | |
end | |
theorem comap_prod_prod (f : M ββ[R] Mβ) (g : M ββ[R] Mβ) | |
(p : submodule R Mβ) (q : submodule R Mβ) : | |
comap (prod f g) (p.prod q) = comap f p β comap g q := | |
submodule.ext $ Ξ» x, iff.rfl | |
theorem prod_eq_inf_comap (p : submodule R M) (q : submodule R Mβ) : | |
p.prod q = p.comap (linear_map.fst R M Mβ) β q.comap (linear_map.snd R M Mβ) := | |
submodule.ext $ Ξ» x, iff.rfl | |
theorem prod_eq_sup_map (p : submodule R M) (q : submodule R Mβ) : | |
p.prod q = p.map (linear_map.inl R M Mβ) β q.map (linear_map.inr R M Mβ) := | |
by rw [β map_coprod_prod, coprod_inl_inr, map_id] | |
lemma span_inl_union_inr {s : set M} {t : set Mβ} : | |
span R (inl R M Mβ '' s βͺ inr R M Mβ '' t) = (span R s).prod (span R t) := | |
by rw [span_union, prod_eq_sup_map, β span_image, β span_image] | |
@[simp] lemma ker_prod (f : M ββ[R] Mβ) (g : M ββ[R] Mβ) : | |
ker (prod f g) = ker f β ker g := | |
by rw [ker, β prod_bot, comap_prod_prod]; refl | |
lemma range_prod_le (f : M ββ[R] Mβ) (g : M ββ[R] Mβ) : | |
range (prod f g) β€ (range f).prod (range g) := | |
begin | |
simp only [set_like.le_def, prod_apply, mem_range, set_like.mem_coe, mem_prod, | |
exists_imp_distrib], | |
rintro _ x rfl, | |
exact β¨β¨x, rflβ©, β¨x, rflβ©β© | |
end | |
lemma ker_prod_ker_le_ker_coprod {Mβ : Type*} [add_comm_group Mβ] [module R Mβ] | |
{Mβ : Type*} [add_comm_group Mβ] [module R Mβ] | |
(f : M ββ[R] Mβ) (g : Mβ ββ[R] Mβ) : | |
(ker f).prod (ker g) β€ ker (f.coprod g) := | |
by { rintros β¨y, zβ©, simp {contextual := tt} } | |
lemma ker_coprod_of_disjoint_range {Mβ : Type*} [add_comm_group Mβ] [module R Mβ] | |
{Mβ : Type*} [add_comm_group Mβ] [module R Mβ] | |
(f : M ββ[R] Mβ) (g : Mβ ββ[R] Mβ) (hd : disjoint f.range g.range) : | |
ker (f.coprod g) = (ker f).prod (ker g) := | |
begin | |
apply le_antisymm _ (ker_prod_ker_le_ker_coprod f g), | |
rintros β¨y, zβ© h, | |
simp only [mem_ker, mem_prod, coprod_apply] at h β’, | |
have : f y β f.range β g.range, | |
{ simp only [true_and, mem_range, mem_inf, exists_apply_eq_apply], | |
use -z, | |
rwa [eq_comm, map_neg, β sub_eq_zero, sub_neg_eq_add] }, | |
rw [hd.eq_bot, mem_bot] at this, | |
rw [this] at h, | |
simpa [this] using h, | |
end | |
end linear_map | |
namespace submodule | |
open linear_map | |
variables [semiring R] | |
variables [add_comm_monoid M] [add_comm_monoid Mβ] | |
variables [module R M] [module R Mβ] | |
lemma sup_eq_range (p q : submodule R M) : p β q = (p.subtype.coprod q.subtype).range := | |
submodule.ext $ Ξ» x, by simp [submodule.mem_sup, set_like.exists] | |
variables (p : submodule R M) (q : submodule R Mβ) | |
@[simp] theorem map_inl : p.map (inl R M Mβ) = prod p β₯ := | |
by { ext β¨x, yβ©, simp only [and.left_comm, eq_comm, mem_map, prod.mk.inj_iff, inl_apply, mem_bot, | |
exists_eq_left', mem_prod] } | |
@[simp] theorem map_inr : q.map (inr R M Mβ) = prod β₯ q := | |
by ext β¨x, yβ©; simp [and.left_comm, eq_comm] | |
@[simp] theorem comap_fst : p.comap (fst R M Mβ) = prod p β€ := | |
by ext β¨x, yβ©; simp | |
@[simp] theorem comap_snd : q.comap (snd R M Mβ) = prod β€ q := | |
by ext β¨x, yβ©; simp | |
@[simp] theorem prod_comap_inl : (prod p q).comap (inl R M Mβ) = p := by ext; simp | |
@[simp] theorem prod_comap_inr : (prod p q).comap (inr R M Mβ) = q := by ext; simp | |
@[simp] theorem prod_map_fst : (prod p q).map (fst R M Mβ) = p := | |
by ext x; simp [(β¨0, zero_mem _β© : β x, x β q)] | |
@[simp] theorem prod_map_snd : (prod p q).map (snd R M Mβ) = q := | |
by ext x; simp [(β¨0, zero_mem _β© : β x, x β p)] | |
@[simp] theorem ker_inl : (inl R M Mβ).ker = β₯ := | |
by rw [ker, β prod_bot, prod_comap_inl] | |
@[simp] theorem ker_inr : (inr R M Mβ).ker = β₯ := | |
by rw [ker, β prod_bot, prod_comap_inr] | |
@[simp] theorem range_fst : (fst R M Mβ).range = β€ := | |
by rw [range_eq_map, β prod_top, prod_map_fst] | |
@[simp] theorem range_snd : (snd R M Mβ).range = β€ := | |
by rw [range_eq_map, β prod_top, prod_map_snd] | |
variables (R M Mβ) | |
/-- `M` as a submodule of `M Γ N`. -/ | |
def fst : submodule R (M Γ Mβ) := (β₯ : submodule R Mβ).comap (linear_map.snd R M Mβ) | |
/-- `M` as a submodule of `M Γ N` is isomorphic to `M`. -/ | |
@[simps] def fst_equiv : submodule.fst R M Mβ ββ[R] M := | |
{ to_fun := Ξ» x, x.1.1, | |
inv_fun := Ξ» m, β¨β¨m, 0β©, by tidyβ©, | |
map_add' := by simp, | |
map_smul' := by simp, | |
left_inv := by tidy, | |
right_inv := by tidy, } | |
lemma fst_map_fst : (submodule.fst R M Mβ).map (linear_map.fst R M Mβ) = β€ := | |
by tidy | |
lemma fst_map_snd : (submodule.fst R M Mβ).map (linear_map.snd R M Mβ) = β₯ := | |
by { tidy, exact 0, } | |
/-- `N` as a submodule of `M Γ N`. -/ | |
def snd : submodule R (M Γ Mβ) := (β₯ : submodule R M).comap (linear_map.fst R M Mβ) | |
/-- `N` as a submodule of `M Γ N` is isomorphic to `N`. -/ | |
@[simps] def snd_equiv : submodule.snd R M Mβ ββ[R] Mβ := | |
{ to_fun := Ξ» x, x.1.2, | |
inv_fun := Ξ» n, β¨β¨0, nβ©, by tidyβ©, | |
map_add' := by simp, | |
map_smul' := by simp, | |
left_inv := by tidy, | |
right_inv := by tidy, } | |
lemma snd_map_fst : (submodule.snd R M Mβ).map (linear_map.fst R M Mβ) = β₯ := | |
by { tidy, exact 0, } | |
lemma snd_map_snd : (submodule.snd R M Mβ).map (linear_map.snd R M Mβ) = β€ := | |
by tidy | |
lemma fst_sup_snd : submodule.fst R M Mβ β submodule.snd R M Mβ = β€ := | |
begin | |
rw eq_top_iff, | |
rintro β¨m, nβ© -, | |
rw [show (m, n) = (m, 0) + (0, n), by simp], | |
apply submodule.add_mem (submodule.fst R M Mβ β submodule.snd R M Mβ), | |
{ exact submodule.mem_sup_left (submodule.mem_comap.mpr (by simp)), }, | |
{ exact submodule.mem_sup_right (submodule.mem_comap.mpr (by simp)), }, | |
end | |
lemma fst_inf_snd : submodule.fst R M Mβ β submodule.snd R M Mβ = β₯ := by tidy | |
lemma le_prod_iff {pβ : submodule R M} {pβ : submodule R Mβ} {q : submodule R (M Γ Mβ)} : | |
q β€ pβ.prod pβ β map (linear_map.fst R M Mβ) q β€ pβ β§ map (linear_map.snd R M Mβ) q β€ pβ := | |
begin | |
split, | |
{ intros h, | |
split, | |
{ rintros x β¨β¨y1,y2β©, β¨hy1,rflβ©β©, exact (h hy1).1 }, | |
{ rintros x β¨β¨y1,y2β©, β¨hy1,rflβ©β©, exact (h hy1).2 }, }, | |
{ rintros β¨hH, hKβ© β¨x1, x2β© h, exact β¨hH β¨_ , h, rflβ©, hK β¨ _, h, rflβ©β©, } | |
end | |
lemma prod_le_iff {pβ : submodule R M} {pβ : submodule R Mβ} {q : submodule R (M Γ Mβ)} : | |
pβ.prod pβ β€ q β map (linear_map.inl R M Mβ) pβ β€ q β§ map (linear_map.inr R M Mβ) pβ β€ q := | |
begin | |
split, | |
{ intros h, | |
split, | |
{ rintros _ β¨x, hx, rflβ©, apply h, exact β¨hx, zero_mem pββ©, }, | |
{ rintros _ β¨x, hx, rflβ©, apply h, exact β¨zero_mem pβ, hxβ©, }, }, | |
{ rintros β¨hH, hKβ© β¨x1, x2β© β¨h1, h2β©, | |
have h1' : (linear_map.inl R _ _) x1 β q, { apply hH, simpa using h1, }, | |
have h2' : (linear_map.inr R _ _) x2 β q, { apply hK, simpa using h2, }, | |
simpa using add_mem h1' h2', } | |
end | |
lemma prod_eq_bot_iff {pβ : submodule R M} {pβ : submodule R Mβ} : | |
pβ.prod pβ = β₯ β pβ = β₯ β§ pβ = β₯ := | |
by simp only [eq_bot_iff, prod_le_iff, (gc_map_comap _).le_iff_le, comap_bot, ker_inl, ker_inr] | |
lemma prod_eq_top_iff {pβ : submodule R M} {pβ : submodule R Mβ} : | |
pβ.prod pβ = β€ β pβ = β€ β§ pβ = β€ := | |
by simp only [eq_top_iff, le_prod_iff, β (gc_map_comap _).le_iff_le, map_top, range_fst, range_snd] | |
end submodule | |
namespace linear_equiv | |
/-- Product of modules is commutative up to linear isomorphism. -/ | |
@[simps apply] | |
def prod_comm (R M N : Type*) [semiring R] [add_comm_monoid M] [add_comm_monoid N] | |
[module R M] [module R N] : (M Γ N) ββ[R] (N Γ M) := | |
{ to_fun := prod.swap, | |
map_smul' := Ξ» r β¨m, nβ©, rfl, | |
..add_equiv.prod_comm } | |
section | |
variables [semiring R] | |
variables [add_comm_monoid M] [add_comm_monoid Mβ] [add_comm_monoid Mβ] [add_comm_monoid Mβ] | |
variables {module_M : module R M} {module_Mβ : module R Mβ} | |
variables {module_Mβ : module R Mβ} {module_Mβ : module R Mβ} | |
variables (eβ : M ββ[R] Mβ) (eβ : Mβ ββ[R] Mβ) | |
/-- Product of linear equivalences; the maps come from `equiv.prod_congr`. -/ | |
protected def prod : | |
(M Γ Mβ) ββ[R] (Mβ Γ Mβ) := | |
{ map_smul' := Ξ» c x, prod.ext (eβ.map_smulββ c _) (eβ.map_smulββ c _), | |
.. eβ.to_add_equiv.prod_congr eβ.to_add_equiv } | |
lemma prod_symm : (eβ.prod eβ).symm = eβ.symm.prod eβ.symm := rfl | |
@[simp] lemma prod_apply (p) : | |
eβ.prod eβ p = (eβ p.1, eβ p.2) := rfl | |
@[simp, norm_cast] lemma coe_prod : | |
(eβ.prod eβ : (M Γ Mβ) ββ[R] (Mβ Γ Mβ)) = (eβ : M ββ[R] Mβ).prod_map (eβ : Mβ ββ[R] Mβ) := rfl | |
end | |
section | |
variables [semiring R] | |
variables [add_comm_monoid M] [add_comm_monoid Mβ] [add_comm_monoid Mβ] [add_comm_group Mβ] | |
variables {module_M : module R M} {module_Mβ : module R Mβ} | |
variables {module_Mβ : module R Mβ} {module_Mβ : module R Mβ} | |
variables (eβ : M ββ[R] Mβ) (eβ : Mβ ββ[R] Mβ) | |
/-- Equivalence given by a block lower diagonal matrix. `eβ` and `eβ` are diagonal square blocks, | |
and `f` is a rectangular block below the diagonal. -/ | |
protected def skew_prod (f : M ββ[R] Mβ) : | |
(M Γ Mβ) ββ[R] Mβ Γ Mβ := | |
{ inv_fun := Ξ» p : Mβ Γ Mβ, (eβ.symm p.1, eβ.symm (p.2 - f (eβ.symm p.1))), | |
left_inv := Ξ» p, by simp, | |
right_inv := Ξ» p, by simp, | |
.. ((eβ : M ββ[R] Mβ).comp (linear_map.fst R M Mβ)).prod | |
((eβ : Mβ ββ[R] Mβ).comp (linear_map.snd R M Mβ) + | |
f.comp (linear_map.fst R M Mβ)) } | |
@[simp] lemma skew_prod_apply (f : M ββ[R] Mβ) (x) : | |
eβ.skew_prod eβ f x = (eβ x.1, eβ x.2 + f x.1) := rfl | |
@[simp] lemma skew_prod_symm_apply (f : M ββ[R] Mβ) (x) : | |
(eβ.skew_prod eβ f).symm x = (eβ.symm x.1, eβ.symm (x.2 - f (eβ.symm x.1))) := rfl | |
end | |
end linear_equiv | |
namespace linear_map | |
open submodule | |
variables [ring R] | |
variables [add_comm_group M] [add_comm_group Mβ] [add_comm_group Mβ] | |
variables [module R M] [module R Mβ] [module R Mβ] | |
/-- If the union of the kernels `ker f` and `ker g` spans the domain, then the range of | |
`prod f g` is equal to the product of `range f` and `range g`. -/ | |
lemma range_prod_eq {f : M ββ[R] Mβ} {g : M ββ[R] Mβ} (h : ker f β ker g = β€) : | |
range (prod f g) = (range f).prod (range g) := | |
begin | |
refine le_antisymm (f.range_prod_le g) _, | |
simp only [set_like.le_def, prod_apply, mem_range, set_like.mem_coe, mem_prod, exists_imp_distrib, | |
and_imp, prod.forall, pi.prod], | |
rintros _ _ x rfl y rfl, | |
simp only [prod.mk.inj_iff, β sub_mem_ker_iff], | |
have : y - x β ker f β ker g, { simp only [h, mem_top] }, | |
rcases mem_sup.1 this with β¨x', hx', y', hy', Hβ©, | |
refine β¨x' + x, _, _β©, | |
{ rwa add_sub_cancel }, | |
{ rwa [β eq_sub_iff_add_eq.1 H, add_sub_add_right_eq_sub, β neg_mem_iff, neg_sub, | |
add_sub_cancel'] } | |
end | |
end linear_map | |
namespace linear_map | |
/-! | |
## Tunnels and tailings | |
Some preliminary work for establishing the strong rank condition for noetherian rings. | |
Given a morphism `f : M Γ N ββ[R] M` which is `i : injective f`, | |
we can find an infinite decreasing `tunnel f i n` of copies of `M` inside `M`, | |
and sitting beside these, an infinite sequence of copies of `N`. | |
We picturesquely name these as `tailing f i n` for each individual copy of `N`, | |
and `tailings f i n` for the supremum of the first `n+1` copies: | |
they are the pieces left behind, sitting inside the tunnel. | |
By construction, each `tailing f i (n+1)` is disjoint from `tailings f i n`; | |
later, when we assume `M` is noetherian, this implies that `N` must be trivial, | |
and establishes the strong rank condition for any left-noetherian ring. | |
-/ | |
section tunnel | |
-- (This doesn't work over a semiring: we need to use that `submodule R M` is a modular lattice, | |
-- which requires cancellation.) | |
variables [ring R] | |
variables {N : Type*} [add_comm_group M] [module R M] [add_comm_group N] [module R N] | |
open function | |
/-- An auxiliary construction for `tunnel`. | |
The composition of `f`, followed by the isomorphism back to `K`, | |
followed by the inclusion of this submodule back into `M`. -/ | |
def tunnel_aux (f : M Γ N ββ[R] M) (KΟ : Ξ£ K : submodule R M, K ββ[R] M) : | |
M Γ N ββ[R] M := | |
(KΟ.1.subtype.comp KΟ.2.symm.to_linear_map).comp f | |
lemma tunnel_aux_injective | |
(f : M Γ N ββ[R] M) (i : injective f) (KΟ : Ξ£ K : submodule R M, K ββ[R] M) : | |
injective (tunnel_aux f KΟ) := | |
(subtype.val_injective.comp KΟ.2.symm.injective).comp i | |
noncomputable theory | |
/-- Auxiliary definition for `tunnel`. -/ | |
-- Even though we have `noncomputable theory`, | |
-- we get an error without another `noncomputable` here. | |
noncomputable def tunnel' (f : M Γ N ββ[R] M) (i : injective f) : | |
β β Ξ£ (K : submodule R M), K ββ[R] M | |
| 0 := β¨β€, linear_equiv.of_top β€ rflβ© | |
| (n+1) := | |
β¨(submodule.fst R M N).map (tunnel_aux f (tunnel' n)), | |
((submodule.fst R M N).equiv_map_of_injective _ (tunnel_aux_injective f i (tunnel' n))).symm.trans | |
(submodule.fst_equiv R M N)β© | |
/-- | |
Give an injective map `f : M Γ N ββ[R] M` we can find a nested sequence of submodules | |
all isomorphic to `M`. | |
-/ | |
def tunnel (f : M Γ N ββ[R] M) (i : injective f) : β βo (submodule R M)α΅α΅ := | |
β¨Ξ» n, order_dual.to_dual (tunnel' f i n).1, monotone_nat_of_le_succ (Ξ» n, begin | |
dsimp [tunnel', tunnel_aux], | |
rw [submodule.map_comp, submodule.map_comp], | |
apply submodule.map_subtype_le, | |
end)β© | |
/-- | |
Give an injective map `f : M Γ N ββ[R] M` we can find a sequence of submodules | |
all isomorphic to `N`. | |
-/ | |
def tailing (f : M Γ N ββ[R] M) (i : injective f) (n : β) : submodule R M := | |
(submodule.snd R M N).map (tunnel_aux f (tunnel' f i n)) | |
/-- Each `tailing f i n` is a copy of `N`. -/ | |
def tailing_linear_equiv (f : M Γ N ββ[R] M) (i : injective f) (n : β) : tailing f i n ββ[R] N := | |
((submodule.snd R M N).equiv_map_of_injective _ | |
(tunnel_aux_injective f i (tunnel' f i n))).symm.trans (submodule.snd_equiv R M N) | |
lemma tailing_le_tunnel (f : M Γ N ββ[R] M) (i : injective f) (n : β) : | |
tailing f i n β€ (tunnel f i n).of_dual := | |
begin | |
dsimp [tailing, tunnel_aux], | |
rw [submodule.map_comp, submodule.map_comp], | |
apply submodule.map_subtype_le, | |
end | |
lemma tailing_disjoint_tunnel_succ (f : M Γ N ββ[R] M) (i : injective f) (n : β) : | |
disjoint (tailing f i n) (tunnel f i (n+1)).of_dual := | |
begin | |
rw disjoint_iff, | |
dsimp [tailing, tunnel, tunnel'], | |
rw [submodule.map_inf_eq_map_inf_comap, | |
submodule.comap_map_eq_of_injective (tunnel_aux_injective _ i _), inf_comm, | |
submodule.fst_inf_snd, submodule.map_bot], | |
end | |
lemma tailing_sup_tunnel_succ_le_tunnel (f : M Γ N ββ[R] M) (i : injective f) (n : β) : | |
tailing f i n β (tunnel f i (n+1)).of_dual β€ (tunnel f i n).of_dual := | |
begin | |
dsimp [tailing, tunnel, tunnel', tunnel_aux], | |
rw [βsubmodule.map_sup, sup_comm, submodule.fst_sup_snd, submodule.map_comp, submodule.map_comp], | |
apply submodule.map_subtype_le, | |
end | |
/-- The supremum of all the copies of `N` found inside the tunnel. -/ | |
def tailings (f : M Γ N ββ[R] M) (i : injective f) : β β submodule R M := | |
partial_sups (tailing f i) | |
@[simp] lemma tailings_zero (f : M Γ N ββ[R] M) (i : injective f) : | |
tailings f i 0 = tailing f i 0 := | |
by simp [tailings] | |
@[simp] lemma tailings_succ (f : M Γ N ββ[R] M) (i : injective f) (n : β) : | |
tailings f i (n+1) = tailings f i n β tailing f i (n+1) := | |
by simp [tailings] | |
lemma tailings_disjoint_tunnel (f : M Γ N ββ[R] M) (i : injective f) (n : β) : | |
disjoint (tailings f i n) (tunnel f i (n+1)).of_dual := | |
begin | |
induction n with n ih, | |
{ simp only [tailings_zero], | |
apply tailing_disjoint_tunnel_succ, }, | |
{ simp only [tailings_succ], | |
refine disjoint.disjoint_sup_left_of_disjoint_sup_right _ _, | |
apply tailing_disjoint_tunnel_succ, | |
apply disjoint.mono_right _ ih, | |
apply tailing_sup_tunnel_succ_le_tunnel, }, | |
end | |
lemma tailings_disjoint_tailing (f : M Γ N ββ[R] M) (i : injective f) (n : β) : | |
disjoint (tailings f i n) (tailing f i (n+1)) := | |
disjoint.mono_right (tailing_le_tunnel f i _) (tailings_disjoint_tunnel f i _) | |
end tunnel | |
section graph | |
variables [semiring R] [add_comm_monoid M] [add_comm_monoid Mβ] | |
[add_comm_group Mβ] [add_comm_group Mβ] [module R M] [module R Mβ] | |
[module R Mβ] [module R Mβ] (f : M ββ[R] Mβ) (g : Mβ ββ[R] Mβ) | |
/-- Graph of a linear map. -/ | |
def graph : submodule R (M Γ Mβ) := | |
{ carrier := {p | p.2 = f p.1}, | |
add_mem' := Ξ» a b (ha : _ = _) (hb : _ = _), | |
begin | |
change _ + _ = f (_ + _), | |
rw [map_add, ha, hb] | |
end, | |
zero_mem' := eq.symm (map_zero f), | |
smul_mem' := Ξ» c x (hx : _ = _), | |
begin | |
change _ β’ _ = f (_ β’ _), | |
rw [map_smul, hx] | |
end } | |
@[simp] lemma mem_graph_iff (x : M Γ Mβ) : x β f.graph β x.2 = f x.1 := iff.rfl | |
lemma graph_eq_ker_coprod : g.graph = ((-g).coprod linear_map.id).ker := | |
begin | |
ext x, | |
change _ = _ β -(g x.1) + x.2 = _, | |
rw [add_comm, add_neg_eq_zero] | |
end | |
lemma graph_eq_range_prod : f.graph = (linear_map.id.prod f).range := | |
begin | |
ext x, | |
exact β¨Ξ» hx, β¨x.1, prod.ext rfl hx.symmβ©, Ξ» β¨u, huβ©, hu βΈ rflβ© | |
end | |
end graph | |
end linear_map | |