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 | |
-/ | |
import group_theory.quotient_group | |
import linear_algebra.span | |
/-! | |
# Quotients by submodules | |
* If `p` is a submodule of `M`, `M β§Έ p` is the quotient of `M` with respect to `p`: | |
that is, elements of `M` are identified if their difference is in `p`. This is itself a module. | |
-/ | |
-- For most of this file we work over a noncommutative ring | |
section ring | |
namespace submodule | |
variables {R M : Type*} {r : R} {x y : M} [ring R] [add_comm_group M] [module R M] | |
variables (p p' : submodule R M) | |
open linear_map quotient_add_group | |
/-- The equivalence relation associated to a submodule `p`, defined by `x β y` iff `-x + y β p`. | |
Note this is equivalent to `y - x β p`, but defined this way to be be defeq to the `add_subgroup` | |
version, where commutativity can't be assumed. -/ | |
def quotient_rel : setoid M := | |
quotient_add_group.left_rel p.to_add_subgroup | |
lemma quotient_rel_r_def {x y : M} : @setoid.r _ (p.quotient_rel) x y β x - y β p := | |
iff.trans (by { rw [left_rel_apply, sub_eq_add_neg, neg_add, neg_neg], refl }) neg_mem_iff | |
/-- The quotient of a module `M` by a submodule `p β M`. -/ | |
instance has_quotient : has_quotient M (submodule R M) := β¨Ξ» p, quotient (quotient_rel p)β© | |
namespace quotient | |
/-- Map associating to an element of `M` the corresponding element of `M/p`, | |
when `p` is a submodule of `M`. -/ | |
def mk {p : submodule R M} : M β M β§Έ p := quotient.mk' | |
@[simp] theorem mk_eq_mk {p : submodule R M} (x : M) : | |
(@_root_.quotient.mk _ (quotient_rel p) x) = mk x := rfl | |
@[simp] theorem mk'_eq_mk {p : submodule R M} (x : M) : (quotient.mk' x : M β§Έ p) = mk x := rfl | |
@[simp] theorem quot_mk_eq_mk {p : submodule R M} (x : M) : (quot.mk _ x : M β§Έ p) = mk x := rfl | |
protected theorem eq' {x y : M} : (mk x : M β§Έ p) = mk y β -x + y β p := quotient_add_group.eq | |
protected theorem eq {x y : M} : (mk x : M β§Έ p) = mk y β x - y β p := | |
(p^.quotient.eq').trans (left_rel_apply.symm.trans p.quotient_rel_r_def) | |
instance : has_zero (M β§Έ p) := β¨mk 0β© | |
instance : inhabited (M β§Έ p) := β¨0β© | |
@[simp] theorem mk_zero : mk 0 = (0 : M β§Έ p) := rfl | |
@[simp] theorem mk_eq_zero : (mk x : M β§Έ p) = 0 β x β p := | |
by simpa using (quotient.eq p : mk x = 0 β _) | |
instance add_comm_group : add_comm_group (M β§Έ p) := | |
quotient_add_group.add_comm_group p.to_add_subgroup | |
@[simp] theorem mk_add : (mk (x + y) : M β§Έ p) = mk x + mk y := rfl | |
@[simp] theorem mk_neg : (mk (-x) : M β§Έ p) = -mk x := rfl | |
@[simp] theorem mk_sub : (mk (x - y) : M β§Έ p) = mk x - mk y := rfl | |
section has_smul | |
variables {S : Type*} [has_smul S R] [has_smul S M] [is_scalar_tower S R M] (P : submodule R M) | |
instance has_smul' : has_smul S (M β§Έ P) := | |
β¨Ξ» a, quotient.map' ((β’) a) $ Ξ» x y h, left_rel_apply.mpr $ | |
by simpa [smul_sub] using P.smul_mem (a β’ 1 : R) (left_rel_apply.mp h)β© | |
/-- Shortcut to help the elaborator in the common case. -/ | |
instance has_smul : has_smul R (M β§Έ P) := | |
quotient.has_smul' P | |
@[simp] theorem mk_smul (r : S) (x : M) : (mk (r β’ x) : M β§Έ p) = r β’ mk x := rfl | |
instance smul_comm_class (T : Type*) [has_smul T R] [has_smul T M] [is_scalar_tower T R M] | |
[smul_comm_class S T M] : smul_comm_class S T (M β§Έ P) := | |
{ smul_comm := Ξ» x y, quotient.ind' $ by exact Ξ» z, congr_arg mk (smul_comm _ _ _) } | |
instance is_scalar_tower (T : Type*) [has_smul T R] [has_smul T M] [is_scalar_tower T R M] | |
[has_smul S T] [is_scalar_tower S T M] : is_scalar_tower S T (M β§Έ P) := | |
{ smul_assoc := Ξ» x y, quotient.ind' $ by exact Ξ» z, congr_arg mk (smul_assoc _ _ _) } | |
instance is_central_scalar [has_smul Sα΅α΅α΅ R] [has_smul Sα΅α΅α΅ M] [is_scalar_tower Sα΅α΅α΅ R M] | |
[is_central_scalar S M] : is_central_scalar S (M β§Έ P) := | |
{ op_smul_eq_smul := Ξ» x, quotient.ind' $ by exact Ξ» z, congr_arg mk $ op_smul_eq_smul _ _ } | |
end has_smul | |
section module | |
variables {S : Type*} | |
instance mul_action' [monoid S] [has_smul S R] [mul_action S M] [is_scalar_tower S R M] | |
(P : submodule R M) : mul_action S (M β§Έ P) := | |
function.surjective.mul_action mk (surjective_quot_mk _) P^.quotient.mk_smul | |
instance mul_action (P : submodule R M) : mul_action R (M β§Έ P) := | |
quotient.mul_action' P | |
instance distrib_mul_action' [monoid S] [has_smul S R] [distrib_mul_action S M] | |
[is_scalar_tower S R M] | |
(P : submodule R M) : distrib_mul_action S (M β§Έ P) := | |
function.surjective.distrib_mul_action | |
β¨mk, rfl, Ξ» _ _, rflβ© (surjective_quot_mk _) P^.quotient.mk_smul | |
instance distrib_mul_action (P : submodule R M) : distrib_mul_action R (M β§Έ P) := | |
quotient.distrib_mul_action' P | |
instance module' [semiring S] [has_smul S R] [module S M] [is_scalar_tower S R M] | |
(P : submodule R M) : module S (M β§Έ P) := | |
function.surjective.module _ | |
β¨mk, rfl, Ξ» _ _, rflβ© (surjective_quot_mk _) P^.quotient.mk_smul | |
instance module (P : submodule R M) : module R (M β§Έ P) := | |
quotient.module' P | |
variables (S) | |
/-- The quotient of `P` as an `S`-submodule is the same as the quotient of `P` as an `R`-submodule, | |
where `P : submodule R M`. | |
-/ | |
def restrict_scalars_equiv [ring S] [has_smul S R] [module S M] [is_scalar_tower S R M] | |
(P : submodule R M) : | |
(M β§Έ P.restrict_scalars S) ββ[S] M β§Έ P := | |
{ map_add' := Ξ» x y, quotient.induction_onβ' x y (Ξ» x' y', rfl), | |
map_smul' := Ξ» c x, quotient.induction_on' x (Ξ» x', rfl), | |
..quotient.congr_right $ Ξ» _ _, iff.rfl } | |
@[simp] lemma restrict_scalars_equiv_mk | |
[ring S] [has_smul S R] [module S M] [is_scalar_tower S R M] (P : submodule R M) | |
(x : M) : restrict_scalars_equiv S P (mk x) = mk x := | |
rfl | |
@[simp] lemma restrict_scalars_equiv_symm_mk | |
[ring S] [has_smul S R] [module S M] [is_scalar_tower S R M] (P : submodule R M) | |
(x : M) : (restrict_scalars_equiv S P).symm (mk x) = mk x := | |
rfl | |
end module | |
lemma mk_surjective : function.surjective (@mk _ _ _ _ _ p) := | |
by { rintros β¨xβ©, exact β¨x, rflβ© } | |
lemma nontrivial_of_lt_top (h : p < β€) : nontrivial (M β§Έ p) := | |
begin | |
obtain β¨x, _, not_mem_sβ© := set_like.exists_of_lt h, | |
refine β¨β¨mk x, 0, _β©β©, | |
simpa using not_mem_s | |
end | |
end quotient | |
section | |
variables {Mβ : Type*} [add_comm_group Mβ] [module R Mβ] | |
lemma quot_hom_ext β¦f g : M β§Έ p ββ[R] Mββ¦ (h : β x, f (quotient.mk x) = g (quotient.mk x)) : | |
f = g := | |
linear_map.ext $ Ξ» x, quotient.induction_on' x h | |
/-- The map from a module `M` to the quotient of `M` by a submodule `p` as a linear map. -/ | |
def mkq : M ββ[R] M β§Έ p := | |
{ to_fun := quotient.mk, map_add' := by simp, map_smul' := by simp } | |
@[simp] theorem mkq_apply (x : M) : p.mkq x = quotient.mk x := rfl | |
lemma mkq_surjective (A : submodule R M) : function.surjective A.mkq := | |
by rintro β¨xβ©; exact β¨x, rflβ© | |
end | |
variables {Rβ Mβ : Type*} [ring Rβ] [add_comm_group Mβ] [module Rβ Mβ] {Οββ : R β+* Rβ} | |
/-- Two `linear_map`s from a quotient module are equal if their compositions with | |
`submodule.mkq` are equal. | |
See note [partially-applied ext lemmas]. -/ | |
@[ext] | |
lemma linear_map_qext β¦f g : M β§Έ p βββ[Οββ] Mββ¦ (h : f.comp p.mkq = g.comp p.mkq) : f = g := | |
linear_map.ext $ Ξ» x, quotient.induction_on' x $ (linear_map.congr_fun h : _) | |
/-- The map from the quotient of `M` by a submodule `p` to `Mβ` induced by a linear map `f : M β Mβ` | |
vanishing on `p`, as a linear map. -/ | |
def liftq (f : M βββ[Οββ] Mβ) (h : p β€ f.ker) : M β§Έ p βββ[Οββ] Mβ := | |
{ map_smul' := by rintro a β¨xβ©; exact f.map_smulββ a x, | |
..quotient_add_group.lift p.to_add_subgroup f.to_add_monoid_hom h } | |
@[simp] theorem liftq_apply (f : M βββ[Οββ] Mβ) {h} (x : M) : | |
p.liftq f h (quotient.mk x) = f x := rfl | |
@[simp] theorem liftq_mkq (f : M βββ[Οββ] Mβ) (h) : (p.liftq f h).comp p.mkq = f := | |
by ext; refl | |
/--Special case of `liftq` when `p` is the span of `x`. In this case, the condition on `f` simply | |
becomes vanishing at `x`.-/ | |
def liftq_span_singleton (x : M) (f : M βββ[Οββ] Mβ) (h : f x = 0) : (M β§Έ R β x) βββ[Οββ] Mβ := | |
(R β x).liftq f $ by rw [span_singleton_le_iff_mem, linear_map.mem_ker, h] | |
@[simp] lemma liftq_span_singleton_apply (x : M) (f : M βββ[Οββ] Mβ) (h : f x = 0) (y : M) : | |
liftq_span_singleton x f h (quotient.mk y) = f y := rfl | |
@[simp] theorem range_mkq : p.mkq.range = β€ := | |
eq_top_iff'.2 $ by rintro β¨xβ©; exact β¨x, rflβ© | |
@[simp] theorem ker_mkq : p.mkq.ker = p := | |
by ext; simp | |
lemma le_comap_mkq (p' : submodule R (M β§Έ p)) : p β€ comap p.mkq p' := | |
by simpa using (comap_mono bot_le : p.mkq.ker β€ comap p.mkq p') | |
@[simp] theorem mkq_map_self : map p.mkq p = β₯ := | |
by rw [eq_bot_iff, map_le_iff_le_comap, comap_bot, ker_mkq]; exact le_rfl | |
@[simp] theorem comap_map_mkq : comap p.mkq (map p.mkq p') = p β p' := | |
by simp [comap_map_eq, sup_comm] | |
@[simp] theorem map_mkq_eq_top : map p.mkq p' = β€ β p β p' = β€ := | |
by simp only [map_eq_top_iff p.range_mkq, sup_comm, ker_mkq] | |
variables (q : submodule Rβ Mβ) | |
/-- The map from the quotient of `M` by submodule `p` to the quotient of `Mβ` by submodule `q` along | |
`f : M β Mβ` is linear. -/ | |
def mapq (f : M βββ[Οββ] Mβ) (h : p β€ comap f q) : | |
(M β§Έ p) βββ[Οββ] (Mβ β§Έ q) := | |
p.liftq (q.mkq.comp f) $ by simpa [ker_comp] using h | |
@[simp] theorem mapq_apply (f : M βββ[Οββ] Mβ) {h} (x : M) : | |
mapq p q f h (quotient.mk x) = quotient.mk (f x) := rfl | |
theorem mapq_mkq (f : M βββ[Οββ] Mβ) {h} : (mapq p q f h).comp p.mkq = q.mkq.comp f := | |
by ext x; refl | |
@[simp] lemma mapq_zero (h : p β€ q.comap (0 : M βββ[Οββ] Mβ) := by simp) : | |
p.mapq q (0 : M βββ[Οββ] Mβ) h = 0 := | |
by { ext, simp, } | |
/-- Given submodules `p β M`, `pβ β Mβ`, `pβ β Mβ` and maps `f : M β Mβ`, `g : Mβ β Mβ` inducing | |
`mapq f : M β§Έ p β Mβ β§Έ pβ` and `mapq g : Mβ β§Έ pβ β Mβ β§Έ pβ` then | |
`mapq (g β f) = (mapq g) β (mapq f)`. -/ | |
lemma mapq_comp {Rβ Mβ : Type*} [ring Rβ] [add_comm_group Mβ] [module Rβ Mβ] | |
(pβ : submodule Rβ Mβ) (pβ : submodule Rβ Mβ) | |
{Οββ : Rβ β+* Rβ} {Οββ : R β+* Rβ} [ring_hom_comp_triple Οββ Οββ Οββ] | |
(f : M βββ[Οββ] Mβ) (g : Mβ βββ[Οββ] Mβ) (hf : p β€ pβ.comap f) (hg : pβ β€ pβ.comap g) | |
(h := (hf.trans (comap_mono hg))) : | |
p.mapq pβ (g.comp f) h = (pβ.mapq pβ g hg).comp (p.mapq pβ f hf) := | |
by { ext, simp, } | |
@[simp] lemma mapq_id (h : p β€ p.comap linear_map.id := by simp) : | |
p.mapq p linear_map.id h = linear_map.id := | |
by { ext, simp, } | |
lemma mapq_pow {f : M ββ[R] M} (h : p β€ p.comap f) (k : β) | |
(h' : p β€ p.comap (f^k) := p.le_comap_pow_of_le_comap h k) : | |
p.mapq p (f^k) h' = (p.mapq p f h)^k := | |
begin | |
induction k with k ih, | |
{ simp [linear_map.one_eq_id], }, | |
{ simp only [linear_map.iterate_succ, β ih], | |
apply p.mapq_comp, }, | |
end | |
theorem comap_liftq (f : M βββ[Οββ] Mβ) (h) : | |
q.comap (p.liftq f h) = (q.comap f).map (mkq p) := | |
le_antisymm | |
(by rintro β¨xβ© hx; exact β¨_, hx, rflβ©) | |
(by rw [map_le_iff_le_comap, β comap_comp, liftq_mkq]; exact le_rfl) | |
theorem map_liftq [ring_hom_surjective Οββ] (f : M βββ[Οββ] Mβ) (h) (q : submodule R (M β§Έ p)) : | |
q.map (p.liftq f h) = (q.comap p.mkq).map f := | |
le_antisymm | |
(by rintro _ β¨β¨xβ©, hxq, rflβ©; exact β¨x, hxq, rflβ©) | |
(by rintro _ β¨x, hxq, rflβ©; exact β¨quotient.mk x, hxq, rflβ©) | |
theorem ker_liftq (f : M βββ[Οββ] Mβ) (h) : | |
ker (p.liftq f h) = (ker f).map (mkq p) := comap_liftq _ _ _ _ | |
theorem range_liftq [ring_hom_surjective Οββ] (f : M βββ[Οββ] Mβ) (h) : | |
range (p.liftq f h) = range f := | |
by simpa only [range_eq_map] using map_liftq _ _ _ _ | |
theorem ker_liftq_eq_bot (f : M βββ[Οββ] Mβ) (h) (h' : ker f β€ p) : ker (p.liftq f h) = β₯ := | |
by rw [ker_liftq, le_antisymm h h', mkq_map_self] | |
/-- The correspondence theorem for modules: there is an order isomorphism between submodules of the | |
quotient of `M` by `p`, and submodules of `M` larger than `p`. -/ | |
def comap_mkq.rel_iso : | |
submodule R (M β§Έ p) βo {p' : submodule R M // p β€ p'} := | |
{ to_fun := Ξ» p', β¨comap p.mkq p', le_comap_mkq p _β©, | |
inv_fun := Ξ» q, map p.mkq q, | |
left_inv := Ξ» p', map_comap_eq_self $ by simp, | |
right_inv := Ξ» β¨q, hqβ©, subtype.ext_val $ by simpa [comap_map_mkq p], | |
map_rel_iff' := Ξ» pβ pβ, comap_le_comap_iff $ range_mkq _ } | |
/-- The ordering on submodules of the quotient of `M` by `p` embeds into the ordering on submodules | |
of `M`. -/ | |
def comap_mkq.order_embedding : | |
submodule R (M β§Έ p) βͺo submodule R M := | |
(rel_iso.to_rel_embedding $ comap_mkq.rel_iso p).trans (subtype.rel_embedding _ _) | |
@[simp] lemma comap_mkq_embedding_eq (p' : submodule R (M β§Έ p)) : | |
comap_mkq.order_embedding p p' = comap p.mkq p' := rfl | |
lemma span_preimage_eq [ring_hom_surjective Οββ] {f : M βββ[Οββ] Mβ} {s : set Mβ} (hβ : s.nonempty) | |
(hβ : s β range f) : | |
span R (f β»ΒΉ' s) = (span Rβ s).comap f := | |
begin | |
suffices : (span Rβ s).comap f β€ span R (f β»ΒΉ' s), | |
{ exact le_antisymm (span_preimage_le f s) this, }, | |
have hk : ker f β€ span R (f β»ΒΉ' s), | |
{ let y := classical.some hβ, have hy : y β s, { exact classical.some_spec hβ, }, | |
rw ker_le_iff, use [y, hβ hy], rw β set.singleton_subset_iff at hy, | |
exact set.subset.trans subset_span (span_mono (set.preimage_mono hy)), }, | |
rw β left_eq_sup at hk, rw f.range_coe at hβ, | |
rw [hk, βlinear_map.map_le_map_iff, map_span, map_comap_eq, set.image_preimage_eq_of_subset hβ], | |
exact inf_le_right, | |
end | |
end submodule | |
open submodule | |
namespace linear_map | |
section ring | |
variables {R M Rβ Mβ Rβ Mβ : Type*} | |
variables [ring R] [ring Rβ] [ring Rβ] | |
variables [add_comm_monoid M] [add_comm_group Mβ] [add_comm_monoid Mβ] | |
variables [module R M] [module Rβ Mβ] [module Rβ Mβ] | |
variables {Οββ : R β+* Rβ} {Οββ : Rβ β+* Rβ} {Οββ : R β+* Rβ} | |
variables [ring_hom_comp_triple Οββ Οββ Οββ] [ring_hom_surjective Οββ] | |
lemma range_mkq_comp (f : M βββ[Οββ] Mβ) : f.range.mkq.comp f = 0 := | |
linear_map.ext $ Ξ» x, by simp | |
lemma ker_le_range_iff {f : M βββ[Οββ] Mβ} {g : Mβ βββ[Οββ] Mβ} : | |
g.ker β€ f.range β f.range.mkq.comp g.ker.subtype = 0 := | |
by rw [βrange_le_ker_iff, submodule.ker_mkq, submodule.range_subtype] | |
/-- An epimorphism is surjective. -/ | |
lemma range_eq_top_of_cancel {f : M βββ[Οββ] Mβ} | |
(h : β (u v : Mβ ββ[Rβ] Mβ β§Έ f.range), u.comp f = v.comp f β u = v) : f.range = β€ := | |
begin | |
have hβ : (0 : Mβ ββ[Rβ] Mβ β§Έ f.range).comp f = 0 := zero_comp _, | |
rw [βsubmodule.ker_mkq f.range, βh 0 f.range.mkq (eq.trans hβ (range_mkq_comp _).symm)], | |
exact ker_zero | |
end | |
end ring | |
end linear_map | |
open linear_map | |
namespace submodule | |
variables {R M : Type*} {r : R} {x y : M} [ring R] [add_comm_group M] [module R M] | |
variables (p p' : submodule R M) | |
/-- If `p = β₯`, then `M / p ββ[R] M`. -/ | |
def quot_equiv_of_eq_bot (hp : p = β₯) : (M β§Έ p) ββ[R] M := | |
linear_equiv.of_linear (p.liftq id $ hp.symm βΈ bot_le) p.mkq (liftq_mkq _ _ _) $ | |
p.quot_hom_ext $ Ξ» x, rfl | |
@[simp] lemma quot_equiv_of_eq_bot_apply_mk (hp : p = β₯) (x : M) : | |
p.quot_equiv_of_eq_bot hp (quotient.mk x) = x := rfl | |
@[simp] lemma quot_equiv_of_eq_bot_symm_apply (hp : p = β₯) (x : M) : | |
(p.quot_equiv_of_eq_bot hp).symm x = quotient.mk x := rfl | |
@[simp] lemma coe_quot_equiv_of_eq_bot_symm (hp : p = β₯) : | |
((p.quot_equiv_of_eq_bot hp).symm : M ββ[R] M β§Έ p) = p.mkq := rfl | |
/-- Quotienting by equal submodules gives linearly equivalent quotients. -/ | |
def quot_equiv_of_eq (h : p = p') : (M β§Έ p) ββ[R] M β§Έ p' := | |
{ map_add' := by { rintros β¨xβ© β¨yβ©, refl }, map_smul' := by { rintros x β¨yβ©, refl }, | |
..@quotient.congr _ _ (quotient_rel p) (quotient_rel p') (equiv.refl _) $ | |
Ξ» a b, by { subst h, refl } } | |
@[simp] | |
lemma quot_equiv_of_eq_mk (h : p = p') (x : M) : | |
submodule.quot_equiv_of_eq p p' h (submodule.quotient.mk x) = submodule.quotient.mk x := | |
rfl | |
end submodule | |
end ring | |
section comm_ring | |
variables {R M Mβ : Type*} {r : R} {x y : M} [comm_ring R] | |
[add_comm_group M] [module R M] [add_comm_group Mβ] [module R Mβ] | |
(p : submodule R M) (q : submodule R Mβ) | |
namespace submodule | |
/-- Given modules `M`, `Mβ` over a commutative ring, together with submodules `p β M`, `q β Mβ`, | |
the natural map $\{f β Hom(M, Mβ) | f(p) β q \} \to Hom(M/p, Mβ/q)$ is linear. -/ | |
def mapq_linear : compatible_maps p q ββ[R] (M β§Έ p) ββ[R] (Mβ β§Έ q) := | |
{ to_fun := Ξ» f, mapq _ _ f.val f.property, | |
map_add' := Ξ» x y, by { ext, refl, }, | |
map_smul' := Ξ» c f, by { ext, refl, } } | |
end submodule | |
end comm_ring | |