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
Conversation
#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) : |
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.
Can you use a different notation for the dependent function type? I really think ∀
should be reserved for propositions.
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 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 |
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.
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).
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.
Lean can find the constant (s := fun _ => M)
if we give it enough hint.
(reindex R e : (⨂[R] _, M) ≃ₗ[R] ⨂[R] _, M)
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.
So do as you prefer!
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.
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
Thanks! bors d+ |
✌️ jjaassoonn can now approve this pull request. To approve and merge a pull request, simply reply with |
bors r+ |
…#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>
Pull request successfully merged into master. Build succeeded: |
reindex
dependently typedreindex
dependently typed
used to be
(⨂[R] _ : ι, M) ≃ₗ[R] ⨂[R] _ : ι₂, M
, nowM
can vary according to the indexing set.