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(LinearAlgebra/TensorProduct): add TensorProduct.map₂ #10986

Closed
wants to merge 8 commits into from

Conversation

jjaassoonn
Copy link
Collaborator


Open in Gitpod

@jjaassoonn jjaassoonn changed the title feat(LinearAlgebra/TensorProduct): add TensorProduct.map2 feat(LinearAlgebra/TensorProduct): add TensorProduct.map₂ Feb 26, 2024
@jjaassoonn jjaassoonn added awaiting-review The author would like community review of the PR awaiting-CI t-algebra Algebra (groups, rings, fields etc) labels Feb 26, 2024
@riccardobrasca
Copy link
Member

Thanks!

bors d+

@mathlib-bors
Copy link

mathlib-bors bot commented Feb 26, 2024

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

@github-actions github-actions bot added delegated and removed awaiting-review The author would like community review of the PR labels Feb 26, 2024
@eric-wieser
Copy link
Member

Can you use this to golf the Mul instance on tensor products?

@jjaassoonn
Copy link
Collaborator Author

Can you use this to golf the Mul instance on tensor products?

done

@eric-wieser
Copy link
Member

Once you've added the docstring, please run a benchmark (it will fail at the moment because the missing docstring will cause a linter error)

@jjaassoonn
Copy link
Collaborator Author

!bench

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit ef495da.
There were significant changes against commit c8bd152:

  Benchmark                     Metric         Change
  ===================================================
- ~Mathlib.RingTheory.Kaehler   instructions     5.8%

@jjaassoonn
Copy link
Collaborator Author

How do we feel about the benchmark result. Is the slow down statistically insignificant?

@jjaassoonn
Copy link
Collaborator Author

bors merge

@eric-wieser
Copy link
Member

I think it's ok; I tried golfing this a long time ago in #6195 and got a timeout; 5% is a much less bad outcome!

-/
def mulAux (a₁ : A) (b₁ : B) : A ⊗[R] B →ₗ[R] A ⊗[R] B :=
TensorProduct.map (LinearMap.mulLeft R a₁) (LinearMap.mulLeft R b₁)
#align algebra.tensor_product.mul_aux Algebra.TensorProduct.mulAux
Copy link
Member

Choose a reason for hiding this comment

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

These should be noaligned

bors r-

bors d+

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

do you mean I should keep these code but just noalign them? Note that I have added

#noalign algebra.tensor_product.mul_aux
#noalign algebra.tensor_product.mul_aux_apply

@mathlib-bors
Copy link

mathlib-bors bot commented Feb 28, 2024

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

@mathlib-bors
Copy link

mathlib-bors bot commented Feb 28, 2024

Canceled.

Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

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

bors merge

@mathlib-bors
Copy link

mathlib-bors bot commented Feb 28, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(LinearAlgebra/TensorProduct): add TensorProduct.map₂ [Merged by Bors] - feat(LinearAlgebra/TensorProduct): add TensorProduct.map₂ Feb 28, 2024
@mathlib-bors mathlib-bors bot closed this Feb 28, 2024
@mathlib-bors mathlib-bors bot deleted the zjj/TensorProduct/map_2 branch February 28, 2024 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated ready-to-merge This PR has been sent to bors. t-algebra Algebra (groups, rings, fields etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants