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

feat (analysis/normed_space): Define real inner product space #1248

Merged
merged 6 commits into from Aug 8, 2019

Conversation

aceg00
Copy link
Collaborator

@aceg00 aceg00 commented Jul 20, 2019

Define real inner product space and prove that it is a normed space. Next step is to define Hilbert space and prove the existence of orthogonal projection onto closed subspaces.

@amswerdlow defines complex inner product space in #840 . I think it may not be possible to treat the real and complex cases together, so I wrote a separate file.

The file discriminant.lean is the content of my previous PR #1245, and so it is temporary. People want me to do a bit more about solving quadratics, so I want to show the inner product space file for discussion while I work on quadratics.

TO CONTRIBUTORS:

Make sure you have:

  • reviewed and applied the coding style: coding, naming
  • for tactics:
  • make sure definitions and lemmas are put in the right files
  • make sure definitions and lemmas are not redundant

If this PR is related to a discussion on Zulip, please include a link in the discussion.

For reviewers: code review check list

@aceg00 aceg00 requested a review from a team as a code owner July 20, 2019 18:18
@robertylewis
Copy link
Member

Could you update to meet the new documentation requirements? (https://github.com/leanprover-community/mathlib/blob/master/docs/contribute/doc.md)

@robertylewis robertylewis added the needs-documentation This PR is missing required documentation label Jul 25, 2019
@aceg00
Copy link
Collaborator Author

aceg00 commented Jul 25, 2019

Hi @robertylewis,

I aimed to follow the new documentation requirements when I wrote the files. I think I must have did it incorrectly?

The file discriminant.lean is temporary. It is part of my previous PR #1245 . I tried to follow the doc requirements there.

@robertylewis
Copy link
Member

Ah, I see. I think a header for discriminant.lean is all that's missing.

@robertylewis robertylewis removed the needs-documentation This PR is missing required documentation label Jul 25, 2019
@semorrison
Copy link
Collaborator

I think we should have some discussion about a unified approach to real and complex normed/inner product/Hilbert spaces. Does something like this

import analysis.normed_space.basic

class scalars (α : Type) extends normed_field α :=
(embed_ℝ : ℝ → α)
(conj : α → α) -- TODO axioms about conj

instance embed_ℝ_coe (α : Type) [scalars α] : has_coe ℝ α :=
{ coe := scalars.embed_ℝ α }

variables (α : Type) [scalars α]

example : α := (1 : ℝ)

notation a `†`:120 := scalars.conj a

set_option class.instance_max_depth 34
class sesquilinear_space (𝕶 : Type) [scalars 𝕶] (α : Type*) [add_comm_group α] [vector_space 𝕶 α] :=
(inner_product : α → α → 𝕶)
(conj_symm : ∀ (x y : α), inner_product x y = (inner_product y x)†)
(linearity : ∀ (x y z : α), ∀ (a : 𝕶), inner_product (a • x + y) z = a * inner_product x z + inner_product y z)

class inner_product_space (𝕶 : Type) [scalars 𝕶] (α : Type*) [add_comm_group α] [vector_space 𝕶 α]
  extends sesquilinear_space 𝕶 α, normed_space 𝕶 α :=
(norm_sq : ∀ (x : α), inner_product x x = (norm x)^2)

get us off the ground?

Joe added 2 commits July 31, 2019 07:06
Prove the existence of orthogonal projections onto complete subspaces in an inner product space.
@aceg00
Copy link
Collaborator Author

aceg00 commented Jul 31, 2019

Update : orthogonal projections onto complete subspaces

Copy link
Collaborator

@avigad avigad 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 like a good start on inner product spaces and projections!

@@ -181,12 +181,18 @@ namespace nat

variables {α : Type*} [linear_ordered_field α]

lemma inv_pos_of_nat [linear_ordered_field α] {n : ℕ} : 0 < ((n : α) + 1)⁻¹ :=
lemma inv_pos_of_nat {n : ℕ} : 0 < ((n : α) + 1)⁻¹ :=
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you get rid of the +1 and add the hypothesis n ≠ 0?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry for the delay -- I was traveling for a few days. I am still not sure this is a great lemma to have in the library, and anyhow the name would be better as inv_of_nat_add_one_pos, but I don't feel strongly about it. I'll merge now.

inv_pos $ add_pos_of_nonneg_of_pos n.cast_nonneg zero_lt_one

lemma one_div_pos_of_nat [linear_ordered_field α] {n : ℕ} : 0 < 1 / ((n : α) + 1) :=
Copy link
Collaborator

Choose a reason for hiding this comment

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

same comment here and below

src/algebra/quadratic_discriminant.lean Show resolved Hide resolved
src/algebra/quadratic_discriminant.lean Show resolved Hide resolved
src/algebra/quadratic_discriminant.lean Show resolved Hide resolved
/--When b < Sup s, there is an element a in s with b < a, if s is nonempty and the order is
a linear order.-/
/-- When b < Sup s, there is an element a in s with b < a, if s is nonempty and the order is
a linear order. -/
lemma exists_lt_of_lt_cSup (_ : s ≠ ∅) (_ : b < Sup s) : ∃a∈s, b < a :=
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not give names to the hypotheses? That will guarantee that the theorem looks nice when users have to see it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

More than fifty hypotheses in this file have no name. Maybe it's better to add names in another PR.

@@ -181,12 +181,18 @@ namespace nat

variables {α : Type*} [linear_ordered_field α]

lemma inv_pos_of_nat [linear_ordered_field α] {n : ℕ} : 0 < ((n : α) + 1)⁻¹ :=
lemma inv_pos_of_nat {n : ℕ} : 0 < ((n : α) + 1)⁻¹ :=
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry for the delay -- I was traveling for a few days. I am still not sure this is a great lemma to have in the library, and anyhow the name would be better as inv_of_nat_add_one_pos, but I don't feel strongly about it. I'll merge now.

@avigad avigad added the ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) label Aug 8, 2019
@mergify mergify bot merged commit 9c4dd95 into leanprover-community:master Aug 8, 2019
@aceg00 aceg00 deleted the inner_product branch November 20, 2019 15:38
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 15, 2020
…over-community#1248)

* Inner product space

* Change the definition of inner_product_space

The original definition introduces an instance loop.

See Zulip talks: https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/ring.20tactic.20works.20at.20one.20place.2C.20fails.20at.20another

* Orthogonal Projection

Prove the existence of orthogonal projections onto complete subspaces in an inner product space.

* Fix names

* small fixes
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

4 participants