Finsets in product types #
This file defines finset constructions on the product type α × β. Beware not to confuse with the
Finset.prod operation which computes the multiplicative product.
Main declarations #
Finset.product: Turnss : Finset α,t : Finset βinto their product inFinset (α × β).Finset.diag: Fors : Finset α,s.diagis theFinset (α × α)of pairs(a, a)witha ∈ s.Finset.offDiag: Fors : Finset α,s.offDiagis theFinset (α × α)of pairs(a, b)witha, b ∈ sanda ≠ b.
prod #
product s t is the set of pairs (a, b) such that a ∈ s and b ∈ t.
Instances For
@[implicit_reducible]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Finset.product_biUnion
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[DecidableEq γ]
(s : Finset α)
(t : Finset β)
(f : α × β → Finset γ)
:
See also Finset.sup_product_left.
theorem
Finset.nontrivial_prod_iff
{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}
:
(s ×ˢ t).Nontrivial ↔ s.Nonempty ∧ t.Nonempty ∧ (s.Nontrivial ∨ t.Nontrivial)
The product of two Finsets is nontrivial iff both are nonempty at least one of them is nontrivial.
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Finset.singleton_product_singleton
{α : Type u_1}
{β : Type u_2}
{a : α}
{b : β}
:
{a} ×ˢ {b} = {(a, b)}
@[simp]
@[simp]
Given a finite set s, the diagonal, s.diag is the set of pairs of the form (a, a) for
a ∈ s.
Instances For
Given a finite set s, the off-diagonal, s.offDiag is the set of pairs (a, b) with a ≠ b
for a, b ∈ s.
Instances For
@[simp]
@[simp]
theorem
Finset.mem_offDiag
{α : Type u_1}
{s : Finset α}
{x : α × α}
:
x ∈ s.offDiag ↔ x.1 ∈ s ∧ x.2 ∈ s ∧ x.1 ≠ x.2
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Finset.offDiag_filter_lt_eq_filter_le
{ι : Type u_4}
[PartialOrder ι]
[DecidableLE ι]
[DecidableLT ι]
(s : Finset ι)
: