Skip to content

Commit

Permalink
feat(data/set/pairwise): Taking the bUnion is injective (#17052)
Browse files Browse the repository at this point in the history
... in the set bounding the union, when all sets in the family are pairwise disjoint and nonempty.
  • Loading branch information
YaelDillies committed Oct 25, 2022
1 parent 12a7da1 commit 23ffd4a
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/data/set/pairwise.lean
Expand Up @@ -37,6 +37,8 @@ def pairwise (r : α → α → Prop) := ∀ i j, i ≠ j → r i j
lemma pairwise.mono (hr : pairwise r) (h : ∀ ⦃i j⦄, r i j → p i j) : pairwise p :=
λ i j hij, h $ hr i j hij

protected lemma pairwise.eq (h : pairwise r) : ¬ r a b → a = b := not_imp_comm.1 $ h _ _

lemma pairwise_on_bool (hr : symmetric r) {a b : α} : pairwise (r on (λ c, cond c a b)) ↔ r a b :=
by simpa [pairwise, function.on_fun] using @hr a b

Expand Down Expand Up @@ -421,3 +423,30 @@ end set

lemma pairwise_disjoint_fiber (f : ι → α) : pairwise (disjoint on (λ a : α, f ⁻¹' {a})) :=
set.pairwise_univ.1 $ set.pairwise_disjoint_fiber f univ


section
variables {f : ι → set α} {s t : set ι}

lemma set.pairwise_disjoint.subset_of_bUnion_subset_bUnion (h₀ : (s ∪ t).pairwise_disjoint f)
(h₁ : ∀ i ∈ s, (f i).nonempty) (h : (⋃ i ∈ s, f i) ⊆ ⋃ i ∈ t, f i) :
s ⊆ t :=
begin
rintro i hi,
obtain ⟨a, hai⟩ := h₁ i hi,
obtain ⟨j, hj, haj⟩ := mem_Union₂.1 (h $ mem_Union₂_of_mem hi hai),
rwa h₀.eq (subset_union_left _ _ hi) (subset_union_right _ _ hj)
(not_disjoint_iff.2 ⟨a, hai, haj⟩),
end

lemma pairwise.subset_of_bUnion_subset_bUnion (h₀ : pairwise (disjoint on f))
(h₁ : ∀ i ∈ s, (f i).nonempty) (h : (⋃ i ∈ s, f i) ⊆ ⋃ i ∈ t, f i) :
s ⊆ t :=
set.pairwise_disjoint.subset_of_bUnion_subset_bUnion (h₀.set_pairwise _) h₁ h

lemma pairwise.bUnion_injective (h₀ : pairwise (disjoint on f)) (h₁ : ∀ i, (f i).nonempty) :
injective (λ s : set ι, ⋃ i ∈ s, f i) :=
λ s t h, (h₀.subset_of_bUnion_subset_bUnion (λ _ _, h₁ _) $ h.subset).antisymm $
h₀.subset_of_bUnion_subset_bUnion (λ _ _, h₁ _) $ h.superset

end

0 comments on commit 23ffd4a

Please sign in to comment.