Module docstring
{"# Pointwise operations of sets
This file defines pointwise algebraic operations on sets.
Main declarations
For sets s and t and scalar a:
* s * t: Multiplication, set of all x * y where x ∈ s and y ∈ t.
* s + t: Addition, set of all x + y where x ∈ s and y ∈ t.
* s⁻¹: Inversion, set of all x⁻¹ where x ∈ s.
* -s: Negation, set of all -x where x ∈ s.
* s / t: Division, set of all x / y where x ∈ s and y ∈ t.
* s - t: Subtraction, set of all x - y where x ∈ s and y ∈ t.
For α a semigroup/monoid, Set α is a semigroup/monoid.
As an unfortunate side effect, this means that n • s, where n : ℕ, is ambiguous between
pointwise scaling and repeated pointwise addition; the former has (2 : ℕ) • {1, 2} = {2, 4}, while
the latter has (2 : ℕ) • {1, 2} = {2, 3, 4}. See note [pointwise nat action].
Appropriate definitions and results are also transported to the additive theory via to_additive.
Implementation notes
- The following expressions are considered in simp-normal form in a group:
(fun h ↦ h * g) ⁻¹' s,(fun h ↦ g * h) ⁻¹' s,(fun h ↦ h * g⁻¹) ⁻¹' s,(fun h ↦ g⁻¹ * h) ⁻¹' s,s * t,s⁻¹,(1 : Set _)(and similarly for additive variants). Expressions equal to one of these will be simplified. - We put all instances in the locale
Pointwise, so that these instances are not available by default. Note that we do not mark them as reducible (as argued by note [reducible non-instances]) since we expect the locale to be open whenever the instances are actually used (and making the instances reducible changes the behavior ofsimp.
Tags
set multiplication, set addition, pointwise addition, pointwise multiplication,
pointwise subtraction
","### 0/1 as sets ","### Set negation/inversion ","### Set addition/multiplication ","### Set subtraction/division ","Note that Set is not a Group because s / s ≠ 1 in general. "}