Built with doc-gen4, running Lean4. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓to navigate, Ctrl+🖱️to focus. On Mac, use Cmdinstead of Ctrl.
/-
Copyright (c) 2022 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov

! This file was ported from Lean 3 source module data.countable.basic
! leanprover-community/mathlib commit 1f0096e6caa61e9c849ec2adbd227e960e9dff58
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathlib.Logic.Equiv.Nat
import Mathlib.Logic.Equiv.Fin
import Mathlib.Data.Countable.Defs

/-!
# Countable types

In this file we provide basic instances of the `Countable` typeclass defined elsewhere.
-/


universe u v w

open Function

instance: Countable
instance
:
Countable: Sort ?u.2 → Prop
Countable
: Type
:=
Countable.of_equiv: ∀ {β : Sort ?u.4} (α : Sort ?u.5) [inst : Countable α], α βCountable β
Countable.of_equiv
: Type
Equiv.intEquivNat:
Equiv.intEquivNat
.
symm: {α : Sort ?u.10} → {β : Sort ?u.9} → α ββ α
symm
/-! ### Definition in terms of `Function.Embedding` -/ section Embedding variable {
α: Sort u
α
:
Sort u: Type u
Sort
Sort u: Type u
u
} {
β: Sort v
β
:
Sort v: Type v
Sort
Sort v: Type v
v
} theorem
countable_iff_nonempty_embedding: Countable α Nonempty (α )
countable_iff_nonempty_embedding
:
Countable: Sort ?u.32 → Prop
Countable
α: Sort u
α
Nonempty: Sort ?u.33 → Prop
Nonempty
(
α: Sort u
α
: Type
) := ⟨fun ⟨⟨
f: α
f
,
hf: Injective f
hf
⟩⟩ => ⟨⟨
f: α
f
,
hf: Injective f
hf
⟩⟩, fun
f: α
f
⟩ => ⟨⟨
f: α
f
,
f: α
f
.
2: ∀ {α : Sort ?u.357} {β : Sort ?u.356} (self : α β), Injective self.toFun
2
⟩⟩⟩ #align countable_iff_nonempty_embedding
countable_iff_nonempty_embedding: ∀ {α : Sort u}, Countable α Nonempty (α )
countable_iff_nonempty_embedding
theorem
nonempty_embedding_nat: ∀ (α : Sort u_1) [inst : Countable α], Nonempty (α )
nonempty_embedding_nat
(
α: Sort u_1
α
) [
Countable: Sort ?u.435 → Prop
Countable
α: ?m.432
α
] :
Nonempty: Sort ?u.438 → Prop
Nonempty
(
α: ?m.432
α
: Type
) :=
countable_iff_nonempty_embedding: ∀ {α : Sort ?u.444}, Countable α Nonempty (α )
countable_iff_nonempty_embedding
.
1: ∀ {a b : Prop}, (a b) → ab
1
‹_› #align nonempty_embedding_nat
nonempty_embedding_nat: ∀ (α : Sort u_1) [inst : Countable α], Nonempty (α )
nonempty_embedding_nat
protected theorem
Function.Embedding.countable: ∀ {α : Sort u} {β : Sort v} [inst : Countable β], (α β) → Countable α
Function.Embedding.countable
[
Countable: Sort ?u.464 → Prop
Countable
β: Sort v
β
] (
f: α β
f
:
α: Sort u
α
β: Sort v
β
) :
Countable: Sort ?u.471 → Prop
Countable
α: Sort u
α
:=
f: α β
f
.
injective: ∀ {α : Sort ?u.475} {β : Sort ?u.476} (f : α β), Injective f
injective
.
countable: ∀ {α : Sort ?u.482} {β : Sort ?u.481} [inst : Countable β] {f : αβ}, Injective fCountable α
countable
#align function.embedding.countable
Function.Embedding.countable: ∀ {α : Sort u} {β : Sort v} [inst : Countable β], (α β) → Countable α
Function.Embedding.countable
end Embedding /-! ### Operations on `Type _`s -/ section type variable {
α: Type u
α
:
Type u: Type (u+1)
Type u
} {
β: Type v
β
:
Type v: Type (v+1)
Type v
} {
π: αType w
π
:
α: Type u
α
Type w: Type (w+1)
Type w
}
instance: ∀ {α : Type u} {β : Type v} [inst : Countable α] [inst : Countable β], Countable (α β)
instance
[
Countable: Sort ?u.525 → Prop
Countable
α: Type u
α
] [
Countable: Sort ?u.528 → Prop
Countable
β: Type v
β
] :
Countable: Sort ?u.531 → Prop
Countable
(
Sum: Type ?u.533 → Type ?u.532 → Type (max?u.533?u.532)
Sum
α: Type u
α
β: Type v
β
) :=

Goals accomplished! 🐙
α: Type u

β: Type v

π: αType w

inst✝¹: Countable α

inst✝: Countable β


Countable (α β)
α: Type u

β: Type v

π: αType w

inst✝¹: Countable α

inst✝: Countable β

f: α

hf: Injective f


intro
Countable (α β)
α: Type u

β: Type v

π: αType w

inst✝¹: Countable α

inst✝: Countable β


Countable (α β)
α: Type u

β: Type v

π: αType w

inst✝¹: Countable α

inst✝: Countable β

f: α

hf: Injective f

g: β

hg: Injective g


intro.intro
Countable (α β)
α: Type u

β: Type v

π: αType w

inst✝¹: Countable α

inst✝: Countable β


Countable (α β)

Goals accomplished! 🐙
instance: ∀ {α : Type u} [inst : Countable α], Countable (Option α)
instance
[
Countable: Sort ?u.759 → Prop
Countable
α: Type u
α
] :
Countable: Sort ?u.762 → Prop
Countable
(
Option: Type ?u.763 → Type ?u.763
Option
α: Type u
α
) :=
Countable.of_equiv: ∀ {β : Sort ?u.766} (α : Sort ?u.767) [inst : Countable α], α βCountable β
Countable.of_equiv
_: Sort ?u.767
_
(
Equiv.optionEquivSumPUnit: (α : Type ?u.785) → Option α α PUnit
Equiv.optionEquivSumPUnit
.{_, 0}
α: Type u
α
).
symm: {α : Sort ?u.787} → {β : Sort ?u.786} → α ββ α
symm
instance: ∀ {α : Type u} {β : Type v} [inst : Countable α] [inst : Countable β], Countable (α × β)
instance
[
Countable: Sort ?u.839 → Prop
Countable
α: Type u
α
] [
Countable: Sort ?u.842 → Prop
Countable
β: Type v
β
] :
Countable: Sort ?u.845 → Prop
Countable
(
α: Type u
α
×
β: Type v
β
) :=

Goals accomplished! 🐙
α: Type u

β: Type v

π: αType w

inst✝¹: Countable α

inst✝: Countable β


Countable (α × β)
α: Type u

β: Type v

π: αType w

inst✝¹: Countable α

inst✝: Countable β

f: α

hf: Injective f


intro
Countable (α × β)
α: Type u

β: Type v

π: αType w

inst✝¹: Countable α

inst✝: Countable β


Countable (α × β)
α: Type u

β: Type v

π: αType w

inst✝¹: Countable α

inst✝: Countable β

f: α

hf: Injective f

g: β

hg: Injective g


intro.intro
Countable (α × β)
α: Type u

β: Type v

π: αType w

inst✝¹: Countable α

inst✝: Countable β


Countable (α × β)

Goals accomplished! 🐙
instance: ∀ {α : Type u} {π : αType w} [inst : Countable α] [inst : ∀ (a : α), Countable (π a)], Countable (Sigma π)
instance
[
Countable: Sort ?u.1073 → Prop
Countable
α: Type u
α
] [∀
a: ?m.1077
a
,
Countable: Sort ?u.1080 → Prop
Countable
(
π: αType w
π
a: ?m.1077
a
)] :
Countable: Sort ?u.1084 → Prop
Countable
(
Sigma: {α : Type ?u.1086} → (αType ?u.1085) → Type (max?u.1086?u.1085)
Sigma
π: αType w
π
) :=

Goals accomplished! 🐙
α: Type u

β: Type v

π: αType w

inst✝¹: Countable α

inst✝: ∀ (a : α), Countable (π a)


α: Type u

β: Type v

π: αType w

inst✝¹: Countable α

inst✝: ∀ (a : α), Countable (π a)

f: α

hf: Injective f


intro
α: Type u

β: Type v

π: αType w

inst✝¹: Countable α

inst✝: ∀ (a : α), Countable (π a)


α: Type u

β: Type v

π: αType w

inst✝¹: Countable α

inst✝: ∀ (a : α), Countable (π a)

f: α

hf: Injective f

g: (a : α) → π a

hg: ∀ (a : α), Injective (g a)


intro
α: Type u

β: Type v

π: αType w

inst✝¹: Countable α

inst✝: ∀ (a : α), Countable (π a)



Goals accomplished! 🐙
end type section sort variable {
α: Sort u
α
:
Sort u: Type u
Sort
Sort u: Type u
u
} {
β: Sort v
β
:
Sort v: Type v
Sort
Sort v: Type v
v
} {
π: αSort w
π
:
α: Sort u
α
Sort w: Type w
Sort
Sort w: Type w
w
} /-! ### Operations on `Sort _`s -/ instance (priority := 500)
SetCoe.countable: ∀ {α : Type u_1} [inst : Countable α] (s : Set α), Countable s
SetCoe.countable
{
α: ?m.1364
α
} [
Countable: Sort ?u.1367 → Prop
Countable
α: ?m.1364
α
] (
s: Set α
s
:
Set: Type ?u.1370 → Type ?u.1370
Set
α: ?m.1364
α
) :
Countable: Sort ?u.1373 → Prop
Countable
s: Set α
s
:=
Subtype.countable: ∀ {α : Sort ?u.1528} [inst : Countable α] {p : αProp}, Countable { x // p x }
Subtype.countable
#align set_coe.countable
SetCoe.countable: ∀ {α : Type u_1} [inst : Countable α] (s : Set α), Countable s
SetCoe.countable
instance: ∀ {α : Sort u} {β : Sort v} [inst : Countable α] [inst : Countable β], Countable (α ⊕' β)
instance
[
Countable: Sort ?u.1591 → Prop
Countable
α: Sort u
α
] [
Countable: Sort ?u.1594 → Prop
Countable
β: Sort v
β
] :
Countable: Sort ?u.1597 → Prop
Countable
(
PSum: Sort ?u.1599 → Sort ?u.1598 → Sort (max(max1?u.1599)?u.1598)
PSum
α: Sort u
α
β: Sort v
β
) :=
Countable.of_equiv: ∀ {β : Sort ?u.1603} (α : Sort ?u.1604) [inst : Countable α], α βCountable β
Countable.of_equiv
(
Sum: Type ?u.1608 → Type ?u.1607 → Type (max?u.1608?u.1607)
Sum
(
PLift: Sort ?u.1609 → Type ?u.1609
PLift
α: Sort u
α
) (
PLift: Sort ?u.1610 → Type ?u.1610
PLift
β: Sort v
β
)) (
Equiv.plift: {α : Sort ?u.1612} → PLift α α
Equiv.plift
.
sumPSum: {α₁ : Type ?u.1617} → {α₂ : Sort ?u.1616} → {β₁ : Type ?u.1615} → {β₂ : Sort ?u.1614} → α₁ α₂β₁ β₂α₁ β₁ α₂ ⊕' β₂
sumPSum
Equiv.plift: {α : Sort ?u.1637} → PLift α α
Equiv.plift
)
instance: ∀ {α : Sort u} {β : Sort v} [inst : Countable α] [inst : Countable β], Countable (PProd α β)
instance
[
Countable: Sort ?u.1717 → Prop
Countable
α: Sort u
α
] [
Countable: Sort ?u.1720 → Prop
Countable
β: Sort v
β
] :
Countable: Sort ?u.1723 → Prop
Countable
(
PProd: Sort ?u.1725 → Sort ?u.1724 → Sort (max(max1?u.1725)?u.1724)
PProd
α: Sort u
α
β: Sort v
β
) :=
Countable.of_equiv: ∀ {β : Sort ?u.1729} (α : Sort ?u.1730) [inst : Countable α], α βCountable β
Countable.of_equiv
(
PLift: Sort ?u.1735 → Type ?u.1735
PLift
α: Sort u
α
×
PLift: Sort ?u.1736 → Type ?u.1736
PLift
β: Sort v
β
) (
Equiv.plift: {α : Sort ?u.1738} → PLift α α
Equiv.plift
.
prodPProd: {α₁ : Type ?u.1743} → {α₂ : Sort ?u.1742} → {β₁ : Type ?u.1741} → {β₂ : Sort ?u.1740} → α₁ α₂β₁ β₂α₁ × β₁ PProd α₂ β₂
prodPProd
Equiv.plift: {α : Sort ?u.1763} → PLift α α
Equiv.plift
)
instance: ∀ {α : Sort u} {π : αSort w} [inst : Countable α] [inst : ∀ (a : α), Countable (π a)], Countable (PSigma π)
instance
[
Countable: Sort ?u.1843 → Prop
Countable
α: Sort u
α
] [∀
a: ?m.1847
a
,
Countable: Sort ?u.1850 → Prop
Countable
(
π: αSort w
π
a: ?m.1847
a
)] :
Countable: Sort ?u.1854 → Prop
Countable
(
PSigma: {α : Sort ?u.1856} → (αSort ?u.1855) → Sort (max(max1?u.1856)?u.1855)
PSigma
π: αSort w
π
) :=
Countable.of_equiv: ∀ {β : Sort ?u.1864} (α : Sort ?u.1865) [inst : Countable α], α βCountable β
Countable.of_equiv
a: PLift α
a
:
PLift: Sort ?u.1872 → Type ?u.1872
PLift
α: Sort u
α
,
PLift: Sort ?u.1874 → Type ?u.1874
PLift
(
π: αSort w
π
a: PLift α
a
.
down: {α : Sort ?u.1875} → PLift αα
down
)) (
Equiv.psigmaEquivSigmaPLift: {α : Sort ?u.1882} → (β : αSort ?u.1881) → (i : α) ×' β i (i : PLift α) × PLift (β i.down)
Equiv.psigmaEquivSigmaPLift
π: αSort w
π
).
symm: {α : Sort ?u.1888} → {β : Sort ?u.1887} → α ββ α
symm
instance: ∀ {α : Sort u} {π : αSort w} [inst : Finite α] [inst : ∀ (a : α), Countable (π a)], Countable ((a : α) → π a)
instance
[
Finite: Sort ?u.2016 → Prop
Finite
α: Sort u
α
] [∀
a: ?m.2020
a
,
Countable: Sort ?u.2023 → Prop
Countable
(
π: αSort w
π
a: ?m.2020
a
)] :
Countable: Sort ?u.2027 → Prop
Countable
(∀
a: ?m.2029
a
,
π: αSort w
π
a: ?m.2029
a
) :=

Goals accomplished! 🐙
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)


Countable ((a : α) → π a)
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)


Countable ((a : α) → π a)

Goals accomplished! 🐙
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)


∀ (n : ), Countable (Fin n)
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)

n:


Countable (Fin n)
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)


∀ (n : ), Countable (Fin n)
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)


zero
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)

n:

ihn: Countable (Fin n)


succ
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)


∀ (n : ), Countable (Fin n)
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)


zero
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)


zero
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)

n:

ihn: Countable (Fin n)


succ
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)


zero
Countable (Fin 0)
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)


zero
Countable (Fin 0)
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)


zero

Goals accomplished! 🐙
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)


∀ (n : ), Countable (Fin n)
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)

n:

ihn: Countable (Fin n)


succ
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)

n:

ihn: Countable (Fin n)


succ
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)

n:

ihn, this: Countable (Fin n)


succ
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)

n:

ihn: Countable (Fin n)


succ

Goals accomplished! 🐙
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)


Countable ((a : α) → π a)
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)

this: ∀ (n : ), Countable (Fin n)

n:

e: α Fin n


intro.intro
Countable ((a : α) → π a)
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)


Countable ((a : α) → π a)
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)

this: ∀ (n : ), Countable (Fin n)

n:

e: α Fin n

f: (a : α) → π a


intro.intro
Countable ((a : α) → π a)
α: Sort u

β: Sort v

π: αSort w

inst✝¹: Finite α

inst✝: ∀ (a : α), Countable (π a)


Countable ((a : α) → π a)

Goals accomplished! 🐙
end sort