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] - fix(analysis/inner_product_space/pi_L2): add missing type cast functions #18574

Closed
wants to merge 6 commits into from

Conversation

eric-wieser
Copy link
Member

@eric-wieser eric-wieser commented Mar 13, 2023

The preferred way to convert between ι → 𝕜 and euclidean_space 𝕜 ι is via pi_Lp.equiv, as this preserves the right typing information.

We use the local notation ⟪x, y⟫ₑ to refer the euclidean inner product of x y : ι → 𝕜, which inserts the casting within the notation.

This adds a new definition matrix.to_euclidean_lin as a shorthand to turn a matrix into a linear_map over euclidean_space.

It also generalizes inner_matrix_row_row and inner_matrix_col_col away from fin n to arbitrary index types.


Open in Gitpod

Similar to

@eric-wieser eric-wieser added awaiting-review The author would like community review of the PR t-analysis Analysis (normed *, calculus) labels Mar 13, 2023
@eric-wieser eric-wieser requested a review from urkud March 14, 2023 06:50
Comment on lines -437 to 439
lemma conj_transpose_eq_adjoint (A : matrix m n 𝕜) :
to_lin' A.conj_transpose =
@linear_map.adjoint _ (euclidean_space 𝕜 n) (euclidean_space 𝕜 m) _ _ _ _ _ (to_lin' A) :=
lemma to_euclidean_lin_conj_transpose_eq_adjoint (A : matrix m n 𝕜) :
A.conj_transpose.to_euclidean_lin = A.to_euclidean_lin.adjoint :=
begin
Copy link
Member Author

@eric-wieser eric-wieser Mar 15, 2023

Choose a reason for hiding this comment

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

The statement of this lemma was the subject of some discussion in #11551 (comment), and in this Zulip thread.

Note the new version is now consistent with the statement of matrix.is_hermitian_iff_is_symmetric below.

In the year since it was added, there are still no consumers of this lemma.

Comment on lines 202 to 204
lemma is_hermitian_iff_is_symmetric [fintype n] [decidable_eq n] {A : matrix n n α} :
is_hermitian A ↔ linear_map.is_symmetric
((pi_Lp.linear_equiv 2 α (λ _ : n, α)).symm.conj A.to_lin' : module.End α (pi_Lp 2 _)) :=
is_hermitian A ↔ A.to_euclidean_lin.is_symmetric :=
begin
Copy link
Member Author

Choose a reason for hiding this comment

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

This spelling (suggested in #14231 (comment)) was already type-correct, but has been folded into to_euclidean_lin.

Copy link
Collaborator

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

This looks very good!

Copy link
Collaborator

@ocfnash ocfnash left a comment

Choose a reason for hiding this comment

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

I have some concerns about potential API burden associated with supporting the new definition matrix.to_euclidean_lin but I think that as long as we have the definition euclidean_space then it is justified to have this definition.

bors merge

@leanprover-community-bot-assistant leanprover-community-bot-assistant 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-review The author would like community review of the PR labels Mar 17, 2023
@eric-wieser
Copy link
Member Author

eric-wieser commented Mar 17, 2023

Note that rw matrix.to_euclidean_lin can be used to make the new definition go away; the unfolded version still has the right type. In the long run matrix.to_Lp_lin p q (p=q=2) would probably be a good replacement for to_euclidean_lin, but we don't have anywhere right now that would use it.

bors bot pushed a commit that referenced this pull request Mar 17, 2023
…ons (#18574)

The preferred way to convert between `ι → 𝕜` and `euclidean_space 𝕜 ι` is via `pi_Lp.equiv`, as this preserves the right typing information.

We use the local notation `⟪x, y⟫ₑ` to refer the euclidean inner product of `x y : ι → 𝕜`, which inserts the casting within the notation.

This adds a new definition `matrix.to_euclidean_lin` as a shorthand to turn a matrix into a `linear_map` over `euclidean_space`.

It also generalizes `inner_matrix_row_row` and `inner_matrix_col_col` away from `fin n` to arbitrary index types.
@bors
Copy link

bors bot commented Mar 17, 2023

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title fix(analysis/inner_product_space/pi_L2): add missing type cast functions [Merged by Bors] - fix(analysis/inner_product_space/pi_L2): add missing type cast functions Mar 17, 2023
@bors bors bot closed this Mar 17, 2023
@bors bors bot deleted the eric-wieser/inner-pi_Lp-fixes branch March 17, 2023 17:02
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+`.) t-analysis Analysis (normed *, calculus)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants