Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 538f015

Browse files
committed
feat(data/finset/basic): empty_product and product_empty (#7886)
add `product_empty_<left/right>`
1 parent 97a7a24 commit 538f015

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/data/finset/basic.lean

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2580,7 +2580,7 @@ theorem subset_product [decidable_eq α] [decidable_eq β] {s : finset (α × β
25802580
λ p hp, mem_product.2 ⟨mem_image_of_mem _ hp, mem_image_of_mem _ hp⟩
25812581

25822582
theorem product_eq_bUnion [decidable_eq α] [decidable_eq β] (s : finset α) (t : finset β) :
2583-
s.product t = s.bUnion (λa, t.image $ λb, (a, b)) :=
2583+
s.product t = s.bUnion (λa, t.image $ λb, (a, b)) :=
25842584
ext $ λ ⟨x, y⟩, by simp only [mem_product, mem_bUnion, mem_image, exists_prop, prod.mk.inj_iff,
25852585
and.left_comm, exists_and_distrib_left, exists_eq_right, exists_eq_left]
25862586

@@ -2603,6 +2603,14 @@ begin
26032603
{ rw disjoint_iff, change _ ∩ _ = ∅, ext ⟨a, b⟩, rw mem_inter, finish, },
26042604
end
26052605

2606+
lemma empty_product (t : finset β) :
2607+
(∅ : finset α).product t = ∅ :=
2608+
rfl
2609+
2610+
lemma product_empty (s : finset α) :
2611+
s.product (∅ : finset β) = ∅ :=
2612+
eq_empty_of_forall_not_mem (λ x h, (finset.mem_product.1 h).2)
2613+
26062614
end prod
26072615

26082616
/-! ### sigma -/

0 commit comments

Comments
 (0)