@@ -289,6 +289,8 @@ protected def nonempty (s : set α) : Prop := ∃ x, x ∈ s
289
289
290
290
@[simp] lemma nonempty_coe_sort {s : set α} : nonempty ↥s ↔ s.nonempty := nonempty_subtype
291
291
292
+ alias nonempty_coe_sort ↔ _ nonempty.coe_sort
293
+
292
294
lemma nonempty_def : s.nonempty ↔ ∃ x, x ∈ s := iff.rfl
293
295
294
296
lemma nonempty_of_mem {x} (h : x ∈ s) : s.nonempty := ⟨x, h⟩
@@ -433,6 +435,9 @@ univ_subset_iff.symm.trans $ forall_congr $ λ x, imp_iff_right trivial
433
435
434
436
theorem eq_univ_of_forall {s : set α} : (∀ x, x ∈ s) → s = univ := eq_univ_iff_forall.2
435
437
438
+ lemma nonempty.eq_univ [subsingleton α] : s.nonempty → s = univ :=
439
+ by { rintro ⟨x, hx⟩, refine eq_univ_of_forall (λ y, by rwa subsingleton.elim y x) }
440
+
436
441
lemma eq_univ_of_subset {s t : set α} (h : s ⊆ t) (hs : s = univ) : t = univ :=
437
442
eq_univ_of_univ_subset $ hs ▸ h
438
443
@@ -1930,17 +1935,19 @@ lemma nontrivial_of_nontrivial (hs : s.nontrivial) : nontrivial α :=
1930
1935
let ⟨x, _, y, _, hxy⟩ := hs in ⟨⟨x, y, hxy⟩⟩
1931
1936
1932
1937
/-- `s`, coerced to a type, is a nontrivial type if and only if `s` is a nontrivial set. -/
1933
- @[simp, norm_cast] lemma nontrivial_coe ( s : set α) : nontrivial s ↔ s.nontrivial :=
1938
+ @[simp, norm_cast] lemma nontrivial_coe_sort { s : set α} : nontrivial s ↔ s.nontrivial :=
1934
1939
by simp_rw [← nontrivial_univ_iff, set.nontrivial, mem_univ,
1935
1940
exists_true_left, set_coe.exists, subtype.mk_eq_mk]
1936
1941
1942
+ alias nontrivial_coe_sort ↔ _ nontrivial.coe_sort
1943
+
1937
1944
/-- A type with a set `s` whose `coe_sort` is a nontrivial type is nontrivial.
1938
1945
For the corresponding result for `subtype`, see `subtype.nontrivial_iff_exists_ne`. -/
1939
1946
lemma nontrivial_of_nontrivial_coe (hs : nontrivial s) : nontrivial α :=
1940
- by { rw [s.nontrivial_coe] at hs, exact nontrivial_of_nontrivial hs }
1947
+ nontrivial_of_nontrivial $ nontrivial_coe_sort. 1 hs
1941
1948
1942
1949
theorem nontrivial_mono {α : Type *} {s t : set α} (hst : s ⊆ t) (hs : nontrivial s) :
1943
- nontrivial t := (nontrivial_coe _). 2 $ (s.nontrivial_coe .1 hs).mono hst
1950
+ nontrivial t := nontrivial.coe_sort $ (nontrivial_coe_sort .1 hs).mono hst
1944
1951
1945
1952
/-- The preimage of a nontrivial set under a surjective map is nontrivial. -/
1946
1953
theorem nontrivial.preimage {s : set β} (hs : s.nontrivial) {f : α → β}
0 commit comments