Skip to content

Commit

Permalink
fix(data/set/lattice): lemmas about Union/Inter over p : Prop (#…
Browse files Browse the repository at this point in the history
…8860)

With recently added `@[congr]` lemmas, it suffices to deal with unions/inters over `true` and `false`.
  • Loading branch information
urkud committed Aug 25, 2021
1 parent 4a0c3d7 commit 26a3286
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions src/data/set/lattice.lean
Expand Up @@ -139,31 +139,21 @@ supr_congr_Prop pq f
(pq : p ↔ q) (f : ∀x, f₁ (pq.mpr x) = f₂ x) : Inter f₁ = Inter f₂ :=
infi_congr_Prop pq f

lemma Union_prop (f : ι → set α) (p : ι → Prop) (i : ι) [decidable $ p i] :
(⋃ (h : p i), f i) = if p i then f i else ∅ :=
begin
ext x,
rw mem_Union,
split_ifs; tauto,
end
lemma Union_eq_if {p : Prop} [decidable p] (s : set α) :
(⋃ h : p, s) = if p then s else ∅ :=
supr_eq_if _

@[simp]
lemma Union_prop_pos {p : ι → Prop} {i : ι} (hi : p i) (f : ι → set α) :
(⋃ (h : p i), f i) = f i :=
begin
classical,
ext x,
rw [Union_prop, if_pos hi]
end
lemma Union_eq_dif {p : Prop} [decidable p] (s : p → set α) :
(⋃ (h : p), s h) = if h : p then s h else ∅ :=
supr_eq_dif _

@[simp]
lemma Union_prop_neg {p : ι → Prop} {i : ι} (hi : ¬ p i) (f : ι → set α) :
(⋃ (h : p i), f i) = ∅ :=
begin
classical,
ext x,
rw [Union_prop, if_neg hi]
end
lemma Inter_eq_if {p : Prop} [decidable p] (s : set α) :
(⋂ h : p, s) = if p then s else univ :=
infi_eq_if _

lemma Infi_eq_dif {p : Prop} [decidable p] (s : p → set α) :
(⋂ (h : p), s h) = if h : p then s h else univ :=
infi_eq_dif _

lemma exists_set_mem_of_union_eq_top {ι : Type*} (t : set ι) (s : ι → set β)
(w : (⋃ i ∈ t, s i) = ⊤) (x : β) :
Expand Down

0 comments on commit 26a3286

Please sign in to comment.