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(linear_algebra/pi_tensor_product): define the tensor product of an indexed family of semimodules #5311

Closed
wants to merge 46 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
205e946
add pi_tensor_product.lean
dupuisf Dec 10, 2020
56ceca9
some progress
dupuisf Dec 10, 2020
1016998
prove semimodule instance
dupuisf Dec 10, 2020
c3db194
small changes
dupuisf Dec 10, 2020
2a5f055
connection with multilinear maps, not finished
dupuisf Dec 10, 2020
cb5d5f1
documentation
dupuisf Dec 10, 2020
647e28a
placate 100-char-per-line linter
dupuisf Dec 10, 2020
c3d1d15
a few more todos
dupuisf Dec 10, 2020
8243a2b
nonempty -> inhabited
dupuisf Dec 10, 2020
8157c3b
add hidden R factor to deal with empty iota
dupuisf Dec 11, 2020
d8da4a3
prove semimodule instance for version with extra R
dupuisf Dec 11, 2020
b049492
defined tprod in terms of tprod_coef
dupuisf Dec 11, 2020
fb9c0b9
now it compiles again
dupuisf Dec 11, 2020
d5337bc
100 char linter
dupuisf Dec 12, 2020
90f8af8
lemmas for ring case
dupuisf Dec 12, 2020
c1858fd
Merge branch 'master' into pi_tensor_product
dupuisf Dec 12, 2020
3d721b6
add comment about requiring comm_ring
dupuisf Dec 12, 2020
59a6a5e
define lift_add_hom to avoid this lift manually twice
dupuisf Dec 12, 2020
0a44f0a
documentation
dupuisf Dec 13, 2020
30a0893
Update src/linear_algebra/pi_tensor_product.lean
dupuisf Dec 16, 2020
f4329df
Update src/linear_algebra/pi_tensor_product.lean
dupuisf Dec 16, 2020
f0d36d4
Update src/linear_algebra/pi_tensor_product.lean
dupuisf Dec 16, 2020
aadfc8c
coef -> coeff
dupuisf Dec 16, 2020
3a282cb
100 chars
dupuisf Dec 16, 2020
2c33be8
Update src/linear_algebra/pi_tensor_product.lean
dupuisf Dec 17, 2020
a43a7a5
Update src/linear_algebra/pi_tensor_product.lean
dupuisf Dec 17, 2020
687ff3e
lift as an add_equiv
dupuisf Dec 17, 2020
3b90835
Merge branch 'master' into pi_tensor_product
dupuisf Dec 17, 2020
84055b2
use map_neg
dupuisf Dec 17, 2020
88c1aa0
Merge together tprod and mk, and remove all the then-redundant lemmas
eric-wieser Dec 18, 2020
9706bcd
fix unused argument linter error in multilinear.lean
dupuisf Dec 18, 2020
a92f5ad
update module-level doc
dupuisf Dec 18, 2020
98e8545
add warning against using tprod_coeff
dupuisf Dec 18, 2020
c75291e
Update src/linear_algebra/multilinear.lean
dupuisf Dec 29, 2020
90edfdd
Update src/linear_algebra/pi_tensor_product.lean
dupuisf Dec 29, 2020
f9542e5
Update src/linear_algebra/pi_tensor_product.lean
dupuisf Dec 29, 2020
6d34517
Update src/linear_algebra/pi_tensor_product.lean
dupuisf Dec 29, 2020
13f551a
Update src/linear_algebra/pi_tensor_product.lean
dupuisf Dec 29, 2020
6237a58
Update src/linear_algebra/pi_tensor_product.lean
dupuisf Dec 29, 2020
9c76a0a
fix build + typo in docs
dupuisf Dec 29, 2020
b8b192a
Merge branch 'master' into pi_tensor_product
dupuisf Dec 29, 2020
7b3be80
scalar tower
dupuisf Dec 29, 2020
c261010
fix
dupuisf Dec 29, 2020
5e3fa95
linter
dupuisf Dec 29, 2020
1b8ef90
Merge branch 'master' into pi_tensor_product
dupuisf Jan 3, 2021
d140385
delete useless smul_zero lemma
dupuisf Jan 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 39 additions & 5 deletions src/linear_algebra/pi_tensor_product.lean
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ open function

section semiring

variables {ι : Type*} {R : Type*} [comm_semiring R] --[inhabited ι]
variables {ι : Type*} {R : Type*} [comm_semiring R]
variables {s : ι → Type*} [∀ i, add_comm_monoid (s i)] [∀ i, semimodule R (s i)]
variables {E : Type*} [add_comm_monoid E] [semimodule R E]

Expand Down Expand Up @@ -151,10 +151,6 @@ lemma smul_tprod_index (f : Π i, s i) (i j : ι) (r : R) :
tprod R (update f i (r • f i)) = tprod R (update f j (r • f j)) :=
by simp_rw [tprod, smul_tprod_coef]

--theorem smul_tprod' (r : R) (f : Π i, s i) (i : ι) :
-- r • (tprod R f) = tprod R (update f i (r • f i)) :=
--smul_tprod f (default ι) i r

/-- Auxiliary function for defining scalar multiplication on the tensor product. -/
def smul.aux (r : R) : free_add_monoid (R × Π i, s i) →+ ⨂[R] i, s i :=
free_add_monoid.lift $ λ (f : R × Π i, s i), tprod_coef R (r * f.1) f.2
Expand Down Expand Up @@ -187,6 +183,15 @@ lemma smul_tprod (r : R) (f : Π i, s i) (i : ι) :
r • (tprod R f) = tprod R (update f i (r • f i)) :=
by simp [tprod, smul_tprod_coef' r 1 f, smul_tprod_coef]

lemma smul_tprod' (r : R) (f : Π i, s i) (i : ι) (m : s i) :
dupuisf marked this conversation as resolved.
Show resolved Hide resolved
r • tprod R (update f i m) = tprod R (update f i (r • m)) :=
begin
set g := update f i m with hg,
have h₁ : update f i (r • m) = update g i (r • m) := by simp_rw [hg, update_idem],
have h₂ : g i = m := by simp [hg],
rw [h₁, smul_tprod r _ i, h₂],
end

lemma tprod_coef_eq_smul_tprod (z : R) (f : Π i, s i) : tprod_coef R z f = z • tprod R f :=
begin
have : z = z • (1 : R) := by rw [smul_eq_mul, mul_one],
Expand Down Expand Up @@ -378,3 +383,32 @@ end multilinear
end pi_tensor_product

end semiring

section ring
namespace pi_tensor_product

open pi_tensor_product
open_locale tensor_product

variables {ι : Type*} {R : Type*} [comm_ring R]
variables {s : ι → Type*} [∀ i, add_comm_group (s i)] [∀ i, module R (s i)]
variables {E : Type*} [add_comm_group E] [semimodule R E]

instance : add_comm_group (⨂[R] i, s i) := semimodule.add_comm_monoid_to_add_comm_group R
dupuisf marked this conversation as resolved.
Show resolved Hide resolved

lemma neg_tprod_coef (z : R) (f : Π i, s i) : tprod_coef R (-z) f = -tprod_coef R z f :=
by rw [←neg_one_smul R, ←smul_tprod_coef', neg_one_smul R]

lemma neg_tprod (f : Π i, s i) (i : ι) : tprod R (update f i (-(f i))) = -tprod R f :=
by rw [←neg_one_smul R, ←smul_tprod, neg_one_smul R]

lemma neg_tprod' (f : Π i, s i) (i : ι) (m : s i) :
tprod R (update f i (-m)) = -tprod R (update f i m) :=
by rw [←neg_one_smul R, ←smul_tprod', neg_one_smul R]
dupuisf marked this conversation as resolved.
Show resolved Hide resolved

lemma sub_tprod (f : Π i, s i) (i : ι) (m₁ m₂ : s i) :
tprod R (update f i m₁) - tprod R (update f i m₂) = tprod R (update f i (m₁ - m₂)) :=
by rw [sub_eq_add_neg, ←neg_tprod' f i _, add_tprod f i m₁ (-m₂), sub_eq_add_neg]
dupuisf marked this conversation as resolved.
Show resolved Hide resolved

end pi_tensor_product
end ring