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.
le/lt #
@[inline, reducible]
Equations
Instances For
@[inline, reducible]
Equations
Instances For
@[inline, reducible]
Instances For
@[inline, reducible]
Equations
Instances For
@[inline, reducible]
Equations
Instances For
@[inline, reducible]
Equations
Instances For
zero/one/two #
@[inline, reducible]
Equations
Instances For
succ/pred #
add #
sub #
@[inline, reducible]
Equations
Instances For
min/max #
mul #
div/mod #
pow #
@[inline, reducible]
Instances For
@[inline, reducible]
Instances For
log2 #
dvd #
shiftLeft and shiftRight #
Decidability of predicates #
Equations
- Nat.decidableForallFin P = decidable_of_iff (∀ (k : Nat) (h : k < n), P { val := k, isLt := h }) ⋯
instance
Nat.decidableExistsLT
{p : Nat → Prop}
[h : DecidablePred p]
:
DecidablePred fun (n : Nat) => ∃ (m : Nat), m < n ∧ p m
Equations
instance
Nat.decidableExistsLE
{p : Nat → Prop}
[DecidablePred p]
:
DecidablePred fun (n : Nat) => ∃ (m : Nat), m ≤ n ∧ p m
Equations
- Nat.decidableExistsLE n = decidable_of_iff (∃ (m : Nat), m < n + 1 ∧ p m) ⋯