The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V32. Logic, model theory and computability

Mathlib.Logic.Encodable.Basic

118 declarations. Mathlib docs · Source

Encodable types

This file defines encodable (constructively countable) types as a typeclass. This is used to provide explicit encode/decode functions from and to ℕ, with the information that those functions are inverses of each other. The difference with Denumerable is that finite types are encodable. For infinite types, Encodable and Denumerable agree.

Main declarations

  • Encodable α: States that there exists an explicit encoding function encode : α → ℕ with a partial inverse decode : ℕ → Option α.
  • decode₂: Version of decode that is equal to none outside of the range of encode. Useful as we do not require this in the definition of decode.
  • ULower α: Any encodable type has an equivalent type living in the lowest universe, namely a subtype of ℕ. ULower α finds it.

Implementation notes

The point of asking for an explicit partial inverse decode : ℕ → Option α to encode : α → ℕ is to make the range of encode decidable even when the finiteness of α is not.

theorem Directed.sequence.match_1.congr_eq_1 E1 #

∀ {α : Type u_1} (motive : Option α → Sort u_2) (x : Option α) (h_1 : Unit → motive none)
  (h_2 : (a : α) → motive (some a)),
  x = none →
    (match x with
      | none => h_1 ()
      | some a => h_2 a) ≍
      h_1 ()

theorem Directed.sequence.congr_simp E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Encodable α] [inst_1 : Inhabited α] {r r_1 : β → β → Prop} (e_r : r = r_1)
  (f f_1 : α → β) (e_f : f = f_1) (hf : Directed r f) (a a_1 : ℕ),
  a = a_1 → Directed.sequence f hf a = Directed.sequence f_1 ⋯ a_1

theorem Encodable.decodeSum.match_1.congr_eq_2 E1 #

∀ (motive : Bool → ℕ → Sort u_1) (x : Bool) (x_1 : ℕ) (h_1 : (m : ℕ) → motive false m)
  (h_2 : (x : Bool) → (m : ℕ) → motive x m) (x_2 : Bool) (m : ℕ),
  x = x_2 →
    x_1 = m →
      (x_2 = false → False) →
        (match x, x_1 with
          | false, m => h_1 m
          | x, m => h_2 x m) ≍
          h_2 x_2 m

theorem Encodable.decodeSigma.match_1.congr_eq_1 E1 #

∀ (motive : ℕ × ℕ → Sort u_1) (x : ℕ × ℕ) (h_1 : (n₁ n₂ : ℕ) → motive (n₁, n₂)) (n₁ n₂ : ℕ),
  x = (n₁, n₂) →
    (match x with
      | (n₁, n₂) => h_1 n₁ n₂) ≍
      h_1 n₁ n₂

theorem Directed.sequence.match_3.congr_eq_1 E1 #

∀ (motive : ℕ → Sort u_1) (x : ℕ) (h_1 : Unit → motive 0) (h_2 : (n : ℕ) → motive n.succ),
  x = 0 →
    (match x with
      | 0 => h_1 ()
      | n.succ => h_2 n) ≍
      h_1 ()

theorem Encodable.encodeSum.match_1.congr_eq_1 E1 #

∀ {α : Type u_1} {β : Type u_2} (motive : α ⊕ β → Sort u_3) (x : α ⊕ β) (h_1 : (a : α) → motive (Sum.inl a))
  (h_2 : (b : β) → motive (Sum.inr b)) (a : α),
  x = Sum.inl a →
    (match x with
      | Sum.inl a => h_1 a
      | Sum.inr b => h_2 b) ≍
      h_1 a

theorem Encodable.encodeSigma.match_1.congr_eq_1 E1 #

∀ {α : Type u_1} {γ : α → Type u_2} (motive : Sigma γ → Sort u_3) (x : Sigma γ)
  (h_1 : (a : α) → (b : γ a) → motive ⟨a, b⟩) (a : α) (b : γ a),
  x = ⟨a, b⟩ →
    (match x with
      | ⟨a, b⟩ => h_1 a b) ≍
      h_1 a b

theorem Encodable.encodeSubtype.match_1.congr_eq_1 E1 #

∀ {α : Type u_1} {P : α → Prop} (motive : { a // P a } → Sort u_2) (x : { a // P a })
  (h_1 : (v : α) → (property : P v) → motive ⟨v, property⟩) (v : α) (property : P v),
  x = ⟨v, property⟩ →
    (match x with
      | ⟨v, property⟩ => h_1 v property) ≍
      h_1 v property

theorem Directed.sequence.match_1.congr_eq_2 E1 #

∀ {α : Type u_1} (motive : Option α → Sort u_2) (x : Option α) (h_1 : Unit → motive none)
  (h_2 : (a : α) → motive (some a)) (a : α),
  x = some a →
    (match x with
      | none => h_1 ()
      | some a => h_2 a) ≍
      h_2 a

theorem Directed.sequence.match_3.congr_eq_2 E1 #

∀ (motive : ℕ → Sort u_1) (x : ℕ) (h_1 : Unit → motive 0) (h_2 : (n : ℕ) → motive n.succ) (n : ℕ),
  x = n.succ →
    (match x with
      | 0 => h_1 ()
      | n.succ => h_2 n) ≍
      h_2 n

theorem Encodable.encodeSum.match_1.congr_eq_2 E1 #

∀ {α : Type u_1} {β : Type u_2} (motive : α ⊕ β → Sort u_3) (x : α ⊕ β) (h_1 : (a : α) → motive (Sum.inl a))
  (h_2 : (b : β) → motive (Sum.inr b)) (b : β),
  x = Sum.inr b →
    (match x with
      | Sum.inl a => h_1 a
      | Sum.inr b => h_2 b) ≍
      h_2 b

def Encodable.ctorIdx E1 #

{α : Type u_1} → Encodable α → ℕ

theorem Encodable.decodeSum.match_1.congr_eq_1 E1 #

∀ (motive : Bool → ℕ → Sort u_1) (x : Bool) (x_1 : ℕ) (h_1 : (m : ℕ) → motive false m)
  (h_2 : (x : Bool) → (m : ℕ) → motive x m) (m : ℕ),
  x = false →
    x_1 = m →
      (match x, x_1 with
        | false, m => h_1 m
        | x, m => h_2 x m) ≍
        h_1 m

class Encodable E1 #

Type u_1 → Type u_1

Constructively countable type. Made from an explicit injection encode : α → ℕ and a partial inverse decode : ℕ → Option α. Note that finite types are countable. See Denumerable if you wish to enforce infiniteness.

ctor Encodable.mk E0 #

{α : Type u_1} → (encode : α → ℕ) → (decode : ℕ → Option α) → (∀ (a : α), decode (encode a) = some a) → Encodable α

abbrev Encodable.encode E3 #

{α : Type u_1} → [self : Encodable α] → α → ℕ

Encoding from Type α to ℕ

abbrev Encodable.decode E3 #

{α : Type u_1} → [self : Encodable α] → ℕ → Option α

Decoding from ℕ to Option α

theorem Encodable.encodek E0 #

∀ {α : Type u_1} [self : Encodable α] (a : α), Encodable.decode (Encodable.encode a) = some a

Invariant relationship between encoding and decoding

theorem Encodable.encode_injective E1 #

∀ {α : Type u_1} [inst : Encodable α], Function.Injective Encodable.encode

theorem Encodable.encode_inj E0 #

∀ {α : Type u_1} [inst : Encodable α] {a b : α}, Encodable.encode a = Encodable.encode b ↔ a = b

instance Encodable.countable E0 #

∀ {α : Type u_1} [Encodable α], Countable α

theorem Encodable.surjective_decode_getD E1 #

∀ (α : Type u_3) [inst : Encodable α] (d : α), Function.Surjective fun n ↦ (Encodable.decode n).getD d

def Encodable.decidableEqOfEncodable E1 #

(α : Type u_3) → [Encodable α] → DecidableEq α

An encodable type has decidable equality. Not set as an instance because this is usually not the best way to infer decidability.

def Encodable.ofLeftInjection E1 #

{α : Type u_1} →
  {β : Type u_2} → [Encodable α] → (f : β → α) → (finv : α → Option β) → (∀ (b : β), finv (f b) = some b) → Encodable β

If α is encodable and there is an injection f : β → α, then β is encodable as well.

def Encodable.ofLeftInverse E1 #

{α : Type u_1} →
  {β : Type u_2} → [Encodable α] → (f : β → α) → (finv : α → β) → (∀ (b : β), finv (f b) = b) → Encodable β

If α is encodable and f : β → α is invertible, then β is encodable as well.

def Encodable.ofEquiv E1 #

{β : Type u_2} → (α : Type u_3) → [Encodable α] → β ≃ α → Encodable β

Encodability is preserved by equivalence.

theorem Encodable.encode_ofEquiv E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : Encodable α] (e : β ≃ α) (b : β), Encodable.encode b = Encodable.encode (e b)

theorem Encodable.decode_ofEquiv E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : Encodable α] (e : β ≃ α) (n : ℕ),
  Encodable.decode n = Option.map (⇑e.symm) (Encodable.decode n)

instance Nat.encodable E0 #

Encodable ℕ

theorem Encodable.encode_nat E0 #

∀ (n : ℕ), Encodable.encode n = n

theorem Encodable.decode_nat E0 #

∀ (n : ℕ), Encodable.decode n = some n

instance IsEmpty.toEncodable E0 #

{α : Type u_1} → [IsEmpty α] → Encodable α

instance PUnit.encodable E0 #

Encodable PUnit.{u_3 + 1}

theorem Encodable.encode_star E0 #

Encodable.encode PUnit.unit = 0

theorem Encodable.decode_unit_zero E0 #

Encodable.decode 0 = some PUnit.unit

theorem Encodable.decode_unit_succ E0 #

∀ (n : ℕ), Encodable.decode n.succ = none

instance Option.encodable E0 #

{α : Type u_3} → [h : Encodable α] → Encodable (Option α)

If α is encodable, then so is Option α.

theorem Encodable.encode_none E0 #

∀ {α : Type u_1} [inst : Encodable α], Encodable.encode none = 0

theorem Encodable.encode_some E0 #

∀ {α : Type u_1} [inst : Encodable α] (a : α), Encodable.encode (some a) = (Encodable.encode a).succ

theorem Encodable.decode_option_zero E0 #

∀ {α : Type u_1} [inst : Encodable α], Encodable.decode 0 = some none

theorem Encodable.decode_option_succ E0 #

∀ {α : Type u_1} [inst : Encodable α] (n : ℕ), Encodable.decode n.succ = Option.map some (Encodable.decode n)

def Encodable.decode₂ E3 #

(α : Type u_3) → [Encodable α] → ℕ → Option α

Failsafe variant of decode. decode₂ α n returns the preimage of n under encode if it exists, and returns none if it doesn't. This requirement could be imposed directly on decode but is not to help make the definition easier to use.

theorem Encodable.mem_decode₂' E0 #

∀ {α : Type u_1} [inst : Encodable α] {n : ℕ} {a : α},
  a ∈ Encodable.decode₂ α n ↔ a ∈ Encodable.decode n ∧ Encodable.encode a = n

theorem Encodable.mem_decode₂ E0 #

∀ {α : Type u_1} [inst : Encodable α] {n : ℕ} {a : α}, a ∈ Encodable.decode₂ α n ↔ Encodable.encode a = n

theorem Encodable.decode₂_eq_some E1 #

∀ {α : Type u_1} [inst : Encodable α] {n : ℕ} {a : α}, Encodable.decode₂ α n = some a ↔ Encodable.encode a = n

theorem Encodable.decode₂_encode E0 #

∀ {α : Type u_1} [inst : Encodable α] (a : α), Encodable.decode₂ α (Encodable.encode a) = some a

theorem Encodable.decode₂_ne_none_iff E0 #

∀ {α : Type u_1} [inst : Encodable α] {n : ℕ}, Encodable.decode₂ α n ≠ none ↔ n ∈ Set.range Encodable.encode

theorem Encodable.decode₂_isPartialInv E1 #

∀ {α : Type u_1} [inst : Encodable α], Function.IsPartialInv Encodable.encode (Encodable.decode₂ α)

theorem Encodable.decode₂_inj E1 #

∀ {α : Type u_1} [inst : Encodable α] {n : ℕ} {a₁ a₂ : α},
  a₁ ∈ Encodable.decode₂ α n → a₂ ∈ Encodable.decode₂ α n → a₁ = a₂

theorem Encodable.encodek₂ E1 #

∀ {α : Type u_1} [inst : Encodable α] (a : α), Encodable.decode₂ α (Encodable.encode a) = some a

def Encodable.decidableRangeEncode E1 #

(α : Type u_3) → [inst : Encodable α] → DecidablePred fun x ↦ x ∈ Set.range Encodable.encode

The encoding function has decidable range.

def Encodable.equivRangeEncode E1 #

(α : Type u_3) → [inst : Encodable α] → α ≃ ↑(Set.range Encodable.encode)

An encodable type is equivalent to the range of its encoding function.

def Unique.encodable E1 #

{α : Type u_1} → [Unique α] → Encodable α

A type with unique element is encodable. This is not an instance to avoid diamonds.

def Encodable.encodeSum E1 #

{α : Type u_1} → {β : Type u_2} → [Encodable α] → [Encodable β] → α ⊕ β → ℕ

Explicit encoding function for the sum of two encodable types.

def Encodable.decodeSum E1 #

{α : Type u_1} → {β : Type u_2} → [Encodable α] → [Encodable β] → ℕ → Option (α ⊕ β)

Explicit decoding function for the sum of two encodable types.

instance Sum.encodable E0 #

{α : Type u_1} → {β : Type u_2} → [Encodable α] → [Encodable β] → Encodable (α ⊕ β)

If α and β are encodable, then so is their sum.

theorem Encodable.encode_inl E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : Encodable α] [inst_1 : Encodable β] (a : α),
  Encodable.encode (Sum.inl a) = 2 * Encodable.encode a

theorem Encodable.encode_inr E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : Encodable α] [inst_1 : Encodable β] (b : β),
  Encodable.encode (Sum.inr b) = 2 * Encodable.encode b + 1

theorem Encodable.decode_sum_val E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : Encodable α] [inst_1 : Encodable β] (n : ℕ),
  Encodable.decode n = Encodable.decodeSum n

instance Bool.encodable E0 #

Encodable Bool

theorem Encodable.encode_true E0 #

Encodable.encode true = 1

theorem Encodable.encode_false E0 #

Encodable.encode false = 0

theorem Encodable.decode_zero E0 #

Encodable.decode 0 = some false

theorem Encodable.decode_one E0 #

Encodable.decode 1 = some true

theorem Encodable.decode_ge_two E1 #

∀ (n : ℕ), 2 ≤ n → Encodable.decode n = none

instance Prop.encodable E0 #

Encodable Prop

def Encodable.encodeSigma E1 #

{α : Type u_1} → {γ : α → Type u_3} → [Encodable α] → [(a : α) → Encodable (γ a)] → Sigma γ → ℕ

Explicit encoding function for Sigma γ

def Encodable.decodeSigma E1 #

{α : Type u_1} → {γ : α → Type u_3} → [Encodable α] → [(a : α) → Encodable (γ a)] → ℕ → Option (Sigma γ)

Explicit decoding function for Sigma γ

instance Sigma.encodable E0 #

{α : Type u_1} → {γ : α → Type u_3} → [Encodable α] → [(a : α) → Encodable (γ a)] → Encodable (Sigma γ)

theorem Encodable.decode_sigma_val E0 #

∀ {α : Type u_1} {γ : α → Type u_3} [inst : Encodable α] [inst_1 : (a : α) → Encodable (γ a)] (n : ℕ),
  Encodable.decode n =
    (Encodable.decode (Nat.unpair n).1).bind fun a ↦ Option.map (Sigma.mk a) (Encodable.decode (Nat.unpair n).2)

theorem Encodable.encode_sigma_val E0 #

∀ {α : Type u_1} {γ : α → Type u_3} [inst : Encodable α] [inst_1 : (a : α) → Encodable (γ a)] (a : α) (b : γ a),
  Encodable.encode ⟨a, b⟩ = Nat.pair (Encodable.encode a) (Encodable.encode b)

instance Encodable.Prod.encodable E0 #

{α : Type u_1} → {β : Type u_2} → [Encodable α] → [Encodable β] → Encodable (α × β)

If α and β are encodable, then so is their product.

theorem Encodable.decode_prod_val E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : Encodable α] [inst_1 : Encodable β] (n : ℕ),
  Encodable.decode n =
    (Encodable.decode (Nat.unpair n).1).bind fun a ↦ Option.map (Prod.mk a) (Encodable.decode (Nat.unpair n).2)

theorem Encodable.encode_prod_val E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : Encodable α] [inst_1 : Encodable β] (a : α) (b : β),
  Encodable.encode (a, b) = Nat.pair (Encodable.encode a) (Encodable.encode b)

def Encodable.encodeSubtype E1 #

{α : Type u_1} → {P : α → Prop} → [encA : Encodable α] → { a // P a } → ℕ

Explicit encoding function for a decidable subtype of an encodable type

def Encodable.decodeSubtype E1 #

{α : Type u_1} → {P : α → Prop} → [encA : Encodable α] → [decP : DecidablePred P] → ℕ → Option { a // P a }

Explicit decoding function for a decidable subtype of an encodable type

instance Subtype.encodable E0 #

{α : Type u_1} → {P : α → Prop} → [encA : Encodable α] → [decP : DecidablePred P] → Encodable { a // P a }

A decidable subtype of an encodable type is encodable.

theorem Encodable.Subtype.encode_eq E0 #

∀ {α : Type u_1} {P : α → Prop} [encA : Encodable α] [decP : DecidablePred P] (a : Subtype P),
  Encodable.encode a = Encodable.encode ↑a

instance Fin.encodable E0 #

(n : ℕ) → Encodable (Fin n)

instance Int.encodable E0 #

Encodable ℤ

instance PNat.encodable E0 #

Encodable ℕ+

instance ULift.encodable E0 #

{α : Type u_1} → [Encodable α] → Encodable (ULift.{u_3, u_1} α)

The lift of an encodable type is encodable

instance PLift.encodable E0 #

{α : Type u_1} → [Encodable α] → Encodable (PLift α)

The lift of an encodable type is encodable.

def Encodable.ofInj E1 #

{α : Type u_1} → {β : Type u_2} → [Encodable β] → (f : α → β) → Function.Injective f → Encodable α

If β is encodable and there is an injection f : α → β, then α is encodable as well.

def Encodable.ofCountable E1 #

(α : Type u_3) → [Countable α] → Encodable α

If α is countable, then it has a (non-canonical) Encodable structure.

theorem Encodable.nonempty_encodable E0 #

∀ {α : Type u_1}, Nonempty (Encodable α) ↔ Countable α

theorem nonempty_encodable E1 #

∀ (α : Type u_1) [Countable α], Nonempty (Encodable α)

See also nonempty_fintype, nonempty_denumerable.

instance instCountablePNat E0 #

Countable ℕ+

def ULower E1 #

(α : Type u_1) → [Encodable α] → Type

ULower α : Type is an equivalent type in the lowest universe, given Encodable α.

instance instDecidableEqULower E0 #

{α : Type u_1} → [inst : Encodable α] → DecidableEq (ULower α)

instance instEncodableULower E0 #

{α : Type u_1} → [inst : Encodable α] → Encodable (ULower α)

def ULower.equiv E1 #

(α : Type u_1) → [inst : Encodable α] → α ≃ ULower α

The equivalence between the encodable type α and ULower α : Type.

def ULower.down E1 #

{α : Type u_1} → [inst : Encodable α] → α → ULower α

Lowers an a : α into ULower α.

instance ULower.instInhabited E0 #

{α : Type u_1} → [inst : Encodable α] → [Inhabited α] → Inhabited (ULower α)

def ULower.up E1 #

{α : Type u_1} → [inst : Encodable α] → ULower α → α

Lifts an a : ULower α into α.

theorem ULower.down_up E0 #

∀ {α : Type u_1} [inst : Encodable α] {a : ULower α}, ULower.down a.up = a

theorem ULower.up_down E0 #

∀ {α : Type u_1} [inst : Encodable α] {a : α}, (ULower.down a).up = a

theorem ULower.up_eq_up E0 #

∀ {α : Type u_1} [inst : Encodable α] {a b : ULower α}, a.up = b.up ↔ a = b

theorem ULower.down_eq_down E0 #

∀ {α : Type u_1} [inst : Encodable α] {a b : α}, ULower.down a = ULower.down b ↔ a = b

theorem ULower.ext E1 #

∀ {α : Type u_1} [inst : Encodable α] {a b : ULower α}, a.up = b.up → a = b

theorem ULower.ext_iff E0 #

∀ {α : Type u_1} [inst : Encodable α] {a b : ULower α}, a = b ↔ a.up = b.up

def Encodable.choose E1 #

{α : Type u_1} → {p : α → Prop} → [Encodable α] → [DecidablePred p] → (∃ x, p x) → α

Constructive choice function for a decidable predicate over an encodable type.

theorem Encodable.choose_spec E1 #

∀ {α : Type u_1} {p : α → Prop} [inst : Encodable α] [inst_1 : DecidablePred p] (h : ∃ x, p x), p (Encodable.choose h)

theorem Encodable.axiom_of_choice E1 #

∀ {α : Type u_1} {β : α → Type u_2} {R : (x : α) → β x → Prop} [(a : α) → Encodable (β a)]
  [(x : α) → (y : β x) → Decidable (R x y)], (∀ (x : α), ∃ y, R x y) → ∃ f, ∀ (x : α), R x (f x)

A constructive version of Classical.axiom_of_choice for Encodable types.

theorem Encodable.skolem E1 #

∀ {α : Type u_1} {β : α → Type u_2} {P : (x : α) → β x → Prop} [(a : α) → Encodable (β a)]
  [(x : α) → (y : β x) → Decidable (P x y)], (∀ (x : α), ∃ y, P x y) ↔ ∃ f, ∀ (x : α), P x (f x)

A constructive version of Classical.skolem for Encodable types.

def Encodable.encode' E1 #

(α : Type u_1) → [Encodable α] → α ↪ ℕ

The encode function, viewed as an embedding.

instance Encodable.instAntisymmPreimageNatCoeEmbeddingEncode'Le E0 #

∀ {α : Type u_1} [inst : Encodable α], Std.Antisymm (⇑(Encodable.encode' α) ⁻¹'o fun x1 x2 ↦ x1 ≤ x2)

instance Encodable.instTotalPreimageNatCoeEmbeddingEncode'Le E0 #

∀ {α : Type u_1} [inst : Encodable α], Std.Total (⇑(Encodable.encode' α) ⁻¹'o fun x1 x2 ↦ x1 ≤ x2)

def Directed.sequence E1 #

{α : Type u_1} →
  {β : Type u_2} → [Encodable α] → [Inhabited α] → {r : β → β → Prop} → (f : α → β) → Directed r f → ℕ → α

Given a Directed r function f : α → β defined on an encodable inhabited type, construct a noncomputable sequence such that r (f (x n)) (f (x (n + 1))) and r (f a) (f (x (encode a + 1)).

theorem Directed.sequence_mono_nat E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Encodable α] [inst_1 : Inhabited α] {r : β → β → Prop} {f : α → β}
  (hf : Directed r f) (n : ℕ), r (f (Directed.sequence f hf n)) (f (Directed.sequence f hf (n + 1)))

theorem Directed.rel_sequence E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Encodable α] [inst_1 : Inhabited α] {r : β → β → Prop} {f : α → β}
  (hf : Directed r f) (a : α), r (f a) (f (Directed.sequence f hf (Encodable.encode a + 1)))

theorem Directed.sequence_mono E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Encodable α] [inst_1 : Inhabited α] [inst_2 : Preorder β] {f : α → β}
  (hf : Directed (fun x1 x2 ↦ x1 ≤ x2) f), Monotone (f ∘ Directed.sequence f hf)

theorem Directed.le_sequence E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Encodable α] [inst_1 : Inhabited α] [inst_2 : Preorder β] {f : α → β}
  (hf : Directed (fun x1 x2 ↦ x1 ≤ x2) f) (a : α), f a ≤ f (Directed.sequence f hf (Encodable.encode a + 1))

theorem Directed.sequence_anti E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Encodable α] [inst_1 : Inhabited α] [inst_2 : Preorder β] {f : α → β}
  (hf : Directed (fun x1 x2 ↦ x1 ≥ x2) f), Antitone (f ∘ Directed.sequence f hf)

theorem Directed.sequence_le E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Encodable α] [inst_1 : Inhabited α] [inst_2 : Preorder β] {f : α → β}
  (hf : Directed (fun x1 x2 ↦ x1 ≥ x2) f) (a : α), f (Directed.sequence f hf (Encodable.encode a + 1)) ≤ f a

def Quotient.rep E1 #

{α : Type u_1} → {s : Setoid α} → [DecidableRel fun x1 x2 ↦ x1 ≈ x2] → [Encodable α] → Quotient s → α

Representative of an equivalence class. This is a computable version of Quot.out for a setoid on an encodable type.

theorem Quotient.rep_spec E1 #

∀ {α : Type u_1} {s : Setoid α} [inst : DecidableRel fun x1 x2 ↦ x1 ≈ x2] [inst_1 : Encodable α] (q : Quotient s),
  ⟦q.rep⟧ = q

def encodableQuotient E1 #

{α : Type u_1} → {s : Setoid α} → [DecidableRel fun x1 x2 ↦ x1 ≈ x2] → [Encodable α] → Encodable (Quotient s)

The quotient of an encodable space by a decidable equivalence relation is encodable.