Pointwise operations of finsets #
This file defines pointwise algebraic operations on finsets.
Main declarations #
For finsets s
and t
:
0
(Finset.zero
): The singleton{0}
.1
(Finset.one
): The singleton{1}
.-s
(Finset.neg
): Negation, finset of all-x
wherex ∈ s
.s⁻¹
(Finset.inv
): Inversion, finset of allx⁻¹
wherex ∈ s
.s + t
(Finset.add
): Addition, finset of allx + y
wherex ∈ s
andy ∈ t
.s * t
(Finset.mul
): Multiplication, finset of allx * y
wherex ∈ s
andy ∈ t
.s - t
(Finset.sub
): Subtraction, finset of allx - y
wherex ∈ s
andy ∈ t
.s / t
(Finset.div
): Division, finset of allx / y
wherex ∈ s
andy ∈ t
.
For α
a semigroup/monoid, Finset α
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].
Implementation notes #
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 of simp
.
Tags #
finset multiplication, finset addition, pointwise addition, pointwise multiplication, pointwise subtraction
0
/1
as finsets #
The singleton operation as a OneHom
.
Equations
- Finset.singletonOneHom = { toFun := singleton, map_one' := ⋯ }
Instances For
The singleton operation as a ZeroHom
.
Equations
- Finset.singletonZeroHom = { toFun := singleton, map_zero' := ⋯ }
Instances For
Lift a OneHom
to Finset
via image
.
Equations
- Finset.imageOneHom f = { toFun := Finset.image ⇑f, map_one' := ⋯ }
Instances For
Lift a ZeroHom
to Finset
via image
Equations
- Finset.imageZeroHom f = { toFun := Finset.image ⇑f, map_zero' := ⋯ }
Instances For
Finset negation/inversion #
The pointwise inversion of finset s⁻¹
is defined as {x⁻¹ | x ∈ s}
in locale Pointwise
.
Equations
- Finset.inv = { inv := Finset.image Inv.inv }
Instances For
The pointwise negation of finset -s
is defined as {-x | x ∈ s}
in locale Pointwise
.
Equations
- Finset.neg = { neg := Finset.image Neg.neg }
Instances For
Alias of the forward direction of Finset.inv_nonempty_iff
.
Alias of the reverse direction of Finset.inv_nonempty_iff
.
Finset addition/multiplication #
The pointwise multiplication of finsets s * t
and t
is defined as {x * y | x ∈ s, y ∈ t}
in locale Pointwise
.
Equations
- Finset.mul = { mul := Finset.image₂ fun (x1 x2 : α) => x1 * x2 }
Instances For
The pointwise addition of finsets s + t
is defined as {x + y | x ∈ s, y ∈ t}
in
locale Pointwise
.
Equations
- Finset.add = { add := Finset.image₂ fun (x1 x2 : α) => x1 + x2 }
Instances For
If a finset u
is contained in the product of two sets s * t
, we can find two finsets s'
,
t'
such that s' ⊆ s
, t' ⊆ t
and u ⊆ s' * t'
.
If a finset u
is contained in the sum of two sets s + t
, we can find two finsets
s'
, t'
such that s' ⊆ s
, t' ⊆ t
and u ⊆ s' + t'
.
The singleton operation as a MulHom
.
Equations
- Finset.singletonMulHom = { toFun := singleton, map_mul' := ⋯ }
Instances For
The singleton operation as an AddHom
.
Equations
- Finset.singletonAddHom = { toFun := singleton, map_add' := ⋯ }
Instances For
Lift a MulHom
to Finset
via image
.
Equations
- Finset.imageMulHom f = { toFun := Finset.image ⇑f, map_mul' := ⋯ }
Instances For
Lift an AddHom
to Finset
via image
Equations
- Finset.imageAddHom f = { toFun := Finset.image ⇑f, map_add' := ⋯ }
Instances For
Finset subtraction/division #
The pointwise division of finsets s / t
is defined as {x / y | x ∈ s, y ∈ t}
in locale
Pointwise
.
Equations
- Finset.div = { div := Finset.image₂ fun (x1 x2 : α) => x1 / x2 }
Instances For
The pointwise subtraction of finsets s - t
is defined as {x - y | x ∈ s, y ∈ t}
in locale Pointwise
.
Equations
- Finset.sub = { sub := Finset.image₂ fun (x1 x2 : α) => x1 - x2 }
Instances For
If a finset u
is contained in the product of two sets s / t
, we can find two finsets s'
,
t'
such that s' ⊆ s
, t' ⊆ t
and u ⊆ s' / t'
.
If a finset u
is contained in the sum of two sets s - t
, we can find two finsets
s'
, t'
such that s' ⊆ s
, t' ⊆ t
and u ⊆ s' - t'
.
Instances #
Repeated pointwise addition (not the same as pointwise repeated addition!) of a Finset
. See
note [pointwise nat action].
Equations
- Finset.nsmul = { smul := nsmulRec }
Instances For
Repeated pointwise addition/subtraction (not the same as pointwise repeated
addition/subtraction!) of a Finset
. See note [pointwise nat action].
Equations
- Finset.zsmul = { smul := zsmulRec }
Instances For
Repeated pointwise multiplication/division (not the same as pointwise repeated
multiplication/division!) of a Finset
. See note [pointwise nat action].
Instances For
Finset α
is a CommSemigroup
under pointwise operations if α
is.
Instances For
Finset α
is an AddCommSemigroup
under pointwise operations if α
is.
Instances For
The singleton operation as a MonoidHom
.
Equations
- Finset.singletonMonoidHom = { toFun := Finset.singletonMulHom.toFun, map_one' := ⋯, map_mul' := ⋯ }
Instances For
The singleton operation as an AddMonoidHom
.
Equations
- Finset.singletonAddMonoidHom = { toFun := Finset.singletonAddHom.toFun, map_zero' := ⋯, map_add' := ⋯ }
Instances For
The coercion from Finset
to Set
as a MonoidHom
.
Equations
- Finset.coeMonoidHom = { toFun := CoeTC.coe, map_one' := ⋯, map_mul' := ⋯ }
Instances For
The coercion from Finset
to set
as an AddMonoidHom
.
Equations
- Finset.coeAddMonoidHom = { toFun := CoeTC.coe, map_zero' := ⋯, map_add' := ⋯ }
Instances For
Lift a MonoidHom
to Finset
via image
.
Equations
- Finset.imageMonoidHom f = { toFun := (Finset.imageMulHom f).toFun, map_one' := ⋯, map_mul' := ⋯ }
Instances For
Lift an add_monoid_hom
to Finset
via image
Equations
- Finset.imageAddMonoidHom f = { toFun := (Finset.imageAddHom f).toFun, map_zero' := ⋯, map_add' := ⋯ }
Instances For
Alias of Finset.pow_subset_pow_right
.
Alias of Finset.nsmul_subset_nsmul_right
.
Alias of Finset.nsmul_empty
.
Finset α
is a division monoid under pointwise operations if α
is.
Equations
- Finset.divisionMonoid = Function.Injective.divisionMonoid Finset.toSet ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ ⋯
Instances For
Finset α
is a subtraction monoid under pointwise operations if α
is.
Equations
Instances For
Finset α
is a commutative division monoid under pointwise operations if α
is.
Equations
Instances For
Finset α
is a commutative subtraction monoid under pointwise operations if α
is.
Equations
Instances For
The size of s * s
is at least the size of s
, version with left-cancellative multiplication.
See card_le_card_mul_self'
for the version with right-cancellative multiplication.
The size of s + s
is at least the size of s
, version with left-cancellative addition.
See card_le_card_add_self'
for the version with right-cancellative addition.
The size of s * s
is at least the size of s
, version with right-cancellative multiplication.
See card_le_card_mul_self
for the version with left-cancellative multiplication.
The size of s + s
is at least the size of s
, version with right-cancellative addition.
See card_le_card_add_self
for the version with left-cancellative addition.
See Finset.card_pow_mono
for a version that works for the empty set.
See Finset.card_nsmul_mono
for a version that works for the empty set.
See Finset.Nonempty.card_pow_mono
for a version that works for zero powers.
See Finset.Nonempty.card_nsmul_mono
for a version that works for zero scalars.