Pointwise operations of finsets #
This file defines pointwise algebraic operations on finsets.
Main declarations #
For finsets s and t:
s +ᵥ t(Finset.vadd): Scalar addition, finset of allx +ᵥ ywherex ∈ sandy ∈ t.s • t(Finset.smul): Scalar multiplication, finset of allx • ywherex ∈ sandy ∈ t.s -ᵥ t(Finset.vsub): Scalar subtraction, finset of allx -ᵥ ywherex ∈ sandy ∈ t.a • s(Finset.smulFinset): Scaling, finset of alla • xwherex ∈ s.a +ᵥ s(Finset.vaddFinset): Translation, finset of alla +ᵥ xwherex ∈ s.
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 scope 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 scope 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
Scalar addition/multiplication of finsets #
The pointwise product of two finsets s and t: s • t = {x • y | x ∈ s, y ∈ t}.
Equations
- Finset.smul = { smul := Finset.image₂ fun (x1 : α) (x2 : β) => x1 • x2 }
Instances For
The pointwise sum of two finsets s and t: s +ᵥ t = {x +ᵥ y | x ∈ s, y ∈ t}.
Equations
- Finset.vadd = { vadd := Finset.image₂ fun (x1 : α) (x2 : β) => x1 +ᵥ x2 }
Instances For
If a finset u is contained in the scalar 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 scalar sum of two sets s +ᵥ t, we can find two
finsets s', t' such that s' ⊆ s, t' ⊆ t and u ⊆ s' +ᵥ t'.
Translation/scaling of finsets #
The scaling of a finset s by a scalar a: a • s = {a • x | x ∈ s}.
Equations
- Finset.smulFinset = { smul := fun (a : α) => Finset.image fun (x : β) => a • x }
Instances For
The translation of a finset s by a vector a: a +ᵥ s = {a +ᵥ x | x ∈ s}.
Equations
- Finset.vaddFinset = { vadd := fun (a : α) => Finset.image fun (x : β) => a +ᵥ x }
Instances For
Instances #
Scalar subtraction of finsets #
The pointwise subtraction of two finsets s and t: s -ᵥ t = {x -ᵥ y | x ∈ s, y ∈ t}.
Equations
- Finset.vsub = { vsub := Finset.image₂ fun (x1 x2 : β) => x1 -ᵥ x2 }
Instances For
If a finset u is contained in the pointwise subtraction of two sets s -ᵥ t, we can find two
finsets s', t' such that s' ⊆ s, t' ⊆ t and u ⊆ s' -ᵥ t'.