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(field_theory/tower): tower law #3355

Closed
wants to merge 7 commits into from

Conversation

kckennylau
Copy link
Collaborator


open is_algebra_tower

theorem smul_mem_span_smul_of_mem {s : set S} {t : set A} {k : S} (hks : k ∈ span R s)
{x : A} (hx : x ∈ t) : k • x ∈ span R (s • t) :=
Copy link
Member

Choose a reason for hiding this comment

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

I this and the next few lemmas specific to towers? They look like they should be moved to earlier files.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

tbh the whole import hierarchy is a bit messy. maybe algebera_tower should occupy a very low position in the import hierarchy (i.e. imported by a lot of files) and this file should not exist at all.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wanted to put the lemmas in this file because they use the span R s = ⊤ assumption, so they're directly related to the spanning part of is_basis.smul.

Copy link
Member

Choose a reason for hiding this comment

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

I think I agree with Patrick.
If the import hierarchy is messy, we better clean it up, before adding stuff and (potentially) making it harder to untangle later on.

Copy link
Member

Choose a reason for hiding this comment

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

So if you have an idea how to improve the import situation, I would be really happy with a refactor PR after this one. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

If you agree, I suggest that we merge this like it is, but then take a step back to refactor things a bit, and untangle the import hierarchy.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure

Copy link
Collaborator

Choose a reason for hiding this comment

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

This conversation sounded like an agreement to punt on this one, with everyone agreeing that they don't really feel like refactoring. Can't we just move these lemmas earlier, as @PatrickMassot suggested?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Presumably those lemmas should just be in ring_theory/algebra_tower.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay, I just did it myself.

I also added a module-doc to ring_theory/algebra_tower, and explained the division of the material between the two files. @kckennylau, could you check if I said anything stupid?

src/linear_algebra/basis.lean Outdated Show resolved Hide resolved

namespace finite_dimensional

theorem trans [finite_dimensional F K] [finite_dimensional K A] : finite_dimensional F A :=
Copy link
Member

Choose a reason for hiding this comment

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

Do we have something like this already for restrict_scalars? Could that be reused here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

what is the name of the theorem?

Copy link
Member

Choose a reason for hiding this comment

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

I think we don't have it yet.

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking of something like

variables (V : Type*) [add_comm_group V] [vector_space K V]

theorem trans' [finite_dimensional F K] [finite_dimensional K V] :
  finite_dimensional F (module.restrict_scalars F K V) :=

But maybe this requires extra glue and congruence lemmas. If so, guess we would need those anyway, but maybe not in this PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is precisely what algebra_tower aims to deprecate. btw what I proved implies what you want, after I've made an instance is_algebra_tower F K V (oh and after I've generalized is_algebra_tower to has_scalar)

Copy link
Member

Choose a reason for hiding this comment

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

Aah right... I forgot that this should really be done for is_scalar_tower 😉 Yup, that's better!

open is_algebra_tower

theorem smul_mem_span_smul_of_mem {s : set S} {t : set A} {k : S} (hks : k ∈ span R s)
{x : A} (hx : x ∈ t) : k • x ∈ span R (s • t) :=
Copy link
Member

Choose a reason for hiding this comment

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

I think I agree with Patrick.
If the import hierarchy is messy, we better clean it up, before adding stuff and (potentially) making it harder to untangle later on.

open is_algebra_tower

theorem smul_mem_span_smul_of_mem {s : set S} {t : set A} {k : S} (hks : k ∈ span R s)
{x : A} (hx : x ∈ t) : k • x ∈ span R (s • t) :=
Copy link
Member

Choose a reason for hiding this comment

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

So if you have an idea how to improve the import situation, I would be really happy with a refactor PR after this one. What do you think?

kckennylau and others added 2 commits July 11, 2020 12:49
Co-authored-by: Johan Commelin <johan@commelin.net>
src/field_theory/tower.lean Outdated Show resolved Hide resolved
src/field_theory/tower.lean Outdated Show resolved Hide resolved
@robertylewis robertylewis added the awaiting-author A reviewer has asked the author a question or requested changes label Jul 13, 2020
@kckennylau kckennylau added the awaiting-review The author would like community review of the PR label Jul 19, 2020
@bryangingechen bryangingechen removed the awaiting-author A reviewer has asked the author a question or requested changes label Jul 19, 2020
@semorrison
Copy link
Collaborator

bors d+

@bors
Copy link

bors bot commented Jul 20, 2020

✌️ kckennylau can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@kckennylau
Copy link
Collaborator Author

bors r+

bors bot pushed a commit that referenced this pull request Jul 20, 2020
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@semorrison semorrison added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Jul 20, 2020
@bors
Copy link

bors bot commented Jul 20, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(field_theory/tower): tower law [Merged by Bors] - feat(field_theory/tower): tower law Jul 20, 2020
@bors bors bot closed this Jul 20, 2020
@bors bors bot deleted the tower-law branch July 20, 2020 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants