Order instances on the integers #
This file contains:
- instances on
ℤ
. The stronger one isInt.linearOrderedCommRing
. - basic lemmas about integers that involve order properties.
Recursors #
Int.rec
: Sign disjunction. Something is true/defined onℤ
if it's true/defined for nonnegative and for negative values. (Defined in core Lean 3)Int.inductionOn
: Simple growing induction on positive numbers, plus simple decreasing induction on negative numbers. Note that this recursor is currently onlyProp
-valued.Int.inductionOn'
: Simple growing induction for numbers greater thanb
, plus simple decreasing induction on numbers less thanb
.
Equations
- Int.linearOrderedCommRing = let __src := Int.instCommRingInt; let __src_1 := Int.instLinearOrderInt; let __src_2 := Int.instNontrivialInt; LinearOrderedCommRing.mk ⋯
Extra instances to short-circuit type class resolution #
Equations
- Int.orderedCommRing = StrictOrderedCommRing.toOrderedCommRing'
Equations
- Int.orderedRing = StrictOrderedRing.toOrderedRing'
Equations
- Int.linearOrderedAddCommGroup = inferInstance
Alias of Int.natAbs_le_self_sq
.
Note this holds in marginally more generality than Int.cast_mul
succ and pred #
def
Int.inductionOn'
{C : ℤ → Sort u_1}
(z : ℤ)
(b : ℤ)
(H0 : C b)
(Hs : (k : ℤ) → b ≤ k → C k → C (k + 1))
(Hp : (k : ℤ) → k ≤ b → C k → C (k - 1))
:
C z
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
- Int.inductionOn' z b H0 Hs Hp = Eq.mpr ⋯ (Eq.mpr ⋯ (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
def
Int.inductionOn'.pos
{C : ℤ → Sort u_1}
(b : ℤ)
(H0 : C b)
(Hs : (k : ℤ) → b ≤ k → C k → C (k + 1))
(n : ℕ)
:
C (b + ↑n)
The positive case of Int.inductionOn'
.
Equations
- Int.inductionOn'.pos b H0 Hs 0 = cast ⋯ H0
- Int.inductionOn'.pos b H0 Hs (Nat.succ n) = cast ⋯ (Hs (b + ↑n) ⋯ (Int.inductionOn'.pos b H0 Hs n))
Instances For
def
Int.inductionOn'.neg
{C : ℤ → Sort u_1}
(b : ℤ)
(H0 : C b)
(Hp : (k : ℤ) → k ≤ b → C k → C (k - 1))
(n : ℕ)
:
C (b + Int.negSucc n)
The negative case of Int.inductionOn'
.
Equations
- Int.inductionOn'.neg b H0 Hp 0 = Hp b ⋯ H0
- Int.inductionOn'.neg b H0 Hp (Nat.succ n) = cast ⋯ (Hp (b + Int.negSucc n) ⋯ (Int.inductionOn'.neg b H0 Hp n))
Instances For
nat abs #
/
#
mod #
properties of /
and %
#
dvd #
/
and ordering #
theorem
Int.natAbs_eq_of_dvd_dvd
{s : ℤ}
{t : ℤ}
(hst : s ∣ t)
(hts : t ∣ s)
:
Int.natAbs s = Int.natAbs t