coercions and constructions #
order #
addition, numerals, and coercion from Nat #
Equations
- Fin.subsingleton_zero = (_ : Subsingleton (Fin 0))
Equations
- Fin.subsingleton_one = (_ : Subsingleton (Fin 1))
succ and casts into larger Fin types #
Version of succ_one_eq_two
to be used by dsimp
For rewriting in the reverse direction, see Fin.cast_castAdd_left
.
castSucc i
is positive when i
is positive
For rewriting in the reverse direction, see Fin.cast_addNat_left
.
For rewriting in the reverse direction, see Fin.cast_natAdd_right
.
pred #
recursion and induction principles #
Define motive n i
by induction on i : Fin n
interpreted as (0 : Fin (n - i)).succ.succ…
.
This function has two arguments: zero n
defines 0
-th element motive (n+1) 0
of an
(n+1)
-tuple, and succ n i
defines (i+1)
-st element of (n+1)
-tuple based on n
, i
, and
i
-th element of n
-tuple.
Equations
- Fin.succRec zero succ i = Fin.elim0 i
- Fin.succRec zero succ { val := 0, isLt := isLt } = Eq.mpr (_ : motive (Nat.succ n) { val := 0, isLt := isLt } = motive (Nat.succ n) 0) (zero n)
- Fin.succRec zero succ { val := Nat.succ i, isLt := h } = succ n { val := i, isLt := (_ : i < n) } (Fin.succRec zero succ { val := i, isLt := (_ : i < n) })
Instances For
Define motive n i
by induction on i : Fin n
interpreted as (0 : Fin (n - i)).succ.succ…
.
This function has two arguments:
zero n
defines the 0
-th element motive (n+1) 0
of an (n+1)
-tuple, and
succ n i
defines the (i+1)
-st element of an (n+1)
-tuple based on n
, i
,
and the i
-th element of an n
-tuple.
A version of Fin.succRec
taking i : Fin n
as the first argument.
Equations
- Fin.succRecOn i zero succ = Fin.succRec zero succ i
Instances For
Define motive i
by induction on i : Fin (n + 1)
via induction on the underlying Nat
value.
This function has two arguments: zero
handles the base case on motive 0
,
and succ
defines the inductive step using motive i.castSucc
.
Equations
- Fin.induction zero succ { val := 0, isLt := hi } = Eq.mpr (_ : motive { val := 0, isLt := hi } = motive 0) zero
- Fin.induction zero succ { val := Nat.succ i, isLt := hi } = succ { val := i, isLt := (_ : i < n) } (Fin.induction zero succ { val := i, isLt := (_ : i < n + 1) })
Instances For
Define motive i
by induction on i : Fin (n + 1)
via induction on the underlying Nat
value.
This function has two arguments: zero
handles the base case on motive 0
,
and succ
defines the inductive step using motive i.castSucc
.
A version of Fin.induction
taking i : Fin (n + 1)
as the first argument.
Equations
- Fin.inductionOn i zero succ = Fin.induction zero succ i
Instances For
Define f : Π i : Fin n.succ, motive i
by separately handling the cases i = 0
and
i = j.succ
, j : Fin n
.
Equations
- Fin.cases zero succ i = Fin.induction zero (fun (i : Fin n) (x : motive (Fin.castSucc i)) => succ i) i
Instances For
Define motive i
by reverse induction on i : Fin (n + 1)
via induction on the underlying Nat
value. This function has two arguments: last
handles the base case on motive (Fin.last n)
,
and cast
defines the inductive step using motive i.succ
, inducting downwards.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Define f : Π i : Fin n.succ, motive i
by separately handling the cases i = Fin.last n
and
i = j.castSucc
, j : Fin n
.
Equations
- Fin.lastCases last cast i = Fin.reverseInduction last (fun (i : Fin n) (x : motive (Fin.succ i)) => cast i) i
Instances For
Define f : Π i : Fin (m + n), motive i
by separately handling the cases i = castAdd n i
,
j : Fin m
and i = natAdd m j
, j : Fin n
.
Equations
- One or more equations did not get rendered due to their size.