Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(ring_theory/algebra): more on restrict_scalars #2445

Closed
wants to merge 26 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a5b3edf
[] to {}
Apr 18, 2020
cd91bba
revert unwanted change
Apr 18, 2020
a8f9ed5
revert unwanted change
Apr 18, 2020
dae3ea2
add comment
Apr 18, 2020
6508d11
revert unwanted change
Apr 18, 2020
b6b3fe7
feat(ring_theory/algebra): more on restrict_scalars
Apr 18, 2020
503ccae
Apply suggestions from code review
semorrison Apr 18, 2020
349f6c4
changes from review
semorrison Apr 18, 2020
0f8ea55
Merge remote-tracking branch 'origin/implicit_args' into restrict_sca…
semorrison Apr 18, 2020
e75858c
more implicit arguments
semorrison Apr 19, 2020
cc931c5
Merge branch 'implicit_args' into restrict_scalars
semorrison Apr 19, 2020
59c3480
type synonym
semorrison Apr 19, 2020
3329c6d
Merge remote-tracking branch 'origin/master' into restrict_scalars
semorrison Apr 19, 2020
8ad0107
merge
semorrison May 21, 2020
8fa7c90
minor
semorrison May 21, 2020
08b39f5
making S explicit in restrict_scalars
semorrison May 21, 2020
52baa18
linting
semorrison May 21, 2020
4c35d85
Merge remote-tracking branch 'origin/master' into restrict_scalars
semorrison May 22, 2020
ed1ea6f
updates
semorrison May 22, 2020
f697b30
fix
semorrison May 22, 2020
e7fb63e
Update src/ring_theory/algebra.lean
semorrison May 26, 2020
8f0500f
add typeclass arguments to module.restrict_scalars type synonym
semorrison May 26, 2020
70d1622
Merge branch 'restrict_scalars' of github.com:leanprover-community/ma…
semorrison May 26, 2020
63ab834
Merge remote-tracking branch 'origin/master' into restrict_scalars
semorrison May 26, 2020
203079f
remove typeclass arguments on type synonym again
semorrison May 26, 2020
fdd2a1e
linting
semorrison May 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 29 additions & 1 deletion src/ring_theory/algebra.lean
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ variables (R : Type*) [comm_ring R] (S : Type*) [ring S] [algebra R S]
(E : Type*) [add_comm_group E] [module S E] {F : Type*} [add_comm_group F] [module S F]

/-- When `E` is a module over a ring `S`, and `S` is an algebra over `R`, then `E` inherits a
module structure over `R`, called `module.restrict S R E`.
module structure over `R`, called `module.restrict_scalars R S E`.
Not registered as an instance as `S` can not be inferred. -/
def module.restrict_scalars : module R E :=
{ smul := λc x, (algebra_map R S c) • x,
Expand All @@ -576,10 +576,38 @@ def module.restrict_scalars : module R E :=
add_smul := by simp [add_smul],
zero_smul := by simp [zero_smul] }

/--
The identity function, considered as an `R`-linear map from an `R`-algebra `S` to itself,
with `module.restrict_scalars R S S` as the module structure in the source,
and `algebra.to_module` as the module structure in the target.
semorrison marked this conversation as resolved.
Show resolved Hide resolved

Unfortunately these structures are not generally definitionally equal,
so we sometimes need to insert this map in order to typecheck.
-/
def algebra.restrict_scalars_iso :
semorrison marked this conversation as resolved.
Show resolved Hide resolved
@linear_map R S S _ _ _ (module.restrict_scalars R S S) (algebra.to_module) :=
{ to_fun := λ s, s,
add := λ x y, rfl,
smul := λ c x, (algebra.smul_def' _ _).symm, }

@[simp]
lemma algebra.restrict_scalars_iso_apply (s : S) : algebra.restrict_scalars_iso R S s = s := rfl

variables {S E}

local attribute [instance] module.restrict_scalars

/--
The `R`-submodule of the `R`-module given by restriction of scalars,
corresponding to an `S`-submodule of the original `S`-module.
-/
@[simps]
def submodule.restrict_scalars (V : submodule S E) : submodule R E :=
semorrison marked this conversation as resolved.
Show resolved Hide resolved
{ carrier := V.carrier,
zero := V.zero,
smul := λ c e h, V.smul _ h,
add := λ x y hx hy, V.add hx hy, }

/-- The `R`-linear map induced by an `S`-linear map when `S` is an algebra over `R`. -/
def linear_map.restrict_scalars (f : E →ₗ[S] F) : E →ₗ[R] F :=
{ to_fun := f.to_fun,
Expand Down