mathlib documentation

data.​num.​basic

data.​num.​basic

inductive pos_num  :
Type

The type of positive binary numbers.

13 = 1101(base 2) = bit1 (bit0 (bit1 one))
inductive num  :
Type

The type of nonnegative binary numbers, using pos_num.

13 = 1101(base 2) = pos (bit1 (bit0 (bit1 one)))
@[instance]

@[instance]

Equations
@[instance]

Equations
@[instance]

Equations
inductive znum  :
Type

Representation of integers using trichotomy around zero.

13 = 1101(base 2) = pos (bit1 (bit0 (bit1 one)))
-13 = -1101(base 2) = neg (bit1 (bit0 (bit1 one)))
@[instance]

@[instance]

Equations
@[instance]

Equations
@[instance]

Equations

Equations

Equations

Equations

Equations

Equations
@[instance]

Equations
@[instance]

Equations
def cast_pos_num {α : Type u_1} [has_zero α] [has_one α] [has_add α] :
pos_num → α

Equations
def cast_num {α : Type u_1} [has_zero α] [has_one α] [has_add α] :
num → α

Equations
@[instance]
def pos_num_coe {α : Type u_1} [has_zero α] [has_one α] [has_add α] :

Equations
@[instance]
def num_nat_coe {α : Type u_1} [has_zero α] [has_one α] [has_add α] :

Equations
@[instance]

Equations
@[instance]

Equations
def num.​succ'  :

Equations
def num.​succ  :
numnum

Equations
def num.​add  :
numnumnum

Equations
@[instance]

Equations
def num.​bit0  :
numnum

Equations
def num.​bit1  :
numnum

Equations
def num.​bit  :
boolnumnum

Equations
def num.​size  :
numnum

Equations
def num.​nat_size  :
num

Equations
def num.​mul  :
numnumnum

Equations
@[instance]

Equations
def num.​cmp  :
numnumordering

Equations
@[instance]

Equations
@[instance]

Equations
def num.​to_znum  :
numznum

Equations
def num.​of_nat'  :
num

Equations
def znum.​zneg  :

Equations
@[instance]

Equations
def znum.​abs  :
znumnum

Equations
def znum.​bit0  :

Equations
def znum.​bit1  :

Equations

Equations
def num.​pred  :
numnum

Equations
def num.​div2  :
numnum

Equations
def num.​sub'  :
numnumznum

Equations
def num.​psub  :
numnumoption num

Equations
def num.​sub  :
numnumnum

Equations
@[instance]

Equations
def znum.​add  :
znumznumznum

Equations
@[instance]

Equations
def znum.​mul  :
znumznumznum

Equations
@[instance]

Equations
@[instance]

Equations
@[instance]

Equations
def pos_num.​divmod_aux  :
pos_numnumnumnum × num

Equations

Equations

Equations

Equations
def pos_num.​sqrt_aux1  :
pos_numnumnumnum × num

Equations
def pos_num.​sqrt_aux  :
pos_numnumnumnum

Equations
def num.​div  :
numnumnum

Equations
def num.​mod  :
numnumnum

Equations
@[instance]

Equations
@[instance]

Equations
def num.​gcd_aux  :
numnumnum

Equations
def num.​gcd  :
numnumnum

Equations
def znum.​div  :
znumznumznum

Equations
def znum.​mod  :
znumznumznum

Equations
@[instance]

Equations
@[instance]

Equations
def znum.​gcd  :
znumznumnum

Equations
def cast_znum {α : Type u_1} [has_zero α] [has_one α] [has_add α] [has_neg α] :
znum → α

Equations
@[instance]
def znum_coe {α : Type u_1} [has_zero α] [has_one α] [has_add α] [has_neg α] :

Equations
@[instance]

Equations