Skip to content

Commit 31eeede

Browse files
committed
move more stuff back
1 parent 7a276bf commit 31eeede

2 files changed

Lines changed: 30 additions & 29 deletions

File tree

Mathlib/Data/Set/Basic.lean

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -199,34 +199,7 @@ theorem setOf_injective : Function.Injective (@setOf α) := injective_id
199199

200200
theorem setOf_inj {p q : α → Prop} : { x | p x } = { x | q x } ↔ p = q := Iff.rfl
201201

202-
/-! ### Lemmas about `mem` and `setOf` -/
203-
204-
theorem mem_setOf {a : α} {p : α → Prop} : a ∈ { x | p x } ↔ p a :=
205-
Iff.rfl
206-
207-
/-- This lemma is intended for use with `rw` where a membership predicate is needed,
208-
hence the explicit argument and the equality in the reverse direction from normal.
209-
See also `Set.mem_setOf_eq` for the reverse direction applied to an argument. -/
210-
theorem eq_mem_setOf (p : α → Prop) : p = (· ∈ {a | p a}) := rfl
211-
212-
/-- If `h : a ∈ {x | p x}` then `h.out : p x`. These are definitionally equal, but this can
213-
nevertheless be useful for various reasons, e.g. to apply further projection notation or in an
214-
argument to `simp`. -/
215-
theorem _root_.Membership.mem.out {p : α → Prop} {a : α} (h : a ∈ { x | p x }) : p a :=
216-
h
217-
218-
theorem setOf_bijective : Bijective (setOf : (α → Prop) → Set α) :=
219-
bijective_id
220-
221-
@[simp]
222-
theorem setOf_subset_setOf {p q : α → Prop} : { a | p a } ⊆ { a | q a } ↔ ∀ a, p a → q a :=
223-
Iff.rfl
224-
225-
theorem setOf_and {p q : α → Prop} : { a | p a ∧ q a } = { a | p a } ∩ { a | q a } :=
226-
rfl
227-
228-
theorem setOf_or {p q : α → Prop} : { a | p a ∨ q a } = { a | p a } ∪ { a | q a } :=
229-
rfl
202+
theorem setOf_bijective : Bijective (setOf : (α → Prop) → Set α) := bijective_id
230203

231204
/-! ### Subset and strict subset relations -/
232205

Mathlib/Data/Set/Operations.lean

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,24 @@ namespace Set
7575

7676
variable {α : Type u} {β : Type v} {γ : Type w}
7777

78+
/-! ### Lemmas about `mem` and `setOf` -/
79+
80+
theorem mem_setOf {a : α} {p : α → Prop} : a ∈ { x | p x } ↔ p a :=
81+
Iff.rfl
82+
83+
/-- This lemma is intended for use with `rw` where a membership predicate is needed,
84+
hence the explicit argument and the equality in the reverse direction from normal.
85+
See also `Set.mem_setOf_eq` for the reverse direction applied to an argument. -/
86+
theorem eq_mem_setOf (p : α → Prop) : p = (· ∈ {a | p a}) := rfl
87+
88+
/-- If `h : a ∈ {x | p x}` then `h.out : p x`. These are definitionally equal, but this can
89+
nevertheless be useful for various reasons, e.g. to apply further projection notation or in an
90+
argument to `simp`. -/
91+
theorem _root_.Membership.mem.out {p : α → Prop} {a : α} (h : a ∈ { x | p x }) : p a :=
92+
h
93+
7894
-- TODO(Jeremy): write a tactic to unfold specific instances of generic notation?
79-
theorem subset_def {s t : Set α}: (s ⊆ t) = ∀ x, x ∈ s → x ∈ t := rfl
95+
theorem subset_def {s t : Set α} : (s ⊆ t) = ∀ x, x ∈ s → x ∈ t := rfl
8096

8197
@[simp, mfld_simps] theorem mem_univ (x : α) : x ∈ @univ α := trivial
8298

@@ -106,6 +122,18 @@ theorem subset_setOf {p : α → Prop} {s : Set α} : s ⊆ setOf p ↔ ∀ x, x
106122
theorem setOf_subset {p : α → Prop} {s : Set α} : setOf p ⊆ s ↔ ∀ x, p x → x ∈ s :=
107123
Iff.rfl
108124

125+
@[simp]
126+
theorem setOf_subset_setOf {p q : α → Prop} : { a | p a } ⊆ { a | q a } ↔ ∀ a, p a → q a :=
127+
Iff.rfl
128+
129+
theorem setOf_and {p q : α → Prop} : { a | p a ∧ q a } = { a | p a } ∩ { a | q a } :=
130+
rfl
131+
132+
theorem setOf_or {p q : α → Prop} : { a | p a ∨ q a } = { a | p a } ∪ { a | q a } :=
133+
rfl
134+
135+
/-! ### Operations -/
136+
109137
instance : HasCompl (Set α) := ⟨fun s ↦ {x | x ∉ s}⟩
110138

111139
@[simp] theorem mem_compl_iff (s : Set α) (x : α) : x ∈ sᶜ ↔ x ∉ s := Iff.rfl

0 commit comments

Comments
 (0)