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 (_ : ∀ (a b : ℤ), a * b = b * a)
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
- One or more equations did not get rendered due to their size.
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
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
- One or more equations did not get rendered due to their size.
- Int.inductionOn'.neg b H0 Hp 0 = Hp b (_ : b ≤ b) H0
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