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

feat(algebra/free_algebra): Define a grading #4321

Open
wants to merge 41 commits into
base: master
Choose a base branch
from

Conversation

eric-wieser
Copy link
Member

@eric-wieser eric-wieser commented Sep 29, 2020

The grading takes the form free_algebra R X →ₐ[R] add_monoid_algebra (free_algebra R X) ℕ

It's likely that there are more generic lemmas about grading that can be shared with tensor_algebra and friends, but that's left to follow-up work


@eric-wieser eric-wieser added WIP Work in progress blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. labels Sep 29, 2020
@eric-wieser eric-wieser changed the title feat(algebra/free_algebra): Attempt to define a grading feat(algebra/free_algebra): Attempt to define a grading (deps: #4315) Sep 29, 2020
Comment on lines +320 to +325
noncomputable
instance : has_coe (add_monoid_algebra (free_algebra R X) ℕ) (free_algebra R X) := ⟨
(add_monoid_algebra.sum_id R : add_monoid_algebra (free_algebra R X) ℕ →ₐ[R] (free_algebra R X))

@[simp, norm_cast]
lemma coe_def (x : add_monoid_algebra (free_algebra R X) ℕ) : (x : free_algebra R X) = add_monoid_algebra.sum_id R x := rfl
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seemed harmless, and it makes the mouthful that is add_monoid_algebra.sum_id not really matter

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean the instance? Why not make it a local instance?

src/algebra/free_algebra.lean Outdated Show resolved Hide resolved
@eric-wieser eric-wieser added awaiting-review The author would like community review of the PR and removed WIP Work in progress labels Sep 30, 2020
@eric-wieser eric-wieser marked this pull request as ready for review September 30, 2020 08:35
@@ -679,6 +684,42 @@ lemma alg_hom_ext_iff {R : Type u₃} [comm_semiring k] [add_monoid G]
(∀ x, φ₁ (finsupp.single x 1) = φ₂ (finsupp.single x 1)) ↔ φ₁ = φ₂ :=
⟨λ h, alg_hom_ext h, by rintro rfl _; refl⟩

/--
The `alg_hom` which maps from a grading of an algebra `A` back to that algebra.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't use the word "grading" in this context. Rather, I would call this map the augmentation map of the monoid algebra: https://ncatlab.org/nlab/show/augmentation+ideal#for_group_algebras

For the Lean identifier, either augmentation or something like your sum_id or perhaps sum_coeffs seems fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind suggesting a complete docstring? My mathematical background is severely lacking.

src/data/monoid_algebra.lean Outdated Show resolved Hide resolved
src/data/monoid_algebra.lean Outdated Show resolved Hide resolved
@@ -225,10 +225,10 @@ instance [ring k] [monoid G] : ring (monoid_algebra k G) :=
instance [comm_ring k] [comm_monoid G] : comm_ring (monoid_algebra k G) :=
{ mul_comm := mul_comm, .. monoid_algebra.ring}

instance [semiring k] : has_scalar k (monoid_algebra k G) :=
instance {R : Type*} [semiring R] [semiring k] [semimodule R k] : has_scalar R (monoid_algebra k G) :=
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you switch the names R and k in this instance and the next one? This way around is too confusing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated #4365 to use a clearer naming

src/data/monoid_algebra.lean Outdated Show resolved Hide resolved
@rwbarton rwbarton added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Sep 30, 2020
@eric-wieser eric-wieser changed the base branch from master to eric-wieser/monoid_algebra-tweaks September 30, 2020 15:02
@eric-wieser eric-wieser force-pushed the eric-wieser/monoid_algebra-tweaks branch from 53afbc0 to 9824b22 Compare October 2, 2020 11:58
@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Oct 2, 2020
@eric-wieser eric-wieser force-pushed the eric-wieser/monoid_algebra-tweaks branch from 9824b22 to c31795f Compare October 2, 2020 15:37
@eric-wieser eric-wieser changed the title feat(algebra/free_algebra): Attempt to define a grading (deps: #4315) feat(algebra/free_algebra): Attempt to define a grading (deps: #4315, #4365) Oct 2, 2020
@eric-wieser eric-wieser force-pushed the eric-wieser/free_algebra-grading branch from ad8308a to a66671e Compare October 3, 2020 14:33
@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Oct 3, 2020
@semorrison semorrison changed the title feat(algebra/free_algebra): Define a grading (deps: #4315) feat(algebra/free_algebra): Define a grading Oct 20, 2020
@semorrison semorrison removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Oct 20, 2020
@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Oct 22, 2020
Copy link
Member

@kbuzzard kbuzzard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that if this is to be the way a grading is defined, it might be good to spell out what the heck is going on in the module docstring -- it took me a while to figure out the relationship between grades and what most people think of as a grading (a decomposition of A into a direct sum of A_i).

-/
noncomputable
def grades : (free_algebra R X) →ₐ[R] add_monoid_algebra (free_algebra R X) ℕ :=
lift R $ finsupp.single 1 ∘ ι R
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have some algebra A (the free algebra), and the question is how to usefully state that A is actually an infinite internal direct sum of submodules A_i. This grades map here seems to be a map which does the following: if a is in A, let a_i be its i'th "piece". Then a_i is in A_i and all but finitely many a_i are zero. We can regard the a_i as elements of A. Now the a_i is a finite sequence of elements of A. So we can make them into a polynomial a_i X^i. grades sends a to this polynomial. I am surprised that this is a useful concept! But one cool thing about it is that it does seem to be a ring homomorphism, rather than just an R-module homomorphism. The next lemma says that if you evaluate the polynomial at 1 then you get back the element you started with. I've been out of the loop for over a month -- sorry if all this conversation has been had already. Is this the way to do grading of an algebra? It still seems a bit weird to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my choice not to use polynomial was deliberate, since I wasn't really trying to invoke the mental model of one (although admittedly I had not spotted that polynomial A is defeq to add_monoid_algebra A ℕ).

I am surprised that this is a useful concept!

It seemed to me like the only (and obvious) way to induce a grading from the universal property alone. I have no idea if this is "how it's done", it's just the way I stumbled upon. I suppose though there's no need for it to be the public interface to the grading, it was just simplest to leave it that way, and the fact it was a ring homomorphism seemed cute, even though there's zero reason to need grades x * grades y as an alternate spelling of grades (x * y).

Is this the way to do grading of an algebra?

I assume you mean for a general algebra?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the question is how to usefully state that A is actually an infinite internal direct sum of submodules A_i

I attempted to do this in #4812. The proofs were really quite painful, and I don't think we want to use an API like that until dfinsupp is easier to use.

noncomputable
instance : has_coe (add_monoid_algebra (free_algebra R X) ℕ) (free_algebra R X) := ⟨
(add_monoid_algebra.sum_id R : add_monoid_algebra (free_algebra R X) ℕ →ₐ[R] (free_algebra R X))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this really be an instance? Do we know for sure that this is the coercion that everyone will want? "evaluate the polynomial at 1"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm reading this as "evaluate my direct sum over A_i back into A" - I hadn't thought of the "evaluate the polynomial" interpretation, and I think it hurts rather than hinders

Comment on lines +320 to +325
noncomputable
instance : has_coe (add_monoid_algebra (free_algebra R X) ℕ) (free_algebra R X) := ⟨
(add_monoid_algebra.sum_id R : add_monoid_algebra (free_algebra R X) ℕ →ₐ[R] (free_algebra R X))

@[simp, norm_cast]
lemma coe_def (x : add_monoid_algebra (free_algebra R X) ℕ) : (x : free_algebra R X) = add_monoid_algebra.sum_id R x := rfl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean the instance? Why not make it a local instance?

src/data/finsupp/basic.lean Show resolved Hide resolved
@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Oct 28, 2020
@eric-wieser eric-wieser removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Oct 28, 2020
@eric-wieser eric-wieser force-pushed the eric-wieser/free_algebra-grading branch from 7274502 to 1d0b9c9 Compare October 28, 2020 22:24
@eric-wieser
Copy link
Member Author

Now without any real changes to add_monoid_algebra, since those were split to other PRs.

@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Nov 19, 2020
@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Dec 4, 2020
@@ -200,6 +200,16 @@ begin
{ rw [single_eq_of_ne h, zero_apply] }
end

lemma single_of_single_apply (a a' : α) (b : M) :
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split to #5219

@bryangingechen bryangingechen added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Jan 16, 2021
@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Aug 30, 2021
@semorrison semorrison added the too-late This PR was ready too late for inclusion in mathlib3 label Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-author A reviewer has asked the author a question or requested changes merge-conflict Please `git merge origin/master` then a bot will remove this label. too-late This PR was ready too late for inclusion in mathlib3
Development

Successfully merging this pull request may close these issues.

None yet

5 participants