Basic operations on the integers #
This file contains some basic lemmas about integers.
See note [foundational algebra order theory].
TODO #
Split this file into:
succ and pred #
The following few lemmas are proved in the core implementation of the omega
tactic. We expose
them here with nice user-facing names.
Inductively define a function on ℤ
by defining it at b
, for the succ
of a number greater
than b
, and the pred
of a number less than b
.
Equations
- z.inductionOn' b H0 Hs Hp = cast ⋯ (match z - b with | Int.ofNat n => Int.inductionOn'.pos b H0 Hs n | Int.negSucc n => Int.inductionOn'.neg b H0 Hp n)
Instances For
The positive case of Int.inductionOn'
.
Equations
- Int.inductionOn'.pos b H0 Hs 0 = cast ⋯ H0
- Int.inductionOn'.pos b H0 Hs n.succ = cast ⋯ (Hs (b + ↑n) ⋯ (Int.inductionOn'.pos b H0 Hs n))
Instances For
The negative case of Int.inductionOn'
.
Equations
- Int.inductionOn'.neg b H0 Hp 0 = Hp b ⋯ H0
- Int.inductionOn'.neg b H0 Hp n.succ = cast ⋯ (Hp (b + Int.negSucc n) ⋯ (Int.inductionOn'.neg b H0 Hp n))
Instances For
Inductively define a function on ℤ
by defining it on ℕ
and extending it from n
to -n
.
Equations
- Int.negInduction nat neg x = match x with | Int.ofNat n => nat n | Int.negSucc n => neg (n + 1) (nat (n + 1))
Instances For
A strong recursor for Int
that specifies explicit values for integers below a threshold,
and is analogous to Nat.strongRec
for integers on or above the threshold.
Equations
- One or more equations did not get rendered due to their size.
Instances For
nat abs #
/
#
mod #
properties of /
and %
#
dvd #
Alias of Int.natCast_dvd_natCast
.
Alias of Int.dvd_natCast
.
Alias of Int.natCast_dvd
.
/
and ordering #
sign #
toNat #
Alias of Int.natCast_pos
.
Alias of Int.natCast_succ_pos
.
Alias of Int.natCast_pow
.
Alias of Int.ofNat_eq_natCast
.
Alias of Int.natCast_inj
.
Alias of Int.natCast_sub
.
Alias of Int.natCast_nonneg
.
Alias of Int.sign_natCast_add_one
.
Alias of Int.natCast_succ
.
Alias of Int.succ_neg_natCast_succ
.
Alias of Int.natCast_pred_of_pos
.
Alias of Int.natCast_div
.
Alias of Int.natCast_ediv
.
Alias of Int.sign_natCast_of_ne_zero
.
Alias of Int.toNat_natCast
.
Alias of Int.toNat_natCast_add_one
.