The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V22. Affine, Euclidean and convex geometry

Mathlib.Geometry.Euclidean.Angle.Unoriented.Basic

51 declarations and 2 deprecated aliases. Mathlib docs · Source

def InnerProductGeometry.angle E3 #

{V : Type u_1} → [inst : NormedAddCommGroup V] → [InnerProductSpace ℝ V] → V → V → ℝ

The undirected angle between two vectors. If either vector is 0, this is π/2. See Orientation.oangle for the corresponding oriented angle definition.

theorem InnerProductGeometry.continuousAt_angle E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x : V × V},
  x.1 ≠ 0 → x.2 ≠ 0 → ContinuousAt (fun y ↦ InnerProductGeometry.angle y.1 y.2) x

theorem InnerProductGeometry.angle_smul_smul E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {c : ℝ},
  c ≠ 0 → ∀ (x y : V), InnerProductGeometry.angle (c • x) (c • y) = InnerProductGeometry.angle x y

theorem LinearIsometry.angle_map E0 #

∀ {E : Type u_2} {F : Type u_3} [inst : NormedAddCommGroup E] [inst_1 : NormedAddCommGroup F]
  [inst_2 : InnerProductSpace ℝ E] [inst_3 : InnerProductSpace ℝ F] (f : E →ₗᵢ[ℝ] F) (u v : E),
  InnerProductGeometry.angle (f u) (f v) = InnerProductGeometry.angle u v

theorem Submodule.angle_coe E0 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {s : Submodule ℝ V} (x y : ↥s),
  InnerProductGeometry.angle ↑x ↑y = InnerProductGeometry.angle x y

theorem InnerProductGeometry.cos_angle E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x y : V),
  Real.cos (InnerProductGeometry.angle x y) = inner ℝ x y / (‖x‖ * ‖y‖)

The cosine of the angle between two vectors.

theorem InnerProductGeometry.angle_comm E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x y : V),
  InnerProductGeometry.angle x y = InnerProductGeometry.angle y x

The angle between two vectors does not depend on their order.

theorem InnerProductGeometry.angle_neg_neg E0 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x y : V),
  InnerProductGeometry.angle (-x) (-y) = InnerProductGeometry.angle x y

The angle between the negation of two vectors.

theorem InnerProductGeometry.angle_nonneg E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x y : V),
  0 ≤ InnerProductGeometry.angle x y

The angle between two vectors is nonnegative.

theorem InnerProductGeometry.angle_le_pi E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x y : V),
  InnerProductGeometry.angle x y ≤ Real.pi

The angle between two vectors is at most π.

theorem InnerProductGeometry.sin_angle_nonneg E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x y : V),
  0 ≤ Real.sin (InnerProductGeometry.angle x y)

The sine of the angle between two vectors is nonnegative.

theorem InnerProductGeometry.angle_neg_right E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x y : V),
  InnerProductGeometry.angle x (-y) = Real.pi - InnerProductGeometry.angle x y

The angle between a vector and the negation of another vector.

theorem InnerProductGeometry.angle_neg_left E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x y : V),
  InnerProductGeometry.angle (-x) y = Real.pi - InnerProductGeometry.angle x y

The angle between the negation of a vector and another vector.

theorem InnerProductGeometry.angle_zero_left E0 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x : V),
  InnerProductGeometry.angle 0 x = Real.pi / 2

The angle between the zero vector and a vector.

theorem InnerProductGeometry.angle_zero_right E0 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x : V),
  InnerProductGeometry.angle x 0 = Real.pi / 2

The angle between a vector and the zero vector.

theorem InnerProductGeometry.angle_self E0 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x : V},
  x ≠ 0 → InnerProductGeometry.angle x x = 0

The angle between a nonzero vector and itself.

theorem InnerProductGeometry.angle_self_neg_of_ne_zero E0 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x : V},
  x ≠ 0 → InnerProductGeometry.angle x (-x) = Real.pi

The angle between a nonzero vector and its negation.

theorem InnerProductGeometry.angle_neg_self_of_ne_zero E0 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x : V},
  x ≠ 0 → InnerProductGeometry.angle (-x) x = Real.pi

The angle between the negation of a nonzero vector and that vector.

theorem InnerProductGeometry.angle_smul_right_of_pos E0 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x y : V) {r : ℝ},
  0 < r → InnerProductGeometry.angle x (r • y) = InnerProductGeometry.angle x y

The angle between a vector and a positive multiple of a vector.

theorem InnerProductGeometry.angle_smul_left_of_pos E0 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x y : V) {r : ℝ},
  0 < r → InnerProductGeometry.angle (r • x) y = InnerProductGeometry.angle x y

The angle between a positive multiple of a vector and a vector.

theorem InnerProductGeometry.angle_smul_right_of_neg E0 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x y : V) {r : ℝ},
  r < 0 → InnerProductGeometry.angle x (r • y) = InnerProductGeometry.angle x (-y)

The angle between a vector and a negative multiple of a vector.

theorem InnerProductGeometry.angle_smul_left_of_neg E0 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x y : V) {r : ℝ},
  r < 0 → InnerProductGeometry.angle (r • x) y = InnerProductGeometry.angle (-x) y

The angle between a negative multiple of a vector and a vector.

theorem InnerProductGeometry.cos_angle_mul_norm_mul_norm E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x y : V),
  Real.cos (InnerProductGeometry.angle x y) * (‖x‖ * ‖y‖) = inner ℝ x y

The cosine of the angle between two vectors, multiplied by the product of their norms.

theorem InnerProductGeometry.sin_angle_mul_norm_mul_norm E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x y : V),
  Real.sin (InnerProductGeometry.angle x y) * (‖x‖ * ‖y‖) = √(inner ℝ x x * inner ℝ y y - inner ℝ x y * inner ℝ x y)

The sine of the angle between two vectors, multiplied by the product of their norms.

theorem InnerProductGeometry.sin_angle E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  x ≠ 0 →
    y ≠ 0 →
      Real.sin (InnerProductGeometry.angle x y) = √(inner ℝ x x * inner ℝ y y - inner ℝ x y * inner ℝ x y) / (‖x‖ * ‖y‖)

The sine of the angle between two vectors.

theorem InnerProductGeometry.sin_angle_add E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  x ≠ 0 →
    x + y ≠ 0 →
      Real.sin (InnerProductGeometry.angle x (x + y)) =
        √(inner ℝ x x * inner ℝ y y - inner ℝ x y * inner ℝ x y) / (‖x‖ * ‖x + y‖)

The sine of the angle between x and x + y.

theorem InnerProductGeometry.angle_eq_zero_iff E0 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  InnerProductGeometry.angle x y = 0 ↔ x ≠ 0 ∧ ∃ r, 0 < r ∧ y = r • x

The angle between two vectors is zero if and only if they are nonzero and one is a positive multiple of the other.

theorem InnerProductGeometry.angle_eq_pi_iff E0 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  InnerProductGeometry.angle x y = Real.pi ↔ x ≠ 0 ∧ ∃ r < 0, y = r • x

The angle between two vectors is π if and only if they are nonzero and one is a negative multiple of the other.

theorem InnerProductGeometry.angle_add_angle_eq_pi_of_angle_eq_pi E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V} (z : V),
  InnerProductGeometry.angle x y = Real.pi → InnerProductGeometry.angle x z + InnerProductGeometry.angle y z = Real.pi

If the angle between two vectors is π, the angles between those vectors and a third vector add to π.

theorem InnerProductGeometry.inner_eq_zero_iff_angle_eq_pi_div_two E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x y : V),
  inner ℝ x y = 0 ↔ InnerProductGeometry.angle x y = Real.pi / 2

Two vectors have inner product 0 if and only if the angle between them is π/2.

theorem InnerProductGeometry.inner_nonpos_iff_pi_div_two_le_angle E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  inner ℝ x y ≤ 0 ↔ Real.pi / 2 ≤ InnerProductGeometry.angle x y

The inner product of two vectors is nonpositive if and only if the angle between them is at least π / 2.

theorem InnerProductGeometry.inner_neg_iff_pi_div_two_lt_angle E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  inner ℝ x y < 0 ↔ Real.pi / 2 < InnerProductGeometry.angle x y

The inner product of two vectors is negative if and only if the angle between them exceeds π / 2.

theorem InnerProductGeometry.inner_eq_neg_mul_norm_of_angle_eq_pi E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  InnerProductGeometry.angle x y = Real.pi → inner ℝ x y = -(‖x‖ * ‖y‖)

If the angle between two vectors is π, the inner product equals the negative product of the norms.

theorem InnerProductGeometry.inner_eq_mul_norm_of_angle_eq_zero E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  InnerProductGeometry.angle x y = 0 → inner ℝ x y = ‖x‖ * ‖y‖

If the angle between two vectors is 0, the inner product equals the product of the norms.

theorem InnerProductGeometry.inner_eq_neg_mul_norm_iff_angle_eq_pi E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  x ≠ 0 → y ≠ 0 → (inner ℝ x y = -(‖x‖ * ‖y‖) ↔ InnerProductGeometry.angle x y = Real.pi)

The inner product of two non-zero vectors equals the negative product of their norms if and only if the angle between the two vectors is π.

theorem InnerProductGeometry.inner_eq_mul_norm_iff_angle_eq_zero E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  x ≠ 0 → y ≠ 0 → (inner ℝ x y = ‖x‖ * ‖y‖ ↔ InnerProductGeometry.angle x y = 0)

The inner product of two non-zero vectors equals the product of their norms if and only if the angle between the two vectors is 0.

theorem InnerProductGeometry.norm_sub_eq_add_norm_of_angle_eq_pi E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  InnerProductGeometry.angle x y = Real.pi → ‖x - y‖ = ‖x‖ + ‖y‖

If the angle between two vectors is π, the norm of their difference equals the sum of their norms.

theorem InnerProductGeometry.norm_add_eq_add_norm_of_angle_eq_zero E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  InnerProductGeometry.angle x y = 0 → ‖x + y‖ = ‖x‖ + ‖y‖

If the angle between two vectors is 0, the norm of their sum equals the sum of their norms.

theorem InnerProductGeometry.norm_sub_eq_abs_sub_norm_of_angle_eq_zero E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  InnerProductGeometry.angle x y = 0 → ‖x - y‖ = |‖x‖ - ‖y‖|

If the angle between two vectors is 0, the norm of their difference equals the absolute value of the difference of their norms.

theorem InnerProductGeometry.norm_sub_eq_add_norm_iff_angle_eq_pi E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  x ≠ 0 → y ≠ 0 → (‖x - y‖ = ‖x‖ + ‖y‖ ↔ InnerProductGeometry.angle x y = Real.pi)

The norm of the difference of two non-zero vectors equals the sum of their norms if and only the angle between the two vectors is π.

theorem InnerProductGeometry.norm_add_eq_add_norm_iff_angle_eq_zero E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  x ≠ 0 → y ≠ 0 → (‖x + y‖ = ‖x‖ + ‖y‖ ↔ InnerProductGeometry.angle x y = 0)

The norm of the sum of two non-zero vectors equals the sum of their norms if and only the angle between the two vectors is 0.

theorem InnerProductGeometry.norm_sub_eq_abs_sub_norm_iff_angle_eq_zero E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  x ≠ 0 → y ≠ 0 → (‖x - y‖ = |‖x‖ - ‖y‖| ↔ InnerProductGeometry.angle x y = 0)

The norm of the difference of two non-zero vectors equals the absolute value of the difference of their norms if and only the angle between the two vectors is 0.

theorem InnerProductGeometry.norm_add_eq_norm_sub_iff_angle_eq_pi_div_two E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x y : V),
  ‖x + y‖ = ‖x - y‖ ↔ InnerProductGeometry.angle x y = Real.pi / 2

The norm of the sum of two vectors equals the norm of their difference if and only if the angle between them is π/2.

theorem InnerProductGeometry.cos_eq_one_iff_angle_eq_zero E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  Real.cos (InnerProductGeometry.angle x y) = 1 ↔ InnerProductGeometry.angle x y = 0

The cosine of the angle between two vectors is 1 if and only if the angle is 0.

theorem InnerProductGeometry.cos_eq_zero_iff_angle_eq_pi_div_two E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  Real.cos (InnerProductGeometry.angle x y) = 0 ↔ InnerProductGeometry.angle x y = Real.pi / 2

The cosine of the angle between two vectors is 0 if and only if the angle is π / 2.

theorem InnerProductGeometry.cos_eq_neg_one_iff_angle_eq_pi E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  Real.cos (InnerProductGeometry.angle x y) = -1 ↔ InnerProductGeometry.angle x y = Real.pi

The cosine of the angle between two vectors is -1 if and only if the angle is π.

theorem InnerProductGeometry.sin_eq_zero_iff_angle_eq_zero_or_angle_eq_pi E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  Real.sin (InnerProductGeometry.angle x y) = 0 ↔
    InnerProductGeometry.angle x y = 0 ∨ InnerProductGeometry.angle x y = Real.pi

The sine of the angle between two vectors is 0 if and only if the angle is 0 or π.

theorem InnerProductGeometry.sin_eq_one_iff_angle_eq_pi_div_two E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  Real.sin (InnerProductGeometry.angle x y) = 1 ↔ InnerProductGeometry.angle x y = Real.pi / 2

The sine of the angle between two vectors is 1 if and only if the angle is π / 2.

theorem InnerProductGeometry.angle_normalize_left E0 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x y : V),
  InnerProductGeometry.angle (NormedSpace.normalize x) y = InnerProductGeometry.angle x y

The angle between a normalized vector and another vector is equal to the angle between the original vectors.

theorem InnerProductGeometry.angle_normalize_right E0 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] (x y : V),
  InnerProductGeometry.angle x (NormedSpace.normalize y) = InnerProductGeometry.angle x y

The angle between a vector and another normalized vector is equal to the angle between the original vectors.

theorem InnerProductGeometry.inner_eq_cos_angle_of_norm_eq_one E1 #

∀ {V : Type u_1} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] {x y : V},
  ‖x‖ = 1 → ‖y‖ = 1 → inner ℝ x y = Real.cos (InnerProductGeometry.angle x y)

The inner product of two unit vectors is equal to the cosine of the angle between them.

Deprecated aliases

NameNew nameSince
InnerProductGeometry.angle_neg_self_of_nonzeroInnerProductGeometry.angle_neg_self_of_ne_zero2026-10-13
InnerProductGeometry.angle_self_neg_of_nonzeroInnerProductGeometry.angle_self_neg_of_ne_zero2026-10-13