Documentation

Init.Data.Int.Basic

the Type, coercions, and notation #

inductive Int :
Instances For
    Equations
    instance instOfNatInt {n : Nat} :
    Equations
    Equations
    @[extern lean_int_neg]
    def Int.neg (n : Int) :
    Equations
    def Int.subNatNat (m : Nat) (n : Nat) :
    Equations
    @[extern lean_int_add]
    def Int.add (m : Int) (n : Int) :
    Equations
    • One or more equations did not get rendered due to their size.
    @[extern lean_int_mul]
    def Int.mul (m : Int) (n : Int) :
    Equations
    • One or more equations did not get rendered due to their size.
    @[defaultInstance 500]

    The Neg Int default instance must have priority higher than low since the default instance OfNat Nat n has low priority.

    #check -42
    
    Equations
    Equations
    Equations
    @[extern lean_int_sub]
    def Int.sub (m : Int) (n : Int) :
    Equations
    Equations
    inductive Int.NonNeg :
    IntProp
    Instances For
      def Int.le (a : Int) (b : Int) :
      Equations
      instance Int.instLEInt :
      Equations
      def Int.lt (a : Int) (b : Int) :
      Equations
      instance Int.instLTInt :
      Equations
      @[extern lean_int_dec_eq]
      def Int.decEq (a : Int) (b : Int) :
      Decidable (a = b)
      Equations
      • One or more equations did not get rendered due to their size.
      @[extern lean_int_dec_le]
      instance Int.decLe (a : Int) (b : Int) :
      Equations
      @[extern lean_int_dec_lt]
      instance Int.decLt (a : Int) (b : Int) :
      Decidable (a < b)
      Equations
      @[extern lean_nat_abs]
      def Int.natAbs (m : Int) :
      Equations
      @[extern lean_int_div]
      def Int.div :
      IntIntInt
      Equations
      • One or more equations did not get rendered due to their size.
      @[extern lean_int_mod]
      def Int.mod :
      IntIntInt
      Equations
      • One or more equations did not get rendered due to their size.
      Equations
      Equations
      def Int.toNat :
      IntNat
      Equations
      def Int.pow (m : Int) :
      NatInt
      Equations
      Equations
      Equations