File: Mathlib/Analysis/Convex/Segment.lean

full_name: segment
code: /-- Segments in a vector space. -/
def segment (x y : E) : Set E 
goal: Set E

full_name: openSegment
code: /-- Open segment in a vector space. Note that `openSegment 𝕜 x x = {x}` instead of being `∅` when
the base semiring has some element between `0` and `1`. -/
def openSegment (x y : E) : Set E 
goal: Set E

full_name: Convex.«_aux_Mathlib_Analysis_Convex_Segment___macroRules_Convex_term[_-[_]_]_1»
code: @[inherit_doc] scoped[Convex] notation (priority := high) "[" x "-[" 𝕜 "]" y "]" => segment 𝕜 x y
goal: Lean.Macro

full_name: Convex._aux_Mathlib_Analysis_Convex_Segment___unexpand_segment_1
code: @[inherit_doc] scoped[Convex] notation (priority := high) "[" x "-[" 𝕜 "]" y "]" => segment 𝕜 x y
goal: Lean.PrettyPrinter.Unexpander

full_name: segment_eq_image₂
code: theorem segment_eq_image₂ (x y : E) :
    [x -[𝕜] y] =
      (fun p : 𝕜 × 𝕜 => p.1 • x + p.2 • y) '' { p | 0 ≤ p.1 ∧ 0 ≤ p.2 ∧ p.1 + p.2 = 1 } 
goal: [x-[𝕜]y] = (fun p => p.1 • x + p.2 • y) '' {p | 0 ≤ p.1 ∧ 0 ≤ p.2 ∧ p.1 + p.2 = 1}

full_name: openSegment_eq_image₂
code: theorem openSegment_eq_image₂ (x y : E) :
    openSegment 𝕜 x y =
      (fun p : 𝕜 × 𝕜 => p.1 • x + p.2 • y) '' { p | 0 < p.1 ∧ 0 < p.2 ∧ p.1 + p.2 = 1 } 
goal: openSegment 𝕜 x y = (fun p => p.1 • x + p.2 • y) '' {p | 0 < p.1 ∧ 0 < p.2 ∧ p.1 + p.2 = 1}

full_name: segment_symm
code: theorem segment_symm (x y : E) : [x -[𝕜] y] = [y -[𝕜] x] 
goal: [x-[𝕜]y] = [y-[𝕜]x]

full_name: openSegment_symm
code: theorem openSegment_symm (x y : E) : openSegment 𝕜 x y = openSegment 𝕜 y x 
goal: openSegment 𝕜 x y = openSegment 𝕜 y x

full_name: openSegment_subset_segment
code: theorem openSegment_subset_segment (x y : E) : openSegment 𝕜 x y ⊆ [x -[𝕜] y] 
goal: openSegment 𝕜 x y ⊆ [x-[𝕜]y]

full_name: segment_subset_iff
code: theorem segment_subset_iff :
    [x -[𝕜] y] ⊆ s ↔ ∀ a b : 𝕜, 0 ≤ a → 0 ≤ b → a + b = 1 → a • x + b • y ∈ s 
goal: [x-[𝕜]y] ⊆ s ↔ ∀ (a b : 𝕜), 0 ≤ a → 0 ≤ b → a + b = 1 → a • x + b • y ∈ s

full_name: openSegment_subset_iff
code: theorem openSegment_subset_iff :
    openSegment 𝕜 x y ⊆ s ↔ ∀ a b : 𝕜, 0 < a → 0 < b → a + b = 1 → a • x + b • y ∈ s 
goal: openSegment 𝕜 x y ⊆ s ↔ ∀ (a b : 𝕜), 0 < a → 0 < b → a + b = 1 → a • x + b • y ∈ s

full_name: left_mem_segment
code: theorem left_mem_segment (x y : E) : x ∈ [x -[𝕜] y] 
goal: x ∈ [x-[𝕜]y]

full_name: right_mem_segment
code: theorem right_mem_segment (x y : E) : y ∈ [x -[𝕜] y] 
goal: y ∈ [x-[𝕜]y]

full_name: segment_same
code: @[simp]
theorem segment_same (x : E) : [x -[𝕜] x] = {x} 
goal: [x-[𝕜]x] = {x}

full_name: insert_endpoints_openSegment
code: theorem insert_endpoints_openSegment (x y : E) :
    insert x (insert y (openSegment 𝕜 x y)) = [x -[𝕜] y] 
goal: insert x (insert y (openSegment 𝕜 x y)) = [x-[𝕜]y]

full_name: mem_openSegment_of_ne_left_right
code: theorem mem_openSegment_of_ne_left_right (hx : x ≠ z) (hy : y ≠ z) (hz : z ∈ [x -[𝕜] y]) :
    z ∈ openSegment 𝕜 x y 
goal: z ∈ openSegment 𝕜 x y

full_name: openSegment_subset_iff_segment_subset
code: theorem openSegment_subset_iff_segment_subset (hx : x ∈ s) (hy : y ∈ s) :
    openSegment 𝕜 x y ⊆ s ↔ [x -[𝕜] y] ⊆ s 
goal: openSegment 𝕜 x y ⊆ s ↔ [x-[𝕜]y] ⊆ s

full_name: openSegment_same
code: @[simp]
theorem openSegment_same (x : E) : openSegment 𝕜 x x = {x} 
goal: openSegment 𝕜 x x = {x}

full_name: segment_eq_image
code: theorem segment_eq_image (x y : E) :
    [x -[𝕜] y] = (fun θ : 𝕜 => (1 - θ) • x + θ • y) '' Icc (0 : 𝕜) 1 
goal: [x-[𝕜]y] = (fun θ => (1 - θ) • x + θ • y) '' Set.Icc 0 1

full_name: openSegment_eq_image
code: theorem openSegment_eq_image (x y : E) :
    openSegment 𝕜 x y = (fun θ : 𝕜 => (1 - θ) • x + θ • y) '' Ioo (0 : 𝕜) 1 
goal: openSegment 𝕜 x y = (fun θ => (1 - θ) • x + θ • y) '' Set.Ioo 0 1

full_name: segment_eq_image'
code: theorem segment_eq_image' (x y : E) :
    [x -[𝕜] y] = (fun θ : 𝕜 => x + θ • (y - x)) '' Icc (0 : 𝕜) 1 
goal: [x-[𝕜]y] = (fun θ => x + θ • (y - x)) '' Set.Icc 0 1

full_name: openSegment_eq_image'
code: theorem openSegment_eq_image' (x y : E) :
    openSegment 𝕜 x y = (fun θ : 𝕜 => x + θ • (y - x)) '' Ioo (0 : 𝕜) 1 
goal: openSegment 𝕜 x y = (fun θ => x + θ • (y - x)) '' Set.Ioo 0 1

full_name: segment_eq_image_lineMap
code: theorem segment_eq_image_lineMap (x y : E) : [x -[𝕜] y] =
    AffineMap.lineMap x y '' Icc (0 : 𝕜) 1 
goal: [x-[𝕜]y] = ⇑(AffineMap.lineMap x y) '' Set.Icc 0 1

full_name: openSegment_eq_image_lineMap
code: theorem openSegment_eq_image_lineMap (x y : E) :
    openSegment 𝕜 x y = AffineMap.lineMap x y '' Ioo (0 : 𝕜) 1 
goal: openSegment 𝕜 x y = ⇑(AffineMap.lineMap x y) '' Set.Ioo 0 1

full_name: image_segment
code: @[simp]
theorem image_segment (f : E →ᵃ[𝕜] F) (a b : E) : f '' [a -[𝕜] b] = [f a -[𝕜] f b] 
goal: ⇑f '' [a-[𝕜]b] = [f a-[𝕜]f b]

full_name: image_openSegment
code: @[simp]
theorem image_openSegment (f : E →ᵃ[𝕜] F) (a b : E) :
    f '' openSegment 𝕜 a b = openSegment 𝕜 (f a) (f b) 
goal: ⇑f '' openSegment 𝕜 a b = openSegment 𝕜 (f a) (f b)

full_name: vadd_segment
code: @[simp]
theorem vadd_segment [AddTorsor G E] [VAddCommClass G E E] (a : G) (b c : E) :
    a +ᵥ [b -[𝕜] c] = [a +ᵥ b -[𝕜] a +ᵥ c] 
goal: a +ᵥ [b-[𝕜]c] = [a +ᵥ b-[𝕜]a +ᵥ c]

full_name: vadd_openSegment
code: @[simp]
theorem vadd_openSegment [AddTorsor G E] [VAddCommClass G E E] (a : G) (b c : E) :
    a +ᵥ openSegment 𝕜 b c = openSegment 𝕜 (a +ᵥ b) (a +ᵥ c) 
goal: a +ᵥ openSegment 𝕜 b c = openSegment 𝕜 (a +ᵥ b) (a +ᵥ c)

full_name: mem_segment_translate
code: @[simp]
theorem mem_segment_translate (a : E) {x b c} : a + x ∈ [a + b -[𝕜] a + c] ↔ x ∈ [b -[𝕜] c] 
goal: a + x ∈ [a + b-[𝕜]a + c] ↔ x ∈ [b-[𝕜]c]

full_name: mem_openSegment_translate
code: @[simp]
theorem mem_openSegment_translate (a : E) {x b c : E} :
    a + x ∈ openSegment 𝕜 (a + b) (a + c) ↔ x ∈ openSegment 𝕜 b c 
goal: a + x ∈ openSegment 𝕜 (a + b) (a + c) ↔ x ∈ openSegment 𝕜 b c

full_name: segment_translate_preimage
code: theorem segment_translate_preimage (a b c : E) :
    (fun x => a + x) ⁻¹' [a + b -[𝕜] a + c] = [b -[𝕜] c] 
goal: (fun x => a + x) ⁻¹' [a + b-[𝕜]a + c] = [b-[𝕜]c]

full_name: openSegment_translate_preimage
code: theorem openSegment_translate_preimage (a b c : E) :
    (fun x => a + x) ⁻¹' openSegment 𝕜 (a + b) (a + c) = openSegment 𝕜 b c 
goal: (fun x => a + x) ⁻¹' openSegment 𝕜 (a + b) (a + c) = openSegment 𝕜 b c

full_name: segment_translate_image
code: theorem segment_translate_image (a b c : E) : (fun x => a + x) '' [b -[𝕜] c] = [a + b -[𝕜] a + c] 
goal: (fun x => a + x) '' [b-[𝕜]c] = [a + b-[𝕜]a + c]

full_name: openSegment_translate_image
code: theorem openSegment_translate_image (a b c : E) :
    (fun x => a + x) '' openSegment 𝕜 b c = openSegment 𝕜 (a + b) (a + c) 
goal: (fun x => a + x) '' openSegment 𝕜 b c = openSegment 𝕜 (a + b) (a + c)

full_name: segment_inter_eq_endpoint_of_linearIndependent_sub
code: lemma segment_inter_eq_endpoint_of_linearIndependent_sub
    {c x y : E} (h : LinearIndependent 𝕜 ![x - c, y - c]) :
    [c -[𝕜] x] ∩ [c -[𝕜] y] = {c} 
goal: [c-[𝕜]x] ∩ [c-[𝕜]y] = {c}

full_name: sameRay_of_mem_segment
code: theorem sameRay_of_mem_segment [StrictOrderedCommRing 𝕜] [AddCommGroup E] [Module 𝕜 E] {x y z : E}
    (h : x ∈ [y -[𝕜] z]) : SameRay 𝕜 (x - y) (z - x) 
goal: SameRay 𝕜 (x - y) (z - x)

full_name: segment_inter_eq_endpoint_of_linearIndependent_of_ne
code: lemma segment_inter_eq_endpoint_of_linearIndependent_of_ne [OrderedCommRing 𝕜] [NoZeroDivisors 𝕜]
    [AddCommGroup E] [Module 𝕜 E]
    {x y : E} (h : LinearIndependent 𝕜 ![x, y]) {s t : 𝕜} (hs : s ≠ t) (c : E) :
    [c + x -[𝕜] c + t • y] ∩ [c + x -[𝕜] c + s • y] = {c + x} 
goal: [c + x-[𝕜]c + t • y] ∩ [c + x-[𝕜]c + s • y] = {c + x}

full_name: midpoint_mem_segment
code: theorem midpoint_mem_segment [Invertible (2 : 𝕜)] (x y : E) : midpoint 𝕜 x y ∈ [x -[𝕜] y] 
goal: midpoint 𝕜 x y ∈ [x-[𝕜]y]

full_name: mem_segment_sub_add
code: theorem mem_segment_sub_add [Invertible (2 : 𝕜)] (x y : E) : x ∈ [x - y -[𝕜] x + y] 
goal: x ∈ [x - y-[𝕜]x + y]

full_name: mem_segment_add_sub
code: theorem mem_segment_add_sub [Invertible (2 : 𝕜)] (x y : E) : x ∈ [x + y -[𝕜] x - y] 
goal: x ∈ [x + y-[𝕜]x - y]

full_name: left_mem_openSegment_iff
code: @[simp]
theorem left_mem_openSegment_iff [DenselyOrdered 𝕜] [NoZeroSMulDivisors 𝕜 E] :
    x ∈ openSegment 𝕜 x y ↔ x = y 
goal: x ∈ openSegment 𝕜 x y ↔ x = y

full_name: right_mem_openSegment_iff
code: @[simp]
theorem right_mem_openSegment_iff [DenselyOrdered 𝕜] [NoZeroSMulDivisors 𝕜 E] :
    y ∈ openSegment 𝕜 x y ↔ x = y 
goal: y ∈ openSegment 𝕜 x y ↔ x = y

full_name: mem_segment_iff_div
code: theorem mem_segment_iff_div :
    x ∈ [y -[𝕜] z] ↔
      ∃ a b : 𝕜, 0 ≤ a ∧ 0 ≤ b ∧ 0 < a + b ∧ (a / (a + b)) • y + (b / (a + b)) • z = x 
goal: x ∈ [y-[𝕜]z] ↔ ∃ a b, 0 ≤ a ∧ 0 ≤ b ∧ 0 < a + b ∧ (a / (a + b)) • y + (b / (a + b)) • z = x

full_name: mem_openSegment_iff_div
code: theorem mem_openSegment_iff_div : x ∈ openSegment 𝕜 y z ↔
    ∃ a b : 𝕜, 0 < a ∧ 0 < b ∧ (a / (a + b)) • y + (b / (a + b)) • z = x 
goal: x ∈ openSegment 𝕜 y z ↔ ∃ a b, 0 < a ∧ 0 < b ∧ (a / (a + b)) • y + (b / (a + b)) • z = x

full_name: mem_segment_iff_sameRay
code: theorem mem_segment_iff_sameRay : x ∈ [y -[𝕜] z] ↔ SameRay 𝕜 (x - y) (z - x) 
goal: x ∈ [y-[𝕜]z] ↔ SameRay 𝕜 (x - y) (z - x)

full_name: openSegment_subset_union
code: /-- If `z = lineMap x y c` is a point on the line passing through `x` and `y`, then the open
segment `openSegment 𝕜 x y` is included in the union of the open segments `openSegment 𝕜 x z`,
`openSegment 𝕜 z y`, and the point `z`. Informally, `(x, y) ⊆ {z} ∪ (x, z) ∪ (z, y)`. -/
theorem openSegment_subset_union (x y : E) {z : E} (hz : z ∈ range (lineMap x y : 𝕜 → E)) :
    openSegment 𝕜 x y ⊆ insert z (openSegment 𝕜 x z ∪ openSegment 𝕜 z y) 
goal: openSegment 𝕜 x y ⊆ insert z (openSegment 𝕜 x z ∪ openSegment 𝕜 z y)

full_name: segment_subset_Icc
code: theorem segment_subset_Icc (h : x ≤ y) : [x -[𝕜] y] ⊆ Icc x y 
goal: [x-[𝕜]y] ⊆ Set.Icc x y

full_name: openSegment_subset_Ioo
code: theorem openSegment_subset_Ioo (h : x < y) : openSegment 𝕜 x y ⊆ Ioo x y 
goal: openSegment 𝕜 x y ⊆ Set.Ioo x y

full_name: segment_subset_uIcc
code: theorem segment_subset_uIcc (x y : E) : [x -[𝕜] y] ⊆ uIcc x y 
goal: [x-[𝕜]y] ⊆ Set.uIcc x y

full_name: Convex.min_le_combo
code: theorem Convex.min_le_combo (x y : E) (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) :
    min x y ≤ a • x + b • y 
goal: min x y ≤ a • x + b • y

full_name: Convex.combo_le_max
code: theorem Convex.combo_le_max (x y : E) (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) :
    a • x + b • y ≤ max x y 
goal: a • x + b • y ≤ max x y

full_name: Icc_subset_segment
code: theorem Icc_subset_segment : Icc x y ⊆ [x -[𝕜] y] 
goal: Set.Icc x y ⊆ [x-[𝕜]y]

full_name: segment_eq_Icc
code: @[simp]
theorem segment_eq_Icc (h : x ≤ y) : [x -[𝕜] y] = Icc x y 
goal: [x-[𝕜]y] = Set.Icc x y

full_name: Ioo_subset_openSegment
code: theorem Ioo_subset_openSegment : Ioo x y ⊆ openSegment 𝕜 x y 
goal: Set.Ioo x y ⊆ openSegment 𝕜 x y

full_name: openSegment_eq_Ioo
code: @[simp]
theorem openSegment_eq_Ioo (h : x < y) : openSegment 𝕜 x y = Ioo x y 
goal: openSegment 𝕜 x y = Set.Ioo x y

full_name: segment_eq_Icc'
code: theorem segment_eq_Icc' (x y : 𝕜) : [x -[𝕜] y] = Icc (min x y) (max x y) 
goal: [x-[𝕜]y] = Set.Icc (min x y) (max x y)

full_name: openSegment_eq_Ioo'
code: theorem openSegment_eq_Ioo' (hxy : x ≠ y) : openSegment 𝕜 x y = Ioo (min x y) (max x y) 
goal: openSegment 𝕜 x y = Set.Ioo (min x y) (max x y)

full_name: segment_eq_uIcc
code: theorem segment_eq_uIcc (x y : 𝕜) : [x -[𝕜] y] = uIcc x y 
goal: [x-[𝕜]y] = Set.uIcc x y

full_name: Convex.mem_Icc
code: /-- A point is in an `Icc` iff it can be expressed as a convex combination of the endpoints. -/
theorem Convex.mem_Icc (h : x ≤ y) :
    z ∈ Icc x y ↔ ∃ a b, 0 ≤ a ∧ 0 ≤ b ∧ a + b = 1 ∧ a * x + b * y = z 
goal: z ∈ Set.Icc x y ↔ ∃ a b, 0 ≤ a ∧ 0 ≤ b ∧ a + b = 1 ∧ a * x + b * y = z

full_name: Convex.mem_Ioo
code: /-- A point is in an `Ioo` iff it can be expressed as a strict convex combination of the endpoints.
-/
theorem Convex.mem_Ioo (h : x < y) :
    z ∈ Ioo x y ↔ ∃ a b, 0 < a ∧ 0 < b ∧ a + b = 1 ∧ a * x + b * y = z 
goal: z ∈ Set.Ioo x y ↔ ∃ a b, 0 < a ∧ 0 < b ∧ a + b = 1 ∧ a * x + b * y = z

full_name: Convex.mem_Ioc
code: /-- A point is in an `Ioc` iff it can be expressed as a semistrict convex combination of the
endpoints. -/
theorem Convex.mem_Ioc (h : x < y) :
    z ∈ Ioc x y ↔ ∃ a b, 0 ≤ a ∧ 0 < b ∧ a + b = 1 ∧ a * x + b * y = z 
goal: z ∈ Set.Ioc x y ↔ ∃ a b, 0 ≤ a ∧ 0 < b ∧ a + b = 1 ∧ a * x + b * y = z

full_name: Convex.mem_Ico
code: /-- A point is in an `Ico` iff it can be expressed as a semistrict convex combination of the
endpoints. -/
theorem Convex.mem_Ico (h : x < y) :
    z ∈ Ico x y ↔ ∃ a b, 0 < a ∧ 0 ≤ b ∧ a + b = 1 ∧ a * x + b * y = z 
goal: z ∈ Set.Ico x y ↔ ∃ a b, 0 < a ∧ 0 ≤ b ∧ a + b = 1 ∧ a * x + b * y = z

full_name: Prod.segment_subset
code: theorem segment_subset (x y : E × F) : segment 𝕜 x y ⊆ segment 𝕜 x.1 y.1 ×ˢ segment 𝕜 x.2 y.2 
goal: [x-[𝕜]y] ⊆ [x.1-[𝕜]y.1] ×ˢ [x.2-[𝕜]y.2]

full_name: Prod.openSegment_subset
code: theorem openSegment_subset (x y : E × F) :
    openSegment 𝕜 x y ⊆ openSegment 𝕜 x.1 y.1 ×ˢ openSegment 𝕜 x.2 y.2 
goal: openSegment 𝕜 x y ⊆ openSegment 𝕜 x.1 y.1 ×ˢ openSegment 𝕜 x.2 y.2

full_name: Prod.image_mk_segment_left
code: theorem image_mk_segment_left (x₁ x₂ : E) (y : F) :
    (fun x => (x, y)) '' [x₁ -[𝕜] x₂] = [(x₁, y) -[𝕜] (x₂, y)] 
goal: (fun x => (x, y)) '' [x₁-[𝕜]x₂] = [(x₁, y)-[𝕜](x₂, y)]

full_name: Prod.image_mk_segment_right
code: theorem image_mk_segment_right (x : E) (y₁ y₂ : F) :
    (fun y => (x, y)) '' [y₁ -[𝕜] y₂] = [(x, y₁) -[𝕜] (x, y₂)] 
goal: (fun y => (x, y)) '' [y₁-[𝕜]y₂] = [(x, y₁)-[𝕜](x, y₂)]

full_name: Prod.image_mk_openSegment_left
code: theorem image_mk_openSegment_left (x₁ x₂ : E) (y : F) :
    (fun x => (x, y)) '' openSegment 𝕜 x₁ x₂ = openSegment 𝕜 (x₁, y) (x₂, y) 
goal: (fun x => (x, y)) '' openSegment 𝕜 x₁ x₂ = openSegment 𝕜 (x₁, y) (x₂, y)

full_name: Prod.image_mk_openSegment_right
code: @[simp]
theorem image_mk_openSegment_right (x : E) (y₁ y₂ : F) :
    (fun y => (x, y)) '' openSegment 𝕜 y₁ y₂ = openSegment 𝕜 (x, y₁) (x, y₂) 
goal: (fun y => (x, y)) '' openSegment 𝕜 y₁ y₂ = openSegment 𝕜 (x, y₁) (x, y₂)

full_name: Pi.segment_subset
code: theorem segment_subset (x y : ∀ i, π i) : segment 𝕜 x y ⊆ s.pi fun i => segment 𝕜 (x i) (y i) 
goal: [x-[𝕜]y] ⊆ s.pi fun i => [x i-[𝕜]y i]

full_name: Pi.openSegment_subset
code: theorem openSegment_subset (x y : ∀ i, π i) :
    openSegment 𝕜 x y ⊆ s.pi fun i => openSegment 𝕜 (x i) (y i) 
goal: openSegment 𝕜 x y ⊆ s.pi fun i => openSegment 𝕜 (x i) (y i)

full_name: Pi.image_update_segment
code: theorem image_update_segment (i : ι) (x₁ x₂ : π i) (y : ∀ i, π i) :
    update y i '' [x₁ -[𝕜] x₂] = [update y i x₁ -[𝕜] update y i x₂] 
goal: Function.update y i '' [x₁-[𝕜]x₂] = [Function.update y i x₁-[𝕜]Function.update y i x₂]

full_name: Pi.image_update_openSegment
code: theorem image_update_openSegment (i : ι) (x₁ x₂ : π i) (y : ∀ i, π i) :
    update y i '' openSegment 𝕜 x₁ x₂ = openSegment 𝕜 (update y i x₁) (update y i x₂) 
goal: Function.update y i '' openSegment 𝕜 x₁ x₂ = openSegment 𝕜 (Function.update y i x₁) (Function.update y i x₂)