@[reducible, inline]
abbrev
Nat.recAux
{motive : Nat → Sort u}
(zero : motive 0)
(succ : (n : Nat) → motive n → motive (n + 1))
(t : Nat)
:
motive t
Recursor identical to Nat.rec
but uses notations 0
for Nat.zero
and · + 1
for Nat.succ
.
Used as the default Nat
eliminator by the induction
tactic.
Instances For
@[reducible, inline]
abbrev
Nat.casesAuxOn
{motive : Nat → Sort u}
(t : Nat)
(zero : motive 0)
(succ : (n : Nat) → motive (n + 1))
:
motive t
Recursor identical to Nat.casesOn
but uses notations 0
for Nat.zero
and · + 1
for Nat.succ
.
Used as the default Nat
eliminator by the cases
tactic.
Instances For
@[specialize #[]]
Nat.repeat f n a
is f^(n) a
; that is, it iterates f
n
times on a
.
Nat.repeat f 3 a = f <| f <| f <| a
Equations
- Nat.repeat f 0 x = x
- Nat.repeat f n.succ x = f (Nat.repeat f n x)
Instances For
@[inline]
Tail-recursive version of Nat.repeat
.
Equations
- Nat.repeatTR f n a = Nat.repeatTR.loop f n a
Instances For
@[specialize #[]]
Equations
- Nat.repeatTR.loop f 0 x = x
- Nat.repeatTR.loop f n.succ x = Nat.repeatTR.loop f n (f x)
Instances For
Helper "packing" theorems #
Helper Bool relation theorems #
Nat.add theorems #
Nat.mul theorems #
Inequalities #
le/lt #
zero/one/two #
succ/pred #
Basic theorems for comparing numerals #
mul + order #
power #
min/max #
Auxiliary theorems for well-founded recursion #
@[reducible, inline, deprecated Nat.pred_lt_of_lt]
Equations
Instances For
pred theorems #
sub theorems #
Mul sub distrib #
@[reducible, inline, deprecated Nat.pred_mul]
Equations
Instances For
@[reducible, inline, deprecated Nat.mul_pred]
Equations
Instances For
Helper normalization theorems #
theorem
Nat.repeat_eq_repeatTR.go
(α : Type u_1)
(f : α → α)
(init : α)
(m n : Nat)
:
Nat.repeatTR.loop f m (Nat.repeat f n init) = Nat.repeat f (m + n) init