algebra.midpoint

Midpoint of a segment

Main definitions

• midpoint R x y: midpoint of the segment [x, y]. We define it for x and y in a module over a ring R with invertible 2.
• add_monoid_hom.of_map_midpoint: construct an add_monoid_hom given a map f such that f sends zero to zero and midpoints to midpoints.

Main theorems

• midpoint_eq_iff: z is the midpoint of [x, y] if and only if x + y = z + z,
• midpoint_unique: midpoint R x y does not depend on R;
• midpoint x y is linear both in x and y;
• point_reflection_midpoint_left, point_reflection_midpoint_right: equiv.point_reflection (midpoint R x y) swaps x and y.

We do not mark most lemmas as @[simp] because it is hard to tell which side is simpler.

Tags

def midpoint (R : Type u_1) {E : Type u_2} [semiring R] [invertible 2] [ E] :
E → E → E

midpoint x y is the midpoint of the segment [x, y].

Equations
theorem midpoint_eq_iff (R : Type u_1) {E : Type u_2} [semiring R] [invertible 2] [ E] {x y z : E} :
x y = z x + y = z + z

@[simp]
theorem midpoint_add_self (R : Type u_1) {E : Type u_2} [semiring R] [invertible 2] [ E] (x y : E) :
x y + x y = x + y

theorem midpoint_unique (R : Type u_1) {E : Type u_2} [semiring R] [invertible 2] [ E] (R' : Type u_3) [semiring R'] [invertible 2] [ E] (x y : E) :
x y = midpoint R' x y

midpoint does not depend on the ring R.

@[simp]
theorem midpoint_self (R : Type u_1) {E : Type u_2} [semiring R] [invertible 2] [ E] (x : E) :
x x = x

theorem midpoint_def {R : Type u_1} {E : Type u_2} [semiring R] [invertible 2] [ E] (x y : E) :
x y = 2 (x + y)

theorem midpoint_comm {R : Type u_1} {E : Type u_2} [semiring R] [invertible 2] [ E] (x y : E) :
x y = y x

theorem midpoint_zero_add {R : Type u_1} {E : Type u_2} [semiring R] [invertible 2] [ E] (x y : E) :
0 (x + y) = x y

theorem midpoint_add_add {R : Type u_1} {E : Type u_2} [semiring R] [invertible 2] [ E] (x y x' y' : E) :
(x + x') (y + y') = x y + x' y'

theorem midpoint_add_right {R : Type u_1} {E : Type u_2} [semiring R] [invertible 2] [ E] (x y z : E) :
(x + z) (y + z) = x y + z

theorem midpoint_add_left {R : Type u_1} {E : Type u_2} [semiring R] [invertible 2] [ E] (x y z : E) :
(x + y) (x + z) = x + y z

theorem midpoint_smul_smul {R : Type u_1} {E : Type u_2} [semiring R] [invertible 2] [ E] (c : R) (x y : E) :
(c x) (c y) = c x y

theorem midpoint_neg_neg (R : Type u_1) {E : Type u_2} [ring R] [invertible 2] [ E] (x y : E) :
(-x) (-y) = - x y

theorem midpoint_sub_sub (R : Type u_1) {E : Type u_2} [ring R] [invertible 2] [ E] (x y x' y' : E) :
(x - x') (y - y') = x y - x' y'

theorem midpoint_sub_right (R : Type u_1) {E : Type u_2} [ring R] [invertible 2] [ E] (x y z : E) :
(x - z) (y - z) = x y - z

theorem midpoint_sub_left (R : Type u_1) {E : Type u_2} [ring R] [invertible 2] [ E] (x y z : E) :
(x - y) (x - z) = x - y z

def add_monoid_hom.of_map_midpoint (R : Type u_1) {E : Type u_2} (R' : Type u_3) {F : Type u_4} [semiring R] [invertible 2] [ E] [semiring R'] [invertible 2] [ F] (f : E → F) :
f 0 = 0(∀ (x y : E), f (midpoint R x y) = midpoint R' (f x) (f y))E →+ F

A map f : E → F sending zero to zero and midpoints to midpoints is an add_monoid_hom.

Equations
@[simp]
theorem add_monoid_hom.coe_of_map_midpoint (R : Type u_1) {E : Type u_2} (R' : Type u_3) {F : Type u_4} [semiring R] [invertible 2] [ E] [semiring R'] [invertible 2] [ F] (f : E → F) (h0 : f 0 = 0) (hm : ∀ (x y : E), f (midpoint R x y) = midpoint R' (f x) (f y)) :
h0 hm) = f

@[simp]
theorem equiv.point_reflection_midpoint_left (R : Type u_1) {E : Type u_2} [ring R] [invertible 2] [ E] (x y : E) :

@[simp]
theorem equiv.point_reflection_midpoint_right (R : Type u_1) {E : Type u_2} [ring R] [invertible 2] [ E] (x y : E) :