Basic lemmas about natural numbers #
The primary purpose of the lemmas in this file is to assist with reasoning about sizes of objects, array indices and such.
This file was upstreamed from Std, and later these lemmas should be organised into other files more systematically.
@[reducible, inline, deprecated Nat.and_forall_add_one (since := "2024-07-30")]
Equations
Instances For
add #
sub #
@[reducible, inline]
Equations
Instances For
min/max #
mul #
div/mod #
pow #
@[reducible, inline]
Equations
Instances For
@[reducible, inline]
Equations
Instances For
log2 #
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
.