File: Mathlib/Data/Set/Countable.lean

full_name: Set.Countable
code: /-- A set `s` is countable if the corresponding subtype is countable,
i.e., there exists an injective map `f : s → ℕ`.

Note that this is an abbreviation, so `hs : Set.Countable s` in the proof context
is the same as an instance `Countable s`.
For a constructive version, see `Encodable`.
-/
protected def Countable (s : Set α) : Prop 
goal: Prop

full_name: Set.countable_coe_iff
code: @[simp]
theorem countable_coe_iff {s : Set α} : Countable s ↔ s.Countable 
goal: Countable ↑s ↔ s.Countable

full_name: Set.to_countable
code: /-- Prove `Set.Countable` from a `Countable` instance on the subtype. -/
theorem to_countable (s : Set α) [Countable s] : s.Countable 
goal: s.Countable

full_name: Set.countable_iff_exists_injective
code: protected theorem countable_iff_exists_injective {s : Set α} :
    s.Countable ↔ ∃ f : s → ℕ, Injective f 
goal: s.Countable ↔ ∃ f, Function.Injective f

full_name: Set.countable_iff_exists_injOn
code: /-- A set `s : Set α` is countable if and only if there exists a function `α → ℕ` injective
on `s`. -/
theorem countable_iff_exists_injOn {s : Set α} : s.Countable ↔ ∃ f : α → ℕ, InjOn f s 
goal: s.Countable ↔ ∃ f, Set.InjOn f s

full_name: Set.countable_iff_nonempty_encodable
code: theorem countable_iff_nonempty_encodable {s : Set α} : s.Countable ↔ Nonempty (Encodable s) 
goal: s.Countable ↔ Nonempty (Encodable ↑s)

full_name: Set.Countable.toEncodable
code: /-- Convert `Set.Countable s` to `Encodable s` (noncomputable). -/
protected def Countable.toEncodable {s : Set α} (hs : s.Countable) : Encodable s 
goal: Encodable ↑s

full_name: Set.enumerateCountable
code: /-- Noncomputably enumerate elements in a set. The `default` value is used to extend the domain to
all of `ℕ`. -/
def enumerateCountable {s : Set α} (h : s.Countable) (default : α) : ℕ → α 
goal: ℕ → α

full_name: Set.subset_range_enumerate
code: theorem subset_range_enumerate {s : Set α} (h : s.Countable) (default : α) :
    s ⊆ range (enumerateCountable h default) 
goal: s ⊆ Set.range (Set.enumerateCountable h default)

full_name: Set.range_enumerateCountable_subset
code: lemma range_enumerateCountable_subset {s : Set α} (h : s.Countable) (default : α) :
    range (enumerateCountable h default) ⊆ insert default s 
goal: Set.range (Set.enumerateCountable h default) ⊆ insert default s

full_name: Set.range_enumerateCountable_of_mem
code: lemma range_enumerateCountable_of_mem {s : Set α} (h : s.Countable) {default : α}
    (h_mem : default ∈ s) :
    range (enumerateCountable h default) = s 
goal: Set.range (Set.enumerateCountable h default) = s

full_name: Set.enumerateCountable_mem
code: lemma enumerateCountable_mem {s : Set α} (h : s.Countable) {default : α} (h_mem : default ∈ s)
    (n : ℕ) :
    enumerateCountable h default n ∈ s 
goal: Set.enumerateCountable h default n ∈ s

full_name: Set.Countable.mono
code: theorem Countable.mono {s₁ s₂ : Set α} (h : s₁ ⊆ s₂) (hs : s₂.Countable) : s₁.Countable 
goal: s₁.Countable

full_name: Set.countable_range
code: theorem countable_range [Countable ι] (f : ι → β) : (range f).Countable 
goal: (Set.range f).Countable

full_name: Set.countable_iff_exists_subset_range
code: theorem countable_iff_exists_subset_range [Nonempty α] {s : Set α} :
    s.Countable ↔ ∃ f : ℕ → α, s ⊆ range f 
goal: s.Countable ↔ ∃ f, s ⊆ Set.range f

full_name: Set.countable_iff_exists_surjective
code: /-- A non-empty set is countable iff there exists a surjection from the
natural numbers onto the subtype induced by the set.
-/
protected theorem countable_iff_exists_surjective {s : Set α} (hs : s.Nonempty) :
    s.Countable ↔ ∃ f : ℕ → s, Surjective f 
goal: s.Countable ↔ ∃ f, Function.Surjective f

full_name: Set.countable_univ
code: theorem countable_univ [Countable α] : (univ : Set α).Countable 
goal: Set.univ.Countable

full_name: Set.countable_univ_iff
code: theorem countable_univ_iff : (univ : Set α).Countable ↔ Countable α 
goal: Set.univ.Countable ↔ Countable α

full_name: Set.Countable.exists_eq_range
code: /-- If `s : Set α` is a nonempty countable set, then there exists a map
`f : ℕ → α` such that `s = range f`. -/
theorem Countable.exists_eq_range {s : Set α} (hc : s.Countable) (hs : s.Nonempty) :
    ∃ f : ℕ → α, s = range f 
goal: ∃ f, s = Set.range f

full_name: Set.countable_empty
code: @[simp] theorem countable_empty : (∅ : Set α).Countable 
goal: ∅.Countable

full_name: Set.countable_singleton
code: @[simp] theorem countable_singleton (a : α) : ({a} : Set α).Countable 
goal: {a}.Countable

full_name: Set.Countable.image
code: theorem Countable.image {s : Set α} (hs : s.Countable) (f : α → β) : (f '' s).Countable 
goal: (f '' s).Countable

full_name: Set.MapsTo.countable_of_injOn
code: theorem MapsTo.countable_of_injOn {s : Set α} {t : Set β} {f : α → β} (hf : MapsTo f s t)
    (hf' : InjOn f s) (ht : t.Countable) : s.Countable 
goal: s.Countable

full_name: Set.Countable.preimage_of_injOn
code: theorem Countable.preimage_of_injOn {s : Set β} (hs : s.Countable) {f : α → β}
    (hf : InjOn f (f ⁻¹' s)) : (f ⁻¹' s).Countable 
goal: (f ⁻¹' s).Countable

full_name: Set.Countable.preimage
code: protected theorem Countable.preimage {s : Set β} (hs : s.Countable) {f : α → β} (hf : Injective f) :
    (f ⁻¹' s).Countable 
goal: (f ⁻¹' s).Countable

full_name: Set.exists_seq_iSup_eq_top_iff_countable
code: theorem exists_seq_iSup_eq_top_iff_countable [CompleteLattice α] {p : α → Prop} (h : ∃ x, p x) :
    (∃ s : ℕ → α, (∀ n, p (s n)) ∧ ⨆ n, s n = ⊤) ↔
      ∃ S : Set α, S.Countable ∧ (∀ s ∈ S, p s) ∧ sSup S = ⊤ 
goal: (∃ s, (∀ (n : ℕ), p (s n)) ∧ ⨆ n, s n = ⊤) ↔ ∃ S, S.Countable ∧ (∀ s ∈ S, p s) ∧ sSup S = ⊤

full_name: Set.exists_seq_cover_iff_countable
code: theorem exists_seq_cover_iff_countable {p : Set α → Prop} (h : ∃ s, p s) :
    (∃ s : ℕ → Set α, (∀ n, p (s n)) ∧ ⋃ n, s n = univ) ↔
      ∃ S : Set (Set α), S.Countable ∧ (∀ s ∈ S, p s) ∧ ⋃₀ S = univ 
goal: (∃ s, (∀ (n : ℕ), p (s n)) ∧ ⋃ n, s n = Set.univ) ↔ ∃ S, S.Countable ∧ (∀ s ∈ S, p s) ∧ ⋃₀ S = Set.univ

full_name: Set.countable_of_injective_of_countable_image
code: theorem countable_of_injective_of_countable_image {s : Set α} {f : α → β} (hf : InjOn f s)
    (hs : (f '' s).Countable) : s.Countable 
goal: s.Countable

full_name: Set.countable_iUnion
code: theorem countable_iUnion {t : ι → Set α} [Countable ι] (ht : ∀ i, (t i).Countable) :
    (⋃ i, t i).Countable 
goal: (⋃ i, t i).Countable

full_name: Set.countable_iUnion_iff
code: @[simp]
theorem countable_iUnion_iff [Countable ι] {t : ι → Set α} :
    (⋃ i, t i).Countable ↔ ∀ i, (t i).Countable 
goal: (⋃ i, t i).Countable ↔ ∀ (i : ι), (t i).Countable

full_name: Set.Countable.biUnion_iff
code: theorem Countable.biUnion_iff {s : Set α} {t : ∀ a ∈ s, Set β} (hs : s.Countable) :
    (⋃ a ∈ s, t a ‹_›).Countable ↔ ∀ a (ha : a ∈ s), (t a ha).Countable 
goal: (⋃ a, ⋃ (h : a ∈ s), t a h).Countable ↔ ∀ (a : α) (ha : a ∈ s), (t a ha).Countable

full_name: Set.Countable.sUnion_iff
code: theorem Countable.sUnion_iff {s : Set (Set α)} (hs : s.Countable) :
    (⋃₀ s).Countable ↔ ∀ a ∈ s, a.Countable 
goal: (⋃₀ s).Countable ↔ ∀ a ∈ s, a.Countable

full_name: Set.countable_union
code: @[simp]
theorem countable_union {s t : Set α} : (s ∪ t).Countable ↔ s.Countable ∧ t.Countable 
goal: (s ∪ t).Countable ↔ s.Countable ∧ t.Countable

full_name: Set.Countable.union
code: theorem Countable.union {s t : Set α} (hs : s.Countable) (ht : t.Countable) : (s ∪ t).Countable 
goal: (s ∪ t).Countable

full_name: Set.Countable.of_diff
code: theorem Countable.of_diff {s t : Set α} (h : (s \ t).Countable) (ht : t.Countable) : s.Countable 
goal: s.Countable

full_name: Set.countable_insert
code: @[simp]
theorem countable_insert {s : Set α} {a : α} : (insert a s).Countable ↔ s.Countable 
goal: (insert a s).Countable ↔ s.Countable

full_name: Set.Countable.insert
code: protected theorem Countable.insert {s : Set α} (a : α) (h : s.Countable) : (insert a s).Countable 
goal: (insert a s).Countable

full_name: Set.Finite.countable
code: theorem Finite.countable {s : Set α} (hs : s.Finite) : s.Countable 
goal: s.Countable

full_name: Set.Countable.of_subsingleton
code: @[nontriviality]
theorem Countable.of_subsingleton [Subsingleton α] (s : Set α) : s.Countable 
goal: s.Countable

full_name: Set.Subsingleton.countable
code: theorem Subsingleton.countable {s : Set α} (hs : s.Subsingleton) : s.Countable 
goal: s.Countable

full_name: Set.countable_isTop
code: theorem countable_isTop (α : Type*) [PartialOrder α] : { x : α | IsTop x }.Countable 
goal: {x | IsTop x}.Countable

full_name: Set.countable_isBot
code: theorem countable_isBot (α : Type*) [PartialOrder α] : { x : α | IsBot x }.Countable 
goal: {x | IsBot x}.Countable

full_name: Set.countable_setOf_finite_subset
code: /-- The set of finite subsets of a countable set is countable. -/
theorem countable_setOf_finite_subset {s : Set α} (hs : s.Countable) :
    { t | Set.Finite t ∧ t ⊆ s }.Countable 
goal: {t | t.Finite ∧ t ⊆ s}.Countable

full_name: Set.countable_univ_pi
code: theorem countable_univ_pi {π : α → Type*} [Finite α] {s : ∀ a, Set (π a)}
    (hs : ∀ a, (s a).Countable) : (pi univ s).Countable 
goal: (Set.univ.pi s).Countable

full_name: Set.countable_pi
code: theorem countable_pi {π : α → Type*} [Finite α] {s : ∀ a, Set (π a)} (hs : ∀ a, (s a).Countable) :
    { f : ∀ a, π a | ∀ a, f a ∈ s a }.Countable 
goal: {f | ∀ (a : α), f a ∈ s a}.Countable

full_name: Set.Countable.prod
code: protected theorem Countable.prod {s : Set α} {t : Set β} (hs : s.Countable) (ht : t.Countable) :
    Set.Countable (s ×ˢ t) 
goal: (s ×ˢ t).Countable

full_name: Set.Countable.image2
code: theorem Countable.image2 {s : Set α} {t : Set β} (hs : s.Countable) (ht : t.Countable)
    (f : α → β → γ) : (image2 f s t).Countable 
goal: (Set.image2 f s t).Countable

full_name: Set.countable_setOf_nonempty_of_disjoint
code: /-- If a family of disjoint sets is included in a countable set, then only countably many of
them are nonempty. -/
theorem countable_setOf_nonempty_of_disjoint {f : β → Set α}
    (hf : Pairwise (Disjoint on f)) {s : Set α} (h'f : ∀ t, f t ⊆ s) (hs : s.Countable) :
    Set.Countable {t | (f t).Nonempty} 
goal: {t | (f t).Nonempty}.Countable

full_name: Finset.countable_toSet
code: theorem Finset.countable_toSet (s : Finset α) : Set.Countable (↑s : Set α) 
goal: (↑s).Countable