bookshelf/Common/Real/Set/Basic.lean

33 lines
840 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import Mathlib.Data.Real.Basic
/-! # Common.Real.Set.Basic
A collection of useful definitions and theorems regarding sets.
-/
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 }
/--
The sum of two sets is nonempty **iff** the summands are nonempty.
-/
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⟩⟩⟩⟩⟩
end Real