Basic theorems about natural numbers #
The primary purpose of the theorems in this file is to assist with reasoning about sizes of objects, array indices and such.
The content of this file was upstreamed from Batteries and mathlib, and later these theorems should be organised into other files more systematically.
succ/pred #
add #
sub #
@[reducible, inline]
Equations
Instances For
A version of Nat.sub_succ
in the form _ - 1
instead of Nat.pred _
.
min/max #
mul #
div/mod #
pow #
log2 #
mod, dvd #
shiftLeft and shiftRight #
Decidability of predicates #
Equations
- Nat.decidableForallFin P = decidable_of_iff (∀ (k : Nat) (h : k < n), P ⟨k, h⟩) ⋯
Equations
instance
Nat.decidableExistsLT'
{k : Nat}
{p : (m : Nat) → m < k → Prop}
[I : (m : Nat) → (h : m < k) → Decidable (p m h)]
:
Dependent version of decidableExistsLT
.
instance
Nat.decidableExistsLE'
{k : Nat}
{p : (m : Nat) → m ≤ k → Prop}
[I : (m : Nat) → (h : m ≤ k) → Decidable (p m h)]
:
Dependent version of decidableExistsLE
.