2023-04-11 12:46:59 +00:00
|
|
|
|
import Mathlib.Data.Real.Basic
|
|
|
|
|
|
2023-05-04 22:37:54 +00:00
|
|
|
|
/-! # Bookshelf.Real.Set.Basic
|
|
|
|
|
|
|
|
|
|
A collection of useful definitions and theorems regarding sets.
|
|
|
|
|
-/
|
|
|
|
|
|
2023-04-11 12:46:59 +00:00
|
|
|
|
namespace Real
|
|
|
|
|
|
|
|
|
|
/--
|
|
|
|
|
The Minkowski sum of two sets `s` and `t` is the set
|
|
|
|
|
`s + t = { a + b : a ∈ s, b ∈ t }`.
|
|
|
|
|
-/
|
|
|
|
|
def minkowski_sum (s t : Set ℝ) :=
|
|
|
|
|
{ x | ∃ a ∈ s, ∃ b ∈ t, x = a + b }
|
|
|
|
|
|
2023-04-13 19:58:38 +00:00
|
|
|
|
/--
|
2023-05-04 22:37:54 +00:00
|
|
|
|
The sum of two sets is nonempty **iff** the summands are nonempty.
|
2023-04-13 19:58:38 +00:00
|
|
|
|
-/
|
|
|
|
|
def nonempty_minkowski_sum_iff_nonempty_add_nonempty {s t : Set ℝ}
|
|
|
|
|
: (minkowski_sum s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty := by
|
|
|
|
|
apply Iff.intro
|
|
|
|
|
· intro h
|
|
|
|
|
have ⟨x, hx⟩ := h
|
|
|
|
|
have ⟨a, ⟨ha, ⟨b, ⟨hb, _⟩⟩⟩⟩ := hx
|
|
|
|
|
apply And.intro
|
|
|
|
|
· exact ⟨a, ha⟩
|
|
|
|
|
· exact ⟨b, hb⟩
|
|
|
|
|
· intro ⟨⟨a, ha⟩, ⟨b, hb⟩⟩
|
|
|
|
|
exact ⟨a + b, ⟨a, ⟨ha, ⟨b, ⟨hb, rfl⟩⟩⟩⟩⟩
|
|
|
|
|
|
2023-04-11 12:46:59 +00:00
|
|
|
|
end Real
|