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

Commit 543ae52

Browse files
committed
feat(analysis/normed_space/add_torsor): normed_add_torsor (#2814)
Define the metric space structure on torsors of additive normed group actions. The motivating case is Euclidean affine spaces. See https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/Some.20olympiad.20formalisations for the discussion leading to this particular handling of the distance. Note: I'm not sure what the right way is to address the dangerous_instance linter error "The following arguments become metavariables. argument 1: (V : Type u_1)".
1 parent e9ba32d commit 543ae52

File tree

3 files changed

+74
-1
lines changed

3 files changed

+74
-1
lines changed

src/algebra/add_torsor.lean

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ instance add_group_is_add_torsor (G : Type*) [add_group G] :
7474
vsub_vadd' := sub_add_cancel,
7575
vadd_vsub' := add_sub_cancel }
7676

77+
/-- Simplify addition for a torsor for an `add_group G` over
78+
itself. -/
79+
@[simp] lemma vadd_eq_add (G : Type*) [add_group G] (g1 g2 : G) : g1 +ᵥ g2 = g1 + g2 :=
80+
rfl
81+
82+
/-- Simplify subtraction for a torsor for an `add_group G` over
83+
itself. -/
84+
@[simp] lemma vsub_eq_sub (G : Type*) [add_group G] (g1 g2 : G) : g1 -ᵥ g2 = g1 - g2 :=
85+
rfl
86+
7787
namespace add_action
7888

7989
section general
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/-
2+
Copyright (c) 2020 Joseph Myers. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Author: Joseph Myers.
5+
-/
6+
import algebra.add_torsor
7+
import analysis.normed_space.basic
8+
9+
noncomputable theory
10+
11+
/-!
12+
# Torsors of additive normed group actions.
13+
14+
This file defines torsors of additive normed group actions, with a
15+
metric space structure. The motivating case is Euclidean affine
16+
spaces.
17+
18+
-/
19+
20+
universes u v
21+
22+
section prio
23+
set_option default_priority 100 -- see Note [default priority]
24+
/-- A `normed_add_torsor V P` is a torsor of an additive normed group
25+
action by a `normed_group V` on points `P`. We bundle the metric space
26+
structure and require the distance to be the same as results from the
27+
norm (which in fact implies the distance yields a metric space, but
28+
bundling just the distance and using an instance for the metric space
29+
results in type class problems). -/
30+
class normed_add_torsor (V : Type u) (P : Type v) [normed_group V] [metric_space P]
31+
extends add_torsor V P :=
32+
(dist_eq_norm' : ∀ (x y : P), dist x y = ∥(x -ᵥ y : V)∥)
33+
end prio
34+
35+
/-- The distance equals the norm of subtracting two points. This lemma
36+
is needed to make V an explicit rather than implicit argument. -/
37+
lemma add_torsor.dist_eq_norm (V : Type u) {P : Type v} [normed_group V] [metric_space P]
38+
[normed_add_torsor V P] (x y : P) :
39+
dist x y = ∥(x -ᵥ y : V)∥ :=
40+
normed_add_torsor.dist_eq_norm' x y
41+
42+
/-- A `normed_group` is a `normed_add_torsor` over itself. -/
43+
instance normed_group.normed_add_torsor (V : Type u) [normed_group V] :
44+
normed_add_torsor V V :=
45+
{ dist_eq_norm' := dist_eq_norm }
46+
47+
open add_torsor
48+
49+
/-- The distance defines a metric space structure on the torsor. This
50+
is not an instance because it depends on `V` to define a `metric_space
51+
P`. -/
52+
def metric_space_of_normed_group_of_add_torsor (V : Type u) (P : Type v) [normed_group V]
53+
[add_torsor V P] : metric_space P :=
54+
{ dist := λ x y, ∥(x -ᵥ y : V)∥,
55+
dist_self := λ x, by simp,
56+
eq_of_dist_eq_zero := λ x y h, by simpa using h,
57+
dist_comm := λ x y, by simp only [←neg_vsub_eq_vsub_rev V y x, norm_neg],
58+
dist_triangle := begin
59+
intros x y z,
60+
change ∥x -ᵥ z∥ ≤ ∥x -ᵥ y∥ + ∥y -ᵥ z∥,
61+
rw ←vsub_add_vsub_cancel,
62+
apply norm_add_le
63+
end }

src/analysis/normed_space/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ by simpa only [dist_add_left, dist_add_right, dist_comm h₂]
141141
@[simp] lemma norm_nonneg (g : α) : 0 ≤ ∥g∥ :=
142142
by { rw[←dist_zero_right], exact dist_nonneg }
143143

144-
lemma norm_eq_zero {g : α} : ∥g∥ = 0 ↔ g = 0 :=
144+
@[simp] lemma norm_eq_zero {g : α} : ∥g∥ = 0 ↔ g = 0 :=
145145
dist_zero_right g ▸ dist_eq_zero
146146

147147
@[simp] lemma norm_zero : ∥(0:α)∥ = 0 := norm_eq_zero.2 rfl

0 commit comments

Comments
 (0)