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

Commit 7826122

Browse files
committed
chore(linear_algebra/affine_space/midpoint): factor out lemmas about char_zero (#18555)
This removes the dependency on `char_p` in `analysis.convex.segment` and `analysis.normed.group.add_torsor`.
1 parent 3b267e7 commit 7826122

8 files changed

Lines changed: 55 additions & 34 deletions

File tree

src/analysis/convex/between.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Authors: Joseph Myers
66
import data.set.intervals.group
77
import analysis.convex.segment
88
import linear_algebra.affine_space.finite_dimensional
9+
import linear_algebra.affine_space.midpoint_zero
910
import tactic.field_simp
1011

1112
/-!

src/analysis/convex/slope.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Authors: Yury Kudriashov, Malo Jaffré
55
-/
66
import analysis.convex.function
77
import tactic.field_simp
8+
import tactic.linarith
89

910
/-!
1011
# Slopes of convex functions

src/analysis/normed_space/add_torsor.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Authors: Joseph Myers, Yury Kudryashov
55
-/
66
import analysis.normed_space.basic
77
import analysis.normed.group.add_torsor
8-
import linear_algebra.affine_space.midpoint
8+
import linear_algebra.affine_space.midpoint_zero
99
import linear_algebra.affine_space.affine_subspace
1010
import topology.instances.real_vector_space
1111

src/analysis/normed_space/affine_isometry.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import analysis.normed_space.linear_isometry
77
import analysis.normed.group.add_torsor
88
import analysis.normed_space.basic
99
import linear_algebra.affine_space.restrict
10+
import linear_algebra.affine_space.midpoint_zero
1011

1112
/-!
1213
# Affine isometries

src/analysis/normed_space/mazur_ulam.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Authors: Yury Kudryashov
55
-/
66
import topology.instances.real_vector_space
77
import analysis.normed_space.affine_isometry
8-
import linear_algebra.affine_space.midpoint
98

109
/-!
1110
# Mazur-Ulam Theorem

src/linear_algebra/affine_space/midpoint.lean

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2020 Yury Kudryashov. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Yury Kudryashov
55
-/
6-
import algebra.char_p.invertible
6+
import algebra.invertible
77
import linear_algebra.affine_space.affine_equiv
88

99
/-!
@@ -175,36 +175,6 @@ by rw midpoint_comm; simp
175175

176176
end
177177

178-
lemma line_map_inv_two {R : Type*} {V P : Type*} [division_ring R] [char_zero R]
179-
[add_comm_group V] [module R V] [add_torsor V P] (a b : P) :
180-
line_map a b (2⁻¹:R) = midpoint R a b :=
181-
rfl
182-
183-
lemma line_map_one_half {R : Type*} {V P : Type*} [division_ring R] [char_zero R]
184-
[add_comm_group V] [module R V] [add_torsor V P] (a b : P) :
185-
line_map a b (1/2:R) = midpoint R a b :=
186-
by rw [one_div, line_map_inv_two]
187-
188-
lemma homothety_inv_of_two {R : Type*} {V P : Type*} [comm_ring R] [invertible (2:R)]
189-
[add_comm_group V] [module R V] [add_torsor V P] (a b : P) :
190-
homothety a (⅟2:R) b = midpoint R a b :=
191-
rfl
192-
193-
lemma homothety_inv_two {k : Type*} {V P : Type*} [field k] [char_zero k]
194-
[add_comm_group V] [module k V] [add_torsor V P] (a b : P) :
195-
homothety a (2⁻¹:k) b = midpoint k a b :=
196-
rfl
197-
198-
lemma homothety_one_half {k : Type*} {V P : Type*} [field k] [char_zero k]
199-
[add_comm_group V] [module k V] [add_torsor V P] (a b : P) :
200-
homothety a (1/2:k) b = midpoint k a b :=
201-
by rw [one_div, homothety_inv_two]
202-
203-
@[simp] lemma pi_midpoint_apply {k ι : Type*} {V : Π i : ι, Type*} {P : Π i : ι, Type*} [field k]
204-
[invertible (2:k)] [Π i, add_comm_group (V i)] [Π i, module k (V i)]
205-
[Π i, add_torsor (V i) (P i)] (f g : Π i, P i) (i : ι) :
206-
midpoint k f g i = midpoint k (f i) (g i) := rfl
207-
208178
namespace add_monoid_hom
209179

210180
variables (R R' : Type*) {E F : Type*}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/-
2+
Copyright (c) 2020 Yury Kudryashov. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Yury Kudryashov
5+
-/
6+
import algebra.char_p.invertible
7+
import linear_algebra.affine_space.midpoint
8+
9+
/-!
10+
# Midpoint of a segment for characteristic zero
11+
12+
We collect lemmas that require that the underlying ring has characteristic zero.
13+
14+
## Tags
15+
16+
midpoint
17+
-/
18+
19+
open affine_map affine_equiv
20+
21+
lemma line_map_inv_two {R : Type*} {V P : Type*} [division_ring R] [char_zero R]
22+
[add_comm_group V] [module R V] [add_torsor V P] (a b : P) :
23+
line_map a b (2⁻¹:R) = midpoint R a b :=
24+
rfl
25+
26+
lemma line_map_one_half {R : Type*} {V P : Type*} [division_ring R] [char_zero R]
27+
[add_comm_group V] [module R V] [add_torsor V P] (a b : P) :
28+
line_map a b (1/2:R) = midpoint R a b :=
29+
by rw [one_div, line_map_inv_two]
30+
31+
lemma homothety_inv_of_two {R : Type*} {V P : Type*} [comm_ring R] [invertible (2:R)]
32+
[add_comm_group V] [module R V] [add_torsor V P] (a b : P) :
33+
homothety a (⅟2:R) b = midpoint R a b :=
34+
rfl
35+
36+
lemma homothety_inv_two {k : Type*} {V P : Type*} [field k] [char_zero k]
37+
[add_comm_group V] [module k V] [add_torsor V P] (a b : P) :
38+
homothety a (2⁻¹:k) b = midpoint k a b :=
39+
rfl
40+
41+
lemma homothety_one_half {k : Type*} {V P : Type*} [field k] [char_zero k]
42+
[add_comm_group V] [module k V] [add_torsor V P] (a b : P) :
43+
homothety a (1/2:k) b = midpoint k a b :=
44+
by rw [one_div, homothety_inv_two]
45+
46+
@[simp] lemma pi_midpoint_apply {k ι : Type*} {V : Π i : ι, Type*} {P : Π i : ι, Type*} [field k]
47+
[invertible (2:k)] [Π i, add_comm_group (V i)] [Π i, module k (V i)]
48+
[Π i, add_torsor (V i) (P i)] (f g : Π i, P i) (i : ι) :
49+
midpoint k f g i = midpoint k (f i) (g i) := rfl

src/linear_algebra/affine_space/ordered.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Authors: Yury G. Kudryashov
55
-/
66
import algebra.order.invertible
77
import algebra.order.module
8-
import linear_algebra.affine_space.midpoint
8+
import linear_algebra.affine_space.midpoint_zero
99
import linear_algebra.affine_space.slope
1010
import tactic.field_simp
1111

0 commit comments

Comments
 (0)