Pointwise addition, multiplication, and scalar multiplication of sets. #
This file defines pointwise algebraic operations on sets.
- For a type
α
with multiplication, multiplication is defined onset α
by takings * t
to be the set of allx * y
wherex ∈ s
andy ∈ t
. Similarly for addition. - For
α
a semigroup,set α
is a semigroup. - If
α
is a (commutative) monoid, we define an aliasset_semiring α
forset α
, which then becomes a (commutative) semiring with union as addition and pointwise multiplication as multiplication. - For a type
β
with scalar multiplication by another typeα
, this file defines a scalar multiplication ofset β
byset α
and a separate scalar multiplication ofset β
byα
. - We also define pointwise multiplication on
finset
.
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:
(λ h, h * g) ⁻¹' s
,(λ h, g * h) ⁻¹' s
,(λ h, h * g⁻¹) ⁻¹' s
,(λ 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
Properties about 1 #
The set (1 : set α)
is defined as {1}
in locale pointwise
.
Equations
- set.has_one = {one := {1}}
The set (0 : set α)
is defined as {0}
in locale pointwise
.
Equations
- set.has_zero = {zero := {0}}
Properties about multiplication #
The set (s * t : set α)
is defined as {x * y | x ∈ s, y ∈ t}
in locale pointwise
.
Equations
The set (s + t : set α)
is defined as {x + y | x ∈ s, y ∈ t}
in locale pointwise
.
Equations
set α
is an add_zero_class
under pointwise operations if α
is.
Equations
- set.add_zero_class = {zero := 0, add := has_add.add set.has_add, zero_add := _, add_zero := _}
set α
is a mul_one_class
under pointwise operations if α
is.
Equations
- set.mul_one_class = {one := 1, mul := has_mul.mul set.has_mul, one_mul := _, mul_one := _}
set α
is an add_semigroup
under pointwise operations if α
is.
Equations
- set.add_semigroup = {add := has_add.add set.has_add, add_assoc := _}
set α
is a semigroup
under pointwise operations if α
is.
Equations
- set.semigroup = {mul := has_mul.mul set.has_mul, mul_assoc := _}
set α
is a monoid
under pointwise operations if α
is.
Equations
- set.monoid = {mul := semigroup.mul set.semigroup, mul_assoc := _, one := mul_one_class.one set.mul_one_class, one_mul := _, mul_one := _, npow := npow_rec (mul_one_class.to_has_mul (set α)), npow_zero' := _, npow_succ' := _}
set α
is an add_monoid
under pointwise operations if α
is.
Equations
- set.add_monoid = {add := add_semigroup.add set.add_semigroup, add_assoc := _, zero := add_zero_class.zero set.add_zero_class, zero_add := _, add_zero := _, nsmul := nsmul_rec (add_zero_class.to_has_add (set α)), nsmul_zero' := _, nsmul_succ' := _}
set α
is a comm_monoid
under pointwise operations if α
is.
Equations
- set.comm_monoid = {mul := monoid.mul set.monoid, mul_assoc := _, one := monoid.one set.monoid, one_mul := _, mul_one := _, npow := monoid.npow set.monoid, npow_zero' := _, npow_succ' := _, mul_comm := _}
set α
is an add_comm_monoid
under pointwise operations if α
is.
Equations
- set.add_comm_monoid = {add := add_monoid.add set.add_monoid, add_assoc := _, zero := add_monoid.zero set.add_monoid, zero_add := _, add_zero := _, nsmul := add_monoid.nsmul set.add_monoid, nsmul_zero' := _, nsmul_succ' := _, add_comm := _}
Equations
- set.decidable_mem_mul = λ (_x : α), decidable_of_iff (∃ (x y : α), x ∈ s ∧ y ∈ t ∧ x * y = _x) _
Equations
- set.decidable_mem_pow n = nat.rec (set.decidable_mem_pow._proof_1.mpr (set.decidable_mem_pow._proof_2.mpr (λ (a : α), _inst_3 a 1))) (λ (n : ℕ) (ih : decidable_pred (λ (_x : α), _x ∈ s ^ n)), let _inst : decidable_pred (λ (_x : α), _x ∈ s ^ n) := ih in _.mpr (λ (a : α), set.decidable_mem_mul a)) n
singleton
is a monoid hom.
Equations
- set.singleton_hom = {to_fun := singleton set.has_singleton, map_one' := _, map_mul' := _}
addition preserves finiteness
Equations
- s.fintype_add t = set.fintype_image2 (λ (a b : α), a + b) s t
multiplication preserves finiteness
Equations
- s.fintype_mul t = set.fintype_image2 (λ (a b : α), a * b) s t
The n-ary version of set.mem_add
.
The n-ary version of set.mem_mul
.
A version of set.mem_finset_prod
with a simpler RHS for products over a fintype.
A version of set.mem_finset_sum
with a simpler RHS for sums over a fintype.
The n-ary version of set.mul_mem_mul
.
The n-ary version of set.add_mem_add
.
The n-ary version of set.mul_subset_mul
.
The n-ary version of set.add_subset_add
.
TODO: define decidable_mem_finset_prod
and decidable_mem_finset_sum
.
Properties about inversion #
The set (-s : set α)
is defined as {x | -x ∈ s}
in locale pointwise
.
It is equal to {-x | x ∈ s}
, see set.image_neg
.
Equations
The set (s⁻¹ : set α)
is defined as {x | x⁻¹ ∈ s}
in locale pointwise
.
It is equal to {x⁻¹ | x ∈ s}
, see set.image_inv
.
Equations
Properties about scalar multiplication #
The translation of a set (x +ᵥ s : set β)
by a scalar x ∶ α
is
defined as {x +ᵥ y | y ∈ s}
in locale pointwise
.
Equations
- set.has_vadd_set = {vadd := λ (a : α), set.image (has_vadd.vadd a)}
The scaling of a set (x • s : set β)
by a scalar x ∶ α
is defined as {x • y | y ∈ s}
in locale pointwise
.
Equations
- set.has_scalar_set = {smul := λ (a : α), set.image (has_scalar.smul a)}
An alias for set α
, which has a semiring structure given by ∪
as "addition" and pointwise
multiplication *
as "multiplication".
Equations
- set.set_semiring α = set α
The identitiy function set_semiring α → set α
.
Equations
- set.set_semiring.add_comm_monoid = {add := λ (s t : set.set_semiring α), s ∪ t, add_assoc := _, zero := ∅, zero_add := _, add_zero := _, nsmul := add_monoid.nsmul._default ∅ (λ (s t : set.set_semiring α), s ∪ t) set.empty_union set.union_empty, nsmul_zero' := _, nsmul_succ' := _, add_comm := _}
Equations
- set.set_semiring.non_unital_non_assoc_semiring = {add := add_comm_monoid.add set.set_semiring.add_comm_monoid, add_assoc := _, zero := add_comm_monoid.zero set.set_semiring.add_comm_monoid, zero_add := _, add_zero := _, nsmul := add_comm_monoid.nsmul set.set_semiring.add_comm_monoid, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := has_mul.mul set.has_mul, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _}
Equations
- set.set_semiring.non_assoc_semiring = {add := non_unital_non_assoc_semiring.add set.set_semiring.non_unital_non_assoc_semiring, add_assoc := _, zero := non_unital_non_assoc_semiring.zero set.set_semiring.non_unital_non_assoc_semiring, zero_add := _, add_zero := _, nsmul := non_unital_non_assoc_semiring.nsmul set.set_semiring.non_unital_non_assoc_semiring, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := non_unital_non_assoc_semiring.mul set.set_semiring.non_unital_non_assoc_semiring, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, one := mul_one_class.one set.mul_one_class, one_mul := _, mul_one := _}
Equations
- set.set_semiring.non_unital_semiring = {add := non_unital_non_assoc_semiring.add set.set_semiring.non_unital_non_assoc_semiring, add_assoc := _, zero := non_unital_non_assoc_semiring.zero set.set_semiring.non_unital_non_assoc_semiring, zero_add := _, add_zero := _, nsmul := non_unital_non_assoc_semiring.nsmul set.set_semiring.non_unital_non_assoc_semiring, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := non_unital_non_assoc_semiring.mul set.set_semiring.non_unital_non_assoc_semiring, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _}
Equations
- set.set_semiring.semiring = {add := non_assoc_semiring.add set.set_semiring.non_assoc_semiring, add_assoc := _, zero := non_assoc_semiring.zero set.set_semiring.non_assoc_semiring, zero_add := _, add_zero := _, nsmul := non_assoc_semiring.nsmul set.set_semiring.non_assoc_semiring, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := non_assoc_semiring.mul set.set_semiring.non_assoc_semiring, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := non_assoc_semiring.one set.set_semiring.non_assoc_semiring, one_mul := _, mul_one := _, npow := monoid_with_zero.npow._default non_assoc_semiring.one non_assoc_semiring.mul set.set_semiring.semiring._proof_14 set.set_semiring.semiring._proof_15, npow_zero' := _, npow_succ' := _}
Equations
- set.set_semiring.comm_semiring = {add := semiring.add set.set_semiring.semiring, add_assoc := _, zero := semiring.zero set.set_semiring.semiring, zero_add := _, add_zero := _, nsmul := semiring.nsmul set.set_semiring.semiring, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := comm_monoid.mul set.comm_monoid, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := comm_monoid.one set.comm_monoid, one_mul := _, mul_one := _, npow := comm_monoid.npow set.comm_monoid, npow_zero' := _, npow_succ' := _, mul_comm := _}
An additive action of an additive monoid on a type β gives also an additive action on the subsets of β.
Equations
- set.add_action_set = {to_has_vadd := {vadd := has_vadd.vadd set.has_vadd_set}, zero_vadd := _, add_vadd := _}
A multiplicative action of a monoid on a type β gives also a multiplicative action on the subsets of β.
Equations
- set.mul_action_set = {to_has_scalar := {smul := has_scalar.smul set.has_scalar_set}, one_smul := _, mul_smul := _}
The image of a set under function is a ring homomorphism with respect to the pointwise operations on sets.
A nonempty set is scaled by zero to the singleton set containing 0.
The finset (1 : finset α)
is defined as {1}
in locale pointwise
.
Equations
- finset.has_one = {one := {1}}
The finset (0 : finset α)
is defined as {0}
in locale pointwise
.
Equations
- finset.has_zero = {zero := {0}}
The pointwise sum of two finite sets s
and t
:
s + t = { x + y | x ∈ s, y ∈ t }
.
The pointwise product of two finite sets s
and t
:
st = s ⬝ t = s * t = { x * y | x ∈ s, y ∈ t }
.
Some lemmas about pointwise multiplication and submonoids. Ideally we put these in
group_theory.submonoid.basic
, but currently we cannot because that file is imported by this.