Documentation
Init
.
Data
.
List
.
FinRange
Search
return to top
source
Imports
Init.Data.List.OfFn
Imported by
List
.
finRange
List
.
length_finRange
List
.
getElem_finRange
List
.
finRange_zero
List
.
finRange_succ
List
.
finRange_succ_last
List
.
finRange_reverse
source
def
List
.
finRange
(n :
Nat
)
:
List
(
Fin
n
)
finRange
n
lists all elements of
Fin
n
in order
Equations
List.finRange
n
=
List.ofFn
fun (
i
:
Fin
n
) =>
i
Instances For
source
@[simp]
theorem
List
.
length_finRange
(n :
Nat
)
:
(
finRange
n
)
.length
=
n
source
@[simp]
theorem
List
.
getElem_finRange
{n :
Nat
}
(i :
Nat
)
(h :
i
<
(
finRange
n
)
.length
)
:
(
finRange
n
)
[
i
]
=
Fin.cast
⋯
⟨
i
,
h
⟩
source
@[simp]
theorem
List
.
finRange_zero
:
finRange
0
=
[]
source
theorem
List
.
finRange_succ
(n :
Nat
)
:
finRange
(
n
+
1
)
=
0
::
map
Fin.succ
(
finRange
n
)
source
theorem
List
.
finRange_succ_last
(n :
Nat
)
:
finRange
(
n
+
1
)
=
map
Fin.castSucc
(
finRange
n
)
++
[
Fin.last
n
]
source
theorem
List
.
finRange_reverse
(n :
Nat
)
:
(
finRange
n
)
.reverse
=
map
Fin.rev
(
finRange
n
)