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 allx * ywherex ∈ sandy ∈ t.s + t: Addition, set of allx + ywherex ∈ sandy ∈ t.s⁻¹: Inversion, set of allx⁻¹wherex ∈ s.-s: Negation, set of all-xwherex ∈ s.s / t: Division, set of allx / ywherex ∈ sandy ∈ t.s - t: Subtraction, set of allx - ywherex ∈ sandy ∈ 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 #
The pointwise negation of set -s is defined as {x | -x ∈ s} in locale Pointwise.
It is equal to {-x | x ∈ s}, see Set.image_neg.
Equations
- Set.neg = { neg := Set.preimage Neg.neg }
Instances For
The pointwise inversion of set s⁻¹ is defined as {x | x⁻¹ ∈ s} in locale Pointwise. It is
equal to {x⁻¹ | x ∈ s}, see Set.image_inv.
Equations
- Set.inv = { inv := Set.preimage Inv.inv }
Instances For
Equations
- Set.involutiveNeg = InvolutiveNeg.mk ⋯
Equations
- Set.involutiveInv = InvolutiveInv.mk ⋯
Set addition/multiplication #
Set subtraction/division #
Repeated pointwise multiplication/division (not the same as pointwise repeated
multiplication/division!) of a Set. See note [pointwise nat action].
Instances For
Set α is an AddSemigroup under pointwise operations if α is.
Equations
- Set.addSemigroup = let __src := Set.add; AddSemigroup.mk ⋯
Instances For
Set α is a Semigroup under pointwise operations if α is.
Equations
- Set.semigroup = let __src := Set.mul; Semigroup.mk ⋯
Instances For
Set α is an AddCommSemigroup under pointwise operations if α is.
Equations
- Set.addCommSemigroup = let __src := Set.addSemigroup; AddCommSemigroup.mk ⋯
Instances For
Set α is a CommSemigroup under pointwise operations if α is.
Equations
- Set.commSemigroup = let __src := Set.semigroup; CommSemigroup.mk ⋯
Instances For
Set α is an AddZeroClass under pointwise operations if α is.
Equations
- Set.addZeroClass = let __src := Set.zero; let __src_1 := Set.add; AddZeroClass.mk ⋯ ⋯
Instances For
Set α is a MulOneClass under pointwise operations if α is.
Equations
- Set.mulOneClass = let __src := Set.one; let __src_1 := Set.mul; MulOneClass.mk ⋯ ⋯
Instances For
The singleton operation as an AddMonoidHom.
Equations
- Set.singletonAddMonoidHom = let __src := Set.singletonAddHom; let __src_1 := Set.singletonZeroHom; { toFun := __src.toFun, map_zero' := ⋯, map_add' := ⋯ }
Instances For
Set α is an AddMonoid under pointwise operations if α is.
Equations
- Set.addMonoid = let __src := Set.addSemigroup; let __src_1 := Set.addZeroClass; let __src_2 := Set.NSMul; AddMonoid.mk ⋯ ⋯ nsmulRec ⋯ ⋯
Instances For
Set α is an AddCommMonoid under pointwise operations if α is.
Equations
- Set.addCommMonoid = let __src := Set.addMonoid; let __src_1 := Set.addCommSemigroup; AddCommMonoid.mk ⋯
Instances For
Set α is a CommMonoid under pointwise operations if α is.
Equations
- Set.commMonoid = let __src := Set.monoid; let __src_1 := Set.commSemigroup; CommMonoid.mk ⋯
Instances For
Set α is a subtraction monoid under pointwise operations if α is.
Equations
- Set.subtractionMonoid = let __src := Set.addMonoid; let __src_1 := Set.involutiveNeg; let __src_2 := Set.sub; let __src_3 := Set.ZSMul; SubtractionMonoid.mk ⋯ ⋯ ⋯
Instances For
Set α is a division monoid under pointwise operations if α is.
Equations
- Set.divisionMonoid = let __src := Set.monoid; let __src_1 := Set.involutiveInv; let __src_2 := Set.div; let __src_3 := Set.ZPow; DivisionMonoid.mk ⋯ ⋯ ⋯
Instances For
Set α is a commutative subtraction monoid under pointwise operations if α is.
Equations
- Set.subtractionCommMonoid = let __src := Set.subtractionMonoid; let __src_1 := Set.addCommSemigroup; SubtractionCommMonoid.mk ⋯
Instances For
Set α is a commutative division monoid under pointwise operations if α is.
Equations
- Set.divisionCommMonoid = let __src := Set.divisionMonoid; let __src_1 := Set.commSemigroup; DivisionCommMonoid.mk ⋯
Instances For
Set α has distributive negation if α has.
Equations
- Set.hasDistribNeg = let __src := Set.involutiveNeg; HasDistribNeg.mk ⋯ ⋯
Instances For
Note that Set is not a MulZeroClass because 0 * ∅ ≠ 0.
Alias of the reverse direction of Set.not_one_mem_div_iff.