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.Slope

27 declarations. Mathlib docs · Source

def slope E1 #

{k : Type u_1} →
  {E : Type u_2} →
    {PE : Type u_3} →
      [inst : Field k] → [inst_1 : AddCommGroup E] → [Module k E] → [AddTorsor E PE] → (k → PE) → k → k → E

slope f a b = (b - a)⁻¹ • (f b -ᵥ f a) is the slope of a function f on the interval [a, b]. Note that slope f a a = 0, not the derivative of f at a.

theorem slope_fun_def E0 #

∀ {k : Type u_1} {E : Type u_2} {PE : Type u_3} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E]
  [inst_3 : AddTorsor E PE] (f : k → PE), slope f = fun a b ↦ (b - a)⁻¹ • (f b -ᵥ f a)

theorem slope_def_field E1 #

∀ {k : Type u_1} [inst : Field k] (f : k → k) (a b : k), slope f a b = (f b - f a) / (b - a)

theorem slope_fun_def_field E1 #

∀ {k : Type u_1} [inst : Field k] (f : k → k) (a : k), slope f a = fun b ↦ (f b - f a) / (b - a)

theorem slope_same E0 #

∀ {k : Type u_1} {E : Type u_2} {PE : Type u_3} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E]
  [inst_3 : AddTorsor E PE] (f : k → PE) (a : k), slope f a a = 0

theorem slope_def_module E1 #

∀ {k : Type u_1} {E : Type u_2} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E] (f : k → E) (a b : k),
  slope f a b = (b - a)⁻¹ • (f b - f a)

theorem sub_smul_slope E0 #

∀ {k : Type u_1} {E : Type u_2} {PE : Type u_3} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E]
  [inst_3 : AddTorsor E PE] (f : k → PE) (a b : k), (b - a) • slope f a b = f b -ᵥ f a

theorem sub_smul_slope_vadd E1 #

∀ {k : Type u_1} {E : Type u_2} {PE : Type u_3} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E]
  [inst_3 : AddTorsor E PE] (f : k → PE) (a b : k), (b - a) • slope f a b +ᵥ f a = f b

theorem slope_vadd_const E0 #

∀ {k : Type u_1} {E : Type u_2} {PE : Type u_3} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E]
  [inst_3 : AddTorsor E PE] (f : k → E) (c : PE), (slope fun x ↦ f x +ᵥ c) = slope f

theorem slope_sub_smul E0 #

∀ {k : Type u_1} {E : Type u_2} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E] (f : k → E) {a b : k},
  a ≠ b → slope (fun x ↦ (x - a) • f x) a b = f b

theorem AffineMap.slope_comp E1 #

∀ {k : Type u_1} {E : Type u_2} {PE : Type u_3} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E]
  [inst_3 : AddTorsor E PE] {F : Type u_4} {PF : Type u_5} [inst_4 : AddCommGroup F] [inst_5 : Module k F]
  [inst_6 : AddTorsor F PF] (f : PE →ᵃ[k] PF) (g : k → PE) (a b : k), slope (⇑f ∘ g) a b = f.linear (slope g a b)

theorem LinearMap.slope_comp E1 #

∀ {k : Type u_1} {E : Type u_2} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E] {F : Type u_4}
  [inst_3 : AddCommGroup F] [inst_4 : Module k F] (f : E →ₗ[k] F) (g : k → E) (a b : k),
  slope (⇑f ∘ g) a b = f (slope g a b)

theorem slope_comm E1 #

∀ {k : Type u_1} {E : Type u_2} {PE : Type u_3} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E]
  [inst_3 : AddTorsor E PE] (f : k → PE) (a b : k), slope f a b = slope f b a

theorem slope_neg E0 #

∀ {k : Type u_1} {E : Type u_2} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E] (f : k → E) (x y : k),
  slope (fun t ↦ -f t) x y = -slope f x y

theorem slope_neg_fun E0 #

∀ {k : Type u_1} {E : Type u_2} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E] (f : k → E),
  slope (-f) = -slope f

theorem slope_eq_zero_iff E0 #

∀ {k : Type u_1} {E : Type u_2} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E] {f : k → E} {a b : k},
  slope f a b = 0 ↔ f a = f b

theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope E1 #

∀ {k : Type u_1} {E : Type u_2} {PE : Type u_3} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E]
  [inst_3 : AddTorsor E PE] (f : k → PE) (a b c : k),
  ((b - a) / (c - a)) • slope f a b + ((c - b) / (c - a)) • slope f b c = slope f a c

slope f a c is a linear combination of slope f a b and slope f b c. This version explicitly provides coefficients. If a ≠ c, then the sum of the coefficients is 1, so it is actually an affine combination, see lineMap_slope_slope_sub_div_sub.

theorem lineMap_slope_slope_sub_div_sub E1 #

∀ {k : Type u_1} {E : Type u_2} {PE : Type u_3} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E]
  [inst_3 : AddTorsor E PE] (f : k → PE) (a b c : k),
  a ≠ c → (AffineMap.lineMap (slope f a b) (slope f b c)) ((c - b) / (c - a)) = slope f a c

slope f a c is an affine combination of slope f a b and slope f b c. This version uses lineMap to express this property.

theorem lineMap_slope_lineMap_slope_lineMap E1 #

∀ {k : Type u_1} {E : Type u_2} {PE : Type u_3} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E]
  [inst_3 : AddTorsor E PE] (f : k → PE) (a b r : k),
  (AffineMap.lineMap (slope f ((AffineMap.lineMap a b) r) b) (slope f a ((AffineMap.lineMap a b) r))) r = slope f a b

slope f a b is an affine combination of slope f a (lineMap a b r) and slope f (lineMap a b r) b. We use lineMap to express this property.

theorem slope_nonneg_iff_of_le E1 #

∀ {k : Type u_1} {E : Type u_2} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E]
  [inst_3 : LinearOrder k] [IsStrictOrderedRing k] [inst_5 : PartialOrder E] [IsOrderedAddMonoid E] [PosSMulMono k E]
  {f : k → E} {x y : k}, x ≤ y → (0 ≤ slope f x y ↔ f x ≤ f y)

theorem MonotoneOn.slope_nonneg E1 #

∀ {k : Type u_1} {E : Type u_2} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E]
  [inst_3 : LinearOrder k] [IsStrictOrderedRing k] [inst_5 : PartialOrder E] [IsOrderedAddMonoid E] [PosSMulMono k E]
  {f : k → E} {x y : k} {s : Set k}, MonotoneOn f s → x ∈ s → y ∈ s → 0 ≤ slope f x y

theorem slope_nonpos_iff_of_le E1 #

∀ {k : Type u_1} {E : Type u_2} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E]
  [inst_3 : LinearOrder k] [IsStrictOrderedRing k] [inst_5 : PartialOrder E] [IsOrderedAddMonoid E] [PosSMulMono k E]
  {f : k → E} {x y : k}, x ≤ y → (slope f x y ≤ 0 ↔ f y ≤ f x)

theorem AntitoneOn.slope_nonpos E1 #

∀ {k : Type u_1} {E : Type u_2} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E]
  [inst_3 : LinearOrder k] [IsStrictOrderedRing k] [inst_5 : PartialOrder E] [IsOrderedAddMonoid E] [PosSMulMono k E]
  {f : k → E} {x y : k} {s : Set k}, AntitoneOn f s → x ∈ s → y ∈ s → slope f x y ≤ 0

theorem slope_pos_iff_of_le E1 #

∀ {k : Type u_1} {E : Type u_2} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E]
  [inst_3 : LinearOrder k] [IsStrictOrderedRing k] [inst_5 : PartialOrder E] [IsOrderedAddMonoid E] [PosSMulMono k E]
  {f : k → E} {x y : k}, x ≤ y → (0 < slope f x y ↔ f x < f y)

theorem StrictMonoOn.slope_pos E1 #

∀ {k : Type u_1} {E : Type u_2} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E]
  [inst_3 : LinearOrder k] [IsStrictOrderedRing k] [inst_5 : PartialOrder E] [IsOrderedAddMonoid E] [PosSMulMono k E]
  {f : k → E} {x y : k} {s : Set k}, StrictMonoOn f s → x ∈ s → y ∈ s → x ≠ y → 0 < slope f x y

theorem slope_neg_iff_of_le E1 #

∀ {k : Type u_1} {E : Type u_2} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E]
  [inst_3 : LinearOrder k] [IsStrictOrderedRing k] [inst_5 : PartialOrder E] [IsOrderedAddMonoid E] [PosSMulMono k E]
  {f : k → E} {x y : k}, x ≤ y → (slope f x y < 0 ↔ f y < f x)

theorem StrictAntiOn.slope_neg E1 #

∀ {k : Type u_1} {E : Type u_2} [inst : Field k] [inst_1 : AddCommGroup E] [inst_2 : Module k E]
  [inst_3 : LinearOrder k] [IsStrictOrderedRing k] [inst_5 : PartialOrder E] [IsOrderedAddMonoid E] [PosSMulMono k E]
  {f : k → E} {x y : k} {s : Set k}, StrictAntiOn f s → x ∈ s → y ∈ s → x ≠ y → slope f x y < 0