Mathlib Map

Structures · Logic and sets

Primcodable

A Primcodable type is, essentially, an Encodable type for which the encode/decode functions are primitive recursive. However, such a definition is circular. Instead, we ask that the composition of decode : ℕ → Option α with encode : Option α → ℕ is primitive recursive. Said composition is the identity function, restricted to the image of encode. Thus, in a way, the added requirement ensures that no predicates can be smuggled in through a cunning choice of the subset of into which the type is encoded.

Defined in
Mathlib.Computability.Primrec.Basic
Shape
One type argument · adds prim

Extends1

Extended by1

Forgetful instances

Provided automatically by

Concrete types that are instances10

  • Bool
  • Empty
  • List.Vector
  • ULower
  • Prod
  • Fin
  • PUnit
  • Sum
  • List
  • Option

How is a type an instance?

Loading the hierarchy index…

Assumed by356

Ancestors4