Skip to content

Commit

Permalink
feat(data/finset) Another finset disjointness lemma (#2698)
Browse files Browse the repository at this point in the history
I couldn't find this anywhere, and I wanted it.

Naming question: this is "obviously" called `disjoint_filter`, except there's already a lemma with that name.

I know I've broken one of the rules of using `simp` here ("don't do it at the beginning"), but this proof is much longer than I'd have thought would be necessary so I'm rather expecting someone to hop in with a one-liner.
  • Loading branch information
Smaug123 committed May 16, 2020
1 parent 4b71428 commit c81be77
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/data/finset.lean
Expand Up @@ -2562,6 +2562,10 @@ lemma disjoint_filter {s : finset α} {p q : α → Prop} [decidable_pred p] [de
disjoint (s.filter p) (s.filter q) ↔ (∀ x ∈ s, p x → ¬ q x) :=
by split; simp [disjoint_left] {contextual := tt}

lemma disjoint_filter_filter {s t : finset α} {p q : α → Prop} [decidable_pred p] [decidable_pred q] :
(disjoint s t) → disjoint (s.filter p) (t.filter q) :=
disjoint.mono (filter_subset _) (filter_subset _)

lemma pi_disjoint_of_disjoint {δ : α → Type*} [∀a, decidable_eq (δ a)]
{s : finset α} [decidable_eq (Πa∈s, δ a)]
(t₁ t₂ : Πa, finset (δ a)) {a : α} (ha : a ∈ s) (h : disjoint (t₁ a) (t₂ a)) :
Expand Down

0 comments on commit c81be77

Please sign in to comment.