Eine aufbereitete Darstellung der Quelle

 
     
 
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung


Quelle  Join.lean   Sprache: Lean

 

/-
Copyright (c) 2022 Yaël Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yaël Dillies
-/

module

public import Mathlib.Analysis.Convex.Hull

set_option doc.verso true
set_option doc.verso.suggestions false

/-!
# Convex join

This file defines the convex join of two sets. The convex join of `s` and `t` is the union of the
segments with one end in `s` and the other in `t`. This is notably a useful gadget to deal with
convex hulls of finite sets.
-/


@[expose] public section


open Set

variable {ι : Sort*} {�� E : Type*}

section OrderedSemiring

variable (��) [Semiring ��] [PartialOrder ��] [AddCommMonoid E] [Module �� E]
  {s t s₁ s₂ t₁ t₂ u : Set E}
  {x y : E}

/-- The join of two sets is the union of the segments joining them. This can be interpreted as the
topological join, but within the original space. -/

def convexJoin (s t : Set E) : Set E :=
  ⋃ (x ∈ s) (y ∈ t), segment �� x y

variable {��}

theorem mem_convexJoin : x ∈ convexJoin �� s t ↔ ∃ a ∈ s, ∃ b ∈ t, x ∈ segment �� a b := by
  simp [convexJoin]

theorem convexJoin_comm (s t : Set E) : convexJoin �� s t = convexJoin �� t s :=
  (iUnion₂_comm _).trans <| by simp_rw [convexJoin, segment_symm]

theorem convexJoin_mono (hs : s₁ ⊆ s₂) (ht : t₁ ⊆ t₂) : convexJoin �� s₁ t₁ ⊆ convexJoin �� s₂ t₂ :=
  biUnion_mono hs fun _ _ => biUnion_subset_biUnion_left ht

theorem convexJoin_mono_left (hs : s₁ ⊆ s₂) : convexJoin �� s₁ t ⊆ convexJoin �� s₂ t :=
  convexJoin_mono hs Subset.rfl

theorem convexJoin_mono_right (ht : t₁ ⊆ t₂) : convexJoin �� s t₁ ⊆ convexJoin �� s t₂ :=
  convexJoin_mono Subset.rfl ht

@[simp]
theorem convexJoin_empty_left (t : Set E) : convexJoin �� ∅ t = ∅ := by simp [convexJoin]

@[simp]
theorem convexJoin_empty_right (s : Set E) : convexJoin �� s ∅ = ∅ := by simp [convexJoin]

@[simp]
theorem convexJoin_singleton_left (t : Set E) (x : E) :
    convexJoin �� {x} t = ⋃ y ∈ t, segment �� x y := by simp [convexJoin]

@[simp]
theorem convexJoin_singleton_right (s : Set E) (y : E) :
    convexJoin �� s {y} = ⋃ x ∈ s, segment �� x y := by simp [convexJoin]

theorem convexJoin_singletons (x : E) : convexJoin �� {x} {y} = segment �� x y := by simp

@[simp]
theorem convexJoin_union_left (s₁ s₂ t : Set E) :
    convexJoin �� (s₁ ∪ s₂) t = convexJoin �� s₁ t ∪ convexJoin �� s₂ t := by
  simp_rw [convexJoin, mem_union, iUnion_or, iUnion_union_distrib]

@[simp]
theorem convexJoin_union_right (s t₁ t₂ : Set E) :
    convexJoin �� s (t₁ ∪ t₂) = convexJoin �� s t₁ ∪ convexJoin �� s t₂ := by
  simp_rw [convexJoin_comm s, convexJoin_union_left]

@[simp]
theorem convexJoin_iUnion_left (s : ι → Set E) (t : Set E) :
    convexJoin �� (⋃ i, s i) t = ⋃ i, convexJoin �� (s i) t := by
  simp_rw [convexJoin, mem_iUnion, iUnion_exists]
  exact iUnion_comm _

@[simp]
theorem convexJoin_iUnion_right (s : Set E) (t : ι → Set E) :
    convexJoin �� s (⋃ i, t i) = ⋃ i, convexJoin �� s (t i) := by
  simp_rw [convexJoin_comm s, convexJoin_iUnion_left]

theorem segment_subset_convexJoin (hx : x ∈ s) (hy : y ∈ t) : segment �� x y ⊆ convexJoin �� s t :=
  subset_iUnion₂_of_subset x hx <| subset_iUnion₂ (s := fun y _ ↦ segment �� x y) y hy

section
variable [IsOrderedRing ��]

theorem subset_convexJoin_left (h : t.Nonempty) : s ⊆ convexJoin �� s t := fun _x hx =>
  let ⟨_y, hy⟩ := h
  segment_subset_convexJoin hx hy <| left_mem_segment _ _ _

theorem subset_convexJoin_right (h : s.Nonempty) : t ⊆ convexJoin �� s t :=
  convexJoin_comm (�� := ��) t s ▸ subset_convexJoin_left h

end

theorem convexJoin_subset (hs : s ⊆ u) (ht : t ⊆ u) (hu : Convex �� u) : convexJoin �� s t ⊆ u :=
  iUnion₂_subset fun _x hx => iUnion₂_subset fun _y hy => hu.segment_subset (hs hx) (ht hy)

theorem convexJoin_subset_convexHull (s t : Set E) : convexJoin �� s t ⊆ convexHull �� (s ∪ t) :=
  convexJoin_subset (subset_union_left.trans <| subset_convexHull _ _)
      (subset_union_right.trans <| subset_convexHull _ _) <|
    convex_convexHull _ _

end OrderedSemiring

section LinearOrderedField

variable [Field ��] [LinearOrder ��] [IsStrictOrderedRing ��]
  [AddCommGroup E] [Module �� E] {s t : Set E} {x : E}

theorem convexJoin_assoc_aux (s t u : Set E) :
    convexJoin �� (convexJoin �� s t) u ⊆ convexJoin �� s (convexJoin �� t u) := by
  simp_rw [subset_def, mem_convexJoin]
  rintro _ ⟨z, ⟨x, hx, y, hy, a₁, b₁, ha₁, hb₁, hab₁, rfl⟩, z, hz, a₂, b₂, ha₂, hb₂, hab₂, rfl⟩
  obtain rfl | hb₂ := hb₂.eq_or_lt
  · refine ⟨x, hx, y, ⟨y, hy, z, hz, left_mem_segment �� _ _⟩, a₁, b₁, ha₁, hb₁, hab₁, ?_⟩
    linear_combination (norm := module) -hab₂ • (a₁ • x + b₁ • y)
  refine
    ⟨x, hx, (a₂ * b₁ / (a₂ * b₁ + b₂)) • y + (b₂ / (a₂ * b₁ + b₂)) • z,
      ⟨y, hy, z, hz, _, _, by positivity, by positivity, by field, rfl⟩,
      a₂ * a₁, a₂ * b₁ + b₂, by positivity, by positivity, ?_, ?_⟩
  · linear_combination a₂ * hab₁ + hab₂
  · match_scalars <;> field

theorem convexJoin_assoc (s t u : Set E) :
    convexJoin �� (convexJoin �� s t) u = convexJoin �� s (convexJoin �� t u) := by
  refine (convexJoin_assoc_aux _ _ _).antisymm ?_
  simp_rw [convexJoin_comm s, convexJoin_comm _ u]
  exact convexJoin_assoc_aux _ _ _

theorem convexJoin_left_comm (s t u : Set E) :
    convexJoin �� s (convexJoin �� t u) = convexJoin �� t (convexJoin �� s u) := by
  simp_rw [← convexJoin_assoc, convexJoin_comm]

theorem convexJoin_right_comm (s t u : Set E) :
    convexJoin �� (convexJoin �� s t) u = convexJoin �� (convexJoin �� s u) t := by
  simp_rw [convexJoin_assoc, convexJoin_comm]

theorem convexJoin_convexJoin_convexJoin_comm (s t u v : Set E) :
    convexJoin �� (convexJoin �� s t) (convexJoin �� u v) =
      convexJoin �� (convexJoin �� s u) (convexJoin �� t v) := by
  simp_rw [← convexJoin_assoc, convexJoin_right_comm]

protected theorem Convex.convexJoin (hs : Convex �� s) (ht : Convex �� t) :
    Convex �� (convexJoin �� s t) := by
  simp only [Convex, StarConvex, convexJoin, mem_iUnion]
  rintro _ ⟨x₁, hx₁, y₁, hy₁, a₁, b₁, ha₁, hb₁, hab₁, rfl⟩
    _ ⟨x₂, hx₂, y₂, hy₂, a₂, b₂, ha₂, hb₂, hab₂, rfl⟩ p q hp hq hpq
  rcases hs.exists_mem_add_smul_eq hx₁ hx₂ (mul_nonneg hp ha₁) (mul_nonneg hq ha₂) with ⟨x, hxs, hx⟩
  rcases ht.exists_mem_add_smul_eq hy₁ hy₂ (mul_nonneg hp hb₁) (mul_nonneg hq hb₂) with ⟨y, hyt, hy⟩
  refine ⟨_, hxs, _, hyt, p * a₁ + q * a₂, p * b₁ + q * b₂, ?_, ?_, ?_, ?_⟩ <;> try positivity
  · linear_combination p * hab₁ + q * hab₂ + hpq
  · rw [hx, hy]
    module

protected theorem Convex.convexHull_union (hs : Convex �� s) (ht : Convex �� t) (hs₀ : s.Nonempty)
    (ht₀ : t.Nonempty) : convexHull �� (s ∪ t) = convexJoin �� s t :=
  (convexHull_min (union_subset (subset_convexJoin_left ht₀) <| subset_convexJoin_right hs₀) <|
        hs.convexJoin ht).antisymm <|
    convexJoin_subset_convexHull _ _

theorem convexHull_union (hs : s.Nonempty) (ht : t.Nonempty) :
    convexHull �� (s ∪ t) = convexJoin �� (convexHull �� s) (convexHull �� t) := by
  rw [← convexHull_convexHull_union_left, ← convexHull_convexHull_union_right]
  exact (convex_convexHull �� s).convexHull_union (convex_convexHull �� t) hs.convexHull ht.convexHull

theorem convexHull_insert (hs : s.Nonempty) :
    convexHull �� (insert x s) = convexJoin �� {x} (convexHull �� s) := by
  rw [insert_eq, convexHull_union (singleton_nonempty _) hs, convexHull_singleton]

theorem convexJoin_segments (a b c d : E) :
    convexJoin �� (segment �� a b) (segment �� c d) = convexHull �� {a, b, c, d} := by
  simp_rw [← convexHull_pair, convexHull_insert (insert_nonempty _ _),
    convexHull_insert (singleton_nonempty _), convexJoin_assoc,
    convexHull_singleton]

theorem convexJoin_segment_singleton (a b c : E) :
    convexJoin �� (segment �� a b) {c} = convexHull �� {a, b, c} := by
  rw [← pair_eq_singleton, ← convexJoin_segments, segment_same, pair_eq_singleton]

theorem convexJoin_singleton_segment (a b c : E) :
    convexJoin �� {a} (segment �� b c) = convexHull �� {a, b, c} := by
  rw [← segment_same ��, convexJoin_segments, insert_idem]

end LinearOrderedField

Messung
CHZG
9210010097

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*Bot Zugriff







                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

Open Source Software


Gedichte
Musik
Bilder

Jenseits des Üblichen

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1,188,113
#Domains=863,322