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]
Equations
Instances For
@[reducible, inline, deprecated Nat.or_exists_add_one]
Equations
Instances For
add #
sub #
@[reducible, inline]
Equations
Instances For
min/max #
mul #
div/mod #
pow #
@[reducible, inline]
Instances For
@[reducible, inline]
Instances For
log2 #
dvd #
shiftLeft and shiftRight #
Decidability of predicates #
instance
Nat.decidableExistsLT
{p : Nat → Prop}
[h : DecidablePred p]
:
DecidablePred fun (n : Nat) => ∃ (m : Nat), m < n ∧ p m
instance
Nat.decidableExistsLE
{p : Nat → Prop}
[DecidablePred p]
:
DecidablePred fun (n : Nat) => ∃ (m : Nat), m ≤ n ∧ p m