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

Commit a8797ce

Browse files
kbuzzardsgouezelmergify[bot]
authored
feat(data/set/basic): add lemmata (#2353)
* feat(data/set/basic): add lemmata * switch to term mode proof * removing dupe * make linter happy * Update src/data/set/basic.lean Co-Authored-By: sgouezel <sebastien.gouezel@univ-rennes1.fr> * change proof Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 80d3ed8 commit a8797ce

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/data/set/basic.lean

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,9 @@ by rw [←compl_empty_iff, compl_compl]
703703
lemma nonempty_compl {s : set α} : (-s : set α).nonempty ↔ s ≠ univ :=
704704
ne_empty_iff_nonempty.symm.trans $ not_congr $ compl_empty_iff
705705

706+
lemma mem_compl_singleton_iff {a x : α} : x ∈ -({a} : set α) ↔ x ≠ a :=
707+
not_iff_not_of_iff mem_singleton_iff
708+
706709
theorem union_eq_compl_compl_inter_compl (s t : set α) : s ∪ t = -(-s ∩ -t) :=
707710
by simp [compl_inter, compl_compl]
708711

@@ -735,9 +738,12 @@ forall_congr $ λ a, imp_not_comm
735738
theorem subset_compl_iff_disjoint {s t : set α} : s ⊆ -t ↔ s ∩ t = ∅ :=
736739
iff.trans (forall_congr $ λ a, and_imp.symm) subset_empty_iff
737740

741+
lemma subset_compl_singleton_iff {a : α} {s : set α} : s ⊆ -({a} : set α) ↔ a ∉ s :=
742+
by { rw subset_compl_comm, simp }
743+
738744
theorem inter_subset (a b c : set α) : a ∩ b ⊆ c ↔ a ⊆ -b ∪ c :=
739745
begin
740-
haveI := classical.prop_decidable,
746+
classical,
741747
split,
742748
{ intros h x xa, by_cases h' : x ∈ b, simp [h ⟨xa, h'⟩], simp [h'] },
743749
intros h x, rintro ⟨xa, xb⟩, cases h xa, contradiction, assumption
@@ -1290,6 +1296,10 @@ theorem forall_range_iff {p : α → Prop} : (∀ a ∈ range f, p a) ↔ (∀ i
12901296
theorem exists_range_iff {p : α → Prop} : (∃ a ∈ range f, p a) ↔ (∃ i, p (f i)) :=
12911297
⟨assume ⟨a, ⟨i, eq⟩, h⟩, ⟨i, eq.symm ▸ h⟩, assume ⟨i, h⟩, ⟨f i, mem_range_self _, h⟩⟩
12921298

1299+
lemma exists_range_iff' {p : α → Prop} :
1300+
(∃ a, a ∈ range f ∧ p a) ↔ ∃ i, p (f i) :=
1301+
by simpa only [exists_prop] using exists_range_iff
1302+
12931303
theorem range_iff_surjective : range f = univ ↔ surjective f :=
12941304
eq_univ_iff_forall
12951305

@@ -1648,6 +1658,8 @@ end
16481658

16491659
end prod
16501660

1661+
/-! ### Lemmas about set-indexed products of sets -/
1662+
16511663
section pi
16521664
variables {α : Type*} {π : α → Type*}
16531665

@@ -1678,6 +1690,8 @@ end
16781690

16791691
end pi
16801692

1693+
/-! ### Lemmas about `inclusion`, the injection of subtypes induced by `⊆` -/
1694+
16811695
section inclusion
16821696
variable {α : Type*}
16831697

0 commit comments

Comments
 (0)