Structures · Lean core
NatCast
The canonical homomorphism Nat → R. In most use cases, the target type will have a (semi)ring
structure, and this homomorphism should be a (semi)ring homomorphism.
NatCast and IntCast exist to allow different libraries with their own types that can be notated
as natural numbers to have consistent simp normal forms without needing to create coercion
simplification sets that are aware of all combinations. Libraries should make it easy to work with
NatCast where possible. For instance, in Mathlib there will be such a homomorphism (and thus a
NatCast R instance) whenever R is an additive monoid with a 1.
The prototypical example is Int.ofNat.
- Defined in
- Init.Data.Cast
- Shape
- One type argument · adds natCast
Extends0
Extends nothing: this is a root of the hierarchy.
Extended by1
Concrete types that are instances50
- Int
- Nat
- Real
- Rat
- Quiver.Hom
- Complex
- SeparationQuotient
- BitVec
- ContinuousLinearMap
- Polynomial
- Filter.Germ
- BoundedContinuousFunction
- Matrix
- WithVal
- HahnSeries
- NonemptyInterval
- LocallyConstant
- ENat
- MeasureTheory.SimpleFunc
- RestrictedProduct
- DirectSum
- DoubleCentralizer
- CauSeq.Completion.Cauchy
- WittVector
- CauSeq
- TruncatedWittVector
- LucasLehmer.X
- FractionalIdeal
- AdicCompletion
- Cardinal
- Representation.IntertwiningMap
- AdicCompletion.AdicCauchySequence
- RingCon.Quotient
- HomogeneousLocalization
- RingQuot
- CentroidHom
- ModularForm
- SlashInvariantForm
- Dyadic
- Lean.Grind.Ring.OfSemiring.Q
- FirstOrder.Language.Term
- Subtype
- OrderDual
- ULift
- MulOpposite
- Lex
- AddOpposite
- ContinuousMap
- WithTop
- WithBot
How is a type an instance?
Loading the hierarchy index…
Assumed by139
- LinearGrowth.linearGrowthInf
- LinearGrowth.linearGrowthSup
- Nat.cast_two
- Nat.cast_ofNat
- LinearGrowth.linearGrowthInf_le_linearGrowthSup
- Int.castDef
- Matrix.diagonal_natCast'
- FunLike.natCast_eq_nsmul_one
- Matrix.diagonal_ofNat'
- Nat.cast_three
- MulOpposite.unop_natCast
- Matrix.diagonal_natCast
- ProbabilityTheory.integrable_map_cast_poissonMeasure_iff
- Pi.natCast_def
- AddOpposite.unop_ofNat
- Matrix.instNatCastOfZero
- FunLike.semiring
- MulOpposite.op_ofNat
- SimpleGraph.adjMatrix_hadamard_ofNat
- Lex.instNatCast
- hasStrictDerivAt_natCast
- Function.Injective.divisionRing
- toLex_ofNat
- differentiableAt_natCast
- hasFDerivWithinAt_natCast
- SimpleGraph.natCast_hadamard_adjMatrix
- Function.Surjective.nonAssocRing
- Function.Surjective.nonAssocCommSemiring
- Function.Surjective.nonAssocCommRing
- NonemptyInterval.fst_natCast
- AddOpposite.op_natCast
- LinearGrowth.linearGrowthSup_congr
- WithTop.natCast
- measurable_natCast
- ofLex_ofNat
- Function.Injective.idemSemiring
- Nat.cast_four
- SeparationQuotient.mk_ofNat
- MeasureTheory.SimpleFunc.coe_natCast
- Function.Injective.addCommMonoidWithOne
- MulOpposite.unop_ofNat
- ContinuousMap.natCast_apply
- Function.Surjective.commSemiring
- ULift.down_ofNat
- ContinuousMap.instNatCast
- AddOpposite.op_ofNat
- Function.Injective.semifield
- hasFDerivAt_natCast
- deriv_natCast
- Function.Surjective.addCommMonoidWithOne
Ancestors0
No ancestors.