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

Commit

Permalink
feat(data/set/basic): add mem_ite_empty_left/right (#17264)
Browse files Browse the repository at this point in the history
  • Loading branch information
RemyDegenne committed Nov 7, 2022
1 parent 89fd6af commit cbdbfd7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/data/set/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,22 @@ by split_ifs; simp [h]
x ∈ ite p set.univ t ↔ (¬ p → x ∈ t) :=
mem_dite_univ_left p (λ _, t) x

lemma mem_dite_empty_right (p : Prop) [decidable p] (t : p → set α) (x : α) :
(x ∈ if h : p then t h else ∅) ↔ (∃ h : p, x ∈ t h) :=
by split_ifs; simp [h]

@[simp] lemma mem_ite_empty_right (p : Prop) [decidable p] (t : set α) (x : α) :
x ∈ ite p t ∅ ↔ p ∧ x ∈ t :=
by split_ifs; simp [h]

lemma mem_dite_empty_left (p : Prop) [decidable p] (t : ¬ p → set α) (x : α) :
(x ∈ if h : p thenelse t h) ↔ (∃ h : ¬ p, x ∈ t h) :=
by split_ifs; simp [h]

@[simp] lemma mem_ite_empty_left (p : Prop) [decidable p] (t : set α) (x : α) :
x ∈ ite p ∅ t ↔ ¬ p ∧ x ∈ t :=
by split_ifs; simp [h]

/-! ### If-then-else for sets -/

/-- `ite` for sets: `set.ite t s s' ∩ t = s ∩ t`, `set.ite t s s' ∩ tᶜ = s' ∩ tᶜ`.
Expand Down

0 comments on commit cbdbfd7

Please sign in to comment.