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/PiTensorProduct): make reindex dependently typed #9445

Closed
wants to merge 7 commits into from

Conversation

jjaassoonn
Copy link
Collaborator

@jjaassoonn jjaassoonn commented Jan 4, 2024

used to be (⨂[R] _ : ι, M) ≃ₗ[R] ⨂[R] _ : ι₂, M, now M can vary according to the indexing set.


Open in Gitpod

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Jan 8, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Jan 9, 2024
#align pi_tensor_product.reindex PiTensorProduct.reindex

end

@[simp]
theorem reindex_tprod (e : ι ≃ ι₂) (f : ι → M) :
reindex R M e (tprod R f) = tprod R fun i ↦ f (e.symm i) := by
theorem reindex_tprod (e : ι ≃ ι₂) (f : ∀ i, s i) :
Copy link
Member

Choose a reason for hiding this comment

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

Can you use a different notation for the dependent function type? I really think should be reserved for propositions.

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 changed as well as other inappropriate \forall in this file. Not sure if I missed anything

congr
ext
rw [e.symm_apply_apply])
variable (s) in
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about making s implicit? I understand that then one has to write (s := ...) to use the dependent version, but I think people will use much more the non dependent one, and maybe Lean is able to guess it in that case (of course if (s := ...) is needed also in the nondependent case this comment is pointless).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Lean can find the constant (s := fun _ => M) if we give it enough hint.

(reindex R e : (⨂[R] _, M) ≃ₗ[R] ⨂[R] _, M)

Copy link
Member

Choose a reason for hiding this comment

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

So do as you prefer!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since implicit s need type hinting in non-dependent cases as well, I have decided to make s explicit, so non-dependent case will be reindex R (fun _ => M) e

@riccardobrasca
Copy link
Member

Thanks!

bors d+

@mathlib-bors
Copy link

mathlib-bors bot commented Jan 10, 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 Jan 10, 2024
@jjaassoonn
Copy link
Collaborator Author

bors r+

mathlib-bors bot pushed a commit that referenced this pull request Jan 10, 2024
…#9445)

used to be `(⨂[R] _ : ι, M) ≃ₗ[R] ⨂[R] _ : ι₂, M`, now `M` can vary according to the indexing set.



Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@mathlib-bors
Copy link

mathlib-bors bot commented Jan 10, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(LinearAlgebra/PiTensorProduct): make reindex dependently typed [Merged by Bors] - feat(LinearAlgebra/PiTensorProduct): make reindex dependently typed Jan 10, 2024
@mathlib-bors mathlib-bors bot closed this Jan 10, 2024
@mathlib-bors mathlib-bors bot deleted the zjj/dependentReindenx branch January 10, 2024 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants