Documentation
Interval
.
Misc
.
Array
Search
return to top
source
Imports
Init
Batteries.Data.ByteArray
Mathlib.Data.Fin.Basic
Mathlib.Tactic.Linarith.Frontend
Imported by
Array
.
getElem_map_fin
Array
.
getElem_eq_getElem!
Fin
.
getElem_fin'
ByteArray
.
size_mkEmpty
ByteArray
.
getElem_eq_data_getElem'
ByteArray
.
getElem_eq_getElem!
ByteArray
.
getElemNat_eq_getElem!
ByteArray
.
getElem!_push
Array
.
getElem?_eq_toList_get?'
ByteArray
.
getElem!_append
Array
lemmas
#
source
@[simp]
theorem
Array
.
getElem_map_fin
{
α
β
:
Type
}
(
f
:
α
→
β
)
(
x
:
Array
α
)
{
n
:
ℕ
}
(
i
:
Fin
n
)
(
h
:
↑
i
<
(
map
f
x
)
.
size
)
:
(
map
f
x
)
[
i
]
=
f
x
[
i
]
source
theorem
Array
.
getElem_eq_getElem!
{
α
:
Type
}
[
Inhabited
α
]
(
d
:
Array
α
)
{
n
:
ℕ
}
(
i
:
Fin
n
)
(
h
:
↑
i
<
d
.
size
)
:
d
[
i
]
=
d
[
i
]
!
source
@[simp]
theorem
Fin
.
getElem_fin'
{
Cont
Elem
:
Type
}
{
Dom
:
Cont
→
ℕ
→
Prop
}
[
GetElem
Cont
ℕ
Elem
Dom
]
(
a
:
Cont
)
{
n
:
ℕ
}
(
i
:
Fin
n
)
(
h
:
Dom
a
↑
i
)
:
a
[
i
]
=
a
[
↑
i
]
ByteArray
lemmas
#
source
@[simp]
theorem
ByteArray
.
size_mkEmpty
(
c
:
ℕ
)
:
(
emptyWithCapacity
c
)
.
size
=
0
source
theorem
ByteArray
.
getElem_eq_data_getElem'
(
d
:
ByteArray
)
(
i
:
Fin
d
.
size
)
:
d
[
i
]
=
d
.
data
[
i
]
source
theorem
ByteArray
.
getElem_eq_getElem!
(
d
:
ByteArray
)
(
i
:
Fin
d
.
size
)
:
d
[
i
]
=
d
[
i
]
!
source
theorem
ByteArray
.
getElemNat_eq_getElem!
{
d
:
ByteArray
}
{
i
:
ℕ
}
(
h
:
i
<
d
.
size
)
:
d
[
i
]
=
d
[
i
]
!
source
theorem
ByteArray
.
getElem!_push
(
d
:
ByteArray
)
(
c
:
UInt8
)
(
i
:
ℕ
)
:
(
d
.
push
c
)
[
i
]
!
=
if
i
<
d
.
size
then
d
[
i
]
!
else
if
i
=
d
.
size
then
c
else
default
source
theorem
Array
.
getElem?_eq_toList_get?'
{
α
:
Type
}
(
a
:
Array
α
)
(
i
:
ℕ
)
:
a
[
i
]
?
=
a
.
toList
[
i
]
?
source
theorem
ByteArray
.
getElem!_append
(
d0
d1
:
ByteArray
)
(
i
:
ℕ
)
:
(
d0
++
d1
)
[
i
]
!
=
if
i
<
d0
.
size
then
d0
[
i
]
!
else
d1
[
i
-
d0
.
size
]
!