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 / V22. Affine, Euclidean and convex geometry

Mathlib.LinearAlgebra.AffineSpace.Midpoint

46 declarations. Mathlib docs · Source

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.
  • AddMonoidHom.ofMapMidpoint: construct an AddMonoidHom 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;
  • pointReflection_midpoint_left, pointReflection_midpoint_right: Equiv.pointReflection (midpoint R x y) swaps x and y;
  • midpoint_midpoint_midpoint_rotate: Varignon's theorem.

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

Tags

midpoint, AddMonoidHom

def midpoint E1 #

(R : Type u_1) →
  {V : Type u_2} →
    {P : Type u_4} →
      [inst : Ring R] → [Invertible 2] → [inst_2 : AddCommGroup V] → [Module R V] → [AddTorsor V P] → P → P → P

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

theorem AffineMap.map_midpoint E0 #

∀ {R : Type u_1} {V : Type u_2} {V' : Type u_3} {P : Type u_4} {P' : Type u_5} [inst : Ring R] [inst_1 : Invertible 2]
  [inst_2 : AddCommGroup V] [inst_3 : Module R V] [inst_4 : AddTorsor V P] [inst_5 : AddCommGroup V']
  [inst_6 : Module R V'] [inst_7 : AddTorsor V' P'] (f : P →ᵃ[R] P') (a b : P),
  f (midpoint R a b) = midpoint R (f a) (f b)

theorem AffineEquiv.map_midpoint E0 #

∀ {R : Type u_1} {V : Type u_2} {V' : Type u_3} {P : Type u_4} {P' : Type u_5} [inst : Ring R] [inst_1 : Invertible 2]
  [inst_2 : AddCommGroup V] [inst_3 : Module R V] [inst_4 : AddTorsor V P] [inst_5 : AddCommGroup V']
  [inst_6 : Module R V'] [inst_7 : AddTorsor V' P'] (f : P ≃ᵃ[R] P') (a b : P),
  f (midpoint R a b) = midpoint R (f a) (f b)

theorem AffineEquiv.pointReflection_midpoint_left E3 #

∀ {R : Type u_1} {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (x y : P), (AffineEquiv.pointReflection R (midpoint R x y)) x = y

theorem Equiv.pointReflection_midpoint_left E3 #

∀ {R : Type u_1} {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (x y : P), (Equiv.pointReflection (midpoint R x y)) x = y

theorem midpoint_comm E1 #

∀ {R : Type u_1} {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (x y : P), midpoint R x y = midpoint R y x

theorem AffineEquiv.pointReflection_midpoint_right E3 #

∀ {R : Type u_1} {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (x y : P), (AffineEquiv.pointReflection R (midpoint R x y)) y = x

theorem Equiv.pointReflection_midpoint_right E3 #

∀ {R : Type u_1} {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (x y : P), (Equiv.pointReflection (midpoint R x y)) y = x

theorem midpoint_vsub_midpoint E1 #

∀ {R : Type u_1} {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (p₁ p₂ p₃ p₄ : P),
  midpoint R p₁ p₂ -ᵥ midpoint R p₃ p₄ = midpoint R (p₁ -ᵥ p₃) (p₂ -ᵥ p₄)

theorem midpoint_vadd_midpoint E1 #

∀ {R : Type u_1} {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (v v' : V) (p p' : P),
  midpoint R v v' +ᵥ midpoint R p p' = midpoint R (v +ᵥ p) (v' +ᵥ p')

theorem midpoint_eq_iff E3 #

∀ {R : Type u_1} {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] {x y z : P},
  midpoint R x y = z ↔ (AffineEquiv.pointReflection R z) x = y

theorem midpoint_pointReflection_left E0 #

∀ {R : Type u_1} {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (x y : P), midpoint R ((Equiv.pointReflection x) y) y = x

theorem midpoint_pointReflection_right E0 #

∀ {R : Type u_1} {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (x y : P), midpoint R y ((Equiv.pointReflection x) y) = x

theorem AffineEquiv.midpoint_pointReflection_left E1 #

∀ {R : Type u_1} {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (x y : P), midpoint R ((AffineEquiv.pointReflection R x) y) y = x

theorem AffineEquiv.midpoint_pointReflection_right E1 #

∀ {R : Type u_1} {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (x y : P), midpoint R y ((AffineEquiv.pointReflection R x) y) = x

theorem midpoint_vsub_left E0 #

∀ {R : Type u_1} {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (p₁ p₂ : P), midpoint R p₁ p₂ -ᵥ p₁ = ⅟2 • (p₂ -ᵥ p₁)

theorem midpoint_vsub_right E0 #

∀ {R : Type u_1} {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (p₁ p₂ : P), midpoint R p₁ p₂ -ᵥ p₂ = ⅟2 • (p₁ -ᵥ p₂)

theorem left_vsub_midpoint E0 #

∀ {R : Type u_1} {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (p₁ p₂ : P), p₁ -ᵥ midpoint R p₁ p₂ = ⅟2 • (p₁ -ᵥ p₂)

theorem right_vsub_midpoint E0 #

∀ {R : Type u_1} {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (p₁ p₂ : P), p₂ -ᵥ midpoint R p₁ p₂ = ⅟2 • (p₂ -ᵥ p₁)

theorem midpoint_vsub E1 #

∀ {R : Type u_1} {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (p₁ p₂ p : P), midpoint R p₁ p₂ -ᵥ p = ⅟2 • (p₁ -ᵥ p) + ⅟2 • (p₂ -ᵥ p)

theorem vsub_midpoint E1 #

∀ {R : Type u_1} {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (p₁ p₂ p : P), p -ᵥ midpoint R p₁ p₂ = ⅟2 • (p -ᵥ p₁) + ⅟2 • (p -ᵥ p₂)

theorem midpoint_sub_left E0 #

∀ {R : Type u_1} {V : Type u_2} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V] [inst_3 : Module R V]
  (v₁ v₂ : V), midpoint R v₁ v₂ - v₁ = ⅟2 • (v₂ - v₁)

theorem midpoint_sub_right E0 #

∀ {R : Type u_1} {V : Type u_2} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V] [inst_3 : Module R V]
  (v₁ v₂ : V), midpoint R v₁ v₂ - v₂ = ⅟2 • (v₁ - v₂)

theorem left_sub_midpoint E0 #

∀ {R : Type u_1} {V : Type u_2} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V] [inst_3 : Module R V]
  (v₁ v₂ : V), v₁ - midpoint R v₁ v₂ = ⅟2 • (v₁ - v₂)

theorem right_sub_midpoint E0 #

∀ {R : Type u_1} {V : Type u_2} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V] [inst_3 : Module R V]
  (v₁ v₂ : V), v₂ - midpoint R v₁ v₂ = ⅟2 • (v₂ - v₁)

theorem midpoint_eq_left_iff E0 #

∀ (R : Type u_1) {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] {x y : P}, midpoint R x y = x ↔ x = y

theorem left_eq_midpoint_iff E0 #

∀ (R : Type u_1) {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] {x y : P}, x = midpoint R x y ↔ x = y

theorem midpoint_eq_right_iff E0 #

∀ (R : Type u_1) {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] {x y : P}, midpoint R x y = y ↔ x = y

theorem right_eq_midpoint_iff E0 #

∀ (R : Type u_1) {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] {x y : P}, y = midpoint R x y ↔ x = y

theorem midpoint_eq_midpoint_iff_vsub_eq_vsub E1 #

∀ (R : Type u_1) {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] {x x' y y' : P}, midpoint R x y = midpoint R x' y' ↔ x -ᵥ x' = y' -ᵥ y

theorem midpoint_eq_iff' E1 #

∀ (R : Type u_1) {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] {x y z : P}, midpoint R x y = z ↔ (Equiv.pointReflection z) x = y

theorem midpoint_unique E3 #

∀ (R : Type u_1) {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (R' : Type u_6) [inst_5 : Ring R'] [inst_6 : Invertible 2]
  [inst_7 : Module R' V] (x y : P), midpoint R x y = midpoint R' x y

midpoint does not depend on the ring R.

theorem midpoint_self E0 #

∀ (R : Type u_1) {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (x : P), midpoint R x x = x

theorem midpoint_add_self E0 #

∀ (R : Type u_1) {V : Type u_2} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V] [inst_3 : Module R V]
  (x y : V), midpoint R x y + midpoint R x y = x + y

theorem midpoint_zero_add E1 #

∀ (R : Type u_1) {V : Type u_2} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V] [inst_3 : Module R V]
  (x y : V), midpoint R 0 (x + y) = midpoint R x y

theorem midpoint_eq_smul_add E1 #

∀ (R : Type u_1) {V : Type u_2} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V] [inst_3 : Module R V]
  (x y : V), midpoint R x y = ⅟2 • (x + y)

theorem midpoint_self_neg E0 #

∀ (R : Type u_1) {V : Type u_2} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V] [inst_3 : Module R V]
  (x : V), midpoint R x (-x) = 0

theorem midpoint_neg_self E0 #

∀ (R : Type u_1) {V : Type u_2} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V] [inst_3 : Module R V]
  (x : V), midpoint R (-x) x = 0

theorem midpoint_sub_add E0 #

∀ (R : Type u_1) {V : Type u_2} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V] [inst_3 : Module R V]
  (x y : V), midpoint R (x - y) (x + y) = x

theorem midpoint_add_sub E0 #

∀ (R : Type u_1) {V : Type u_2} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V] [inst_3 : Module R V]
  (x y : V), midpoint R (x + y) (x - y) = x

theorem midpoint_vsub_midpoint_same_left E1 #

∀ (R : Type u_1) {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (p₁ p₂ p₃ : P), midpoint R p₁ p₂ -ᵥ midpoint R p₁ p₃ = ⅟2 • (p₂ -ᵥ p₃)

theorem midpoint_vsub_midpoint_same_right E1 #

∀ (R : Type u_1) {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (p₁ p₂ p₃ : P), midpoint R p₁ p₃ -ᵥ midpoint R p₂ p₃ = ⅟2 • (p₁ -ᵥ p₂)

theorem midpoint_midpoint_midpoint_comm E1 #

∀ (R : Type u_1) {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (p₁ p₂ p₃ p₄ : P),
  midpoint R (midpoint R p₁ p₂) (midpoint R p₃ p₄) = midpoint R (midpoint R p₁ p₃) (midpoint R p₂ p₄)

theorem midpoint_midpoint_midpoint_rotate E3 #

∀ (R : Type u_1) {V : Type u_2} {P : Type u_4} [inst : Ring R] [inst_1 : Invertible 2] [inst_2 : AddCommGroup V]
  [inst_3 : Module R V] [inst_4 : AddTorsor V P] (p₁ p₂ p₃ p₄ : P),
  midpoint R (midpoint R p₁ p₂) (midpoint R p₃ p₄) = midpoint R (midpoint R p₂ p₃) (midpoint R p₄ p₁)

Varignon's theorem: the midpoints of the sides of the quadrilateral p₁ p₂ p₃ p₄ form a parallelogram. The statement says that the two diagonals of this parallelogram have the same midpoint. See https://en.wikipedia.org/wiki/Varignon%27s_theorem and https://teorth.github.io/equational_theories/implications/?934154.

def AddMonoidHom.ofMapMidpoint E3 #

(R : Type u_1) →
  (R' : Type u_2) →
    {E : Type u_3} →
      {F : Type u_4} →
        [inst : Ring R] →
          [inst_1 : Invertible 2] →
            [inst_2 : AddCommGroup E] →
              [inst_3 : Module R E] →
                [inst_4 : Ring R'] →
                  [inst_5 : Invertible 2] →
                    [inst_6 : AddCommGroup F] →
                      [inst_7 : Module R' 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 AddMonoidHom.

theorem AddMonoidHom.coe_ofMapMidpoint E0 #

∀ (R : Type u_1) (R' : Type u_2) {E : Type u_3} {F : Type u_4} [inst : Ring R] [inst_1 : Invertible 2]
  [inst_2 : AddCommGroup E] [inst_3 : Module R E] [inst_4 : Ring R'] [inst_5 : Invertible 2] [inst_6 : AddCommGroup F]
  [inst_7 : Module R' F] (f : E → F) (h0 : f 0 = 0) (hm : ∀ (x y : E), f (midpoint R x y) = midpoint R' (f x) (f y)),
  ⇑(AddMonoidHom.ofMapMidpoint R R' f h0 hm) = f