N-ary images of finsets #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines finset.image₂, the binary image of finsets. This is the finset version of
set.image2. This is mostly useful to define pointwise operations.
Notes #
This file is very similar to data.set.n_ary, order.filter.n_ary and data.option.n_ary. Please
keep them in sync.
We do not define finset.image₃ as its only purpose would be to prove properties of finset.image₂
and set.image2 already fulfills this task.
The image of a binary function f : α → β → γ as a function finset α → finset β → finset γ.
Mathematically this should be thought of as the image of the corresponding function α × β → γ.
Equations
- finset.image₂ f s t = finset.image (function.uncurry f) (s ×ˢ t)
A common special case of image₂_congr
Algebraic replacement rules #
A collection of lemmas to transfer associativity, commutativity, distributivity, ... of operations
to the associativity, commutativity, distributivity, ... of finset.image₂ of those operations.
The proof pattern is image₂_lemma operation_lemma. For example, image₂_comm mul_comm proves that
image₂ (*) f g = image₂ (*) g f in a comm_semigroup.
Symmetric statement to finset.image₂_image_left_comm.
Symmetric statement to finset.image_image₂_right_comm.
Symmetric statement to finset.image_image₂_distrib_left.
Symmetric statement to finset.image_image₂_distrib_right.
The other direction does not hold because of the s-s cross terms on the RHS.
The other direction does not hold because of the u-u cross terms on the RHS.
Symmetric statement to finset.image₂_image_left_anticomm.
Symmetric statement to finset.image_image₂_right_anticomm.
Symmetric statement to finset.image_image₂_antidistrib_left.
Symmetric statement to finset.image_image₂_antidistrib_right.
If a is a left identity for f : α → β → β, then {a} is a left identity for
finset.image₂ f.
If b is a right identity for f : α → β → α, then {b} is a right identity for
finset.image₂ f.
If each partial application of f is injective, and images of s under those partial
applications are disjoint (but not necessarily distinct!), then the size of t divides the size of
finset.image₂ f s t.
If each partial application of f is injective, and images of t under those partial
applications are disjoint (but not necessarily distinct!), then the size of s divides the size of
finset.image₂ f s t.