mathlib documentation

analysis.​normed_space.​real_inner_product

analysis.​normed_space.​real_inner_product

Inner Product Space

This file defines real inner product space and proves its basic properties.

An inner product space is a vector space endowed with an inner product. It generalizes the notion of dot product in ℝ^n and provides the means of defining the length of a vector and the angle between two vectors. In particular vectors x and y are orthogonal if their inner product equals zero.

Main statements

Existence of orthogonal projection onto nonempty complete subspace: Let u be a point in an inner product space, and let K be a nonempty complete subspace. Then there exists a unique v in K that minimizes the distance ∥u - v∥ to u. The point v is usually called the orthogonal projection of u onto K.

Implementation notes

We decide to develop the theory of real inner product spaces and that of complex inner product spaces separately.

Tags

inner product space, norm, orthogonal projection

References

The Coq code is available at the following address: http://www.lri.fr/~sboldo/elfic/index.html

@[class]
structure has_inner  :
Type u_1Type u_1
  • inner : α → α →

Syntactic typeclass for types endowed with an inner product

Instances
@[class]
structure inner_product_space  :
Type u_1Type u_1

An inner product space is a real vector space with an additional operation called inner product. Inner product spaces over complex vector space will be defined in another file. The norm could be derived from the inner product, instead we require the existence of a norm and the fact that it is equal to sqrt (inner x x) to be able to put instances on or product spaces.

To construct a norm from an inner product, see inner_product_space.of_core.

Instances

Constructing a normed space structure from a scalar product

In the definition of an inner product space, we require the existence of a norm, which is equal (but maybe not defeq) to the square root of the scalar product. This makes it possible to put an inner product space structure on spaces with a preexisting norm (for instance ), with good properties. However, sometimes, one would like to define the norm starting only from a well-behaved scalar product. This is what we implement in this paragraph, starting from a structure inner_product_space.core stating that we have a nice scalar product.

Our goal here is not to develop a whole theory with all the supporting API, as this will be done below for inner_product_space. Instead, we implement the bare minimum to go as directly as possible to the construction of the norm and the proof of the triangular inequality.

@[nolint, class]
structure inner_product_space.​core (F : Type u_1) [add_comm_group F] [semimodule F] :
Type u_1

A structure requiring that a scalar product is positive definite and symmetric, from which one can construct an inner_product_space instance in inner_product_space.of_core.

Norm constructed from an inner_product_space.core structure, defined to be the square root of the scalar product.

Equations

Expand inner (x + y) (x + y)

Cauchy–Schwarz inequality with norm

Normed group structure constructed from an inner_product_space.core structure.

Equations

Given an inner_product_space.core structure on a space, one can use it to turn the space into an inner product space, constructing the norm out of the inner product.

Equations

Properties of inner product spaces

theorem inner_comm {α : Type u} [inner_product_space α] (x y : α) :

theorem inner_add_left {α : Type u} [inner_product_space α] {x y z : α} :

theorem inner_add_right {α : Type u} [inner_product_space α] {x y z : α} :

theorem inner_smul_left {α : Type u} [inner_product_space α] {x y : α} {r : } :

theorem inner_smul_right {α : Type u} [inner_product_space α] {x y : α} {r : } :

theorem sum_inner {α : Type u} [inner_product_space α] {ι : Type u_1} (s : finset ι) (f : ι → α) (x : α) :
has_inner.inner (s.sum (λ (i : ι), f i)) x = s.sum (λ (i : ι), has_inner.inner (f i) x)

An inner product with a sum on the left.

theorem inner_sum {α : Type u} [inner_product_space α] {ι : Type u_1} (s : finset ι) (f : ι → α) (x : α) :
has_inner.inner x (s.sum (λ (i : ι), f i)) = s.sum (λ (i : ι), has_inner.inner x (f i))

An inner product with a sum on the right.

@[simp]
theorem inner_zero_left {α : Type u} [inner_product_space α] {x : α} :

@[simp]
theorem inner_zero_right {α : Type u} [inner_product_space α] {x : α} :

@[simp]
theorem inner_self_eq_zero {α : Type u} [inner_product_space α] {x : α} :

theorem inner_self_nonneg {α : Type u} [inner_product_space α] {x : α} :

@[simp]
theorem inner_self_nonpos {α : Type u} [inner_product_space α] {x : α} :

@[simp]
theorem inner_neg_left {α : Type u} [inner_product_space α] {x y : α} :

@[simp]
theorem inner_neg_right {α : Type u} [inner_product_space α] {x y : α} :

@[simp]
theorem inner_neg_neg {α : Type u} [inner_product_space α] {x y : α} :

theorem inner_sub_left {α : Type u} [inner_product_space α] {x y z : α} :

theorem inner_sub_right {α : Type u} [inner_product_space α] {x y z : α} :

theorem inner_add_add_self {α : Type u} [inner_product_space α] {x y : α} :

Expand inner (x + y) (x + y)

theorem inner_sub_sub_self {α : Type u} [inner_product_space α] {x y : α} :

Expand inner (x - y) (x - y)

theorem parallelogram_law {α : Type u} [inner_product_space α] {x y : α} :
has_inner.inner (x + y) (x + y) + has_inner.inner (x - y) (x - y) = 2 * (has_inner.inner x x + has_inner.inner y y)

Parallelogram law

Cauchy–Schwarz inequality

theorem inner_self_eq_norm_square {α : Type u} [inner_product_space α] (x : α) :

theorem norm_add_pow_two {α : Type u} [inner_product_space α] {x y : α} :
x + y ^ 2 = x ^ 2 + 2 * has_inner.inner x y + y ^ 2

Expand the square

theorem norm_add_mul_self {α : Type u} [inner_product_space α] {x y : α} :

Same lemma as above but in a different form

theorem norm_sub_pow_two {α : Type u} [inner_product_space α] {x y : α} :
x - y ^ 2 = x ^ 2 - 2 * has_inner.inner x y + y ^ 2

Expand the square

theorem norm_sub_mul_self {α : Type u} [inner_product_space α] {x y : α} :

Same lemma as above but in a different form

theorem abs_inner_le_norm {α : Type u} [inner_product_space α] (x y : α) :

Cauchy–Schwarz inequality with norm

theorem parallelogram_law_with_norm {α : Type u} [inner_product_space α] {x y : α} :

The inner product, in terms of the norm.

The inner product, in terms of the norm.

The inner product, in terms of the norm.

Pythagorean theorem, if-and-only-if vector inner product form.

Pythagorean theorem, vector inner product form.

Pythagorean theorem, subtracting vectors, if-and-only-if vector inner product form.

Pythagorean theorem, subtracting vectors, vector inner product form.

theorem abs_inner_div_norm_mul_norm_le_one {α : Type u} [inner_product_space α] (x y : α) :

The inner product of two vectors, divided by the product of their norms, has absolute value at most 1.

theorem inner_smul_self_left {α : Type u} [inner_product_space α] (x : α) (r : ) :

The inner product of a vector with a multiple of itself.

theorem inner_smul_self_right {α : Type u} [inner_product_space α] (x : α) (r : ) :

The inner product of a vector with a multiple of itself.

theorem abs_inner_div_norm_mul_norm_eq_one_of_ne_zero_of_ne_zero_mul {α : Type u} [inner_product_space α] {x : α} {r : } :
x 0r 0abs (has_inner.inner x (r x) / (x * r x)) = 1

The inner product of a nonzero vector with a nonzero multiple of itself, divided by the product of their norms, has absolute value 1.

theorem inner_div_norm_mul_norm_eq_one_of_ne_zero_of_pos_mul {α : Type u} [inner_product_space α] {x : α} {r : } :
x 00 < rhas_inner.inner x (r x) / (x * r x) = 1

The inner product of a nonzero vector with a positive multiple of itself, divided by the product of their norms, has value 1.

theorem inner_div_norm_mul_norm_eq_neg_one_of_ne_zero_of_neg_mul {α : Type u} [inner_product_space α] {x : α} {r : } :
x 0r < 0has_inner.inner x (r x) / (x * r x) = -1

The inner product of a nonzero vector with a negative multiple of itself, divided by the product of their norms, has value -1.

theorem abs_inner_div_norm_mul_norm_eq_one_iff {α : Type u} [inner_product_space α] (x y : α) :
abs (has_inner.inner x y / (x * y)) = 1 x 0 ∃ (r : ), r 0 y = r x

The inner product of two vectors, divided by the product of their norms, has absolute value 1 if and only if they are nonzero and one is a multiple of the other. One form of equality case for Cauchy-Schwarz.

theorem inner_div_norm_mul_norm_eq_one_iff {α : Type u} [inner_product_space α] (x y : α) :
has_inner.inner x y / (x * y) = 1 x 0 ∃ (r : ), 0 < r y = r x

The inner product of two vectors, divided by the product of their norms, has value 1 if and only if they are nonzero and one is a positive multiple of the other.

theorem inner_div_norm_mul_norm_eq_neg_one_iff {α : Type u} [inner_product_space α] (x y : α) :
has_inner.inner x y / (x * y) = -1 x 0 ∃ (r : ), r < 0 y = r x

The inner product of two vectors, divided by the product of their norms, has value -1 if and only if they are nonzero and one is a negative multiple of the other.

theorem inner_sum_smul_sum_smul_of_sum_eq_zero {α : Type u} [inner_product_space α] {ι₁ : Type u_1} {s₁ : finset ι₁} {w₁ : ι₁ → } (v₁ : ι₁ → α) (h₁ : s₁.sum (λ (i : ι₁), w₁ i) = 0) {ι₂ : Type u_2} {s₂ : finset ι₂} {w₂ : ι₂ → } (v₂ : ι₂ → α) :
s₂.sum (λ (i : ι₂), w₂ i) = 0has_inner.inner (s₁.sum (λ (i₁ : ι₁), w₁ i₁ v₁ i₁)) (s₂.sum (λ (i₂ : ι₂), w₂ i₂ v₂ i₂)) = -s₁.sum (λ (i₁ : ι₁), s₂.sum (λ (i₂ : ι₂), w₁ i₁ * w₂ i₂ * (v₁ i₁ - v₂ i₂ * v₁ i₁ - v₂ i₂))) / 2

The inner product of two weighted sums, where the weights in each sum add to 0, in terms of the norms of pairwise differences.

Inner product space structure on product spaces

@[instance]
def pi_Lp.​inner_product_space (ι : Type u_1) [fintype ι] (f : ι → Type u_2) [Π (i : ι), inner_product_space (f i)] :

If ι is a finite type and each space f i, i : ι, is an inner product space, then Π i, f i is an inner product space as well. Since Π i, f i is endowed with the sup norm, we use instead pi_Lp 2 one_le_two f for the product space, which is endowed with the L^2 norm.

Equations
@[instance]

The type of real numbers is an inner product space.

Equations
@[nolint]
def euclidean_space (n : Type u_1) [fintype n] :
Type u_1

The standard Euclidean space, functions on a finite type. For an n-dimensional space use euclidean_space (fin n).

Equations
@[instance]

Equations
  • _ = _

Orthogonal projection in inner product spaces

theorem exists_norm_eq_infi_of_complete_convex {α : Type u} [inner_product_space α] {K : set α} (ne : K.nonempty) (h₁ : is_complete K) (h₂ : convex K) (u : α) :
∃ (v : α) (H : v K), u - v = ⨅ (w : K), u - w

Existence of minimizers Let u be a point in an inner product space, and let K be a nonempty complete convex subset. Then there exists a unique v in K that minimizes the distance ∥u - v∥ to u.

theorem norm_eq_infi_iff_inner_le_zero {α : Type u} [inner_product_space α] {K : set α} (h : convex K) {u v : α} :
v K((u - v = ⨅ (w : K), u - w) ∀ (w : α), w Khas_inner.inner (u - v) (w - v) 0)

Characterization of minimizers in the above theorem

theorem exists_norm_eq_infi_of_complete_subspace {α : Type u} [inner_product_space α] (K : subspace α) (h : is_complete K) (u : α) :
∃ (v : α) (H : v K), u - v = ⨅ (w : K), u - w

Existence of minimizers. Let u be a point in an inner product space, and let K be a nonempty complete subspace. Then there exists a unique v in K that minimizes the distance ∥u - v∥ to u. This point v is usually called the orthogonal projection of u onto K.

theorem norm_eq_infi_iff_inner_eq_zero {α : Type u} [inner_product_space α] (K : subspace α) {u v : α} :
v K((u - v = ⨅ (w : K), u - w) ∀ (w : α), w Khas_inner.inner (u - v) w = 0)

Characterization of minimizers in the above theorem. Let u be a point in an inner product space, and let K be a nonempty subspace. Then point v minimizes the distance ∥u - v∥ if and only if for all w ∈ K, inner (u - v) w = 0 (i.e., u - v is orthogonal to the subspace K)

def orthogonal_projection_fn {α : Type u} [inner_product_space α] {K : submodule α} :
is_complete Kα → α

The orthogonal projection onto a complete subspace, as an unbundled function. This definition is only intended for use in setting up the bundled version orthogonal_projection and should not be used once that is defined.

Equations
theorem orthogonal_projection_fn_mem {α : Type u} [inner_product_space α] {K : submodule α} (h : is_complete K) (v : α) :

The unbundled orthogonal projection is in the given subspace. This lemma is only intended for use in setting up the bundled version and should not be used once that is defined.

theorem orthogonal_projection_fn_inner_eq_zero {α : Type u} [inner_product_space α] {K : submodule α} (h : is_complete K) (v w : α) :

The characterization of the unbundled orthogonal projection. This lemma is only intended for use in setting up the bundled version and should not be used once that is defined.

theorem eq_orthogonal_projection_fn_of_mem_of_inner_eq_zero {α : Type u} [inner_product_space α] {K : submodule α} (h : is_complete K) {u v : α} :
v K(∀ (w : α), w Khas_inner.inner (u - v) w = 0)v = orthogonal_projection_fn h u

The unbundled orthogonal projection is the unique point in K with the orthogonality property. This lemma is only intended for use in setting up the bundled version and should not be used once that is defined.

def orthogonal_projection {α : Type u} [inner_product_space α] {K : submodule α} :

The orthogonal projection onto a complete subspace.

Equations
theorem orthogonal_projection_mem {α : Type u} [inner_product_space α] {K : submodule α} (h : is_complete K) (v : α) :

The orthogonal projection is in the given subspace.

@[simp]
theorem orthogonal_projection_inner_eq_zero {α : Type u} [inner_product_space α] {K : submodule α} (h : is_complete K) (v w : α) :

The characterization of the orthogonal projection.

theorem eq_orthogonal_projection_of_mem_of_inner_eq_zero {α : Type u} [inner_product_space α] {K : submodule α} (h : is_complete K) {u v : α} :
v K(∀ (w : α), w Khas_inner.inner (u - v) w = 0)v = (orthogonal_projection h) u

The orthogonal projection is the unique point in K with the orthogonality property.

The subspace of vectors orthogonal to a given subspace.

Equations
theorem submodule.​mem_orthogonal {α : Type u} [inner_product_space α] (K : submodule α) (v : α) :
v K.orthogonal ∀ (u : α), u Khas_inner.inner u v = 0

When a vector is in K.orthogonal.

theorem submodule.​mem_orthogonal' {α : Type u} [inner_product_space α] (K : submodule α) (v : α) :
v K.orthogonal ∀ (u : α), u Khas_inner.inner v u = 0

When a vector is in K.orthogonal, with the inner product the other way round.

theorem submodule.​inner_right_of_mem_orthogonal {α : Type u} [inner_product_space α] {u v : α} {K : submodule α} :
u Kv K.orthogonalhas_inner.inner u v = 0

A vector in K is orthogonal to one in K.orthogonal.

theorem submodule.​inner_left_of_mem_orthogonal {α : Type u} [inner_product_space α] {u v : α} {K : submodule α} :
u Kv K.orthogonalhas_inner.inner v u = 0

A vector in K.orthogonal is orthogonal to one in K.

K and K.orthogonal have trivial intersection.

K is contained in K.orthogonal.orthogonal.

theorem submodule.​inf_orthogonal {α : Type u} [inner_product_space α] (K₁ K₂ : submodule α) :
K₁.orthogonal K₂.orthogonal = (K₁ K₂).orthogonal

The inf of two orthogonal subspaces equals the subspace orthogonal to the sup.

theorem submodule.​infi_orthogonal {α : Type u} [inner_product_space α] {ι : Type u_1} (K : ι → submodule α) :
(⨅ (i : ι), (K i).orthogonal) = (supr K).orthogonal

The inf of an indexed family of orthogonal subspaces equals the subspace orthogonal to the sup.

theorem submodule.​Inf_orthogonal {α : Type u} [inner_product_space α] (s : set (submodule α)) :
(⨅ (K : submodule α) (H : K s), K.orthogonal) = (has_Sup.Sup s).orthogonal

The inf of a set of orthogonal subspaces equals the subspace orthogonal to the sup.

If K is complete, K and K.orthogonal span the whole space.

If K is complete, K and K.orthogonal are complements of each other.