def
Nat.recAuxOn
{motive : Nat โ Sort u_1}
(t : Nat)
(zero : motive 0)
(succ : (n : Nat) โ motive n โ motive (n + 1))
:
motive t
Recursor identical to Nat.recOn but uses notations 0 for Nat.zero and ยท+1 for Nat.succ
Equations
- Nat.recAuxOn t zero succ = Nat.recAux zero succ t
Instances For
@[irreducible]
def
Nat.strongRec
{motive : Nat โ Sort u_1}
(ind : (n : Nat) โ ((m : Nat) โ m < n โ motive m) โ motive n)
(t : Nat)
:
motive t
Strong recursor for Nat
Equations
- Nat.strongRec ind t = ind t fun (m : Nat) (x : m < t) => Nat.strongRec ind m
Instances For
@[irreducible]
def
Nat.strongRecMeasure
{ฮฑ : Sort u_1}
(f : ฮฑ โ Nat)
{motive : ฮฑ โ Sort u_2}
(ind : (x : ฮฑ) โ ((y : ฮฑ) โ f y < f x โ motive y) โ motive x)
(x : ฮฑ)
:
motive x
Strong recursor via a Nat-valued measure
Equations
- Nat.strongRecMeasure f ind x = ind x fun (y : ฮฑ) (x : f y < f x) => Nat.strongRecMeasure f ind y
Instances For
def
Nat.recDiagAux
{motive : Nat โ Nat โ Sort u_1}
(zero_left : (n : Nat) โ motive 0 n)
(zero_right : (m : Nat) โ motive m 0)
(succ_succ : (m n : Nat) โ motive m n โ motive (m + 1) (n + 1))
(m n : Nat)
:
motive m n
Simple diagonal recursor for Nat
Equations
- Nat.recDiagAux zero_left zero_right succ_succ 0 xโ = zero_left xโ
- Nat.recDiagAux zero_left zero_right succ_succ xโ 0 = zero_right xโ
- Nat.recDiagAux zero_left zero_right succ_succ n.succ n_1.succ = succ_succ n n_1 (Nat.recDiagAux zero_left zero_right succ_succ n n_1)
Instances For
def
Nat.recDiag
{motive : Nat โ Nat โ Sort u_1}
(zero_zero : motive 0 0)
(zero_succ : (n : Nat) โ motive 0 n โ motive 0 (n + 1))
(succ_zero : (m : Nat) โ motive m 0 โ motive (m + 1) 0)
(succ_succ : (m n : Nat) โ motive m n โ motive (m + 1) (n + 1))
(m n : Nat)
:
motive m n
Diagonal recursor for Nat
Equations
- Nat.recDiag zero_zero zero_succ succ_zero succ_succ m n = Nat.recDiagAux (Nat.recDiag.left zero_zero zero_succ) (Nat.recDiag.right zero_zero succ_zero) succ_succ m n
Instances For
def
Nat.recDiag.left
{motive : Nat โ Nat โ Sort u_1}
(zero_zero : motive 0 0)
(zero_succ : (n : Nat) โ motive 0 n โ motive 0 (n + 1))
(n : Nat)
:
motive 0 n
Left leg for Nat.recDiag
Equations
- Nat.recDiag.left zero_zero zero_succ 0 = zero_zero
- Nat.recDiag.left zero_zero zero_succ n.succ = zero_succ n (Nat.recDiag.left zero_zero zero_succ n)
Instances For
def
Nat.recDiag.right
{motive : Nat โ Nat โ Sort u_1}
(zero_zero : motive 0 0)
(succ_zero : (m : Nat) โ motive m 0 โ motive (m + 1) 0)
(m : Nat)
:
motive m 0
Right leg for Nat.recDiag
Equations
- Nat.recDiag.right zero_zero succ_zero 0 = zero_zero
- Nat.recDiag.right zero_zero succ_zero n.succ = succ_zero n (Nat.recDiag.right zero_zero succ_zero n)
Instances For
def
Nat.recDiagOn
{motive : Nat โ Nat โ Sort u_1}
(m n : Nat)
(zero_zero : motive 0 0)
(zero_succ : (n : Nat) โ motive 0 n โ motive 0 (n + 1))
(succ_zero : (m : Nat) โ motive m 0 โ motive (m + 1) 0)
(succ_succ : (m n : Nat) โ motive m n โ motive (m + 1) (n + 1))
:
motive m n
Diagonal recursor for Nat
Equations
- Nat.recDiagOn m n zero_zero zero_succ succ_zero succ_succ = Nat.recDiag zero_zero zero_succ succ_zero succ_succ m n
Instances For
def
Nat.casesDiagOn
{motive : Nat โ Nat โ Sort u_1}
(m n : Nat)
(zero_zero : motive 0 0)
(zero_succ : (n : Nat) โ motive 0 (n + 1))
(succ_zero : (m : Nat) โ motive (m + 1) 0)
(succ_succ : (m n : Nat) โ motive (m + 1) (n + 1))
:
motive m n
Diagonal recursor for Nat
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
Construct a natural number from a sequence of bits using little endian convention.