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 / V13. General topology

Mathlib.Topology.MetricSpace.Pseudo.Pi

25 declarations and 9 deprecated aliases. Mathlib docs · Source

instance pseudoMetricSpacePi E0 #

{β : Type u_2} →
  {X : β → Type u_3} → [Fintype β] → [(b : β) → PseudoMetricSpace (X b)] → PseudoMetricSpace ((b : β) → X b)

A finite product of pseudometric spaces is a pseudometric space, with the sup distance.

theorem nnDist_pi_def E0 #

∀ {β : Type u_2} {X : β → Type u_3} [inst : Fintype β] [inst_1 : (b : β) → PseudoMetricSpace (X b)]
  (f g : (b : β) → X b), nnDist f g = Finset.univ.sup fun b ↦ nnDist (f b) (g b)

theorem dist_pi_def E0 #

∀ {β : Type u_2} {X : β → Type u_3} [inst : Fintype β] [inst_1 : (b : β) → PseudoMetricSpace (X b)]
  (f g : (b : β) → X b), dist f g = ↑(Finset.univ.sup fun b ↦ nnDist (f b) (g b))

theorem nnDist_pi_le_iff E0 #

∀ {β : Type u_2} {X : β → Type u_3} [inst : Fintype β] [inst_1 : (b : β) → PseudoMetricSpace (X b)]
  {f g : (b : β) → X b} {r : NNReal}, nnDist f g ≤ r ↔ ∀ (b : β), nnDist (f b) (g b) ≤ r

theorem nnDist_pi_lt_iff E0 #

∀ {β : Type u_2} {X : β → Type u_3} [inst : Fintype β] [inst_1 : (b : β) → PseudoMetricSpace (X b)]
  {f g : (b : β) → X b} {r : NNReal}, 0 < r → (nnDist f g < r ↔ ∀ (b : β), nnDist (f b) (g b) < r)

theorem nnDist_pi_eq_iff E0 #

∀ {β : Type u_2} {X : β → Type u_3} [inst : Fintype β] [inst_1 : (b : β) → PseudoMetricSpace (X b)]
  {f g : (b : β) → X b} {r : NNReal},
  0 < r → (nnDist f g = r ↔ (∃ i, nnDist (f i) (g i) = r) ∧ ∀ (b : β), nnDist (f b) (g b) ≤ r)

theorem dist_pi_lt_iff E0 #

∀ {β : Type u_2} {X : β → Type u_3} [inst : Fintype β] [inst_1 : (b : β) → PseudoMetricSpace (X b)]
  {f g : (b : β) → X b} {r : ℝ}, 0 < r → (dist f g < r ↔ ∀ (b : β), dist (f b) (g b) < r)

theorem dist_pi_le_iff E0 #

∀ {β : Type u_2} {X : β → Type u_3} [inst : Fintype β] [inst_1 : (b : β) → PseudoMetricSpace (X b)]
  {f g : (b : β) → X b} {r : ℝ}, 0 ≤ r → (dist f g ≤ r ↔ ∀ (b : β), dist (f b) (g b) ≤ r)

theorem dist_pi_eq_iff E0 #

∀ {β : Type u_2} {X : β → Type u_3} [inst : Fintype β] [inst_1 : (b : β) → PseudoMetricSpace (X b)]
  {f g : (b : β) → X b} {r : ℝ}, 0 < r → (dist f g = r ↔ (∃ i, dist (f i) (g i) = r) ∧ ∀ (b : β), dist (f b) (g b) ≤ r)

theorem dist_pi_le_iff' E1 #

∀ {β : Type u_2} {X : β → Type u_3} [inst : Fintype β] [inst_1 : (b : β) → PseudoMetricSpace (X b)] [Nonempty β]
  {f g : (b : β) → X b} {r : ℝ}, dist f g ≤ r ↔ ∀ (b : β), dist (f b) (g b) ≤ r

theorem dist_pi_const_le E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : PseudoMetricSpace α] [inst_1 : Fintype β] (a b : α),
  (dist (fun x ↦ a) fun x ↦ b) ≤ dist a b

theorem nnDist_pi_const_le E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : PseudoMetricSpace α] [inst_1 : Fintype β] (a b : α),
  (nnDist (fun x ↦ a) fun x ↦ b) ≤ nnDist a b

theorem dist_pi_const E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : PseudoMetricSpace α] [inst_1 : Fintype β] [Nonempty β] (a b : α),
  (dist (fun x ↦ a) fun x ↦ b) = dist a b

theorem nnDist_pi_const E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : PseudoMetricSpace α] [inst_1 : Fintype β] [Nonempty β] (a b : α),
  (nnDist (fun x ↦ a) fun x ↦ b) = nnDist a b

theorem nnDist_le_pi_nnDist E1 #

∀ {β : Type u_2} {X : β → Type u_3} [inst : Fintype β] [inst_1 : (b : β) → PseudoMetricSpace (X b)]
  (f g : (b : β) → X b) (b : β), nnDist (f b) (g b) ≤ nnDist f g

theorem dist_le_pi_dist E1 #

∀ {β : Type u_2} {X : β → Type u_3} [inst : Fintype β] [inst_1 : (b : β) → PseudoMetricSpace (X b)]
  (f g : (b : β) → X b) (b : β), dist (f b) (g b) ≤ dist f g

theorem ball_pi E1 #

∀ {β : Type u_2} {X : β → Type u_3} [inst : Fintype β] [inst_1 : (b : β) → PseudoMetricSpace (X b)] (x : (b : β) → X b)
  {r : ℝ}, 0 < r → Metric.ball x r = Set.univ.pi fun b ↦ Metric.ball (x b) r

An open ball in a product space is a product of open balls. See also ball_pi' for a version assuming Nonempty β instead of 0 < r.

theorem ball_pi' E1 #

∀ {β : Type u_2} {X : β → Type u_3} [inst : Fintype β] [inst_1 : (b : β) → PseudoMetricSpace (X b)] [Nonempty β]
  (x : (b : β) → X b) (r : ℝ), Metric.ball x r = Set.univ.pi fun b ↦ Metric.ball (x b) r

An open ball in a product space is a product of open balls. See also ball_pi for a version assuming 0 < r instead of Nonempty β.

theorem closedBall_pi E1 #

∀ {β : Type u_2} {X : β → Type u_3} [inst : Fintype β] [inst_1 : (b : β) → PseudoMetricSpace (X b)] (x : (b : β) → X b)
  {r : ℝ}, 0 ≤ r → Metric.closedBall x r = Set.univ.pi fun b ↦ Metric.closedBall (x b) r

A closed ball in a product space is a product of closed balls. See also closedBall_pi' for a version assuming Nonempty β instead of 0 ≤ r.

theorem closedBall_pi' E1 #

∀ {β : Type u_2} {X : β → Type u_3} [inst : Fintype β] [inst_1 : (b : β) → PseudoMetricSpace (X b)] [Nonempty β]
  (x : (b : β) → X b) (r : ℝ), Metric.closedBall x r = Set.univ.pi fun b ↦ Metric.closedBall (x b) r

A closed ball in a product space is a product of closed balls. See also closedBall_pi for a version assuming 0 ≤ r instead of Nonempty β.

theorem sphere_pi E1 #

∀ {β : Type u_2} {X : β → Type u_3} [inst : Fintype β] [inst_1 : (b : β) → PseudoMetricSpace (X b)] (x : (b : β) → X b)
  {r : ℝ},
  0 < r ∨ Nonempty β → Metric.sphere x r = (⋃ i, Function.eval i ⁻¹' Metric.sphere (x i) r) ∩ Metric.closedBall x r

A sphere in a product space is a union of spheres on each component restricted to the closed ball.

theorem Fin.nnDist_insertNth_insertNth E0 #

∀ {n : ℕ} {α : Fin (n + 1) → Type u_4} [inst : (i : Fin (n + 1)) → PseudoMetricSpace (α i)] (i : Fin (n + 1))
  (x y : α i) (f g : (j : Fin n) → α (i.succAbove j)),
  nnDist (i.insertNth x f) (i.insertNth y g) = max (nnDist x y) (nnDist f g)

theorem Fin.dist_insertNth_insertNth E0 #

∀ {n : ℕ} {α : Fin (n + 1) → Type u_4} [inst : (i : Fin (n + 1)) → PseudoMetricSpace (α i)] (i : Fin (n + 1))
  (x y : α i) (f g : (j : Fin n) → α (i.succAbove j)),
  dist (i.insertNth x f) (i.insertNth y g) = max (dist x y) (dist f g)

theorem nnDist_single_single E1 #

∀ {β : Type u_2} [inst : Fintype β] {Y : Type u_4} [inst_1 : PseudoMetricSpace Y] [inst_2 : Zero Y]
  [inst_3 : DecidableEq β] (i j : β) (a b : Y),
  i ≠ j → nnDist (Pi.single i a) (Pi.single j b) = max (nnDist a 0) (nnDist b 0)

The (sup metric) nonnegative distance between Pi.single i a and Pi.single j b for i ≠ j is max (nnDist a 0) (nnDist b 0).

theorem dist_single_single E1 #

∀ {β : Type u_2} [inst : Fintype β] {Y : Type u_4} [inst_1 : PseudoMetricSpace Y] [inst_2 : Zero Y]
  [inst_3 : DecidableEq β] (i j : β) (a b : Y), i ≠ j → dist (Pi.single i a) (Pi.single j b) = max (dist a 0) (dist b 0)

The (sup metric) distance between Pi.single i a and Pi.single j b for i ≠ j is max (dist a 0) (dist b 0).

Deprecated aliases

NameNew nameSince
Fin.nndist_insertNth_insertNthFin.nnDist_insertNth_insertNth2026-11-07
nndist_le_pi_nndistnnDist_le_pi_nnDist2026-11-07
nndist_pi_constnnDist_pi_const2026-11-07
nndist_pi_const_lennDist_pi_const_le2026-11-07
nndist_pi_defnnDist_pi_def2026-11-07
nndist_pi_eq_iffnnDist_pi_eq_iff2026-11-07
nndist_pi_le_iffnnDist_pi_le_iff2026-11-07
nndist_pi_lt_iffnnDist_pi_lt_iff2026-11-07
nndist_single_singlennDist_single_single2026-11-07