Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit c8a2fd7

Browse files
committed
feat(analysis/normed_space): normed_group punit (#7616)
Minor content from LTE. Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent 2bd4bb6 commit c8a2fd7

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

src/analysis/normed_space/basic.lean

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Copyright (c) 2018 Patrick Massot. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Patrick Massot, Johannes Hölzl
55
-/
6+
import algebra.punit_instances
67
import topology.instances.nnreal
78
import topology.algebra.module
89
import topology.algebra.algebra
@@ -86,6 +87,12 @@ noncomputable def semi_normed_group.of_core (α : Type*) [add_comm_group α] [ha
8687
calc ∥x - y∥ = ∥ -(y - x)∥ : by simp
8788
... = ∥y - x∥ : by { rw [C.norm_neg] } }
8889

90+
instance : normed_group punit :=
91+
{ norm := function.const _ 0,
92+
dist_eq := λ _ _, rfl, }
93+
94+
@[simp] lemma punit.norm_eq_zero (r : punit) : ∥r∥ = 0 := rfl
95+
8996
instance : normed_group ℝ :=
9097
{ norm := λ x, abs x,
9198
dist_eq := assume x y, rfl }
@@ -773,6 +780,11 @@ class normed_comm_ring (α : Type*) extends normed_ring α :=
773780
instance normed_comm_ring.to_semi_normed_comm_ring [β : normed_comm_ring α] :
774781
semi_normed_comm_ring α := { ..β }
775782

783+
instance : normed_comm_ring punit :=
784+
{ norm_mul := λ _ _, by simp,
785+
..punit.normed_group,
786+
..punit.comm_ring, }
787+
776788
/-- A mixin class with the axiom `∥1∥ = 1`. Many `normed_ring`s and all `normed_field`s satisfy this
777789
axiom. -/
778790
class norm_one_class (α : Type*) [has_norm α] [has_one α] : Prop :=

src/topology/metric_space/basic.lean

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,6 +1876,20 @@ metric_space.induced coe (λ x y, subtype.ext) t
18761876

18771877
theorem subtype.dist_eq {p : α → Prop} (x y : subtype p) : dist x y = dist (x : α) y := rfl
18781878

1879+
instance : metric_space empty :=
1880+
{ dist := λ _ _, 0,
1881+
dist_self := λ _, rfl,
1882+
dist_comm := λ _ _, rfl,
1883+
eq_of_dist_eq_zero := λ _ _ _, subsingleton.elim _ _,
1884+
dist_triangle := λ _ _ _, show (0:ℝ) ≤ 0 + 0, by rw add_zero, }
1885+
1886+
instance : metric_space punit :=
1887+
{ dist := λ _ _, 0,
1888+
dist_self := λ _, rfl,
1889+
dist_comm := λ _ _, rfl,
1890+
eq_of_dist_eq_zero := λ _ _ _, subsingleton.elim _ _,
1891+
dist_triangle := λ _ _ _, show (0:ℝ) ≤ 0 + 0, by rw add_zero, }
1892+
18791893
section real
18801894

18811895
/-- Instantiate the reals as a metric space. -/

src/topology/uniform_space/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ lemma to_topological_space_inf {u v : uniform_space α} :
10891089
by rw [to_topological_space_Inf, infi_pair]
10901090

10911091
instance : uniform_space empty := ⊥
1092-
instance : uniform_space unit := ⊥
1092+
instance : uniform_space punit := ⊥
10931093
instance : uniform_space bool := ⊥
10941094
instance : uniform_space ℕ := ⊥
10951095
instance : uniform_space ℤ := ⊥

0 commit comments

Comments
 (0)