-
Notifications
You must be signed in to change notification settings - Fork 297
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] - refactor(field_theory/intermediate_field): introduce restrict_scalars
which replaces lift2
#15191
Conversation
…s` which replaces `lift2`
@@ -377,43 +376,45 @@ section tower | |||
|
|||
/-- Lift an intermediate_field of an intermediate_field -/ | |||
def lift1 {F : intermediate_field K L} (E : intermediate_field K F) : intermediate_field K L := |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not reproduce the vector3
naming weirdness!
def lift1 {F : intermediate_field K L} (E : intermediate_field K F) : intermediate_field K L := | |
def lift {F : intermediate_field K L} (E : intermediate_field K F) : intermediate_field K L := |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing even uses this; shall I just remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S.map val
isn't horrible as a spelling, and we put up with it for submodules etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that we probably should get rid of it, but @kmill just introduced the subgraph
analogues of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the subgraph-of-subgraph to subgraph map is a perfect analogue (I feel that combinatorial objects have somewhat different considerations from algebraic structures), but for what it's worth I've been making these sorts of shortcuts be @[reducible]
.
I'd vote don't remove it, and perhaps write add to the docstring to consider writing S.map val
directly? That way someone trying to figure out how to do this lift can learn how to do it more easily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like enough of a resistance that removing it is out of scope of this PR.
I'll remove the 1 suffix for now, and propose a full removal in another PR.
@@ -356,10 +359,10 @@ by { conv_rhs { rw ← adjoin_simple.algebra_map_gen F α }, | |||
rw is_integral_algebra_map_iff (algebra_map F⟮α⟯ E).injective, | |||
apply_instance } | |||
|
|||
lemma adjoin_simple_adjoin_simple (β : E) : ↑F⟮α⟯⟮β⟯ = F⟮α, β⟯ := | |||
lemma adjoin_simple_adjoin_simple (β : E) : F⟮α⟯⟮β⟯.restrict_scalars F = F⟮α, β⟯ := |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure where to leave this comment, so I'm choosing a random example.
Is F⟮α⟯⟮β⟯.restrict_scalars F
now the simp normal form? I missed whether there was a simp lemma that rewrote ↑F⟮α⟯⟮β⟯
into a restrict_scalars
expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The coercion form no longer exists, for consistency with submodule.restrict_scalars
and subalgebra.restrict_scalars
which also have no coercion spelling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/field_theory/galois.lean
Outdated
[hFE : finite_dimensional F E] | ||
[sp : p.is_splitting_field F E] (hp : p.separable) | ||
(K : Type*) [field K] [algebra F K] [algebra K E] | ||
[is_scalar_tower F K E] [finite_dimensional F K] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should follow from finite_dimensional F E
+ is_scalar_tower F K E
(compare intermediate_field.finite_dimensional_left
), but library_search
isn't finding it at the moment...
[is_scalar_tower F K E] [finite_dimensional F K] | |
[is_scalar_tower F K E] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inferring [finite_dimensional F K]
from finite_dimensional F E + is_scalar_tower F K E
isn't allowed because lean has no way to find E
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, the instance you're thinking of is found automatically when K
is an intermediate_field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but it can still be a theorem that we apply here. It turns out we have the other half: finite_dimensional.right
, and basically the same should work for the left part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The instance is needed in the theorem statement though in order to provide a fintype
instance. This gets messy quite quickly; should we just take the fintype
argument directly (since it carries data anyway?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a proof:
theorem finite_dimensional.left (F K E : Type*) [field F] [field K] [field E]
[algebra F K] [algebra K E] [algebra F E] [is_scalar_tower F K E]
[finite_dimensional F E] :
finite_dimensional F K :=
finite_dimensional.of_injective
(is_scalar_tower.to_alg_hom F K E).to_linear_map
(ring_hom.injective _)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The instance is needed in the theorem statement though in order to provide a
fintype
instance. This gets messy quite quickly; should we just take thefintype
argument directly (since it carries data anyway?)
That's a good idea actually, there are in fact already non-defeq fintype
instances on alg_hom
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arguably none of this matters anyway; this is an auxiliary lemma
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made the change anyway, it was straightforward.
✌️ kmill can now approve this pull request. To approve and merge a pull request, simply reply with |
This result came up in the discussion of #15191, where I couldn't find it. (In the end we didn't up needing it.) I saw we already had finiteness of `L / K` (in fact, for any vector space instead of the field `L`) as `finite_dimensional.right`, so I made the `left` version too. Also use this to provide an instance where `K` is an intermediate field.
✌️ eric-wieser can now approve this pull request. To approve and merge a pull request, simply reply with |
Co-authored-by: Kyle Miller <kmill31415@gmail.com>
bors merge |
…s` which replaces `lift2` (#15191) This brings the API in line with `submodule` and `subalgebra` by removing `intermediate_field.lift2` and `intermediate_field.has_lift2`, and replacing them with `intermediate_field.restrict_scalars`. This definition is strictly more general than the previous `intermediate_field.lift2` definition was. A few downstream lemma statements have been generalized in the same way. The handful of API lemmas for `restrict_scalars` that this adds were already missing for `lift2`. `intermediate_field.lift2_alg_equiv` has been removed since we didn't appear to have anything similar for `subalgebra` or `submodule`, but it's possible I missed it. At any rate, it's only needed in one proof, and we can just use `show` or `refl` instead. Note that `(↑x : intermediate_field F E)` is not actually a shorter spelling than `x.restrict_scalars F`, especially when `E` is more than a single character. Finally this renames `lift1` to `lift` now that no ambiguity remains.
Pull request successfully merged into master. Build succeeded: |
restrict_scalars
which replaces lift2
restrict_scalars
which replaces lift2
…5303) This result came up in the discussion of #15191, where I couldn't find it. (In the end we didn't up needing it.) I saw we already had finiteness of `L / K` (in fact, for any vector space instead of the field `L`) as `finite_dimensional.right`, so I made the `left` version too. Also use this to provide an instance where `K` is an intermediate field. Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
…5303) This result came up in the discussion of #15191, where I couldn't find it. (In the end we didn't up needing it.) I saw we already had finiteness of `L / K` (in fact, for any vector space instead of the field `L`) as `finite_dimensional.right`, so I made the `left` version too. Also use this to provide an instance where `K` is an intermediate field. Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
…5303) This result came up in the discussion of #15191, where I couldn't find it. (In the end we didn't up needing it.) I saw we already had finiteness of `L / K` (in fact, for any vector space instead of the field `L`) as `finite_dimensional.right`, so I made the `left` version too. Also use this to provide an instance where `K` is an intermediate field. Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
…5303) This result came up in the discussion of #15191, where I couldn't find it. (In the end we didn't up needing it.) I saw we already had finiteness of `L / K` (in fact, for any vector space instead of the field `L`) as `finite_dimensional.right`, so I made the `left` version too. Also use this to provide an instance where `K` is an intermediate field. Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
…5303) This result came up in the discussion of #15191, where I couldn't find it. (In the end we didn't up needing it.) I saw we already had finiteness of `L / K` (in fact, for any vector space instead of the field `L`) as `finite_dimensional.right`, so I made the `left` version too. Also use this to provide an instance where `K` is an intermediate field. Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
…5303) This result came up in the discussion of #15191, where I couldn't find it. (In the end we didn't up needing it.) I saw we already had finiteness of `L / K` (in fact, for any vector space instead of the field `L`) as `finite_dimensional.right`, so I made the `left` version too. Also use this to provide an instance where `K` is an intermediate field. Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
…s` which replaces `lift2` (#15191) This brings the API in line with `submodule` and `subalgebra` by removing `intermediate_field.lift2` and `intermediate_field.has_lift2`, and replacing them with `intermediate_field.restrict_scalars`. This definition is strictly more general than the previous `intermediate_field.lift2` definition was. A few downstream lemma statements have been generalized in the same way. The handful of API lemmas for `restrict_scalars` that this adds were already missing for `lift2`. `intermediate_field.lift2_alg_equiv` has been removed since we didn't appear to have anything similar for `subalgebra` or `submodule`, but it's possible I missed it. At any rate, it's only needed in one proof, and we can just use `show` or `refl` instead. Note that `(↑x : intermediate_field F E)` is not actually a shorter spelling than `x.restrict_scalars F`, especially when `E` is more than a single character. Finally this renames `lift1` to `lift` now that no ambiguity remains.
…5303) This result came up in the discussion of #15191, where I couldn't find it. (In the end we didn't up needing it.) I saw we already had finiteness of `L / K` (in fact, for any vector space instead of the field `L`) as `finite_dimensional.right`, so I made the `left` version too. Also use this to provide an instance where `K` is an intermediate field. Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
This brings the API in line with
submodule
andsubalgebra
by removingintermediate_field.lift2
andintermediate_field.has_lift2
, and replacing them withintermediate_field.restrict_scalars
. This definition is strictly more general than the previousintermediate_field.lift2
definition was. A few downstream lemma statements have been generalized in the same way.The handful of API lemmas for
restrict_scalars
that this adds were already missing forlift2
.intermediate_field.lift2_alg_equiv
has been removed since we didn't appear to have anything similar forsubalgebra
orsubmodule
, but it's possible I missed it. At any rate, it's only needed in one proof, and we can just useshow
orrefl
instead.Note that
(↑x : intermediate_field F E)
is not actually a shorter spelling thanx.restrict_scalars F
, especially whenE
is more than a single character.Finally this renames
lift1
tolift
now that no ambiguity remains.