Mathlib Map

Structures · Lean core

Inhabited

Inhabited α is a typeclass that says that α has a designated element, called (default : α). This is sometimes referred to as a "pointed type". This class is used by functions that need to return a value of the type when called "out of domain". For example, Array.get! arr i : α returns a value of type α when arr : Array α, but if i is not in range of the array, it reports a panic message, but this does not halt the program, so it must still return a value of type α (and in fact this is required for logical consistency), so in this case it returns default.

Defined in
Init.Prelude
Shape
One type argument · adds default

Extends0

Extends nothing: this is a root of the hierarchy.

Extended by2

Forgetful instances

Every Inhabited is also a

Provided automatically by

Concrete types that are instances100

  • Int
  • Nat
  • Real
  • Rat
  • Bool
  • Quiver.Hom
  • Complex
  • SeparationQuotient
  • NNReal
  • BitVec
  • ContinuousLinearMap
  • ZMod
  • ENNReal
  • Polynomial
  • Filter.Germ
  • BoundedContinuousFunction
  • Padic
  • CStarMatrix
  • CategoryTheory.Functor
  • RatFunc
  • UniformSpace.Completion
  • UInt64
  • NNRat
  • TensorProduct
  • UInt8
  • UInt16
  • UInt32
  • Quaternion
  • Unitization
  • Matrix
  • WithVal
  • HahnSeries
  • NumberField.InfinitePlace.Completion
  • NonemptyInterval
  • LocallyConstant
  • USize
  • ENat
  • PadicInt
  • CategoryTheory.Over
  • QuadraticAlgebra
  • Units
  • MeasureTheory.SimpleFunc
  • FreeAbelianGroup
  • EReal
  • MonoidAlgebra
  • TrivSqZeroExt
  • Hyperreal
  • AddMonoidAlgebra
  • Finsupp
  • DirectSum
  • IsLocalRing.ResidueField
  • Polynomial.SplittingField
  • RatFunc.CompletionAtInfty
  • RestrictScalars
  • DoubleCentralizer
  • Zsqrtd
  • GaloisField
  • CategoryTheory.Discrete
  • ZNum
  • SymAlg
  • SkewMonoidAlgebra
  • ModuleCat
  • Interval
  • AddUnits
  • CauSeq.Completion.Cauchy
  • AlgebraicClosure
  • PerfectClosure
  • ContMDiffMap
  • AdjoinRoot
  • OreLocalization
  • CyclotomicField
  • Polynomial.SplittingFieldAux
  • PiTensorProduct
  • CategoryTheory.Grp
  • QuaternionAlgebra
  • ZeroAtInftyContinuousMap
  • Int32
  • Int8
  • Int64
  • ContinuousAlternatingMap
  • Int16
  • DFinsupp
  • WittVector
  • SetSemiring
  • PNat
  • NumberField.InfiniteAdeleRing
  • TopologicalSpace.NonemptyCompacts
  • CauSeq
  • TruncatedWittVector
  • LucasLehmer.X
  • CategoryTheory.End
  • NumberField.AdeleRing
  • HomologicalComplex
  • WithCStarModule
  • Tropical
  • MvPowerSeries
  • FreeRing
  • CompareReals.Q
  • Action
  • Ordinal

How is a type an instance?

Loading the hierarchy index…

Assumed by528

Ancestors1