-
Notifications
You must be signed in to change notification settings - Fork 291
[Merged by Bors] - feat(algebra/monoid_algebra): Add an equivalence between add_monoid_algebra and monoid_algebra in terms of multiplicative
#4402
Changes from all commits
5500504
1ad73f0
f0cc24c
ee17c59
10d9b11
e026b21
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -197,6 +197,23 @@ subset.trans support_sum $ bind_mono $ assume a₁ _, | |
|
|
||
| section | ||
|
|
||
| /-- Like `finsupp.map_domain_add`, but for the convolutive multiplication we define in this file -/ | ||
| lemma map_domain_mul {α : Type*} {β : Type*} {α₂ : Type*} [semiring β] [monoid α] [monoid α₂] | ||
| {x y : monoid_algebra β α} (f : mul_hom α α₂) : | ||
| (map_domain f (x * y : monoid_algebra β α) : monoid_algebra β α₂) = | ||
| (map_domain f x * map_domain f y : monoid_algebra β α₂) := | ||
| begin | ||
| simp_rw [mul_def, map_domain_sum, map_domain_single, f.map_mul], | ||
| rw finsupp.sum_map_domain_index, | ||
| { congr, | ||
| ext a b, | ||
| rw finsupp.sum_map_domain_index, | ||
| { simp }, | ||
| { simp [mul_add] } }, | ||
| { simp }, | ||
| { simp [add_mul] } | ||
| end | ||
|
|
||
| variables (k G) | ||
|
|
||
| /-- Embedding of a monoid into its monoid algebra. -/ | ||
|
|
@@ -620,6 +637,24 @@ lemma single_mul_single {a₁ a₂ : G} {b₁ b₂ : k} : | |
| (sum_single_index (by simp only [zero_mul, single_zero, sum_zero])).trans | ||
| (sum_single_index (by rw [mul_zero, single_zero])) | ||
|
|
||
| /-- Like `finsupp.map_domain_add`, but for the convolutive multiplication we define in this file -/ | ||
| lemma map_domain_mul {α : Type*} {β : Type*} {α₂ : Type*} | ||
| [semiring β] [add_monoid α] [add_monoid α₂] | ||
| {x y : add_monoid_algebra β α} (f : add_hom α α₂) : | ||
| (map_domain f (x * y : add_monoid_algebra β α) : add_monoid_algebra β α₂) = | ||
| (map_domain f x * map_domain f y : add_monoid_algebra β α₂) := | ||
| begin | ||
| simp_rw [mul_def, map_domain_sum, map_domain_single, f.map_add], | ||
| rw finsupp.sum_map_domain_index, | ||
| { congr, | ||
| ext a b, | ||
| rw finsupp.sum_map_domain_index, | ||
| { simp }, | ||
| { simp [mul_add] } }, | ||
| { simp }, | ||
| { simp [add_mul] } | ||
| end | ||
|
|
||
| section | ||
|
|
||
| variables (k G) | ||
|
|
@@ -667,6 +702,31 @@ f.single_mul_apply_aux r _ _ _ $ λ a, by rw [zero_add] | |
|
|
||
| end misc_theorems | ||
|
|
||
| end add_monoid_algebra | ||
|
|
||
| /-! | ||
| #### Conversions between `add_monoid_algebra` and `monoid_algebra` | ||
|
|
||
| While we were not able to define `add_monoid_algebra k G = monoid_algebra k (multiplicative G)` due | ||
| to definitional inconveniences, we can still show the types are isomorphic. | ||
| -/ | ||
|
|
||
| /-- The equivalence between `add_monoid_algebra` and `monoid_algebra` in terms of `multiplicative` -/ | ||
| protected def add_monoid_algebra.to_multiplicative [semiring k] [add_monoid G] : | ||
| add_monoid_algebra k G ≃+* monoid_algebra k (multiplicative G) := | ||
| { map_mul' := λ x y, by convert add_monoid_algebra.map_domain_mul (add_hom.id G), | ||
| ..finsupp.dom_congr multiplicative.of_add } | ||
|
|
||
| /-- The equivalence between `monoid_algebra` and `add_monoid_algebra` in terms of `additive` -/ | ||
| protected def monoid_algebra.to_additive [semiring k] [monoid G] : | ||
| monoid_algebra k G ≃+* add_monoid_algebra k (additive G) := | ||
| { map_mul' := λ x y, by convert monoid_algebra.map_domain_mul (mul_hom.id G), | ||
| ..finsupp.dom_congr additive.of_mul } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aah! If you make This is the problem -- multiplicative is on the wrong side.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This typechecks even if But now you need a result which applies to
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW making error in definition of lift.to_fun. Type abuse like this creates problems down the line (e.g. the earlier problem about p*q=p+q) and I've found that making stuff like
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this - but this was a mistake in just one of the two definitions.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is a case of two wrong make a right. After the -- VVVVV add_monoid_algebra k G
map_domain ⇑multiplicative.of_add (x * y) =
-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ monoid_algebra k multiplicative(G)
map_domain ⇑multiplicative.of_add x * map_domain ⇑multiplicative.of_add y
The second wrong is the tricks we already see in This would all be a lot easier if we could do away with
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that sneaky steps in type abuse should be avoided if at all possible. Can't we also use
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd argue that type abuse is only a problem in definitions. In proofs, it shouldn't matter - as long as the theorem statement plays no tricks, then proof irrelevance means that abuse in the proof doesn't matter, right?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now, I could replace the proof apply monoid_algebra.map_domain_mul',
intros p q,
simp only [of_mul_mul],
reflwith simp only [finsupp.dom_congr],
rw monoid_algebra.mul_def,
rw add_monoid_algebra.mul_def,
simp_rw [map_domain_sum, map_domain_single, of_mul_mul],
rw finsupp.sum_map_domain_index,
{ congr,
ext a b,
rw finsupp.sum_map_domain_index,
{ simp },
{ simp [mul_add] } },
{ simp },
{ simp [add_mul] },but that amounts to a copy-paste of
Given the whole point of the |
||
|
|
||
| namespace add_monoid_algebra | ||
|
|
||
| variables {k G} | ||
|
|
||
| /-! #### Algebra structure -/ | ||
| section algebra | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.