@[specialize #[]]
Equations
- Nat.foldTR.loop f n 0 x = x
- Nat.foldTR.loop f n (Nat.succ n_1) x = Nat.foldTR.loop f n n_1 (f (n - Nat.succ n_1) x)
Instances For
@[specialize #[]]
Nat.foldRev
evaluates f
on the numbers up to n
exclusive, in decreasing order:
Nat.foldRev f 3 init = f 0 <| f 1 <| f 2 <| init
Equations
- Nat.foldRev f 0 x = x
- Nat.foldRev f (Nat.succ n) x = Nat.foldRev f n (f n x)
Instances For
@[specialize #[]]
Equations
- Nat.anyTR.loop f n 0 = false
- Nat.anyTR.loop f n (Nat.succ n_1) = (f (n - Nat.succ n_1) || Nat.anyTR.loop f n n_1)
Instances For
@[specialize #[]]
Equations
- Nat.allTR.loop f n 0 = true
- Nat.allTR.loop f n (Nat.succ n_1) = (f (n - Nat.succ n_1) && Nat.allTR.loop f n n_1)
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 (Nat.succ n) x = f (Nat.repeat f n x)
Instances For
@[specialize #[]]
Equations
- Nat.repeatTR.loop f 0 x = x
- Nat.repeatTR.loop f (Nat.succ n) x = Nat.repeatTR.loop f n (f x)
Instances For
Helper "packing" theorems #
Helper Bool relation theorems #
Nat.add theorems #
Nat.mul theorems #
Inequalities #
Basic theorems for comparing numerals #
mul + order #
power #
min/max #
Auxiliary theorems for well-founded recursion #
sub/pred theorems #
Helper normalization theorems #
csimp theorems #
theorem
Nat.repeat_eq_repeatTR.go
(α : Type u_1)
(f : α → α)
(init : α)
(m : Nat)
(n : Nat)
:
Nat.repeatTR.loop f m (Nat.repeat f n init) = Nat.repeat f (m + n) init