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/multilinear/basis): multilinear maps on basis vectors #10090

Closed
wants to merge 16 commits into from

Conversation

jsm28
Copy link
Collaborator

@jsm28 jsm28 commented Nov 1, 2021

Add two versions of the fact that a multilinear map on finitely many
arguments is determined by its values on basis vectors. The precise
requirements for each version follow from the results used in the
proof: basis.ext_multilinear_fin uses the curry and uncurry
results to deduce it from basis.ext and thus works for multilinear
maps on a family of modules indexed by fin n, while
basis.ext_multilinear works for an arbitrary fintype index type
but is limited to the case where the modules for all the arguments
(and the bases used for those modules) are the same, since it's
derived from the previous result using dom_dom_congr which only
handles the case where all the modules are the same.

This is in preparation for proving a corresponding result for
alternating maps, for which the case of all argument modules the same
suffices.

There is probably room for making results more general.


Open in Gitpod

…tors

Add two versions of the fact that a multilinear map on finitely many
arguments is determined by its values on basis vectors.  The precise
requirements for each version follow from the results used in the
proof: `basis.ext_multilinear_fin` uses the `curry` and `uncurry`
results to deduce it from `basis.ext` and thus works for multilinear
maps on a family of modules indexed by `fin n.succ`, while
`basis.ext_multilinear` works for an arbitrary `fintype` index type
but is limited to the case where the modules for all the arguments
(and the bases used for those modules) are the same, since it's
derived from the previous result using `dom_dom_congr` which only
handles the case where all the modules are the same.

This is in preparation for proving a corresponding result for
alternating maps, for which the case of all argument modules the same
suffices.

There is probably room for both golfing (the proofs seem longer than
should be necessary given the trivial content) and making more
general.

If the dependency of `linear_algebra.multilinear.basic` on
`linear_algebra.basis` isn't desired, this code could of course go in
a separate file.
@jsm28 jsm28 added the awaiting-review The author would like community review of the PR label Nov 1, 2021
jsm28 and others added 3 commits November 2, 2021 02:48
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@eric-wieser
Copy link
Member

eric-wieser commented Nov 5, 2021

If the dependency of linear_algebra.multilinear.basic on
linear_algebra.basis isn't desired, this code could of course go in
a separate file.

In the interest of not letting basic.lean expand too much, I think a new multilinear/basis file would be a good idea.

@jsm28
Copy link
Collaborator Author

jsm28 commented Nov 5, 2021

I've now moved the lemmas to such a new file.

Comment on lines 44 to 45
{ rw [←f.uncurry_curry_left, ←g.uncurry_curry_left],
congr' 1,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{ rw [←f.uncurry_curry_left, ←g.uncurry_curry_left],
congr' 1,
{ apply function.left_inverse.injective uncurry_curry_left,

although it might be better to add a standalone

lemma multilinear_map.curry_left_left_inverse :
  left_inverse (linear_map.uncurry_left : _ → multilinear_map R M M₂) multilinear_map.curry_left :=
multilinear_map.uncurry_curry_left

next to uncurry_curry_left first

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've applied that change (I've not done anything about adding that separate lemma).

@jsm28 jsm28 changed the title feat(linear_algebra/multilinear/basic): multilinear maps on basis vectors feat(linear_algebra/multilinear/basis): multilinear maps on basis vectors Nov 5, 2021
@ocfnash
Copy link
Collaborator

ocfnash commented Nov 8, 2021

Could we add the following:

def basis.pi {ι₁ : fin n → Type*} (e : Π i, basis (ι₁ i) R (M i)) :
  basis (Π i, ι₁ i) R (Π i, M i) :=
sorry

and obtain this result as a corollary?

@ocfnash ocfnash removed the awaiting-review The author would like community review of the PR label Nov 8, 2021
@ocfnash ocfnash added the awaiting-author A reviewer has asked the author a question or requested changes label Nov 8, 2021
Co-authored-by: Oliver Nash <github@olivernash.org>
@jsm28
Copy link
Collaborator Author

jsm28 commented Nov 8, 2021

I don't think that basis.pi is quite what's wanted. Equivalence of multilinear maps to linear maps on the tensor product (and the corresponding basis for the tensor product) would be, but it looks like we only have that for bilinear maps and the tensor product of two modules.

@eric-wieser
Copy link
Member

Aren't you describing https://leanprover-community.github.io/mathlib_docs/linear_algebra/pi_tensor_product.html#pi_tensor_product.lift?

@jsm28
Copy link
Collaborator Author

jsm28 commented Nov 8, 2021

Yes (the separate files for the different cases of tensor product confused me), but as well as the pi_tensor_product not having bases, it also seems to be missing equivalents of most of the API used to define basis.tensor_product.

@ocfnash
Copy link
Collaborator

ocfnash commented Nov 8, 2021

I don't think that basis.pi is quite what's wanted. Equivalence of multilinear maps to linear maps on the tensor product (and the corresponding basis for the tensor product) would be

Oops, yes of course.

Yes (the separate files for the different cases of tensor product confused me), but as well as the pi_tensor_product not having bases, it also seems to be missing equivalents of most of the API used to define basis.tensor_product.

I think situations like this are the perfect time to fill in the missing bits of an API but I can appreciate you might feel this is too much of a diversion. Maybe at least add a TODO in the doc string, saying that this should eventually be refactored through the an API for bases of tensor products?

@jsm28
Copy link
Collaborator Author

jsm28 commented Nov 8, 2021

I've added that TODO.

@ocfnash
Copy link
Collaborator

ocfnash commented Nov 8, 2021

I've added that TODO.

Thanks!

bors merge

@github-actions github-actions bot 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-author A reviewer has asked the author a question or requested changes labels Nov 8, 2021
bors bot pushed a commit that referenced this pull request Nov 8, 2021
…tors (#10090)

Add two versions of the fact that a multilinear map on finitely many
arguments is determined by its values on basis vectors.  The precise
requirements for each version follow from the results used in the
proof: `basis.ext_multilinear_fin` uses the `curry` and `uncurry`
results to deduce it from `basis.ext` and thus works for multilinear
maps on a family of modules indexed by `fin n`, while
`basis.ext_multilinear` works for an arbitrary `fintype` index type
but is limited to the case where the modules for all the arguments
(and the bases used for those modules) are the same, since it's
derived from the previous result using `dom_dom_congr` which only
handles the case where all the modules are the same.

This is in preparation for proving a corresponding result for
alternating maps, for which the case of all argument modules the same
suffices.

There is probably room for making results more general.
@bors
Copy link

bors bot commented Nov 8, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(linear_algebra/multilinear/basis): multilinear maps on basis vectors [Merged by Bors] - feat(linear_algebra/multilinear/basis): multilinear maps on basis vectors Nov 8, 2021
@bors bors bot closed this Nov 8, 2021
@bors bors bot deleted the jsm28/basis-ext-multilinear branch November 8, 2021 17:34
ericrbg pushed a commit that referenced this pull request Nov 9, 2021
…tors (#10090)

Add two versions of the fact that a multilinear map on finitely many
arguments is determined by its values on basis vectors.  The precise
requirements for each version follow from the results used in the
proof: `basis.ext_multilinear_fin` uses the `curry` and `uncurry`
results to deduce it from `basis.ext` and thus works for multilinear
maps on a family of modules indexed by `fin n`, while
`basis.ext_multilinear` works for an arbitrary `fintype` index type
but is limited to the case where the modules for all the arguments
(and the bases used for those modules) are the same, since it's
derived from the previous result using `dom_dom_congr` which only
handles the case where all the modules are the same.

This is in preparation for proving a corresponding result for
alternating maps, for which the case of all argument modules the same
suffices.

There is probably room for making results more general.
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

3 participants